diff --git a/fetch-libraries.sh b/fetch-libraries.sh index 7ff4cf23e..81ce32a47 100644 --- a/fetch-libraries.sh +++ b/fetch-libraries.sh @@ -1,10 +1,10 @@ -VERSION=v0.18.3-beta-zeus.previous-events +VERSION=v0.18.4-beta-zeus ANDROID_FILE=Lndmobile.aar IOS_FILE=Lndmobile.xcframework -ANDROID_SHA256='a48b39675d1442611546cb22b07c8440f44d7917a77962f1f50fe558a679c220' -IOS_SHA256='de9831c586b31008bfca1d48d9b4e11bbae2adcd2127b614530d8e7259f1bcf4' +ANDROID_SHA256='8f3f569fd603fb101d7de08a7f9e017cb7267fd24da549908b7733b40e54393f' +IOS_SHA256='159e63de8b4a14a402f885adb88c9b34a66c7f6c8a15cbb3c5cc2ba44a5c1bd6' FILE_PATH=https://github.com/ZeusLN/lnd/releases/download/$VERSION/ diff --git a/proto/invoicesrpc/invoices.proto b/proto/invoicesrpc/invoices.proto index 7afffba4e..d9d3bc123 100644 --- a/proto/invoicesrpc/invoices.proto +++ b/proto/invoicesrpc/invoices.proto @@ -55,10 +55,19 @@ service Invoices { rpc SettleInvoice (SettleInvoiceMsg) returns (SettleInvoiceResp); /* - LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced + LookupInvoiceV2 attempts to look up at invoice. An invoice can be referenced using either its payment hash, payment address, or set ID. */ rpc LookupInvoiceV2 (LookupInvoiceMsg) returns (lnrpc.Invoice); + + /* + HtlcModifier is a bidirectional streaming RPC that allows a client to + intercept and modify the HTLCs that attempt to settle the given invoice. The + server will send HTLCs of invoices to the client and the client can modify + some aspects of the HTLC in order to pass the invoice acceptance tests. + */ + rpc HtlcModifier (stream HtlcModifyResponse) + returns (stream HtlcModifyRequest); } message CancelInvoiceMsg { @@ -192,3 +201,51 @@ message LookupInvoiceMsg { LookupModifier lookup_modifier = 4; } + +// CircuitKey is a unique identifier for an HTLC. +message CircuitKey { + // The id of the channel that the is part of this circuit. + uint64 chan_id = 1; + + // The index of the incoming htlc in the incoming channel. + uint64 htlc_id = 2; +} + +message HtlcModifyRequest { + // The invoice the intercepted HTLC is attempting to settle. The HTLCs in + // the invoice are only HTLCs that have already been accepted or settled, + // not including the current intercepted HTLC. + lnrpc.Invoice invoice = 1; + + // The unique identifier of the HTLC of this intercepted HTLC. + CircuitKey exit_htlc_circuit_key = 2; + + // The amount in milli-satoshi that the exit HTLC is attempting to pay. + uint64 exit_htlc_amt = 3; + + // The absolute expiry height of the exit HTLC. + uint32 exit_htlc_expiry = 4; + + // The current block height. + uint32 current_height = 5; + + // The wire message custom records of the exit HTLC. + map exit_htlc_wire_custom_records = 6; +} + +message HtlcModifyResponse { + // The circuit key of the HTLC that the client wants to modify. + CircuitKey circuit_key = 1; + + // The modified amount in milli-satoshi that the exit HTLC is paying. This + // value can be different from the actual on-chain HTLC amount, in case the + // HTLC carries other valuable items, as can be the case with custom channel + // types. + optional uint64 amt_paid = 2; + + // This flag indicates whether the HTLCs associated with the invoices should + // be cancelled. The interceptor client may set this field if some + // unexpected behavior is encountered. Setting this will ignore the amt_paid + // field. + bool cancel_set = 3; +} diff --git a/proto/lightning.d.ts b/proto/lightning.d.ts index 8ac33f0d6..380602c9e 100644 --- a/proto/lightning.d.ts +++ b/proto/lightning.d.ts @@ -7252,7 +7252,8 @@ export namespace lnrpc { STATIC_REMOTE_KEY = 2, ANCHORS = 3, SCRIPT_ENFORCED_LEASE = 4, - SIMPLE_TAPROOT = 5 + SIMPLE_TAPROOT = 5, + SIMPLE_TAPROOT_OVERLAY = 6 } /** Properties of a ChannelConstraints. */ @@ -7507,6 +7508,9 @@ export namespace lnrpc { /** Channel memo */ memo?: string | null; + + /** Channel custom_channel_data */ + custom_channel_data?: Uint8Array | null; } /** Represents a Channel. */ @@ -7625,6 +7629,9 @@ export namespace lnrpc { /** Channel memo. */ public memo: string; + /** Channel custom_channel_data. */ + public custom_channel_data: Uint8Array; + /** * Creates a new Channel instance using the specified properties. * @param [properties] Properties to set @@ -10852,6 +10859,137 @@ export namespace lnrpc { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a CloseOutput. */ + interface ICloseOutput { + /** CloseOutput amount_sat */ + amount_sat?: Long | null; + + /** CloseOutput pk_script */ + pk_script?: Uint8Array | null; + + /** CloseOutput is_local */ + is_local?: boolean | null; + + /** CloseOutput custom_channel_data */ + custom_channel_data?: Uint8Array | null; + } + + /** Represents a CloseOutput. */ + class CloseOutput implements ICloseOutput { + /** + * Constructs a new CloseOutput. + * @param [properties] Properties to set + */ + constructor(properties?: lnrpc.ICloseOutput); + + /** CloseOutput amount_sat. */ + public amount_sat: Long; + + /** CloseOutput pk_script. */ + public pk_script: Uint8Array; + + /** CloseOutput is_local. */ + public is_local: boolean; + + /** CloseOutput custom_channel_data. */ + public custom_channel_data: Uint8Array; + + /** + * Creates a new CloseOutput instance using the specified properties. + * @param [properties] Properties to set + * @returns CloseOutput instance + */ + public static create( + properties?: lnrpc.ICloseOutput + ): lnrpc.CloseOutput; + + /** + * Encodes the specified CloseOutput message. Does not implicitly {@link lnrpc.CloseOutput.verify|verify} messages. + * @param message CloseOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: lnrpc.ICloseOutput, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified CloseOutput message, length delimited. Does not implicitly {@link lnrpc.CloseOutput.verify|verify} messages. + * @param message CloseOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: lnrpc.ICloseOutput, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a CloseOutput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloseOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): lnrpc.CloseOutput; + + /** + * Decodes a CloseOutput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloseOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): lnrpc.CloseOutput; + + /** + * Verifies a CloseOutput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a CloseOutput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloseOutput + */ + public static fromObject(object: { + [k: string]: any; + }): lnrpc.CloseOutput; + + /** + * Creates a plain object from a CloseOutput message. Also converts values to other types if specified. + * @param message CloseOutput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: lnrpc.CloseOutput, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this CloseOutput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloseOutput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a ChannelCloseUpdate. */ interface IChannelCloseUpdate { /** ChannelCloseUpdate closing_txid */ @@ -10859,6 +10997,15 @@ export namespace lnrpc { /** ChannelCloseUpdate success */ success?: boolean | null; + + /** ChannelCloseUpdate local_close_output */ + local_close_output?: lnrpc.ICloseOutput | null; + + /** ChannelCloseUpdate remote_close_output */ + remote_close_output?: lnrpc.ICloseOutput | null; + + /** ChannelCloseUpdate additional_outputs */ + additional_outputs?: lnrpc.ICloseOutput[] | null; } /** Represents a ChannelCloseUpdate. */ @@ -10875,6 +11022,15 @@ export namespace lnrpc { /** ChannelCloseUpdate success. */ public success: boolean; + /** ChannelCloseUpdate local_close_output. */ + public local_close_output?: lnrpc.ICloseOutput | null; + + /** ChannelCloseUpdate remote_close_output. */ + public remote_close_output?: lnrpc.ICloseOutput | null; + + /** ChannelCloseUpdate additional_outputs. */ + public additional_outputs: lnrpc.ICloseOutput[]; + /** * Creates a new ChannelCloseUpdate instance using the specified properties. * @param [properties] Properties to set @@ -14181,6 +14337,9 @@ export namespace lnrpc { /** PendingChannel memo */ memo?: string | null; + + /** PendingChannel custom_channel_data */ + custom_channel_data?: Uint8Array | null; } /** Represents a PendingChannel. */ @@ -14232,6 +14391,9 @@ export namespace lnrpc { /** PendingChannel memo. */ public memo: string; + /** PendingChannel custom_channel_data. */ + public custom_channel_data: Uint8Array; + /** * Creates a new PendingChannel instance using the specified properties. * @param [properties] Properties to set @@ -15944,6 +16106,9 @@ export namespace lnrpc { /** ChannelBalanceResponse pending_open_remote_balance */ pending_open_remote_balance?: lnrpc.IAmount | null; + + /** ChannelBalanceResponse custom_channel_data */ + custom_channel_data?: Uint8Array | null; } /** Represents a ChannelBalanceResponse. */ @@ -15978,6 +16143,9 @@ export namespace lnrpc { /** ChannelBalanceResponse pending_open_remote_balance. */ public pending_open_remote_balance?: lnrpc.IAmount | null; + /** ChannelBalanceResponse custom_channel_data. */ + public custom_channel_data: Uint8Array; + /** * Creates a new ChannelBalanceResponse instance using the specified properties. * @param [properties] Properties to set @@ -17096,6 +17264,12 @@ export namespace lnrpc { /** Route total_amt_msat */ total_amt_msat?: Long | null; + + /** Route first_hop_amount_msat */ + first_hop_amount_msat?: Long | null; + + /** Route custom_channel_data */ + custom_channel_data?: Uint8Array | null; } /** Represents a Route. */ @@ -17124,6 +17298,12 @@ export namespace lnrpc { /** Route total_amt_msat. */ public total_amt_msat: Long; + /** Route first_hop_amount_msat. */ + public first_hop_amount_msat: Long; + + /** Route custom_channel_data. */ + public custom_channel_data: Uint8Array; + /** * Creates a new Route instance using the specified properties. * @param [properties] Properties to set @@ -21254,6 +21434,9 @@ export namespace lnrpc { /** InvoiceHTLC amp */ amp?: lnrpc.IAMP | null; + + /** InvoiceHTLC custom_channel_data */ + custom_channel_data?: Uint8Array | null; } /** Represents an InvoiceHTLC. */ @@ -21297,6 +21480,9 @@ export namespace lnrpc { /** InvoiceHTLC amp. */ public amp?: lnrpc.IAMP | null; + /** InvoiceHTLC custom_channel_data. */ + public custom_channel_data: Uint8Array; + /** * Creates a new InvoiceHTLC instance using the specified properties. * @param [properties] Properties to set @@ -22220,6 +22406,9 @@ export namespace lnrpc { /** Payment failure_reason */ failure_reason?: lnrpc.PaymentFailureReason | null; + + /** Payment first_hop_custom_records */ + first_hop_custom_records?: { [k: string]: Uint8Array } | null; } /** Represents a Payment. */ @@ -22275,6 +22464,9 @@ export namespace lnrpc { /** Payment failure_reason. */ public failure_reason: lnrpc.PaymentFailureReason; + /** Payment first_hop_custom_records. */ + public first_hop_custom_records: { [k: string]: Uint8Array }; + /** * Creates a new Payment instance using the specified properties. * @param [properties] Properties to set @@ -33917,6 +34109,25 @@ export namespace invoicesrpc { public lookupInvoiceV2( request: invoicesrpc.ILookupInvoiceMsg ): Promise; + + /** + * Calls HtlcModifier. + * @param request HtlcModifyResponse message or plain object + * @param callback Node-style callback called with the error, if any, and HtlcModifyRequest + */ + public htlcModifier( + request: invoicesrpc.IHtlcModifyResponse, + callback: invoicesrpc.Invoices.HtlcModifierCallback + ): void; + + /** + * Calls HtlcModifier. + * @param request HtlcModifyResponse message or plain object + * @returns Promise + */ + public htlcModifier( + request: invoicesrpc.IHtlcModifyResponse + ): Promise; } namespace Invoices { @@ -33969,6 +34180,16 @@ export namespace invoicesrpc { error: Error | null, response?: lnrpc.Invoice ) => void; + + /** + * Callback as used by {@link invoicesrpc.Invoices#htlcModifier}. + * @param error Error, if any + * @param [response] HtlcModifyRequest + */ + type HtlcModifierCallback = ( + error: Error | null, + response?: invoicesrpc.HtlcModifyRequest + ) => void; } /** Properties of a CancelInvoiceMsg. */ @@ -34958,6 +35179,396 @@ export namespace invoicesrpc { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a CircuitKey. */ + interface ICircuitKey { + /** CircuitKey chan_id */ + chan_id?: Long | null; + + /** CircuitKey htlc_id */ + htlc_id?: Long | null; + } + + /** Represents a CircuitKey. */ + class CircuitKey implements ICircuitKey { + /** + * Constructs a new CircuitKey. + * @param [properties] Properties to set + */ + constructor(properties?: invoicesrpc.ICircuitKey); + + /** CircuitKey chan_id. */ + public chan_id: Long; + + /** CircuitKey htlc_id. */ + public htlc_id: Long; + + /** + * Creates a new CircuitKey instance using the specified properties. + * @param [properties] Properties to set + * @returns CircuitKey instance + */ + public static create( + properties?: invoicesrpc.ICircuitKey + ): invoicesrpc.CircuitKey; + + /** + * Encodes the specified CircuitKey message. Does not implicitly {@link invoicesrpc.CircuitKey.verify|verify} messages. + * @param message CircuitKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: invoicesrpc.ICircuitKey, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified CircuitKey message, length delimited. Does not implicitly {@link invoicesrpc.CircuitKey.verify|verify} messages. + * @param message CircuitKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: invoicesrpc.ICircuitKey, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a CircuitKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CircuitKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): invoicesrpc.CircuitKey; + + /** + * Decodes a CircuitKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CircuitKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): invoicesrpc.CircuitKey; + + /** + * Verifies a CircuitKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a CircuitKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CircuitKey + */ + public static fromObject(object: { + [k: string]: any; + }): invoicesrpc.CircuitKey; + + /** + * Creates a plain object from a CircuitKey message. Also converts values to other types if specified. + * @param message CircuitKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: invoicesrpc.CircuitKey, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this CircuitKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CircuitKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HtlcModifyRequest. */ + interface IHtlcModifyRequest { + /** HtlcModifyRequest invoice */ + invoice?: lnrpc.IInvoice | null; + + /** HtlcModifyRequest exit_htlc_circuit_key */ + exit_htlc_circuit_key?: invoicesrpc.ICircuitKey | null; + + /** HtlcModifyRequest exit_htlc_amt */ + exit_htlc_amt?: Long | null; + + /** HtlcModifyRequest exit_htlc_expiry */ + exit_htlc_expiry?: number | null; + + /** HtlcModifyRequest current_height */ + current_height?: number | null; + + /** HtlcModifyRequest exit_htlc_wire_custom_records */ + exit_htlc_wire_custom_records?: { [k: string]: Uint8Array } | null; + } + + /** Represents a HtlcModifyRequest. */ + class HtlcModifyRequest implements IHtlcModifyRequest { + /** + * Constructs a new HtlcModifyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: invoicesrpc.IHtlcModifyRequest); + + /** HtlcModifyRequest invoice. */ + public invoice?: lnrpc.IInvoice | null; + + /** HtlcModifyRequest exit_htlc_circuit_key. */ + public exit_htlc_circuit_key?: invoicesrpc.ICircuitKey | null; + + /** HtlcModifyRequest exit_htlc_amt. */ + public exit_htlc_amt: Long; + + /** HtlcModifyRequest exit_htlc_expiry. */ + public exit_htlc_expiry: number; + + /** HtlcModifyRequest current_height. */ + public current_height: number; + + /** HtlcModifyRequest exit_htlc_wire_custom_records. */ + public exit_htlc_wire_custom_records: { [k: string]: Uint8Array }; + + /** + * Creates a new HtlcModifyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns HtlcModifyRequest instance + */ + public static create( + properties?: invoicesrpc.IHtlcModifyRequest + ): invoicesrpc.HtlcModifyRequest; + + /** + * Encodes the specified HtlcModifyRequest message. Does not implicitly {@link invoicesrpc.HtlcModifyRequest.verify|verify} messages. + * @param message HtlcModifyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: invoicesrpc.IHtlcModifyRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified HtlcModifyRequest message, length delimited. Does not implicitly {@link invoicesrpc.HtlcModifyRequest.verify|verify} messages. + * @param message HtlcModifyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: invoicesrpc.IHtlcModifyRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a HtlcModifyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HtlcModifyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): invoicesrpc.HtlcModifyRequest; + + /** + * Decodes a HtlcModifyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HtlcModifyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): invoicesrpc.HtlcModifyRequest; + + /** + * Verifies a HtlcModifyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a HtlcModifyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HtlcModifyRequest + */ + public static fromObject(object: { + [k: string]: any; + }): invoicesrpc.HtlcModifyRequest; + + /** + * Creates a plain object from a HtlcModifyRequest message. Also converts values to other types if specified. + * @param message HtlcModifyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: invoicesrpc.HtlcModifyRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this HtlcModifyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HtlcModifyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HtlcModifyResponse. */ + interface IHtlcModifyResponse { + /** HtlcModifyResponse circuit_key */ + circuit_key?: invoicesrpc.ICircuitKey | null; + + /** HtlcModifyResponse amt_paid */ + amt_paid?: Long | null; + + /** HtlcModifyResponse cancel_set */ + cancel_set?: boolean | null; + } + + /** Represents a HtlcModifyResponse. */ + class HtlcModifyResponse implements IHtlcModifyResponse { + /** + * Constructs a new HtlcModifyResponse. + * @param [properties] Properties to set + */ + constructor(properties?: invoicesrpc.IHtlcModifyResponse); + + /** HtlcModifyResponse circuit_key. */ + public circuit_key?: invoicesrpc.ICircuitKey | null; + + /** HtlcModifyResponse amt_paid. */ + public amt_paid?: Long | null; + + /** HtlcModifyResponse cancel_set. */ + public cancel_set: boolean; + + /** HtlcModifyResponse _amt_paid. */ + public _amt_paid?: 'amt_paid'; + + /** + * Creates a new HtlcModifyResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns HtlcModifyResponse instance + */ + public static create( + properties?: invoicesrpc.IHtlcModifyResponse + ): invoicesrpc.HtlcModifyResponse; + + /** + * Encodes the specified HtlcModifyResponse message. Does not implicitly {@link invoicesrpc.HtlcModifyResponse.verify|verify} messages. + * @param message HtlcModifyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: invoicesrpc.IHtlcModifyResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified HtlcModifyResponse message, length delimited. Does not implicitly {@link invoicesrpc.HtlcModifyResponse.verify|verify} messages. + * @param message HtlcModifyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: invoicesrpc.IHtlcModifyResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a HtlcModifyResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HtlcModifyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): invoicesrpc.HtlcModifyResponse; + + /** + * Decodes a HtlcModifyResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HtlcModifyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): invoicesrpc.HtlcModifyResponse; + + /** + * Verifies a HtlcModifyResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a HtlcModifyResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HtlcModifyResponse + */ + public static fromObject(object: { + [k: string]: any; + }): invoicesrpc.HtlcModifyResponse; + + /** + * Creates a plain object from a HtlcModifyResponse message. Also converts values to other types if specified. + * @param message HtlcModifyResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: invoicesrpc.HtlcModifyResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this HtlcModifyResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HtlcModifyResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Namespace neutrinorpc. */ @@ -37591,6 +38202,44 @@ export namespace routerrpc { public updateChanStatus( request: routerrpc.IUpdateChanStatusRequest ): Promise; + + /** + * Calls XAddLocalChanAliases. + * @param request AddAliasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AddAliasesResponse + */ + public xAddLocalChanAliases( + request: routerrpc.IAddAliasesRequest, + callback: routerrpc.Router.XAddLocalChanAliasesCallback + ): void; + + /** + * Calls XAddLocalChanAliases. + * @param request AddAliasesRequest message or plain object + * @returns Promise + */ + public xAddLocalChanAliases( + request: routerrpc.IAddAliasesRequest + ): Promise; + + /** + * Calls XDeleteLocalChanAliases. + * @param request DeleteAliasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DeleteAliasesResponse + */ + public xDeleteLocalChanAliases( + request: routerrpc.IDeleteAliasesRequest, + callback: routerrpc.Router.XDeleteLocalChanAliasesCallback + ): void; + + /** + * Calls XDeleteLocalChanAliases. + * @param request DeleteAliasesRequest message or plain object + * @returns Promise + */ + public xDeleteLocalChanAliases( + request: routerrpc.IDeleteAliasesRequest + ): Promise; } namespace Router { @@ -37773,6 +38422,26 @@ export namespace routerrpc { error: Error | null, response?: routerrpc.UpdateChanStatusResponse ) => void; + + /** + * Callback as used by {@link routerrpc.Router#xAddLocalChanAliases}. + * @param error Error, if any + * @param [response] AddAliasesResponse + */ + type XAddLocalChanAliasesCallback = ( + error: Error | null, + response?: routerrpc.AddAliasesResponse + ) => void; + + /** + * Callback as used by {@link routerrpc.Router#xDeleteLocalChanAliases}. + * @param error Error, if any + * @param [response] DeleteAliasesResponse + */ + type XDeleteLocalChanAliasesCallback = ( + error: Error | null, + response?: routerrpc.DeleteAliasesResponse + ) => void; } /** Properties of a SendPaymentRequest. */ @@ -37845,6 +38514,12 @@ export namespace routerrpc { /** SendPaymentRequest time_pref */ time_pref?: number | null; + + /** SendPaymentRequest cancelable */ + cancelable?: boolean | null; + + /** SendPaymentRequest first_hop_custom_records */ + first_hop_custom_records?: { [k: string]: Uint8Array } | null; } /** Represents a SendPaymentRequest. */ @@ -37924,6 +38599,12 @@ export namespace routerrpc { /** SendPaymentRequest time_pref. */ public time_pref: number; + /** SendPaymentRequest cancelable. */ + public cancelable: boolean; + + /** SendPaymentRequest first_hop_custom_records. */ + public first_hop_custom_records: { [k: string]: Uint8Array }; + /** * Creates a new SendPaymentRequest instance using the specified properties. * @param [properties] Properties to set @@ -38518,6 +39199,9 @@ export namespace routerrpc { /** SendToRouteRequest skip_temp_err */ skip_temp_err?: boolean | null; + + /** SendToRouteRequest first_hop_custom_records */ + first_hop_custom_records?: { [k: string]: Uint8Array } | null; } /** Represents a SendToRouteRequest. */ @@ -38537,6 +39221,9 @@ export namespace routerrpc { /** SendToRouteRequest skip_temp_err. */ public skip_temp_err: boolean; + /** SendToRouteRequest first_hop_custom_records. */ + public first_hop_custom_records: { [k: string]: Uint8Array }; + /** * Creates a new SendToRouteRequest instance using the specified properties. * @param [properties] Properties to set @@ -40814,6 +41501,9 @@ export namespace routerrpc { /** BuildRouteRequest payment_addr */ payment_addr?: Uint8Array | null; + + /** BuildRouteRequest first_hop_custom_records */ + first_hop_custom_records?: { [k: string]: Uint8Array } | null; } /** Represents a BuildRouteRequest. */ @@ -40839,6 +41529,9 @@ export namespace routerrpc { /** BuildRouteRequest payment_addr. */ public payment_addr: Uint8Array; + /** BuildRouteRequest first_hop_custom_records. */ + public first_hop_custom_records: { [k: string]: Uint8Array }; + /** * Creates a new BuildRouteRequest instance using the specified properties. * @param [properties] Properties to set @@ -42487,6 +43180,9 @@ export namespace routerrpc { /** ForwardHtlcInterceptRequest auto_fail_height */ auto_fail_height?: number | null; + + /** ForwardHtlcInterceptRequest in_wire_custom_records */ + in_wire_custom_records?: { [k: string]: Uint8Array } | null; } /** Represents a ForwardHtlcInterceptRequest. */ @@ -42527,6 +43223,9 @@ export namespace routerrpc { /** ForwardHtlcInterceptRequest auto_fail_height. */ public auto_fail_height: number; + /** ForwardHtlcInterceptRequest in_wire_custom_records. */ + public in_wire_custom_records: { [k: string]: Uint8Array }; + /** * Creates a new ForwardHtlcInterceptRequest instance using the specified properties. * @param [properties] Properties to set @@ -42642,12 +43341,23 @@ export namespace routerrpc { /** ForwardHtlcInterceptResponse failure_code */ failure_code?: lnrpc.Failure.FailureCode | null; + + /** ForwardHtlcInterceptResponse in_amount_msat */ + in_amount_msat?: Long | null; + + /** ForwardHtlcInterceptResponse out_amount_msat */ + out_amount_msat?: Long | null; + + /** ForwardHtlcInterceptResponse out_wire_custom_records */ + out_wire_custom_records?: { [k: string]: Uint8Array } | null; } /** * ForwardHtlcInterceptResponse enables the caller to resolve a previously hold * forward. The caller can choose either to: * - `Resume`: Execute the default behavior (usually forward). + * - `ResumeModified`: Execute the default behavior (usually forward) with HTLC + * field modifications. * - `Reject`: Fail the htlc backwards. * - `Settle`: Settle this htlc with a given preimage. */ @@ -42678,6 +43388,15 @@ export namespace routerrpc { /** ForwardHtlcInterceptResponse failure_code. */ public failure_code: lnrpc.Failure.FailureCode; + /** ForwardHtlcInterceptResponse in_amount_msat. */ + public in_amount_msat: Long; + + /** ForwardHtlcInterceptResponse out_amount_msat. */ + public out_amount_msat: Long; + + /** ForwardHtlcInterceptResponse out_wire_custom_records. */ + public out_wire_custom_records: { [k: string]: Uint8Array }; + /** * Creates a new ForwardHtlcInterceptResponse instance using the specified properties. * @param [properties] Properties to set @@ -42778,7 +43497,8 @@ export namespace routerrpc { enum ResolveHoldForwardAction { SETTLE = 0, FAIL = 1, - RESUME = 2 + RESUME = 2, + RESUME_MODIFIED = 3 } /** Properties of an UpdateChanStatusRequest. */ @@ -43013,6 +43733,458 @@ export namespace routerrpc { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of an AddAliasesRequest. */ + interface IAddAliasesRequest { + /** AddAliasesRequest alias_maps */ + alias_maps?: lnrpc.IAliasMap[] | null; + } + + /** Represents an AddAliasesRequest. */ + class AddAliasesRequest implements IAddAliasesRequest { + /** + * Constructs a new AddAliasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: routerrpc.IAddAliasesRequest); + + /** AddAliasesRequest alias_maps. */ + public alias_maps: lnrpc.IAliasMap[]; + + /** + * Creates a new AddAliasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddAliasesRequest instance + */ + public static create( + properties?: routerrpc.IAddAliasesRequest + ): routerrpc.AddAliasesRequest; + + /** + * Encodes the specified AddAliasesRequest message. Does not implicitly {@link routerrpc.AddAliasesRequest.verify|verify} messages. + * @param message AddAliasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: routerrpc.IAddAliasesRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified AddAliasesRequest message, length delimited. Does not implicitly {@link routerrpc.AddAliasesRequest.verify|verify} messages. + * @param message AddAliasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: routerrpc.IAddAliasesRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an AddAliasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddAliasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): routerrpc.AddAliasesRequest; + + /** + * Decodes an AddAliasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddAliasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): routerrpc.AddAliasesRequest; + + /** + * Verifies an AddAliasesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates an AddAliasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddAliasesRequest + */ + public static fromObject(object: { + [k: string]: any; + }): routerrpc.AddAliasesRequest; + + /** + * Creates a plain object from an AddAliasesRequest message. Also converts values to other types if specified. + * @param message AddAliasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: routerrpc.AddAliasesRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this AddAliasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddAliasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AddAliasesResponse. */ + interface IAddAliasesResponse { + /** AddAliasesResponse alias_maps */ + alias_maps?: lnrpc.IAliasMap[] | null; + } + + /** Represents an AddAliasesResponse. */ + class AddAliasesResponse implements IAddAliasesResponse { + /** + * Constructs a new AddAliasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: routerrpc.IAddAliasesResponse); + + /** AddAliasesResponse alias_maps. */ + public alias_maps: lnrpc.IAliasMap[]; + + /** + * Creates a new AddAliasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AddAliasesResponse instance + */ + public static create( + properties?: routerrpc.IAddAliasesResponse + ): routerrpc.AddAliasesResponse; + + /** + * Encodes the specified AddAliasesResponse message. Does not implicitly {@link routerrpc.AddAliasesResponse.verify|verify} messages. + * @param message AddAliasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: routerrpc.IAddAliasesResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified AddAliasesResponse message, length delimited. Does not implicitly {@link routerrpc.AddAliasesResponse.verify|verify} messages. + * @param message AddAliasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: routerrpc.IAddAliasesResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an AddAliasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddAliasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): routerrpc.AddAliasesResponse; + + /** + * Decodes an AddAliasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddAliasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): routerrpc.AddAliasesResponse; + + /** + * Verifies an AddAliasesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates an AddAliasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddAliasesResponse + */ + public static fromObject(object: { + [k: string]: any; + }): routerrpc.AddAliasesResponse; + + /** + * Creates a plain object from an AddAliasesResponse message. Also converts values to other types if specified. + * @param message AddAliasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: routerrpc.AddAliasesResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this AddAliasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddAliasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAliasesRequest. */ + interface IDeleteAliasesRequest { + /** DeleteAliasesRequest alias_maps */ + alias_maps?: lnrpc.IAliasMap[] | null; + } + + /** Represents a DeleteAliasesRequest. */ + class DeleteAliasesRequest implements IDeleteAliasesRequest { + /** + * Constructs a new DeleteAliasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: routerrpc.IDeleteAliasesRequest); + + /** DeleteAliasesRequest alias_maps. */ + public alias_maps: lnrpc.IAliasMap[]; + + /** + * Creates a new DeleteAliasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAliasesRequest instance + */ + public static create( + properties?: routerrpc.IDeleteAliasesRequest + ): routerrpc.DeleteAliasesRequest; + + /** + * Encodes the specified DeleteAliasesRequest message. Does not implicitly {@link routerrpc.DeleteAliasesRequest.verify|verify} messages. + * @param message DeleteAliasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: routerrpc.IDeleteAliasesRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified DeleteAliasesRequest message, length delimited. Does not implicitly {@link routerrpc.DeleteAliasesRequest.verify|verify} messages. + * @param message DeleteAliasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: routerrpc.IDeleteAliasesRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a DeleteAliasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAliasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): routerrpc.DeleteAliasesRequest; + + /** + * Decodes a DeleteAliasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAliasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): routerrpc.DeleteAliasesRequest; + + /** + * Verifies a DeleteAliasesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a DeleteAliasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAliasesRequest + */ + public static fromObject(object: { + [k: string]: any; + }): routerrpc.DeleteAliasesRequest; + + /** + * Creates a plain object from a DeleteAliasesRequest message. Also converts values to other types if specified. + * @param message DeleteAliasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: routerrpc.DeleteAliasesRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this DeleteAliasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAliasesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAliasesResponse. */ + interface IDeleteAliasesResponse { + /** DeleteAliasesResponse alias_maps */ + alias_maps?: lnrpc.IAliasMap[] | null; + } + + /** Represents a DeleteAliasesResponse. */ + class DeleteAliasesResponse implements IDeleteAliasesResponse { + /** + * Constructs a new DeleteAliasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: routerrpc.IDeleteAliasesResponse); + + /** DeleteAliasesResponse alias_maps. */ + public alias_maps: lnrpc.IAliasMap[]; + + /** + * Creates a new DeleteAliasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAliasesResponse instance + */ + public static create( + properties?: routerrpc.IDeleteAliasesResponse + ): routerrpc.DeleteAliasesResponse; + + /** + * Encodes the specified DeleteAliasesResponse message. Does not implicitly {@link routerrpc.DeleteAliasesResponse.verify|verify} messages. + * @param message DeleteAliasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: routerrpc.IDeleteAliasesResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified DeleteAliasesResponse message, length delimited. Does not implicitly {@link routerrpc.DeleteAliasesResponse.verify|verify} messages. + * @param message DeleteAliasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: routerrpc.IDeleteAliasesResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a DeleteAliasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAliasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): routerrpc.DeleteAliasesResponse; + + /** + * Decodes a DeleteAliasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAliasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): routerrpc.DeleteAliasesResponse; + + /** + * Verifies a DeleteAliasesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a DeleteAliasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAliasesResponse + */ + public static fromObject(object: { + [k: string]: any; + }): routerrpc.DeleteAliasesResponse; + + /** + * Creates a plain object from a DeleteAliasesResponse message. Also converts values to other types if specified. + * @param message DeleteAliasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: routerrpc.DeleteAliasesResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this DeleteAliasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAliasesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Namespace signrpc. */ @@ -52506,6 +53678,9 @@ export namespace walletrpc { interface IEstimateFeeResponse { /** EstimateFeeResponse sat_per_kw */ sat_per_kw?: Long | null; + + /** EstimateFeeResponse min_relay_fee_sat_per_kw */ + min_relay_fee_sat_per_kw?: Long | null; } /** Represents an EstimateFeeResponse. */ @@ -52519,6 +53694,9 @@ export namespace walletrpc { /** EstimateFeeResponse sat_per_kw. */ public sat_per_kw: Long; + /** EstimateFeeResponse min_relay_fee_sat_per_kw. */ + public min_relay_fee_sat_per_kw: Long; + /** * Creates a new EstimateFeeResponse instance using the specified properties. * @param [properties] Properties to set diff --git a/proto/lightning.js b/proto/lightning.js index 5352d496c..5dccd2058 100644 --- a/proto/lightning.js +++ b/proto/lightning.js @@ -7646,6 +7646,7 @@ export const lnrpc = $root.lnrpc = (() => { case 3: case 4: case 5: + case 6: break; } if (message.wants_zero_conf != null && message.hasOwnProperty("wants_zero_conf")) @@ -7784,6 +7785,10 @@ export const lnrpc = $root.lnrpc = (() => { case 5: message.commitment_type = 5; break; + case "SIMPLE_TAPROOT_OVERLAY": + case 6: + message.commitment_type = 6; + break; } if (object.wants_zero_conf != null) message.wants_zero_conf = Boolean(object.wants_zero_conf); @@ -14600,6 +14605,7 @@ export const lnrpc = $root.lnrpc = (() => { * @property {number} ANCHORS=3 ANCHORS value * @property {number} SCRIPT_ENFORCED_LEASE=4 SCRIPT_ENFORCED_LEASE value * @property {number} SIMPLE_TAPROOT=5 SIMPLE_TAPROOT value + * @property {number} SIMPLE_TAPROOT_OVERLAY=6 SIMPLE_TAPROOT_OVERLAY value */ lnrpc.CommitmentType = (function() { const valuesById = {}, values = Object.create(valuesById); @@ -14609,6 +14615,7 @@ export const lnrpc = $root.lnrpc = (() => { values[valuesById[3] = "ANCHORS"] = 3; values[valuesById[4] = "SCRIPT_ENFORCED_LEASE"] = 4; values[valuesById[5] = "SIMPLE_TAPROOT"] = 5; + values[valuesById[6] = "SIMPLE_TAPROOT_OVERLAY"] = 6; return values; })(); @@ -15029,6 +15036,7 @@ export const lnrpc = $root.lnrpc = (() => { * @property {string|null} [peer_alias] Channel peer_alias * @property {Long|null} [peer_scid_alias] Channel peer_scid_alias * @property {string|null} [memo] Channel memo + * @property {Uint8Array|null} [custom_channel_data] Channel custom_channel_data */ /** @@ -15336,6 +15344,14 @@ export const lnrpc = $root.lnrpc = (() => { */ Channel.prototype.memo = ""; + /** + * Channel custom_channel_data. + * @member {Uint8Array} custom_channel_data + * @memberof lnrpc.Channel + * @instance + */ + Channel.prototype.custom_channel_data = $util.newBuffer([]); + /** * Creates a new Channel instance using the specified properties. * @function create @@ -15437,6 +15453,8 @@ export const lnrpc = $root.lnrpc = (() => { writer.uint32(/* id 35, wireType 0 =*/280).uint64(message.peer_scid_alias); if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) writer.uint32(/* id 36, wireType 2 =*/290).string(message.memo); + if (message.custom_channel_data != null && Object.hasOwnProperty.call(message, "custom_channel_data")) + writer.uint32(/* id 37, wireType 2 =*/298).bytes(message.custom_channel_data); return writer; }; @@ -15624,6 +15642,10 @@ export const lnrpc = $root.lnrpc = (() => { message.memo = reader.string(); break; } + case 37: { + message.custom_channel_data = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -15741,6 +15763,7 @@ export const lnrpc = $root.lnrpc = (() => { case 3: case 4: case 5: + case 6: break; } if (message.lifetime != null && message.hasOwnProperty("lifetime")) @@ -15790,6 +15813,9 @@ export const lnrpc = $root.lnrpc = (() => { if (message.memo != null && message.hasOwnProperty("memo")) if (!$util.isString(message.memo)) return "memo: string expected"; + if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data")) + if (!(message.custom_channel_data && typeof message.custom_channel_data.length === "number" || $util.isString(message.custom_channel_data))) + return "custom_channel_data: buffer expected"; return null; }; @@ -15979,6 +16005,10 @@ export const lnrpc = $root.lnrpc = (() => { case 5: message.commitment_type = 5; break; + case "SIMPLE_TAPROOT_OVERLAY": + case 6: + message.commitment_type = 6; + break; } if (object.lifetime != null) if ($util.Long) @@ -16059,6 +16089,11 @@ export const lnrpc = $root.lnrpc = (() => { message.peer_scid_alias = new $util.LongBits(object.peer_scid_alias.low >>> 0, object.peer_scid_alias.high >>> 0).toNumber(true); if (object.memo != null) message.memo = String(object.memo); + if (object.custom_channel_data != null) + if (typeof object.custom_channel_data === "string") + $util.base64.decode(object.custom_channel_data, message.custom_channel_data = $util.newBuffer($util.base64.length(object.custom_channel_data)), 0); + else if (object.custom_channel_data.length >= 0) + message.custom_channel_data = object.custom_channel_data; return message; }; @@ -16186,6 +16221,13 @@ export const lnrpc = $root.lnrpc = (() => { } else object.peer_scid_alias = options.longs === String ? "0" : 0; object.memo = ""; + if (options.bytes === String) + object.custom_channel_data = ""; + else { + object.custom_channel_data = []; + if (options.bytes !== Array) + object.custom_channel_data = $util.newBuffer(object.custom_channel_data); + } } if (message.active != null && message.hasOwnProperty("active")) object.active = message.active; @@ -16322,6 +16364,8 @@ export const lnrpc = $root.lnrpc = (() => { object.peer_scid_alias = options.longs === String ? $util.Long.prototype.toString.call(message.peer_scid_alias) : options.longs === Number ? new $util.LongBits(message.peer_scid_alias.low >>> 0, message.peer_scid_alias.high >>> 0).toNumber(true) : message.peer_scid_alias; if (message.memo != null && message.hasOwnProperty("memo")) object.memo = message.memo; + if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data")) + object.custom_channel_data = options.bytes === String ? $util.base64.encode(message.custom_channel_data, 0, message.custom_channel_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_channel_data) : message.custom_channel_data; return object; }; @@ -23646,6 +23690,311 @@ export const lnrpc = $root.lnrpc = (() => { return ChannelOpenUpdate; })(); + lnrpc.CloseOutput = (function() { + + /** + * Properties of a CloseOutput. + * @memberof lnrpc + * @interface ICloseOutput + * @property {Long|null} [amount_sat] CloseOutput amount_sat + * @property {Uint8Array|null} [pk_script] CloseOutput pk_script + * @property {boolean|null} [is_local] CloseOutput is_local + * @property {Uint8Array|null} [custom_channel_data] CloseOutput custom_channel_data + */ + + /** + * Constructs a new CloseOutput. + * @memberof lnrpc + * @classdesc Represents a CloseOutput. + * @implements ICloseOutput + * @constructor + * @param {lnrpc.ICloseOutput=} [properties] Properties to set + */ + function CloseOutput(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloseOutput amount_sat. + * @member {Long} amount_sat + * @memberof lnrpc.CloseOutput + * @instance + */ + CloseOutput.prototype.amount_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * CloseOutput pk_script. + * @member {Uint8Array} pk_script + * @memberof lnrpc.CloseOutput + * @instance + */ + CloseOutput.prototype.pk_script = $util.newBuffer([]); + + /** + * CloseOutput is_local. + * @member {boolean} is_local + * @memberof lnrpc.CloseOutput + * @instance + */ + CloseOutput.prototype.is_local = false; + + /** + * CloseOutput custom_channel_data. + * @member {Uint8Array} custom_channel_data + * @memberof lnrpc.CloseOutput + * @instance + */ + CloseOutput.prototype.custom_channel_data = $util.newBuffer([]); + + /** + * Creates a new CloseOutput instance using the specified properties. + * @function create + * @memberof lnrpc.CloseOutput + * @static + * @param {lnrpc.ICloseOutput=} [properties] Properties to set + * @returns {lnrpc.CloseOutput} CloseOutput instance + */ + CloseOutput.create = function create(properties) { + return new CloseOutput(properties); + }; + + /** + * Encodes the specified CloseOutput message. Does not implicitly {@link lnrpc.CloseOutput.verify|verify} messages. + * @function encode + * @memberof lnrpc.CloseOutput + * @static + * @param {lnrpc.ICloseOutput} message CloseOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseOutput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount_sat != null && Object.hasOwnProperty.call(message, "amount_sat")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.amount_sat); + if (message.pk_script != null && Object.hasOwnProperty.call(message, "pk_script")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.pk_script); + if (message.is_local != null && Object.hasOwnProperty.call(message, "is_local")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.is_local); + if (message.custom_channel_data != null && Object.hasOwnProperty.call(message, "custom_channel_data")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.custom_channel_data); + return writer; + }; + + /** + * Encodes the specified CloseOutput message, length delimited. Does not implicitly {@link lnrpc.CloseOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof lnrpc.CloseOutput + * @static + * @param {lnrpc.ICloseOutput} message CloseOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseOutput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloseOutput message from the specified reader or buffer. + * @function decode + * @memberof lnrpc.CloseOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {lnrpc.CloseOutput} CloseOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseOutput.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.CloseOutput(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.amount_sat = reader.int64(); + break; + } + case 2: { + message.pk_script = reader.bytes(); + break; + } + case 3: { + message.is_local = reader.bool(); + break; + } + case 4: { + message.custom_channel_data = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloseOutput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof lnrpc.CloseOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {lnrpc.CloseOutput} CloseOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseOutput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloseOutput message. + * @function verify + * @memberof lnrpc.CloseOutput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloseOutput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amount_sat != null && message.hasOwnProperty("amount_sat")) + if (!$util.isInteger(message.amount_sat) && !(message.amount_sat && $util.isInteger(message.amount_sat.low) && $util.isInteger(message.amount_sat.high))) + return "amount_sat: integer|Long expected"; + if (message.pk_script != null && message.hasOwnProperty("pk_script")) + if (!(message.pk_script && typeof message.pk_script.length === "number" || $util.isString(message.pk_script))) + return "pk_script: buffer expected"; + if (message.is_local != null && message.hasOwnProperty("is_local")) + if (typeof message.is_local !== "boolean") + return "is_local: boolean expected"; + if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data")) + if (!(message.custom_channel_data && typeof message.custom_channel_data.length === "number" || $util.isString(message.custom_channel_data))) + return "custom_channel_data: buffer expected"; + return null; + }; + + /** + * Creates a CloseOutput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof lnrpc.CloseOutput + * @static + * @param {Object.} object Plain object + * @returns {lnrpc.CloseOutput} CloseOutput + */ + CloseOutput.fromObject = function fromObject(object) { + if (object instanceof $root.lnrpc.CloseOutput) + return object; + let message = new $root.lnrpc.CloseOutput(); + if (object.amount_sat != null) + if ($util.Long) + (message.amount_sat = $util.Long.fromValue(object.amount_sat)).unsigned = false; + else if (typeof object.amount_sat === "string") + message.amount_sat = parseInt(object.amount_sat, 10); + else if (typeof object.amount_sat === "number") + message.amount_sat = object.amount_sat; + else if (typeof object.amount_sat === "object") + message.amount_sat = new $util.LongBits(object.amount_sat.low >>> 0, object.amount_sat.high >>> 0).toNumber(); + if (object.pk_script != null) + if (typeof object.pk_script === "string") + $util.base64.decode(object.pk_script, message.pk_script = $util.newBuffer($util.base64.length(object.pk_script)), 0); + else if (object.pk_script.length >= 0) + message.pk_script = object.pk_script; + if (object.is_local != null) + message.is_local = Boolean(object.is_local); + if (object.custom_channel_data != null) + if (typeof object.custom_channel_data === "string") + $util.base64.decode(object.custom_channel_data, message.custom_channel_data = $util.newBuffer($util.base64.length(object.custom_channel_data)), 0); + else if (object.custom_channel_data.length >= 0) + message.custom_channel_data = object.custom_channel_data; + return message; + }; + + /** + * Creates a plain object from a CloseOutput message. Also converts values to other types if specified. + * @function toObject + * @memberof lnrpc.CloseOutput + * @static + * @param {lnrpc.CloseOutput} message CloseOutput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloseOutput.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.amount_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount_sat = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.pk_script = ""; + else { + object.pk_script = []; + if (options.bytes !== Array) + object.pk_script = $util.newBuffer(object.pk_script); + } + object.is_local = false; + if (options.bytes === String) + object.custom_channel_data = ""; + else { + object.custom_channel_data = []; + if (options.bytes !== Array) + object.custom_channel_data = $util.newBuffer(object.custom_channel_data); + } + } + if (message.amount_sat != null && message.hasOwnProperty("amount_sat")) + if (typeof message.amount_sat === "number") + object.amount_sat = options.longs === String ? String(message.amount_sat) : message.amount_sat; + else + object.amount_sat = options.longs === String ? $util.Long.prototype.toString.call(message.amount_sat) : options.longs === Number ? new $util.LongBits(message.amount_sat.low >>> 0, message.amount_sat.high >>> 0).toNumber() : message.amount_sat; + if (message.pk_script != null && message.hasOwnProperty("pk_script")) + object.pk_script = options.bytes === String ? $util.base64.encode(message.pk_script, 0, message.pk_script.length) : options.bytes === Array ? Array.prototype.slice.call(message.pk_script) : message.pk_script; + if (message.is_local != null && message.hasOwnProperty("is_local")) + object.is_local = message.is_local; + if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data")) + object.custom_channel_data = options.bytes === String ? $util.base64.encode(message.custom_channel_data, 0, message.custom_channel_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_channel_data) : message.custom_channel_data; + return object; + }; + + /** + * Converts this CloseOutput to JSON. + * @function toJSON + * @memberof lnrpc.CloseOutput + * @instance + * @returns {Object.} JSON object + */ + CloseOutput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloseOutput + * @function getTypeUrl + * @memberof lnrpc.CloseOutput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloseOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/lnrpc.CloseOutput"; + }; + + return CloseOutput; + })(); + lnrpc.ChannelCloseUpdate = (function() { /** @@ -23654,6 +24003,9 @@ export const lnrpc = $root.lnrpc = (() => { * @interface IChannelCloseUpdate * @property {Uint8Array|null} [closing_txid] ChannelCloseUpdate closing_txid * @property {boolean|null} [success] ChannelCloseUpdate success + * @property {lnrpc.ICloseOutput|null} [local_close_output] ChannelCloseUpdate local_close_output + * @property {lnrpc.ICloseOutput|null} [remote_close_output] ChannelCloseUpdate remote_close_output + * @property {Array.|null} [additional_outputs] ChannelCloseUpdate additional_outputs */ /** @@ -23665,6 +24017,7 @@ export const lnrpc = $root.lnrpc = (() => { * @param {lnrpc.IChannelCloseUpdate=} [properties] Properties to set */ function ChannelCloseUpdate(properties) { + this.additional_outputs = []; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23687,6 +24040,30 @@ export const lnrpc = $root.lnrpc = (() => { */ ChannelCloseUpdate.prototype.success = false; + /** + * ChannelCloseUpdate local_close_output. + * @member {lnrpc.ICloseOutput|null|undefined} local_close_output + * @memberof lnrpc.ChannelCloseUpdate + * @instance + */ + ChannelCloseUpdate.prototype.local_close_output = null; + + /** + * ChannelCloseUpdate remote_close_output. + * @member {lnrpc.ICloseOutput|null|undefined} remote_close_output + * @memberof lnrpc.ChannelCloseUpdate + * @instance + */ + ChannelCloseUpdate.prototype.remote_close_output = null; + + /** + * ChannelCloseUpdate additional_outputs. + * @member {Array.} additional_outputs + * @memberof lnrpc.ChannelCloseUpdate + * @instance + */ + ChannelCloseUpdate.prototype.additional_outputs = $util.emptyArray; + /** * Creates a new ChannelCloseUpdate instance using the specified properties. * @function create @@ -23715,6 +24092,13 @@ export const lnrpc = $root.lnrpc = (() => { writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.closing_txid); if (message.success != null && Object.hasOwnProperty.call(message, "success")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.success); + if (message.local_close_output != null && Object.hasOwnProperty.call(message, "local_close_output")) + $root.lnrpc.CloseOutput.encode(message.local_close_output, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.remote_close_output != null && Object.hasOwnProperty.call(message, "remote_close_output")) + $root.lnrpc.CloseOutput.encode(message.remote_close_output, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.additional_outputs != null && message.additional_outputs.length) + for (let i = 0; i < message.additional_outputs.length; ++i) + $root.lnrpc.CloseOutput.encode(message.additional_outputs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -23757,6 +24141,20 @@ export const lnrpc = $root.lnrpc = (() => { message.success = reader.bool(); break; } + case 3: { + message.local_close_output = $root.lnrpc.CloseOutput.decode(reader, reader.uint32()); + break; + } + case 4: { + message.remote_close_output = $root.lnrpc.CloseOutput.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.additional_outputs && message.additional_outputs.length)) + message.additional_outputs = []; + message.additional_outputs.push($root.lnrpc.CloseOutput.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -23798,6 +24196,25 @@ export const lnrpc = $root.lnrpc = (() => { if (message.success != null && message.hasOwnProperty("success")) if (typeof message.success !== "boolean") return "success: boolean expected"; + if (message.local_close_output != null && message.hasOwnProperty("local_close_output")) { + let error = $root.lnrpc.CloseOutput.verify(message.local_close_output); + if (error) + return "local_close_output." + error; + } + if (message.remote_close_output != null && message.hasOwnProperty("remote_close_output")) { + let error = $root.lnrpc.CloseOutput.verify(message.remote_close_output); + if (error) + return "remote_close_output." + error; + } + if (message.additional_outputs != null && message.hasOwnProperty("additional_outputs")) { + if (!Array.isArray(message.additional_outputs)) + return "additional_outputs: array expected"; + for (let i = 0; i < message.additional_outputs.length; ++i) { + let error = $root.lnrpc.CloseOutput.verify(message.additional_outputs[i]); + if (error) + return "additional_outputs." + error; + } + } return null; }; @@ -23820,6 +24237,26 @@ export const lnrpc = $root.lnrpc = (() => { message.closing_txid = object.closing_txid; if (object.success != null) message.success = Boolean(object.success); + if (object.local_close_output != null) { + if (typeof object.local_close_output !== "object") + throw TypeError(".lnrpc.ChannelCloseUpdate.local_close_output: object expected"); + message.local_close_output = $root.lnrpc.CloseOutput.fromObject(object.local_close_output); + } + if (object.remote_close_output != null) { + if (typeof object.remote_close_output !== "object") + throw TypeError(".lnrpc.ChannelCloseUpdate.remote_close_output: object expected"); + message.remote_close_output = $root.lnrpc.CloseOutput.fromObject(object.remote_close_output); + } + if (object.additional_outputs) { + if (!Array.isArray(object.additional_outputs)) + throw TypeError(".lnrpc.ChannelCloseUpdate.additional_outputs: array expected"); + message.additional_outputs = []; + for (let i = 0; i < object.additional_outputs.length; ++i) { + if (typeof object.additional_outputs[i] !== "object") + throw TypeError(".lnrpc.ChannelCloseUpdate.additional_outputs: object expected"); + message.additional_outputs[i] = $root.lnrpc.CloseOutput.fromObject(object.additional_outputs[i]); + } + } return message; }; @@ -23836,6 +24273,8 @@ export const lnrpc = $root.lnrpc = (() => { if (!options) options = {}; let object = {}; + if (options.arrays || options.defaults) + object.additional_outputs = []; if (options.defaults) { if (options.bytes === String) object.closing_txid = ""; @@ -23845,11 +24284,22 @@ export const lnrpc = $root.lnrpc = (() => { object.closing_txid = $util.newBuffer(object.closing_txid); } object.success = false; + object.local_close_output = null; + object.remote_close_output = null; } if (message.closing_txid != null && message.hasOwnProperty("closing_txid")) object.closing_txid = options.bytes === String ? $util.base64.encode(message.closing_txid, 0, message.closing_txid.length) : options.bytes === Array ? Array.prototype.slice.call(message.closing_txid) : message.closing_txid; if (message.success != null && message.hasOwnProperty("success")) object.success = message.success; + if (message.local_close_output != null && message.hasOwnProperty("local_close_output")) + object.local_close_output = $root.lnrpc.CloseOutput.toObject(message.local_close_output, options); + if (message.remote_close_output != null && message.hasOwnProperty("remote_close_output")) + object.remote_close_output = $root.lnrpc.CloseOutput.toObject(message.remote_close_output, options); + if (message.additional_outputs && message.additional_outputs.length) { + object.additional_outputs = []; + for (let j = 0; j < message.additional_outputs.length; ++j) + object.additional_outputs[j] = $root.lnrpc.CloseOutput.toObject(message.additional_outputs[j], options); + } return object; }; @@ -26127,6 +26577,7 @@ export const lnrpc = $root.lnrpc = (() => { case 3: case 4: case 5: + case 6: break; } if (message.remote_max_value_in_flight_msat != null && message.hasOwnProperty("remote_max_value_in_flight_msat")) @@ -26251,6 +26702,10 @@ export const lnrpc = $root.lnrpc = (() => { case 5: message.commitment_type = 5; break; + case "SIMPLE_TAPROOT_OVERLAY": + case 6: + message.commitment_type = 6; + break; } if (object.remote_max_value_in_flight_msat != null) if ($util.Long) @@ -27300,6 +27755,7 @@ export const lnrpc = $root.lnrpc = (() => { case 3: case 4: case 5: + case 6: break; } if (message.zero_conf != null && message.hasOwnProperty("zero_conf")) @@ -27466,6 +27922,10 @@ export const lnrpc = $root.lnrpc = (() => { case 5: message.commitment_type = 5; break; + case "SIMPLE_TAPROOT_OVERLAY": + case 6: + message.commitment_type = 6; + break; } if (object.zero_conf != null) message.zero_conf = Boolean(object.zero_conf); @@ -31646,6 +32106,7 @@ export const lnrpc = $root.lnrpc = (() => { * @property {string|null} [chan_status_flags] PendingChannel chan_status_flags * @property {boolean|null} ["private"] PendingChannel private * @property {string|null} [memo] PendingChannel memo + * @property {Uint8Array|null} [custom_channel_data] PendingChannel custom_channel_data */ /** @@ -31767,6 +32228,14 @@ export const lnrpc = $root.lnrpc = (() => { */ PendingChannel.prototype.memo = ""; + /** + * PendingChannel custom_channel_data. + * @member {Uint8Array} custom_channel_data + * @memberof lnrpc.PendingChannelsResponse.PendingChannel + * @instance + */ + PendingChannel.prototype.custom_channel_data = $util.newBuffer([]); + /** * Creates a new PendingChannel instance using the specified properties. * @function create @@ -31817,6 +32286,8 @@ export const lnrpc = $root.lnrpc = (() => { writer.uint32(/* id 12, wireType 0 =*/96).bool(message["private"]); if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) writer.uint32(/* id 13, wireType 2 =*/106).string(message.memo); + if (message.custom_channel_data != null && Object.hasOwnProperty.call(message, "custom_channel_data")) + writer.uint32(/* id 34, wireType 2 =*/274).bytes(message.custom_channel_data); return writer; }; @@ -31903,6 +32374,10 @@ export const lnrpc = $root.lnrpc = (() => { message.memo = reader.string(); break; } + case 34: { + message.custom_channel_data = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -31979,6 +32454,7 @@ export const lnrpc = $root.lnrpc = (() => { case 3: case 4: case 5: + case 6: break; } if (message.num_forwarding_packages != null && message.hasOwnProperty("num_forwarding_packages")) @@ -31993,6 +32469,9 @@ export const lnrpc = $root.lnrpc = (() => { if (message.memo != null && message.hasOwnProperty("memo")) if (!$util.isString(message.memo)) return "memo: string expected"; + if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data")) + if (!(message.custom_channel_data && typeof message.custom_channel_data.length === "number" || $util.isString(message.custom_channel_data))) + return "custom_channel_data: buffer expected"; return null; }; @@ -32112,6 +32591,10 @@ export const lnrpc = $root.lnrpc = (() => { case 5: message.commitment_type = 5; break; + case "SIMPLE_TAPROOT_OVERLAY": + case 6: + message.commitment_type = 6; + break; } if (object.num_forwarding_packages != null) if ($util.Long) @@ -32128,6 +32611,11 @@ export const lnrpc = $root.lnrpc = (() => { message["private"] = Boolean(object["private"]); if (object.memo != null) message.memo = String(object.memo); + if (object.custom_channel_data != null) + if (typeof object.custom_channel_data === "string") + $util.base64.decode(object.custom_channel_data, message.custom_channel_data = $util.newBuffer($util.base64.length(object.custom_channel_data)), 0); + else if (object.custom_channel_data.length >= 0) + message.custom_channel_data = object.custom_channel_data; return message; }; @@ -32182,6 +32670,13 @@ export const lnrpc = $root.lnrpc = (() => { object.chan_status_flags = ""; object["private"] = false; object.memo = ""; + if (options.bytes === String) + object.custom_channel_data = ""; + else { + object.custom_channel_data = []; + if (options.bytes !== Array) + object.custom_channel_data = $util.newBuffer(object.custom_channel_data); + } } if (message.remote_node_pub != null && message.hasOwnProperty("remote_node_pub")) object.remote_node_pub = message.remote_node_pub; @@ -32227,6 +32722,8 @@ export const lnrpc = $root.lnrpc = (() => { object["private"] = message["private"]; if (message.memo != null && message.hasOwnProperty("memo")) object.memo = message.memo; + if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data")) + object.custom_channel_data = options.bytes === String ? $util.base64.encode(message.custom_channel_data, 0, message.custom_channel_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_channel_data) : message.custom_channel_data; return object; }; @@ -35998,6 +36495,7 @@ export const lnrpc = $root.lnrpc = (() => { * @property {lnrpc.IAmount|null} [unsettled_remote_balance] ChannelBalanceResponse unsettled_remote_balance * @property {lnrpc.IAmount|null} [pending_open_local_balance] ChannelBalanceResponse pending_open_local_balance * @property {lnrpc.IAmount|null} [pending_open_remote_balance] ChannelBalanceResponse pending_open_remote_balance + * @property {Uint8Array|null} [custom_channel_data] ChannelBalanceResponse custom_channel_data */ /** @@ -36079,6 +36577,14 @@ export const lnrpc = $root.lnrpc = (() => { */ ChannelBalanceResponse.prototype.pending_open_remote_balance = null; + /** + * ChannelBalanceResponse custom_channel_data. + * @member {Uint8Array} custom_channel_data + * @memberof lnrpc.ChannelBalanceResponse + * @instance + */ + ChannelBalanceResponse.prototype.custom_channel_data = $util.newBuffer([]); + /** * Creates a new ChannelBalanceResponse instance using the specified properties. * @function create @@ -36119,6 +36625,8 @@ export const lnrpc = $root.lnrpc = (() => { $root.lnrpc.Amount.encode(message.pending_open_local_balance, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.pending_open_remote_balance != null && Object.hasOwnProperty.call(message, "pending_open_remote_balance")) $root.lnrpc.Amount.encode(message.pending_open_remote_balance, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.custom_channel_data != null && Object.hasOwnProperty.call(message, "custom_channel_data")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.custom_channel_data); return writer; }; @@ -36185,6 +36693,10 @@ export const lnrpc = $root.lnrpc = (() => { message.pending_open_remote_balance = $root.lnrpc.Amount.decode(reader, reader.uint32()); break; } + case 9: { + message.custom_channel_data = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -36256,6 +36768,9 @@ export const lnrpc = $root.lnrpc = (() => { if (error) return "pending_open_remote_balance." + error; } + if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data")) + if (!(message.custom_channel_data && typeof message.custom_channel_data.length === "number" || $util.isString(message.custom_channel_data))) + return "custom_channel_data: buffer expected"; return null; }; @@ -36319,6 +36834,11 @@ export const lnrpc = $root.lnrpc = (() => { throw TypeError(".lnrpc.ChannelBalanceResponse.pending_open_remote_balance: object expected"); message.pending_open_remote_balance = $root.lnrpc.Amount.fromObject(object.pending_open_remote_balance); } + if (object.custom_channel_data != null) + if (typeof object.custom_channel_data === "string") + $util.base64.decode(object.custom_channel_data, message.custom_channel_data = $util.newBuffer($util.base64.length(object.custom_channel_data)), 0); + else if (object.custom_channel_data.length >= 0) + message.custom_channel_data = object.custom_channel_data; return message; }; @@ -36352,6 +36872,13 @@ export const lnrpc = $root.lnrpc = (() => { object.unsettled_remote_balance = null; object.pending_open_local_balance = null; object.pending_open_remote_balance = null; + if (options.bytes === String) + object.custom_channel_data = ""; + else { + object.custom_channel_data = []; + if (options.bytes !== Array) + object.custom_channel_data = $util.newBuffer(object.custom_channel_data); + } } if (message.balance != null && message.hasOwnProperty("balance")) if (typeof message.balance === "number") @@ -36375,6 +36902,8 @@ export const lnrpc = $root.lnrpc = (() => { object.pending_open_local_balance = $root.lnrpc.Amount.toObject(message.pending_open_local_balance, options); if (message.pending_open_remote_balance != null && message.hasOwnProperty("pending_open_remote_balance")) object.pending_open_remote_balance = $root.lnrpc.Amount.toObject(message.pending_open_remote_balance, options); + if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data")) + object.custom_channel_data = options.bytes === String ? $util.base64.encode(message.custom_channel_data, 0, message.custom_channel_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_channel_data) : message.custom_channel_data; return object; }; @@ -39363,6 +39892,8 @@ export const lnrpc = $root.lnrpc = (() => { * @property {Array.|null} [hops] Route hops * @property {Long|null} [total_fees_msat] Route total_fees_msat * @property {Long|null} [total_amt_msat] Route total_amt_msat + * @property {Long|null} [first_hop_amount_msat] Route first_hop_amount_msat + * @property {Uint8Array|null} [custom_channel_data] Route custom_channel_data */ /** @@ -39429,6 +39960,22 @@ export const lnrpc = $root.lnrpc = (() => { */ Route.prototype.total_amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Route first_hop_amount_msat. + * @member {Long} first_hop_amount_msat + * @memberof lnrpc.Route + * @instance + */ + Route.prototype.first_hop_amount_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Route custom_channel_data. + * @member {Uint8Array} custom_channel_data + * @memberof lnrpc.Route + * @instance + */ + Route.prototype.custom_channel_data = $util.newBuffer([]); + /** * Creates a new Route instance using the specified properties. * @function create @@ -39466,6 +40013,10 @@ export const lnrpc = $root.lnrpc = (() => { writer.uint32(/* id 5, wireType 0 =*/40).int64(message.total_fees_msat); if (message.total_amt_msat != null && Object.hasOwnProperty.call(message, "total_amt_msat")) writer.uint32(/* id 6, wireType 0 =*/48).int64(message.total_amt_msat); + if (message.first_hop_amount_msat != null && Object.hasOwnProperty.call(message, "first_hop_amount_msat")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.first_hop_amount_msat); + if (message.custom_channel_data != null && Object.hasOwnProperty.call(message, "custom_channel_data")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.custom_channel_data); return writer; }; @@ -39526,6 +40077,14 @@ export const lnrpc = $root.lnrpc = (() => { message.total_amt_msat = reader.int64(); break; } + case 7: { + message.first_hop_amount_msat = reader.int64(); + break; + } + case 8: { + message.custom_channel_data = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -39585,6 +40144,12 @@ export const lnrpc = $root.lnrpc = (() => { if (message.total_amt_msat != null && message.hasOwnProperty("total_amt_msat")) if (!$util.isInteger(message.total_amt_msat) && !(message.total_amt_msat && $util.isInteger(message.total_amt_msat.low) && $util.isInteger(message.total_amt_msat.high))) return "total_amt_msat: integer|Long expected"; + if (message.first_hop_amount_msat != null && message.hasOwnProperty("first_hop_amount_msat")) + if (!$util.isInteger(message.first_hop_amount_msat) && !(message.first_hop_amount_msat && $util.isInteger(message.first_hop_amount_msat.low) && $util.isInteger(message.first_hop_amount_msat.high))) + return "first_hop_amount_msat: integer|Long expected"; + if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data")) + if (!(message.custom_channel_data && typeof message.custom_channel_data.length === "number" || $util.isString(message.custom_channel_data))) + return "custom_channel_data: buffer expected"; return null; }; @@ -39648,6 +40213,20 @@ export const lnrpc = $root.lnrpc = (() => { message.total_amt_msat = object.total_amt_msat; else if (typeof object.total_amt_msat === "object") message.total_amt_msat = new $util.LongBits(object.total_amt_msat.low >>> 0, object.total_amt_msat.high >>> 0).toNumber(); + if (object.first_hop_amount_msat != null) + if ($util.Long) + (message.first_hop_amount_msat = $util.Long.fromValue(object.first_hop_amount_msat)).unsigned = false; + else if (typeof object.first_hop_amount_msat === "string") + message.first_hop_amount_msat = parseInt(object.first_hop_amount_msat, 10); + else if (typeof object.first_hop_amount_msat === "number") + message.first_hop_amount_msat = object.first_hop_amount_msat; + else if (typeof object.first_hop_amount_msat === "object") + message.first_hop_amount_msat = new $util.LongBits(object.first_hop_amount_msat.low >>> 0, object.first_hop_amount_msat.high >>> 0).toNumber(); + if (object.custom_channel_data != null) + if (typeof object.custom_channel_data === "string") + $util.base64.decode(object.custom_channel_data, message.custom_channel_data = $util.newBuffer($util.base64.length(object.custom_channel_data)), 0); + else if (object.custom_channel_data.length >= 0) + message.custom_channel_data = object.custom_channel_data; return message; }; @@ -39688,6 +40267,18 @@ export const lnrpc = $root.lnrpc = (() => { object.total_amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.total_amt_msat = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.first_hop_amount_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.first_hop_amount_msat = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.custom_channel_data = ""; + else { + object.custom_channel_data = []; + if (options.bytes !== Array) + object.custom_channel_data = $util.newBuffer(object.custom_channel_data); + } } if (message.total_time_lock != null && message.hasOwnProperty("total_time_lock")) object.total_time_lock = message.total_time_lock; @@ -39716,6 +40307,13 @@ export const lnrpc = $root.lnrpc = (() => { object.total_amt_msat = options.longs === String ? String(message.total_amt_msat) : message.total_amt_msat; else object.total_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.total_amt_msat) : options.longs === Number ? new $util.LongBits(message.total_amt_msat.low >>> 0, message.total_amt_msat.high >>> 0).toNumber() : message.total_amt_msat; + if (message.first_hop_amount_msat != null && message.hasOwnProperty("first_hop_amount_msat")) + if (typeof message.first_hop_amount_msat === "number") + object.first_hop_amount_msat = options.longs === String ? String(message.first_hop_amount_msat) : message.first_hop_amount_msat; + else + object.first_hop_amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.first_hop_amount_msat) : options.longs === Number ? new $util.LongBits(message.first_hop_amount_msat.low >>> 0, message.first_hop_amount_msat.high >>> 0).toNumber() : message.first_hop_amount_msat; + if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data")) + object.custom_channel_data = options.bytes === String ? $util.base64.encode(message.custom_channel_data, 0, message.custom_channel_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_channel_data) : message.custom_channel_data; return object; }; @@ -49804,6 +50402,7 @@ export const lnrpc = $root.lnrpc = (() => { * @property {Object.|null} [custom_records] InvoiceHTLC custom_records * @property {Long|null} [mpp_total_amt_msat] InvoiceHTLC mpp_total_amt_msat * @property {lnrpc.IAMP|null} [amp] InvoiceHTLC amp + * @property {Uint8Array|null} [custom_channel_data] InvoiceHTLC custom_channel_data */ /** @@ -49910,6 +50509,14 @@ export const lnrpc = $root.lnrpc = (() => { */ InvoiceHTLC.prototype.amp = null; + /** + * InvoiceHTLC custom_channel_data. + * @member {Uint8Array} custom_channel_data + * @memberof lnrpc.InvoiceHTLC + * @instance + */ + InvoiceHTLC.prototype.custom_channel_data = $util.newBuffer([]); + /** * Creates a new InvoiceHTLC instance using the specified properties. * @function create @@ -49957,6 +50564,8 @@ export const lnrpc = $root.lnrpc = (() => { writer.uint32(/* id 10, wireType 0 =*/80).uint64(message.mpp_total_amt_msat); if (message.amp != null && Object.hasOwnProperty.call(message, "amp")) $root.lnrpc.AMP.encode(message.amp, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.custom_channel_data != null && Object.hasOwnProperty.call(message, "custom_channel_data")) + writer.uint32(/* id 12, wireType 2 =*/98).bytes(message.custom_channel_data); return writer; }; @@ -50054,6 +50663,10 @@ export const lnrpc = $root.lnrpc = (() => { message.amp = $root.lnrpc.AMP.decode(reader, reader.uint32()); break; } + case 12: { + message.custom_channel_data = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -50138,6 +50751,9 @@ export const lnrpc = $root.lnrpc = (() => { if (error) return "amp." + error; } + if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data")) + if (!(message.custom_channel_data && typeof message.custom_channel_data.length === "number" || $util.isString(message.custom_channel_data))) + return "custom_channel_data: buffer expected"; return null; }; @@ -50246,6 +50862,11 @@ export const lnrpc = $root.lnrpc = (() => { throw TypeError(".lnrpc.InvoiceHTLC.amp: object expected"); message.amp = $root.lnrpc.AMP.fromObject(object.amp); } + if (object.custom_channel_data != null) + if (typeof object.custom_channel_data === "string") + $util.base64.decode(object.custom_channel_data, message.custom_channel_data = $util.newBuffer($util.base64.length(object.custom_channel_data)), 0); + else if (object.custom_channel_data.length >= 0) + message.custom_channel_data = object.custom_channel_data; return message; }; @@ -50299,6 +50920,13 @@ export const lnrpc = $root.lnrpc = (() => { } else object.mpp_total_amt_msat = options.longs === String ? "0" : 0; object.amp = null; + if (options.bytes === String) + object.custom_channel_data = ""; + else { + object.custom_channel_data = []; + if (options.bytes !== Array) + object.custom_channel_data = $util.newBuffer(object.custom_channel_data); + } } if (message.chan_id != null && message.hasOwnProperty("chan_id")) if (typeof message.chan_id === "number") @@ -50344,6 +50972,8 @@ export const lnrpc = $root.lnrpc = (() => { object.mpp_total_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.mpp_total_amt_msat) : options.longs === Number ? new $util.LongBits(message.mpp_total_amt_msat.low >>> 0, message.mpp_total_amt_msat.high >>> 0).toNumber(true) : message.mpp_total_amt_msat; if (message.amp != null && message.hasOwnProperty("amp")) object.amp = $root.lnrpc.AMP.toObject(message.amp, options); + if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data")) + object.custom_channel_data = options.bytes === String ? $util.base64.encode(message.custom_channel_data, 0, message.custom_channel_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_channel_data) : message.custom_channel_data; return object; }; @@ -52224,6 +52854,7 @@ export const lnrpc = $root.lnrpc = (() => { * @property {Array.|null} [htlcs] Payment htlcs * @property {Long|null} [payment_index] Payment payment_index * @property {lnrpc.PaymentFailureReason|null} [failure_reason] Payment failure_reason + * @property {Object.|null} [first_hop_custom_records] Payment first_hop_custom_records */ /** @@ -52236,6 +52867,7 @@ export const lnrpc = $root.lnrpc = (() => { */ function Payment(properties) { this.htlcs = []; + this.first_hop_custom_records = {}; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52362,6 +52994,14 @@ export const lnrpc = $root.lnrpc = (() => { */ Payment.prototype.failure_reason = 0; + /** + * Payment first_hop_custom_records. + * @member {Object.} first_hop_custom_records + * @memberof lnrpc.Payment + * @instance + */ + Payment.prototype.first_hop_custom_records = $util.emptyObject; + /** * Creates a new Payment instance using the specified properties. * @function create @@ -52417,6 +53057,9 @@ export const lnrpc = $root.lnrpc = (() => { writer.uint32(/* id 15, wireType 0 =*/120).uint64(message.payment_index); if (message.failure_reason != null && Object.hasOwnProperty.call(message, "failure_reason")) writer.uint32(/* id 16, wireType 0 =*/128).int32(message.failure_reason); + if (message.first_hop_custom_records != null && Object.hasOwnProperty.call(message, "first_hop_custom_records")) + for (let keys = Object.keys(message.first_hop_custom_records), i = 0; i < keys.length; ++i) + writer.uint32(/* id 17, wireType 2 =*/138).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.first_hop_custom_records[keys[i]]).ldelim(); return writer; }; @@ -52447,7 +53090,7 @@ export const lnrpc = $root.lnrpc = (() => { Payment.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.Payment(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.Payment(), key, value; while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { @@ -52513,6 +53156,29 @@ export const lnrpc = $root.lnrpc = (() => { message.failure_reason = reader.int32(); break; } + case 17: { + if (message.first_hop_custom_records === $util.emptyObject) + message.first_hop_custom_records = {}; + let end2 = reader.uint32() + reader.pos; + key = 0; + value = []; + while (reader.pos < end2) { + let tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint64(); + break; + case 2: + value = reader.bytes(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.first_hop_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -52617,6 +53283,17 @@ export const lnrpc = $root.lnrpc = (() => { case 6: break; } + if (message.first_hop_custom_records != null && message.hasOwnProperty("first_hop_custom_records")) { + if (!$util.isObject(message.first_hop_custom_records)) + return "first_hop_custom_records: object expected"; + let key = Object.keys(message.first_hop_custom_records); + for (let i = 0; i < key.length; ++i) { + if (!$util.key64Re.test(key[i])) + return "first_hop_custom_records: integer|Long key{k:uint64} expected"; + if (!(message.first_hop_custom_records[key[i]] && typeof message.first_hop_custom_records[key[i]].length === "number" || $util.isString(message.first_hop_custom_records[key[i]]))) + return "first_hop_custom_records: buffer{k:uint64} expected"; + } + } return null; }; @@ -52793,6 +53470,16 @@ export const lnrpc = $root.lnrpc = (() => { message.failure_reason = 6; break; } + if (object.first_hop_custom_records) { + if (typeof object.first_hop_custom_records !== "object") + throw TypeError(".lnrpc.Payment.first_hop_custom_records: object expected"); + message.first_hop_custom_records = {}; + for (let keys = Object.keys(object.first_hop_custom_records), i = 0; i < keys.length; ++i) + if (typeof object.first_hop_custom_records[keys[i]] === "string") + $util.base64.decode(object.first_hop_custom_records[keys[i]], message.first_hop_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.first_hop_custom_records[keys[i]])), 0); + else if (object.first_hop_custom_records[keys[i]].length >= 0) + message.first_hop_custom_records[keys[i]] = object.first_hop_custom_records[keys[i]]; + } return message; }; @@ -52811,6 +53498,8 @@ export const lnrpc = $root.lnrpc = (() => { let object = {}; if (options.arrays || options.defaults) object.htlcs = []; + if (options.objects || options.defaults) + object.first_hop_custom_records = {}; if (options.defaults) { object.payment_hash = ""; if ($util.Long) { @@ -52923,6 +53612,12 @@ export const lnrpc = $root.lnrpc = (() => { object.payment_index = options.longs === String ? $util.Long.prototype.toString.call(message.payment_index) : options.longs === Number ? new $util.LongBits(message.payment_index.low >>> 0, message.payment_index.high >>> 0).toNumber(true) : message.payment_index; if (message.failure_reason != null && message.hasOwnProperty("failure_reason")) object.failure_reason = options.enums === String ? $root.lnrpc.PaymentFailureReason[message.failure_reason] === undefined ? message.failure_reason : $root.lnrpc.PaymentFailureReason[message.failure_reason] : message.failure_reason; + let keys2; + if (message.first_hop_custom_records && (keys2 = Object.keys(message.first_hop_custom_records)).length) { + object.first_hop_custom_records = {}; + for (let j = 0; j < keys2.length; ++j) + object.first_hop_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.first_hop_custom_records[keys2[j]], 0, message.first_hop_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.first_hop_custom_records[keys2[j]]) : message.first_hop_custom_records[keys2[j]]; + } return object; }; @@ -77295,6 +77990,39 @@ export const invoicesrpc = $root.invoicesrpc = (() => { * @variation 2 */ + /** + * Callback as used by {@link invoicesrpc.Invoices#htlcModifier}. + * @memberof invoicesrpc.Invoices + * @typedef HtlcModifierCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {invoicesrpc.HtlcModifyRequest} [response] HtlcModifyRequest + */ + + /** + * Calls HtlcModifier. + * @function htlcModifier + * @memberof invoicesrpc.Invoices + * @instance + * @param {invoicesrpc.IHtlcModifyResponse} request HtlcModifyResponse message or plain object + * @param {invoicesrpc.Invoices.HtlcModifierCallback} callback Node-style callback called with the error, if any, and HtlcModifyRequest + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Invoices.prototype.htlcModifier = function htlcModifier(request, callback) { + return this.rpcCall(htlcModifier, $root.invoicesrpc.HtlcModifyResponse, $root.invoicesrpc.HtlcModifyRequest, request, callback); + }, "name", { value: "HtlcModifier" }); + + /** + * Calls HtlcModifier. + * @function htlcModifier + * @memberof invoicesrpc.Invoices + * @instance + * @param {invoicesrpc.IHtlcModifyResponse} request HtlcModifyResponse message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return Invoices; })(); @@ -79416,398 +80144,117 @@ export const invoicesrpc = $root.invoicesrpc = (() => { return LookupInvoiceMsg; })(); - return invoicesrpc; -})(); - -export const neutrinorpc = $root.neutrinorpc = (() => { - - /** - * Namespace neutrinorpc. - * @exports neutrinorpc - * @namespace - */ - const neutrinorpc = {}; - - neutrinorpc.NeutrinoKit = (function() { - - /** - * Constructs a new NeutrinoKit service. - * @memberof neutrinorpc - * @classdesc Represents a NeutrinoKit - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function NeutrinoKit(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (NeutrinoKit.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = NeutrinoKit; - - /** - * Creates new NeutrinoKit service using the specified rpc implementation. - * @function create - * @memberof neutrinorpc.NeutrinoKit - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {NeutrinoKit} RPC service. Useful where requests and/or responses are streamed. - */ - NeutrinoKit.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link neutrinorpc.NeutrinoKit#status}. - * @memberof neutrinorpc.NeutrinoKit - * @typedef StatusCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutrinorpc.StatusResponse} [response] StatusResponse - */ - - /** - * Calls Status. - * @function status - * @memberof neutrinorpc.NeutrinoKit - * @instance - * @param {neutrinorpc.IStatusRequest} request StatusRequest message or plain object - * @param {neutrinorpc.NeutrinoKit.StatusCallback} callback Node-style callback called with the error, if any, and StatusResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NeutrinoKit.prototype.status = function status(request, callback) { - return this.rpcCall(status, $root.neutrinorpc.StatusRequest, $root.neutrinorpc.StatusResponse, request, callback); - }, "name", { value: "Status" }); - - /** - * Calls Status. - * @function status - * @memberof neutrinorpc.NeutrinoKit - * @instance - * @param {neutrinorpc.IStatusRequest} request StatusRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutrinorpc.NeutrinoKit#addPeer}. - * @memberof neutrinorpc.NeutrinoKit - * @typedef AddPeerCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutrinorpc.AddPeerResponse} [response] AddPeerResponse - */ - - /** - * Calls AddPeer. - * @function addPeer - * @memberof neutrinorpc.NeutrinoKit - * @instance - * @param {neutrinorpc.IAddPeerRequest} request AddPeerRequest message or plain object - * @param {neutrinorpc.NeutrinoKit.AddPeerCallback} callback Node-style callback called with the error, if any, and AddPeerResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NeutrinoKit.prototype.addPeer = function addPeer(request, callback) { - return this.rpcCall(addPeer, $root.neutrinorpc.AddPeerRequest, $root.neutrinorpc.AddPeerResponse, request, callback); - }, "name", { value: "AddPeer" }); - - /** - * Calls AddPeer. - * @function addPeer - * @memberof neutrinorpc.NeutrinoKit - * @instance - * @param {neutrinorpc.IAddPeerRequest} request AddPeerRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutrinorpc.NeutrinoKit#disconnectPeer}. - * @memberof neutrinorpc.NeutrinoKit - * @typedef DisconnectPeerCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutrinorpc.DisconnectPeerResponse} [response] DisconnectPeerResponse - */ - - /** - * Calls DisconnectPeer. - * @function disconnectPeer - * @memberof neutrinorpc.NeutrinoKit - * @instance - * @param {neutrinorpc.IDisconnectPeerRequest} request DisconnectPeerRequest message or plain object - * @param {neutrinorpc.NeutrinoKit.DisconnectPeerCallback} callback Node-style callback called with the error, if any, and DisconnectPeerResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NeutrinoKit.prototype.disconnectPeer = function disconnectPeer(request, callback) { - return this.rpcCall(disconnectPeer, $root.neutrinorpc.DisconnectPeerRequest, $root.neutrinorpc.DisconnectPeerResponse, request, callback); - }, "name", { value: "DisconnectPeer" }); - - /** - * Calls DisconnectPeer. - * @function disconnectPeer - * @memberof neutrinorpc.NeutrinoKit - * @instance - * @param {neutrinorpc.IDisconnectPeerRequest} request DisconnectPeerRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutrinorpc.NeutrinoKit#isBanned}. - * @memberof neutrinorpc.NeutrinoKit - * @typedef IsBannedCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutrinorpc.IsBannedResponse} [response] IsBannedResponse - */ - - /** - * Calls IsBanned. - * @function isBanned - * @memberof neutrinorpc.NeutrinoKit - * @instance - * @param {neutrinorpc.IIsBannedRequest} request IsBannedRequest message or plain object - * @param {neutrinorpc.NeutrinoKit.IsBannedCallback} callback Node-style callback called with the error, if any, and IsBannedResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NeutrinoKit.prototype.isBanned = function isBanned(request, callback) { - return this.rpcCall(isBanned, $root.neutrinorpc.IsBannedRequest, $root.neutrinorpc.IsBannedResponse, request, callback); - }, "name", { value: "IsBanned" }); - - /** - * Calls IsBanned. - * @function isBanned - * @memberof neutrinorpc.NeutrinoKit - * @instance - * @param {neutrinorpc.IIsBannedRequest} request IsBannedRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutrinorpc.NeutrinoKit#getBlockHeader}. - * @memberof neutrinorpc.NeutrinoKit - * @typedef GetBlockHeaderCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutrinorpc.GetBlockHeaderResponse} [response] GetBlockHeaderResponse - */ - - /** - * Calls GetBlockHeader. - * @function getBlockHeader - * @memberof neutrinorpc.NeutrinoKit - * @instance - * @param {neutrinorpc.IGetBlockHeaderRequest} request GetBlockHeaderRequest message or plain object - * @param {neutrinorpc.NeutrinoKit.GetBlockHeaderCallback} callback Node-style callback called with the error, if any, and GetBlockHeaderResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NeutrinoKit.prototype.getBlockHeader = function getBlockHeader(request, callback) { - return this.rpcCall(getBlockHeader, $root.neutrinorpc.GetBlockHeaderRequest, $root.neutrinorpc.GetBlockHeaderResponse, request, callback); - }, "name", { value: "GetBlockHeader" }); - - /** - * Calls GetBlockHeader. - * @function getBlockHeader - * @memberof neutrinorpc.NeutrinoKit - * @instance - * @param {neutrinorpc.IGetBlockHeaderRequest} request GetBlockHeaderRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutrinorpc.NeutrinoKit#getBlock}. - * @memberof neutrinorpc.NeutrinoKit - * @typedef GetBlockCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutrinorpc.GetBlockResponse} [response] GetBlockResponse - */ - - /** - * Calls GetBlock. - * @function getBlock - * @memberof neutrinorpc.NeutrinoKit - * @instance - * @param {neutrinorpc.IGetBlockRequest} request GetBlockRequest message or plain object - * @param {neutrinorpc.NeutrinoKit.GetBlockCallback} callback Node-style callback called with the error, if any, and GetBlockResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NeutrinoKit.prototype.getBlock = function getBlock(request, callback) { - return this.rpcCall(getBlock, $root.neutrinorpc.GetBlockRequest, $root.neutrinorpc.GetBlockResponse, request, callback); - }, "name", { value: "GetBlock" }); - - /** - * Calls GetBlock. - * @function getBlock - * @memberof neutrinorpc.NeutrinoKit - * @instance - * @param {neutrinorpc.IGetBlockRequest} request GetBlockRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link neutrinorpc.NeutrinoKit#getCFilter}. - * @memberof neutrinorpc.NeutrinoKit - * @typedef GetCFilterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutrinorpc.GetCFilterResponse} [response] GetCFilterResponse - */ - - /** - * Calls GetCFilter. - * @function getCFilter - * @memberof neutrinorpc.NeutrinoKit - * @instance - * @param {neutrinorpc.IGetCFilterRequest} request GetCFilterRequest message or plain object - * @param {neutrinorpc.NeutrinoKit.GetCFilterCallback} callback Node-style callback called with the error, if any, and GetCFilterResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NeutrinoKit.prototype.getCFilter = function getCFilter(request, callback) { - return this.rpcCall(getCFilter, $root.neutrinorpc.GetCFilterRequest, $root.neutrinorpc.GetCFilterResponse, request, callback); - }, "name", { value: "GetCFilter" }); + invoicesrpc.CircuitKey = (function() { /** - * Calls GetCFilter. - * @function getCFilter - * @memberof neutrinorpc.NeutrinoKit - * @instance - * @param {neutrinorpc.IGetCFilterRequest} request GetCFilterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a CircuitKey. + * @memberof invoicesrpc + * @interface ICircuitKey + * @property {Long|null} [chan_id] CircuitKey chan_id + * @property {Long|null} [htlc_id] CircuitKey htlc_id */ /** - * Callback as used by {@link neutrinorpc.NeutrinoKit#getBlockHash}. - * @memberof neutrinorpc.NeutrinoKit - * @typedef GetBlockHashCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {neutrinorpc.GetBlockHashResponse} [response] GetBlockHashResponse + * Constructs a new CircuitKey. + * @memberof invoicesrpc + * @classdesc Represents a CircuitKey. + * @implements ICircuitKey + * @constructor + * @param {invoicesrpc.ICircuitKey=} [properties] Properties to set */ + function CircuitKey(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls GetBlockHash. - * @function getBlockHash - * @memberof neutrinorpc.NeutrinoKit + * CircuitKey chan_id. + * @member {Long} chan_id + * @memberof invoicesrpc.CircuitKey * @instance - * @param {neutrinorpc.IGetBlockHashRequest} request GetBlockHashRequest message or plain object - * @param {neutrinorpc.NeutrinoKit.GetBlockHashCallback} callback Node-style callback called with the error, if any, and GetBlockHashResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(NeutrinoKit.prototype.getBlockHash = function getBlockHash(request, callback) { - return this.rpcCall(getBlockHash, $root.neutrinorpc.GetBlockHashRequest, $root.neutrinorpc.GetBlockHashResponse, request, callback); - }, "name", { value: "GetBlockHash" }); + CircuitKey.prototype.chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Calls GetBlockHash. - * @function getBlockHash - * @memberof neutrinorpc.NeutrinoKit + * CircuitKey htlc_id. + * @member {Long} htlc_id + * @memberof invoicesrpc.CircuitKey * @instance - * @param {neutrinorpc.IGetBlockHashRequest} request GetBlockHashRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return NeutrinoKit; - })(); - - neutrinorpc.StatusRequest = (function() { - - /** - * Properties of a StatusRequest. - * @memberof neutrinorpc - * @interface IStatusRequest - */ - - /** - * Constructs a new StatusRequest. - * @memberof neutrinorpc - * @classdesc Represents a StatusRequest. - * @implements IStatusRequest - * @constructor - * @param {neutrinorpc.IStatusRequest=} [properties] Properties to set */ - function StatusRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + CircuitKey.prototype.htlc_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Creates a new StatusRequest instance using the specified properties. + * Creates a new CircuitKey instance using the specified properties. * @function create - * @memberof neutrinorpc.StatusRequest + * @memberof invoicesrpc.CircuitKey * @static - * @param {neutrinorpc.IStatusRequest=} [properties] Properties to set - * @returns {neutrinorpc.StatusRequest} StatusRequest instance + * @param {invoicesrpc.ICircuitKey=} [properties] Properties to set + * @returns {invoicesrpc.CircuitKey} CircuitKey instance */ - StatusRequest.create = function create(properties) { - return new StatusRequest(properties); + CircuitKey.create = function create(properties) { + return new CircuitKey(properties); }; /** - * Encodes the specified StatusRequest message. Does not implicitly {@link neutrinorpc.StatusRequest.verify|verify} messages. + * Encodes the specified CircuitKey message. Does not implicitly {@link invoicesrpc.CircuitKey.verify|verify} messages. * @function encode - * @memberof neutrinorpc.StatusRequest + * @memberof invoicesrpc.CircuitKey * @static - * @param {neutrinorpc.IStatusRequest} message StatusRequest message or plain object to encode + * @param {invoicesrpc.ICircuitKey} message CircuitKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StatusRequest.encode = function encode(message, writer) { + CircuitKey.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.chan_id != null && Object.hasOwnProperty.call(message, "chan_id")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.chan_id); + if (message.htlc_id != null && Object.hasOwnProperty.call(message, "htlc_id")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.htlc_id); return writer; }; /** - * Encodes the specified StatusRequest message, length delimited. Does not implicitly {@link neutrinorpc.StatusRequest.verify|verify} messages. + * Encodes the specified CircuitKey message, length delimited. Does not implicitly {@link invoicesrpc.CircuitKey.verify|verify} messages. * @function encodeDelimited - * @memberof neutrinorpc.StatusRequest + * @memberof invoicesrpc.CircuitKey * @static - * @param {neutrinorpc.IStatusRequest} message StatusRequest message or plain object to encode + * @param {invoicesrpc.ICircuitKey} message CircuitKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StatusRequest.encodeDelimited = function encodeDelimited(message, writer) { + CircuitKey.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a StatusRequest message from the specified reader or buffer. + * Decodes a CircuitKey message from the specified reader or buffer. * @function decode - * @memberof neutrinorpc.StatusRequest + * @memberof invoicesrpc.CircuitKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {neutrinorpc.StatusRequest} StatusRequest + * @returns {invoicesrpc.CircuitKey} CircuitKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StatusRequest.decode = function decode(reader, length) { + CircuitKey.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.StatusRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.invoicesrpc.CircuitKey(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.chan_id = reader.uint64(); + break; + } + case 2: { + message.htlc_id = reader.uint64(); + break; + } default: reader.skipType(tag & 7); break; @@ -79817,114 +80264,165 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Decodes a StatusRequest message from the specified reader or buffer, length delimited. + * Decodes a CircuitKey message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof neutrinorpc.StatusRequest + * @memberof invoicesrpc.CircuitKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutrinorpc.StatusRequest} StatusRequest + * @returns {invoicesrpc.CircuitKey} CircuitKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StatusRequest.decodeDelimited = function decodeDelimited(reader) { + CircuitKey.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a StatusRequest message. + * Verifies a CircuitKey message. * @function verify - * @memberof neutrinorpc.StatusRequest + * @memberof invoicesrpc.CircuitKey * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - StatusRequest.verify = function verify(message) { + CircuitKey.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.chan_id != null && message.hasOwnProperty("chan_id")) + if (!$util.isInteger(message.chan_id) && !(message.chan_id && $util.isInteger(message.chan_id.low) && $util.isInteger(message.chan_id.high))) + return "chan_id: integer|Long expected"; + if (message.htlc_id != null && message.hasOwnProperty("htlc_id")) + if (!$util.isInteger(message.htlc_id) && !(message.htlc_id && $util.isInteger(message.htlc_id.low) && $util.isInteger(message.htlc_id.high))) + return "htlc_id: integer|Long expected"; return null; }; /** - * Creates a StatusRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CircuitKey message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof neutrinorpc.StatusRequest + * @memberof invoicesrpc.CircuitKey * @static * @param {Object.} object Plain object - * @returns {neutrinorpc.StatusRequest} StatusRequest + * @returns {invoicesrpc.CircuitKey} CircuitKey */ - StatusRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutrinorpc.StatusRequest) + CircuitKey.fromObject = function fromObject(object) { + if (object instanceof $root.invoicesrpc.CircuitKey) return object; - return new $root.neutrinorpc.StatusRequest(); + let message = new $root.invoicesrpc.CircuitKey(); + if (object.chan_id != null) + if ($util.Long) + (message.chan_id = $util.Long.fromValue(object.chan_id)).unsigned = true; + else if (typeof object.chan_id === "string") + message.chan_id = parseInt(object.chan_id, 10); + else if (typeof object.chan_id === "number") + message.chan_id = object.chan_id; + else if (typeof object.chan_id === "object") + message.chan_id = new $util.LongBits(object.chan_id.low >>> 0, object.chan_id.high >>> 0).toNumber(true); + if (object.htlc_id != null) + if ($util.Long) + (message.htlc_id = $util.Long.fromValue(object.htlc_id)).unsigned = true; + else if (typeof object.htlc_id === "string") + message.htlc_id = parseInt(object.htlc_id, 10); + else if (typeof object.htlc_id === "number") + message.htlc_id = object.htlc_id; + else if (typeof object.htlc_id === "object") + message.htlc_id = new $util.LongBits(object.htlc_id.low >>> 0, object.htlc_id.high >>> 0).toNumber(true); + return message; }; /** - * Creates a plain object from a StatusRequest message. Also converts values to other types if specified. + * Creates a plain object from a CircuitKey message. Also converts values to other types if specified. * @function toObject - * @memberof neutrinorpc.StatusRequest + * @memberof invoicesrpc.CircuitKey * @static - * @param {neutrinorpc.StatusRequest} message StatusRequest + * @param {invoicesrpc.CircuitKey} message CircuitKey * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StatusRequest.toObject = function toObject() { - return {}; + CircuitKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.chan_id = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.htlc_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.htlc_id = options.longs === String ? "0" : 0; + } + if (message.chan_id != null && message.hasOwnProperty("chan_id")) + if (typeof message.chan_id === "number") + object.chan_id = options.longs === String ? String(message.chan_id) : message.chan_id; + else + object.chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.chan_id) : options.longs === Number ? new $util.LongBits(message.chan_id.low >>> 0, message.chan_id.high >>> 0).toNumber(true) : message.chan_id; + if (message.htlc_id != null && message.hasOwnProperty("htlc_id")) + if (typeof message.htlc_id === "number") + object.htlc_id = options.longs === String ? String(message.htlc_id) : message.htlc_id; + else + object.htlc_id = options.longs === String ? $util.Long.prototype.toString.call(message.htlc_id) : options.longs === Number ? new $util.LongBits(message.htlc_id.low >>> 0, message.htlc_id.high >>> 0).toNumber(true) : message.htlc_id; + return object; }; /** - * Converts this StatusRequest to JSON. + * Converts this CircuitKey to JSON. * @function toJSON - * @memberof neutrinorpc.StatusRequest + * @memberof invoicesrpc.CircuitKey * @instance * @returns {Object.} JSON object */ - StatusRequest.prototype.toJSON = function toJSON() { + CircuitKey.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for StatusRequest + * Gets the default type url for CircuitKey * @function getTypeUrl - * @memberof neutrinorpc.StatusRequest + * @memberof invoicesrpc.CircuitKey * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - StatusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CircuitKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/neutrinorpc.StatusRequest"; + return typeUrlPrefix + "/invoicesrpc.CircuitKey"; }; - return StatusRequest; + return CircuitKey; })(); - neutrinorpc.StatusResponse = (function() { + invoicesrpc.HtlcModifyRequest = (function() { /** - * Properties of a StatusResponse. - * @memberof neutrinorpc - * @interface IStatusResponse - * @property {boolean|null} [active] StatusResponse active - * @property {boolean|null} [synced] StatusResponse synced - * @property {number|null} [block_height] StatusResponse block_height - * @property {string|null} [block_hash] StatusResponse block_hash - * @property {Array.|null} [peers] StatusResponse peers + * Properties of a HtlcModifyRequest. + * @memberof invoicesrpc + * @interface IHtlcModifyRequest + * @property {lnrpc.IInvoice|null} [invoice] HtlcModifyRequest invoice + * @property {invoicesrpc.ICircuitKey|null} [exit_htlc_circuit_key] HtlcModifyRequest exit_htlc_circuit_key + * @property {Long|null} [exit_htlc_amt] HtlcModifyRequest exit_htlc_amt + * @property {number|null} [exit_htlc_expiry] HtlcModifyRequest exit_htlc_expiry + * @property {number|null} [current_height] HtlcModifyRequest current_height + * @property {Object.|null} [exit_htlc_wire_custom_records] HtlcModifyRequest exit_htlc_wire_custom_records */ /** - * Constructs a new StatusResponse. - * @memberof neutrinorpc - * @classdesc Represents a StatusResponse. - * @implements IStatusResponse + * Constructs a new HtlcModifyRequest. + * @memberof invoicesrpc + * @classdesc Represents a HtlcModifyRequest. + * @implements IHtlcModifyRequest * @constructor - * @param {neutrinorpc.IStatusResponse=} [properties] Properties to set + * @param {invoicesrpc.IHtlcModifyRequest=} [properties] Properties to set */ - function StatusResponse(properties) { - this.peers = []; + function HtlcModifyRequest(properties) { + this.exit_htlc_wire_custom_records = {}; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -79932,134 +80430,165 @@ export const neutrinorpc = $root.neutrinorpc = (() => { } /** - * StatusResponse active. - * @member {boolean} active - * @memberof neutrinorpc.StatusResponse + * HtlcModifyRequest invoice. + * @member {lnrpc.IInvoice|null|undefined} invoice + * @memberof invoicesrpc.HtlcModifyRequest * @instance */ - StatusResponse.prototype.active = false; + HtlcModifyRequest.prototype.invoice = null; /** - * StatusResponse synced. - * @member {boolean} synced - * @memberof neutrinorpc.StatusResponse + * HtlcModifyRequest exit_htlc_circuit_key. + * @member {invoicesrpc.ICircuitKey|null|undefined} exit_htlc_circuit_key + * @memberof invoicesrpc.HtlcModifyRequest * @instance */ - StatusResponse.prototype.synced = false; + HtlcModifyRequest.prototype.exit_htlc_circuit_key = null; /** - * StatusResponse block_height. - * @member {number} block_height - * @memberof neutrinorpc.StatusResponse + * HtlcModifyRequest exit_htlc_amt. + * @member {Long} exit_htlc_amt + * @memberof invoicesrpc.HtlcModifyRequest * @instance */ - StatusResponse.prototype.block_height = 0; + HtlcModifyRequest.prototype.exit_htlc_amt = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * StatusResponse block_hash. - * @member {string} block_hash - * @memberof neutrinorpc.StatusResponse + * HtlcModifyRequest exit_htlc_expiry. + * @member {number} exit_htlc_expiry + * @memberof invoicesrpc.HtlcModifyRequest * @instance */ - StatusResponse.prototype.block_hash = ""; + HtlcModifyRequest.prototype.exit_htlc_expiry = 0; /** - * StatusResponse peers. - * @member {Array.} peers - * @memberof neutrinorpc.StatusResponse + * HtlcModifyRequest current_height. + * @member {number} current_height + * @memberof invoicesrpc.HtlcModifyRequest * @instance */ - StatusResponse.prototype.peers = $util.emptyArray; + HtlcModifyRequest.prototype.current_height = 0; /** - * Creates a new StatusResponse instance using the specified properties. + * HtlcModifyRequest exit_htlc_wire_custom_records. + * @member {Object.} exit_htlc_wire_custom_records + * @memberof invoicesrpc.HtlcModifyRequest + * @instance + */ + HtlcModifyRequest.prototype.exit_htlc_wire_custom_records = $util.emptyObject; + + /** + * Creates a new HtlcModifyRequest instance using the specified properties. * @function create - * @memberof neutrinorpc.StatusResponse + * @memberof invoicesrpc.HtlcModifyRequest * @static - * @param {neutrinorpc.IStatusResponse=} [properties] Properties to set - * @returns {neutrinorpc.StatusResponse} StatusResponse instance + * @param {invoicesrpc.IHtlcModifyRequest=} [properties] Properties to set + * @returns {invoicesrpc.HtlcModifyRequest} HtlcModifyRequest instance */ - StatusResponse.create = function create(properties) { - return new StatusResponse(properties); + HtlcModifyRequest.create = function create(properties) { + return new HtlcModifyRequest(properties); }; /** - * Encodes the specified StatusResponse message. Does not implicitly {@link neutrinorpc.StatusResponse.verify|verify} messages. + * Encodes the specified HtlcModifyRequest message. Does not implicitly {@link invoicesrpc.HtlcModifyRequest.verify|verify} messages. * @function encode - * @memberof neutrinorpc.StatusResponse + * @memberof invoicesrpc.HtlcModifyRequest * @static - * @param {neutrinorpc.IStatusResponse} message StatusResponse message or plain object to encode + * @param {invoicesrpc.IHtlcModifyRequest} message HtlcModifyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StatusResponse.encode = function encode(message, writer) { + HtlcModifyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.active != null && Object.hasOwnProperty.call(message, "active")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.active); - if (message.synced != null && Object.hasOwnProperty.call(message, "synced")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.synced); - if (message.block_height != null && Object.hasOwnProperty.call(message, "block_height")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.block_height); - if (message.block_hash != null && Object.hasOwnProperty.call(message, "block_hash")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.block_hash); - if (message.peers != null && message.peers.length) - for (let i = 0; i < message.peers.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.peers[i]); + if (message.invoice != null && Object.hasOwnProperty.call(message, "invoice")) + $root.lnrpc.Invoice.encode(message.invoice, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.exit_htlc_circuit_key != null && Object.hasOwnProperty.call(message, "exit_htlc_circuit_key")) + $root.invoicesrpc.CircuitKey.encode(message.exit_htlc_circuit_key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.exit_htlc_amt != null && Object.hasOwnProperty.call(message, "exit_htlc_amt")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.exit_htlc_amt); + if (message.exit_htlc_expiry != null && Object.hasOwnProperty.call(message, "exit_htlc_expiry")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.exit_htlc_expiry); + if (message.current_height != null && Object.hasOwnProperty.call(message, "current_height")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.current_height); + if (message.exit_htlc_wire_custom_records != null && Object.hasOwnProperty.call(message, "exit_htlc_wire_custom_records")) + for (let keys = Object.keys(message.exit_htlc_wire_custom_records), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.exit_htlc_wire_custom_records[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified StatusResponse message, length delimited. Does not implicitly {@link neutrinorpc.StatusResponse.verify|verify} messages. + * Encodes the specified HtlcModifyRequest message, length delimited. Does not implicitly {@link invoicesrpc.HtlcModifyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof neutrinorpc.StatusResponse + * @memberof invoicesrpc.HtlcModifyRequest * @static - * @param {neutrinorpc.IStatusResponse} message StatusResponse message or plain object to encode + * @param {invoicesrpc.IHtlcModifyRequest} message HtlcModifyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StatusResponse.encodeDelimited = function encodeDelimited(message, writer) { + HtlcModifyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a StatusResponse message from the specified reader or buffer. + * Decodes a HtlcModifyRequest message from the specified reader or buffer. * @function decode - * @memberof neutrinorpc.StatusResponse + * @memberof invoicesrpc.HtlcModifyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {neutrinorpc.StatusResponse} StatusResponse + * @returns {invoicesrpc.HtlcModifyRequest} HtlcModifyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StatusResponse.decode = function decode(reader, length) { + HtlcModifyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.StatusResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.invoicesrpc.HtlcModifyRequest(), key, value; while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.active = reader.bool(); + message.invoice = $root.lnrpc.Invoice.decode(reader, reader.uint32()); break; } case 2: { - message.synced = reader.bool(); + message.exit_htlc_circuit_key = $root.invoicesrpc.CircuitKey.decode(reader, reader.uint32()); break; } case 3: { - message.block_height = reader.int32(); + message.exit_htlc_amt = reader.uint64(); break; } case 4: { - message.block_hash = reader.string(); + message.exit_htlc_expiry = reader.uint32(); break; } case 5: { - if (!(message.peers && message.peers.length)) - message.peers = []; - message.peers.push(reader.string()); + message.current_height = reader.uint32(); + break; + } + case 6: { + if (message.exit_htlc_wire_custom_records === $util.emptyObject) + message.exit_htlc_wire_custom_records = {}; + let end2 = reader.uint32() + reader.pos; + key = 0; + value = []; + while (reader.pos < end2) { + let tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint64(); + break; + case 2: + value = reader.bytes(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.exit_htlc_wire_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value; break; } default: @@ -80071,168 +80600,210 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Decodes a StatusResponse message from the specified reader or buffer, length delimited. + * Decodes a HtlcModifyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof neutrinorpc.StatusResponse + * @memberof invoicesrpc.HtlcModifyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutrinorpc.StatusResponse} StatusResponse + * @returns {invoicesrpc.HtlcModifyRequest} HtlcModifyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StatusResponse.decodeDelimited = function decodeDelimited(reader) { + HtlcModifyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a StatusResponse message. + * Verifies a HtlcModifyRequest message. * @function verify - * @memberof neutrinorpc.StatusResponse + * @memberof invoicesrpc.HtlcModifyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - StatusResponse.verify = function verify(message) { + HtlcModifyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.active != null && message.hasOwnProperty("active")) - if (typeof message.active !== "boolean") - return "active: boolean expected"; - if (message.synced != null && message.hasOwnProperty("synced")) - if (typeof message.synced !== "boolean") - return "synced: boolean expected"; - if (message.block_height != null && message.hasOwnProperty("block_height")) - if (!$util.isInteger(message.block_height)) - return "block_height: integer expected"; - if (message.block_hash != null && message.hasOwnProperty("block_hash")) - if (!$util.isString(message.block_hash)) - return "block_hash: string expected"; - if (message.peers != null && message.hasOwnProperty("peers")) { - if (!Array.isArray(message.peers)) - return "peers: array expected"; - for (let i = 0; i < message.peers.length; ++i) - if (!$util.isString(message.peers[i])) - return "peers: string[] expected"; + if (message.invoice != null && message.hasOwnProperty("invoice")) { + let error = $root.lnrpc.Invoice.verify(message.invoice); + if (error) + return "invoice." + error; + } + if (message.exit_htlc_circuit_key != null && message.hasOwnProperty("exit_htlc_circuit_key")) { + let error = $root.invoicesrpc.CircuitKey.verify(message.exit_htlc_circuit_key); + if (error) + return "exit_htlc_circuit_key." + error; + } + if (message.exit_htlc_amt != null && message.hasOwnProperty("exit_htlc_amt")) + if (!$util.isInteger(message.exit_htlc_amt) && !(message.exit_htlc_amt && $util.isInteger(message.exit_htlc_amt.low) && $util.isInteger(message.exit_htlc_amt.high))) + return "exit_htlc_amt: integer|Long expected"; + if (message.exit_htlc_expiry != null && message.hasOwnProperty("exit_htlc_expiry")) + if (!$util.isInteger(message.exit_htlc_expiry)) + return "exit_htlc_expiry: integer expected"; + if (message.current_height != null && message.hasOwnProperty("current_height")) + if (!$util.isInteger(message.current_height)) + return "current_height: integer expected"; + if (message.exit_htlc_wire_custom_records != null && message.hasOwnProperty("exit_htlc_wire_custom_records")) { + if (!$util.isObject(message.exit_htlc_wire_custom_records)) + return "exit_htlc_wire_custom_records: object expected"; + let key = Object.keys(message.exit_htlc_wire_custom_records); + for (let i = 0; i < key.length; ++i) { + if (!$util.key64Re.test(key[i])) + return "exit_htlc_wire_custom_records: integer|Long key{k:uint64} expected"; + if (!(message.exit_htlc_wire_custom_records[key[i]] && typeof message.exit_htlc_wire_custom_records[key[i]].length === "number" || $util.isString(message.exit_htlc_wire_custom_records[key[i]]))) + return "exit_htlc_wire_custom_records: buffer{k:uint64} expected"; + } } return null; }; /** - * Creates a StatusResponse message from a plain object. Also converts values to their respective internal types. + * Creates a HtlcModifyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof neutrinorpc.StatusResponse + * @memberof invoicesrpc.HtlcModifyRequest * @static * @param {Object.} object Plain object - * @returns {neutrinorpc.StatusResponse} StatusResponse + * @returns {invoicesrpc.HtlcModifyRequest} HtlcModifyRequest */ - StatusResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutrinorpc.StatusResponse) + HtlcModifyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.invoicesrpc.HtlcModifyRequest) return object; - let message = new $root.neutrinorpc.StatusResponse(); - if (object.active != null) - message.active = Boolean(object.active); - if (object.synced != null) - message.synced = Boolean(object.synced); - if (object.block_height != null) - message.block_height = object.block_height | 0; - if (object.block_hash != null) - message.block_hash = String(object.block_hash); - if (object.peers) { - if (!Array.isArray(object.peers)) - throw TypeError(".neutrinorpc.StatusResponse.peers: array expected"); - message.peers = []; - for (let i = 0; i < object.peers.length; ++i) - message.peers[i] = String(object.peers[i]); - } - return message; - }; - - /** - * Creates a plain object from a StatusResponse message. Also converts values to other types if specified. + let message = new $root.invoicesrpc.HtlcModifyRequest(); + if (object.invoice != null) { + if (typeof object.invoice !== "object") + throw TypeError(".invoicesrpc.HtlcModifyRequest.invoice: object expected"); + message.invoice = $root.lnrpc.Invoice.fromObject(object.invoice); + } + if (object.exit_htlc_circuit_key != null) { + if (typeof object.exit_htlc_circuit_key !== "object") + throw TypeError(".invoicesrpc.HtlcModifyRequest.exit_htlc_circuit_key: object expected"); + message.exit_htlc_circuit_key = $root.invoicesrpc.CircuitKey.fromObject(object.exit_htlc_circuit_key); + } + if (object.exit_htlc_amt != null) + if ($util.Long) + (message.exit_htlc_amt = $util.Long.fromValue(object.exit_htlc_amt)).unsigned = true; + else if (typeof object.exit_htlc_amt === "string") + message.exit_htlc_amt = parseInt(object.exit_htlc_amt, 10); + else if (typeof object.exit_htlc_amt === "number") + message.exit_htlc_amt = object.exit_htlc_amt; + else if (typeof object.exit_htlc_amt === "object") + message.exit_htlc_amt = new $util.LongBits(object.exit_htlc_amt.low >>> 0, object.exit_htlc_amt.high >>> 0).toNumber(true); + if (object.exit_htlc_expiry != null) + message.exit_htlc_expiry = object.exit_htlc_expiry >>> 0; + if (object.current_height != null) + message.current_height = object.current_height >>> 0; + if (object.exit_htlc_wire_custom_records) { + if (typeof object.exit_htlc_wire_custom_records !== "object") + throw TypeError(".invoicesrpc.HtlcModifyRequest.exit_htlc_wire_custom_records: object expected"); + message.exit_htlc_wire_custom_records = {}; + for (let keys = Object.keys(object.exit_htlc_wire_custom_records), i = 0; i < keys.length; ++i) + if (typeof object.exit_htlc_wire_custom_records[keys[i]] === "string") + $util.base64.decode(object.exit_htlc_wire_custom_records[keys[i]], message.exit_htlc_wire_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.exit_htlc_wire_custom_records[keys[i]])), 0); + else if (object.exit_htlc_wire_custom_records[keys[i]].length >= 0) + message.exit_htlc_wire_custom_records[keys[i]] = object.exit_htlc_wire_custom_records[keys[i]]; + } + return message; + }; + + /** + * Creates a plain object from a HtlcModifyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof neutrinorpc.StatusResponse + * @memberof invoicesrpc.HtlcModifyRequest * @static - * @param {neutrinorpc.StatusResponse} message StatusResponse + * @param {invoicesrpc.HtlcModifyRequest} message HtlcModifyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StatusResponse.toObject = function toObject(message, options) { + HtlcModifyRequest.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.arrays || options.defaults) - object.peers = []; + if (options.objects || options.defaults) + object.exit_htlc_wire_custom_records = {}; if (options.defaults) { - object.active = false; - object.synced = false; - object.block_height = 0; - object.block_hash = ""; - } - if (message.active != null && message.hasOwnProperty("active")) - object.active = message.active; - if (message.synced != null && message.hasOwnProperty("synced")) - object.synced = message.synced; - if (message.block_height != null && message.hasOwnProperty("block_height")) - object.block_height = message.block_height; - if (message.block_hash != null && message.hasOwnProperty("block_hash")) - object.block_hash = message.block_hash; - if (message.peers && message.peers.length) { - object.peers = []; - for (let j = 0; j < message.peers.length; ++j) - object.peers[j] = message.peers[j]; + object.invoice = null; + object.exit_htlc_circuit_key = null; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.exit_htlc_amt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.exit_htlc_amt = options.longs === String ? "0" : 0; + object.exit_htlc_expiry = 0; + object.current_height = 0; + } + if (message.invoice != null && message.hasOwnProperty("invoice")) + object.invoice = $root.lnrpc.Invoice.toObject(message.invoice, options); + if (message.exit_htlc_circuit_key != null && message.hasOwnProperty("exit_htlc_circuit_key")) + object.exit_htlc_circuit_key = $root.invoicesrpc.CircuitKey.toObject(message.exit_htlc_circuit_key, options); + if (message.exit_htlc_amt != null && message.hasOwnProperty("exit_htlc_amt")) + if (typeof message.exit_htlc_amt === "number") + object.exit_htlc_amt = options.longs === String ? String(message.exit_htlc_amt) : message.exit_htlc_amt; + else + object.exit_htlc_amt = options.longs === String ? $util.Long.prototype.toString.call(message.exit_htlc_amt) : options.longs === Number ? new $util.LongBits(message.exit_htlc_amt.low >>> 0, message.exit_htlc_amt.high >>> 0).toNumber(true) : message.exit_htlc_amt; + if (message.exit_htlc_expiry != null && message.hasOwnProperty("exit_htlc_expiry")) + object.exit_htlc_expiry = message.exit_htlc_expiry; + if (message.current_height != null && message.hasOwnProperty("current_height")) + object.current_height = message.current_height; + let keys2; + if (message.exit_htlc_wire_custom_records && (keys2 = Object.keys(message.exit_htlc_wire_custom_records)).length) { + object.exit_htlc_wire_custom_records = {}; + for (let j = 0; j < keys2.length; ++j) + object.exit_htlc_wire_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.exit_htlc_wire_custom_records[keys2[j]], 0, message.exit_htlc_wire_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.exit_htlc_wire_custom_records[keys2[j]]) : message.exit_htlc_wire_custom_records[keys2[j]]; } return object; }; /** - * Converts this StatusResponse to JSON. + * Converts this HtlcModifyRequest to JSON. * @function toJSON - * @memberof neutrinorpc.StatusResponse + * @memberof invoicesrpc.HtlcModifyRequest * @instance * @returns {Object.} JSON object */ - StatusResponse.prototype.toJSON = function toJSON() { + HtlcModifyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for StatusResponse + * Gets the default type url for HtlcModifyRequest * @function getTypeUrl - * @memberof neutrinorpc.StatusResponse + * @memberof invoicesrpc.HtlcModifyRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - StatusResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + HtlcModifyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/neutrinorpc.StatusResponse"; + return typeUrlPrefix + "/invoicesrpc.HtlcModifyRequest"; }; - return StatusResponse; + return HtlcModifyRequest; })(); - neutrinorpc.AddPeerRequest = (function() { + invoicesrpc.HtlcModifyResponse = (function() { /** - * Properties of an AddPeerRequest. - * @memberof neutrinorpc - * @interface IAddPeerRequest - * @property {string|null} [peer_addrs] AddPeerRequest peer_addrs + * Properties of a HtlcModifyResponse. + * @memberof invoicesrpc + * @interface IHtlcModifyResponse + * @property {invoicesrpc.ICircuitKey|null} [circuit_key] HtlcModifyResponse circuit_key + * @property {Long|null} [amt_paid] HtlcModifyResponse amt_paid + * @property {boolean|null} [cancel_set] HtlcModifyResponse cancel_set */ /** - * Constructs a new AddPeerRequest. - * @memberof neutrinorpc - * @classdesc Represents an AddPeerRequest. - * @implements IAddPeerRequest + * Constructs a new HtlcModifyResponse. + * @memberof invoicesrpc + * @classdesc Represents a HtlcModifyResponse. + * @implements IHtlcModifyResponse * @constructor - * @param {neutrinorpc.IAddPeerRequest=} [properties] Properties to set + * @param {invoicesrpc.IHtlcModifyResponse=} [properties] Properties to set */ - function AddPeerRequest(properties) { + function HtlcModifyResponse(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -80240,75 +80811,117 @@ export const neutrinorpc = $root.neutrinorpc = (() => { } /** - * AddPeerRequest peer_addrs. - * @member {string} peer_addrs - * @memberof neutrinorpc.AddPeerRequest + * HtlcModifyResponse circuit_key. + * @member {invoicesrpc.ICircuitKey|null|undefined} circuit_key + * @memberof invoicesrpc.HtlcModifyResponse * @instance */ - AddPeerRequest.prototype.peer_addrs = ""; + HtlcModifyResponse.prototype.circuit_key = null; /** - * Creates a new AddPeerRequest instance using the specified properties. + * HtlcModifyResponse amt_paid. + * @member {Long|null|undefined} amt_paid + * @memberof invoicesrpc.HtlcModifyResponse + * @instance + */ + HtlcModifyResponse.prototype.amt_paid = null; + + /** + * HtlcModifyResponse cancel_set. + * @member {boolean} cancel_set + * @memberof invoicesrpc.HtlcModifyResponse + * @instance + */ + HtlcModifyResponse.prototype.cancel_set = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * HtlcModifyResponse _amt_paid. + * @member {"amt_paid"|undefined} _amt_paid + * @memberof invoicesrpc.HtlcModifyResponse + * @instance + */ + Object.defineProperty(HtlcModifyResponse.prototype, "_amt_paid", { + get: $util.oneOfGetter($oneOfFields = ["amt_paid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HtlcModifyResponse instance using the specified properties. * @function create - * @memberof neutrinorpc.AddPeerRequest + * @memberof invoicesrpc.HtlcModifyResponse * @static - * @param {neutrinorpc.IAddPeerRequest=} [properties] Properties to set - * @returns {neutrinorpc.AddPeerRequest} AddPeerRequest instance + * @param {invoicesrpc.IHtlcModifyResponse=} [properties] Properties to set + * @returns {invoicesrpc.HtlcModifyResponse} HtlcModifyResponse instance */ - AddPeerRequest.create = function create(properties) { - return new AddPeerRequest(properties); + HtlcModifyResponse.create = function create(properties) { + return new HtlcModifyResponse(properties); }; /** - * Encodes the specified AddPeerRequest message. Does not implicitly {@link neutrinorpc.AddPeerRequest.verify|verify} messages. + * Encodes the specified HtlcModifyResponse message. Does not implicitly {@link invoicesrpc.HtlcModifyResponse.verify|verify} messages. * @function encode - * @memberof neutrinorpc.AddPeerRequest + * @memberof invoicesrpc.HtlcModifyResponse * @static - * @param {neutrinorpc.IAddPeerRequest} message AddPeerRequest message or plain object to encode + * @param {invoicesrpc.IHtlcModifyResponse} message HtlcModifyResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddPeerRequest.encode = function encode(message, writer) { + HtlcModifyResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.peer_addrs != null && Object.hasOwnProperty.call(message, "peer_addrs")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.peer_addrs); + if (message.circuit_key != null && Object.hasOwnProperty.call(message, "circuit_key")) + $root.invoicesrpc.CircuitKey.encode(message.circuit_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.amt_paid != null && Object.hasOwnProperty.call(message, "amt_paid")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amt_paid); + if (message.cancel_set != null && Object.hasOwnProperty.call(message, "cancel_set")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.cancel_set); return writer; }; /** - * Encodes the specified AddPeerRequest message, length delimited. Does not implicitly {@link neutrinorpc.AddPeerRequest.verify|verify} messages. + * Encodes the specified HtlcModifyResponse message, length delimited. Does not implicitly {@link invoicesrpc.HtlcModifyResponse.verify|verify} messages. * @function encodeDelimited - * @memberof neutrinorpc.AddPeerRequest + * @memberof invoicesrpc.HtlcModifyResponse * @static - * @param {neutrinorpc.IAddPeerRequest} message AddPeerRequest message or plain object to encode + * @param {invoicesrpc.IHtlcModifyResponse} message HtlcModifyResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AddPeerRequest.encodeDelimited = function encodeDelimited(message, writer) { + HtlcModifyResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AddPeerRequest message from the specified reader or buffer. + * Decodes a HtlcModifyResponse message from the specified reader or buffer. * @function decode - * @memberof neutrinorpc.AddPeerRequest + * @memberof invoicesrpc.HtlcModifyResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {neutrinorpc.AddPeerRequest} AddPeerRequest + * @returns {invoicesrpc.HtlcModifyResponse} HtlcModifyResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddPeerRequest.decode = function decode(reader, length) { + HtlcModifyResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.AddPeerRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.invoicesrpc.HtlcModifyResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.peer_addrs = reader.string(); + message.circuit_key = $root.invoicesrpc.CircuitKey.decode(reader, reader.uint32()); + break; + } + case 2: { + message.amt_paid = reader.uint64(); + break; + } + case 3: { + message.cancel_set = reader.bool(); break; } default: @@ -80320,499 +80933,469 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Decodes an AddPeerRequest message from the specified reader or buffer, length delimited. + * Decodes a HtlcModifyResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof neutrinorpc.AddPeerRequest + * @memberof invoicesrpc.HtlcModifyResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutrinorpc.AddPeerRequest} AddPeerRequest + * @returns {invoicesrpc.HtlcModifyResponse} HtlcModifyResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AddPeerRequest.decodeDelimited = function decodeDelimited(reader) { + HtlcModifyResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AddPeerRequest message. + * Verifies a HtlcModifyResponse message. * @function verify - * @memberof neutrinorpc.AddPeerRequest + * @memberof invoicesrpc.HtlcModifyResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AddPeerRequest.verify = function verify(message) { + HtlcModifyResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.peer_addrs != null && message.hasOwnProperty("peer_addrs")) - if (!$util.isString(message.peer_addrs)) - return "peer_addrs: string expected"; + let properties = {}; + if (message.circuit_key != null && message.hasOwnProperty("circuit_key")) { + let error = $root.invoicesrpc.CircuitKey.verify(message.circuit_key); + if (error) + return "circuit_key." + error; + } + if (message.amt_paid != null && message.hasOwnProperty("amt_paid")) { + properties._amt_paid = 1; + if (!$util.isInteger(message.amt_paid) && !(message.amt_paid && $util.isInteger(message.amt_paid.low) && $util.isInteger(message.amt_paid.high))) + return "amt_paid: integer|Long expected"; + } + if (message.cancel_set != null && message.hasOwnProperty("cancel_set")) + if (typeof message.cancel_set !== "boolean") + return "cancel_set: boolean expected"; return null; }; /** - * Creates an AddPeerRequest message from a plain object. Also converts values to their respective internal types. + * Creates a HtlcModifyResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof neutrinorpc.AddPeerRequest + * @memberof invoicesrpc.HtlcModifyResponse * @static * @param {Object.} object Plain object - * @returns {neutrinorpc.AddPeerRequest} AddPeerRequest + * @returns {invoicesrpc.HtlcModifyResponse} HtlcModifyResponse */ - AddPeerRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutrinorpc.AddPeerRequest) + HtlcModifyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.invoicesrpc.HtlcModifyResponse) return object; - let message = new $root.neutrinorpc.AddPeerRequest(); - if (object.peer_addrs != null) - message.peer_addrs = String(object.peer_addrs); + let message = new $root.invoicesrpc.HtlcModifyResponse(); + if (object.circuit_key != null) { + if (typeof object.circuit_key !== "object") + throw TypeError(".invoicesrpc.HtlcModifyResponse.circuit_key: object expected"); + message.circuit_key = $root.invoicesrpc.CircuitKey.fromObject(object.circuit_key); + } + if (object.amt_paid != null) + if ($util.Long) + (message.amt_paid = $util.Long.fromValue(object.amt_paid)).unsigned = true; + else if (typeof object.amt_paid === "string") + message.amt_paid = parseInt(object.amt_paid, 10); + else if (typeof object.amt_paid === "number") + message.amt_paid = object.amt_paid; + else if (typeof object.amt_paid === "object") + message.amt_paid = new $util.LongBits(object.amt_paid.low >>> 0, object.amt_paid.high >>> 0).toNumber(true); + if (object.cancel_set != null) + message.cancel_set = Boolean(object.cancel_set); return message; }; /** - * Creates a plain object from an AddPeerRequest message. Also converts values to other types if specified. + * Creates a plain object from a HtlcModifyResponse message. Also converts values to other types if specified. * @function toObject - * @memberof neutrinorpc.AddPeerRequest + * @memberof invoicesrpc.HtlcModifyResponse * @static - * @param {neutrinorpc.AddPeerRequest} message AddPeerRequest + * @param {invoicesrpc.HtlcModifyResponse} message HtlcModifyResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AddPeerRequest.toObject = function toObject(message, options) { + HtlcModifyResponse.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.defaults) - object.peer_addrs = ""; - if (message.peer_addrs != null && message.hasOwnProperty("peer_addrs")) - object.peer_addrs = message.peer_addrs; + if (options.defaults) { + object.circuit_key = null; + object.cancel_set = false; + } + if (message.circuit_key != null && message.hasOwnProperty("circuit_key")) + object.circuit_key = $root.invoicesrpc.CircuitKey.toObject(message.circuit_key, options); + if (message.amt_paid != null && message.hasOwnProperty("amt_paid")) { + if (typeof message.amt_paid === "number") + object.amt_paid = options.longs === String ? String(message.amt_paid) : message.amt_paid; + else + object.amt_paid = options.longs === String ? $util.Long.prototype.toString.call(message.amt_paid) : options.longs === Number ? new $util.LongBits(message.amt_paid.low >>> 0, message.amt_paid.high >>> 0).toNumber(true) : message.amt_paid; + if (options.oneofs) + object._amt_paid = "amt_paid"; + } + if (message.cancel_set != null && message.hasOwnProperty("cancel_set")) + object.cancel_set = message.cancel_set; return object; }; /** - * Converts this AddPeerRequest to JSON. + * Converts this HtlcModifyResponse to JSON. * @function toJSON - * @memberof neutrinorpc.AddPeerRequest + * @memberof invoicesrpc.HtlcModifyResponse * @instance * @returns {Object.} JSON object */ - AddPeerRequest.prototype.toJSON = function toJSON() { + HtlcModifyResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AddPeerRequest + * Gets the default type url for HtlcModifyResponse * @function getTypeUrl - * @memberof neutrinorpc.AddPeerRequest + * @memberof invoicesrpc.HtlcModifyResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AddPeerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + HtlcModifyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/neutrinorpc.AddPeerRequest"; + return typeUrlPrefix + "/invoicesrpc.HtlcModifyResponse"; }; - return AddPeerRequest; + return HtlcModifyResponse; })(); - neutrinorpc.AddPeerResponse = (function() { + return invoicesrpc; +})(); - /** - * Properties of an AddPeerResponse. - * @memberof neutrinorpc - * @interface IAddPeerResponse - */ +export const neutrinorpc = $root.neutrinorpc = (() => { + + /** + * Namespace neutrinorpc. + * @exports neutrinorpc + * @namespace + */ + const neutrinorpc = {}; + + neutrinorpc.NeutrinoKit = (function() { /** - * Constructs a new AddPeerResponse. + * Constructs a new NeutrinoKit service. * @memberof neutrinorpc - * @classdesc Represents an AddPeerResponse. - * @implements IAddPeerResponse + * @classdesc Represents a NeutrinoKit + * @extends $protobuf.rpc.Service * @constructor - * @param {neutrinorpc.IAddPeerResponse=} [properties] Properties to set + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ - function AddPeerResponse(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + function NeutrinoKit(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } + (NeutrinoKit.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = NeutrinoKit; + /** - * Creates a new AddPeerResponse instance using the specified properties. + * Creates new NeutrinoKit service using the specified rpc implementation. * @function create - * @memberof neutrinorpc.AddPeerResponse + * @memberof neutrinorpc.NeutrinoKit * @static - * @param {neutrinorpc.IAddPeerResponse=} [properties] Properties to set - * @returns {neutrinorpc.AddPeerResponse} AddPeerResponse instance + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {NeutrinoKit} RPC service. Useful where requests and/or responses are streamed. */ - AddPeerResponse.create = function create(properties) { - return new AddPeerResponse(properties); + NeutrinoKit.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Encodes the specified AddPeerResponse message. Does not implicitly {@link neutrinorpc.AddPeerResponse.verify|verify} messages. - * @function encode - * @memberof neutrinorpc.AddPeerResponse - * @static - * @param {neutrinorpc.IAddPeerResponse} message AddPeerResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link neutrinorpc.NeutrinoKit#status}. + * @memberof neutrinorpc.NeutrinoKit + * @typedef StatusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {neutrinorpc.StatusResponse} [response] StatusResponse */ - AddPeerResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; /** - * Encodes the specified AddPeerResponse message, length delimited. Does not implicitly {@link neutrinorpc.AddPeerResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutrinorpc.AddPeerResponse - * @static - * @param {neutrinorpc.IAddPeerResponse} message AddPeerResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls Status. + * @function status + * @memberof neutrinorpc.NeutrinoKit + * @instance + * @param {neutrinorpc.IStatusRequest} request StatusRequest message or plain object + * @param {neutrinorpc.NeutrinoKit.StatusCallback} callback Node-style callback called with the error, if any, and StatusResponse + * @returns {undefined} + * @variation 1 */ - AddPeerResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(NeutrinoKit.prototype.status = function status(request, callback) { + return this.rpcCall(status, $root.neutrinorpc.StatusRequest, $root.neutrinorpc.StatusResponse, request, callback); + }, "name", { value: "Status" }); /** - * Decodes an AddPeerResponse message from the specified reader or buffer. - * @function decode - * @memberof neutrinorpc.AddPeerResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutrinorpc.AddPeerResponse} AddPeerResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls Status. + * @function status + * @memberof neutrinorpc.NeutrinoKit + * @instance + * @param {neutrinorpc.IStatusRequest} request StatusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - AddPeerResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.AddPeerResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes an AddPeerResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutrinorpc.AddPeerResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutrinorpc.AddPeerResponse} AddPeerResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link neutrinorpc.NeutrinoKit#addPeer}. + * @memberof neutrinorpc.NeutrinoKit + * @typedef AddPeerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {neutrinorpc.AddPeerResponse} [response] AddPeerResponse */ - AddPeerResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies an AddPeerResponse message. - * @function verify - * @memberof neutrinorpc.AddPeerResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls AddPeer. + * @function addPeer + * @memberof neutrinorpc.NeutrinoKit + * @instance + * @param {neutrinorpc.IAddPeerRequest} request AddPeerRequest message or plain object + * @param {neutrinorpc.NeutrinoKit.AddPeerCallback} callback Node-style callback called with the error, if any, and AddPeerResponse + * @returns {undefined} + * @variation 1 */ - AddPeerResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; + Object.defineProperty(NeutrinoKit.prototype.addPeer = function addPeer(request, callback) { + return this.rpcCall(addPeer, $root.neutrinorpc.AddPeerRequest, $root.neutrinorpc.AddPeerResponse, request, callback); + }, "name", { value: "AddPeer" }); /** - * Creates an AddPeerResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutrinorpc.AddPeerResponse - * @static - * @param {Object.} object Plain object - * @returns {neutrinorpc.AddPeerResponse} AddPeerResponse + * Calls AddPeer. + * @function addPeer + * @memberof neutrinorpc.NeutrinoKit + * @instance + * @param {neutrinorpc.IAddPeerRequest} request AddPeerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - AddPeerResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutrinorpc.AddPeerResponse) - return object; - return new $root.neutrinorpc.AddPeerResponse(); - }; /** - * Creates a plain object from an AddPeerResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutrinorpc.AddPeerResponse - * @static - * @param {neutrinorpc.AddPeerResponse} message AddPeerResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link neutrinorpc.NeutrinoKit#disconnectPeer}. + * @memberof neutrinorpc.NeutrinoKit + * @typedef DisconnectPeerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {neutrinorpc.DisconnectPeerResponse} [response] DisconnectPeerResponse */ - AddPeerResponse.toObject = function toObject() { - return {}; - }; /** - * Converts this AddPeerResponse to JSON. - * @function toJSON - * @memberof neutrinorpc.AddPeerResponse + * Calls DisconnectPeer. + * @function disconnectPeer + * @memberof neutrinorpc.NeutrinoKit * @instance - * @returns {Object.} JSON object + * @param {neutrinorpc.IDisconnectPeerRequest} request DisconnectPeerRequest message or plain object + * @param {neutrinorpc.NeutrinoKit.DisconnectPeerCallback} callback Node-style callback called with the error, if any, and DisconnectPeerResponse + * @returns {undefined} + * @variation 1 */ - AddPeerResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(NeutrinoKit.prototype.disconnectPeer = function disconnectPeer(request, callback) { + return this.rpcCall(disconnectPeer, $root.neutrinorpc.DisconnectPeerRequest, $root.neutrinorpc.DisconnectPeerResponse, request, callback); + }, "name", { value: "DisconnectPeer" }); /** - * Gets the default type url for AddPeerResponse - * @function getTypeUrl - * @memberof neutrinorpc.AddPeerResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls DisconnectPeer. + * @function disconnectPeer + * @memberof neutrinorpc.NeutrinoKit + * @instance + * @param {neutrinorpc.IDisconnectPeerRequest} request DisconnectPeerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - AddPeerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/neutrinorpc.AddPeerResponse"; - }; - return AddPeerResponse; - })(); + /** + * Callback as used by {@link neutrinorpc.NeutrinoKit#isBanned}. + * @memberof neutrinorpc.NeutrinoKit + * @typedef IsBannedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {neutrinorpc.IsBannedResponse} [response] IsBannedResponse + */ - neutrinorpc.DisconnectPeerRequest = (function() { + /** + * Calls IsBanned. + * @function isBanned + * @memberof neutrinorpc.NeutrinoKit + * @instance + * @param {neutrinorpc.IIsBannedRequest} request IsBannedRequest message or plain object + * @param {neutrinorpc.NeutrinoKit.IsBannedCallback} callback Node-style callback called with the error, if any, and IsBannedResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NeutrinoKit.prototype.isBanned = function isBanned(request, callback) { + return this.rpcCall(isBanned, $root.neutrinorpc.IsBannedRequest, $root.neutrinorpc.IsBannedResponse, request, callback); + }, "name", { value: "IsBanned" }); /** - * Properties of a DisconnectPeerRequest. - * @memberof neutrinorpc - * @interface IDisconnectPeerRequest - * @property {string|null} [peer_addrs] DisconnectPeerRequest peer_addrs + * Calls IsBanned. + * @function isBanned + * @memberof neutrinorpc.NeutrinoKit + * @instance + * @param {neutrinorpc.IIsBannedRequest} request IsBannedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new DisconnectPeerRequest. - * @memberof neutrinorpc - * @classdesc Represents a DisconnectPeerRequest. - * @implements IDisconnectPeerRequest - * @constructor - * @param {neutrinorpc.IDisconnectPeerRequest=} [properties] Properties to set + * Callback as used by {@link neutrinorpc.NeutrinoKit#getBlockHeader}. + * @memberof neutrinorpc.NeutrinoKit + * @typedef GetBlockHeaderCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {neutrinorpc.GetBlockHeaderResponse} [response] GetBlockHeaderResponse */ - function DisconnectPeerRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * DisconnectPeerRequest peer_addrs. - * @member {string} peer_addrs - * @memberof neutrinorpc.DisconnectPeerRequest + * Calls GetBlockHeader. + * @function getBlockHeader + * @memberof neutrinorpc.NeutrinoKit * @instance + * @param {neutrinorpc.IGetBlockHeaderRequest} request GetBlockHeaderRequest message or plain object + * @param {neutrinorpc.NeutrinoKit.GetBlockHeaderCallback} callback Node-style callback called with the error, if any, and GetBlockHeaderResponse + * @returns {undefined} + * @variation 1 */ - DisconnectPeerRequest.prototype.peer_addrs = ""; + Object.defineProperty(NeutrinoKit.prototype.getBlockHeader = function getBlockHeader(request, callback) { + return this.rpcCall(getBlockHeader, $root.neutrinorpc.GetBlockHeaderRequest, $root.neutrinorpc.GetBlockHeaderResponse, request, callback); + }, "name", { value: "GetBlockHeader" }); /** - * Creates a new DisconnectPeerRequest instance using the specified properties. - * @function create - * @memberof neutrinorpc.DisconnectPeerRequest - * @static - * @param {neutrinorpc.IDisconnectPeerRequest=} [properties] Properties to set - * @returns {neutrinorpc.DisconnectPeerRequest} DisconnectPeerRequest instance + * Calls GetBlockHeader. + * @function getBlockHeader + * @memberof neutrinorpc.NeutrinoKit + * @instance + * @param {neutrinorpc.IGetBlockHeaderRequest} request GetBlockHeaderRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DisconnectPeerRequest.create = function create(properties) { - return new DisconnectPeerRequest(properties); - }; /** - * Encodes the specified DisconnectPeerRequest message. Does not implicitly {@link neutrinorpc.DisconnectPeerRequest.verify|verify} messages. - * @function encode - * @memberof neutrinorpc.DisconnectPeerRequest - * @static - * @param {neutrinorpc.IDisconnectPeerRequest} message DisconnectPeerRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link neutrinorpc.NeutrinoKit#getBlock}. + * @memberof neutrinorpc.NeutrinoKit + * @typedef GetBlockCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {neutrinorpc.GetBlockResponse} [response] GetBlockResponse */ - DisconnectPeerRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.peer_addrs != null && Object.hasOwnProperty.call(message, "peer_addrs")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.peer_addrs); - return writer; - }; /** - * Encodes the specified DisconnectPeerRequest message, length delimited. Does not implicitly {@link neutrinorpc.DisconnectPeerRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof neutrinorpc.DisconnectPeerRequest - * @static - * @param {neutrinorpc.IDisconnectPeerRequest} message DisconnectPeerRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetBlock. + * @function getBlock + * @memberof neutrinorpc.NeutrinoKit + * @instance + * @param {neutrinorpc.IGetBlockRequest} request GetBlockRequest message or plain object + * @param {neutrinorpc.NeutrinoKit.GetBlockCallback} callback Node-style callback called with the error, if any, and GetBlockResponse + * @returns {undefined} + * @variation 1 */ - DisconnectPeerRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(NeutrinoKit.prototype.getBlock = function getBlock(request, callback) { + return this.rpcCall(getBlock, $root.neutrinorpc.GetBlockRequest, $root.neutrinorpc.GetBlockResponse, request, callback); + }, "name", { value: "GetBlock" }); /** - * Decodes a DisconnectPeerRequest message from the specified reader or buffer. - * @function decode - * @memberof neutrinorpc.DisconnectPeerRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutrinorpc.DisconnectPeerRequest} DisconnectPeerRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetBlock. + * @function getBlock + * @memberof neutrinorpc.NeutrinoKit + * @instance + * @param {neutrinorpc.IGetBlockRequest} request GetBlockRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DisconnectPeerRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.DisconnectPeerRequest(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.peer_addrs = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a DisconnectPeerRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutrinorpc.DisconnectPeerRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutrinorpc.DisconnectPeerRequest} DisconnectPeerRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link neutrinorpc.NeutrinoKit#getCFilter}. + * @memberof neutrinorpc.NeutrinoKit + * @typedef GetCFilterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {neutrinorpc.GetCFilterResponse} [response] GetCFilterResponse */ - DisconnectPeerRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a DisconnectPeerRequest message. - * @function verify - * @memberof neutrinorpc.DisconnectPeerRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls GetCFilter. + * @function getCFilter + * @memberof neutrinorpc.NeutrinoKit + * @instance + * @param {neutrinorpc.IGetCFilterRequest} request GetCFilterRequest message or plain object + * @param {neutrinorpc.NeutrinoKit.GetCFilterCallback} callback Node-style callback called with the error, if any, and GetCFilterResponse + * @returns {undefined} + * @variation 1 */ - DisconnectPeerRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.peer_addrs != null && message.hasOwnProperty("peer_addrs")) - if (!$util.isString(message.peer_addrs)) - return "peer_addrs: string expected"; - return null; - }; + Object.defineProperty(NeutrinoKit.prototype.getCFilter = function getCFilter(request, callback) { + return this.rpcCall(getCFilter, $root.neutrinorpc.GetCFilterRequest, $root.neutrinorpc.GetCFilterResponse, request, callback); + }, "name", { value: "GetCFilter" }); /** - * Creates a DisconnectPeerRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutrinorpc.DisconnectPeerRequest - * @static - * @param {Object.} object Plain object - * @returns {neutrinorpc.DisconnectPeerRequest} DisconnectPeerRequest + * Calls GetCFilter. + * @function getCFilter + * @memberof neutrinorpc.NeutrinoKit + * @instance + * @param {neutrinorpc.IGetCFilterRequest} request GetCFilterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DisconnectPeerRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutrinorpc.DisconnectPeerRequest) - return object; - let message = new $root.neutrinorpc.DisconnectPeerRequest(); - if (object.peer_addrs != null) - message.peer_addrs = String(object.peer_addrs); - return message; - }; /** - * Creates a plain object from a DisconnectPeerRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof neutrinorpc.DisconnectPeerRequest - * @static - * @param {neutrinorpc.DisconnectPeerRequest} message DisconnectPeerRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link neutrinorpc.NeutrinoKit#getBlockHash}. + * @memberof neutrinorpc.NeutrinoKit + * @typedef GetBlockHashCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {neutrinorpc.GetBlockHashResponse} [response] GetBlockHashResponse */ - DisconnectPeerRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.peer_addrs = ""; - if (message.peer_addrs != null && message.hasOwnProperty("peer_addrs")) - object.peer_addrs = message.peer_addrs; - return object; - }; /** - * Converts this DisconnectPeerRequest to JSON. - * @function toJSON - * @memberof neutrinorpc.DisconnectPeerRequest + * Calls GetBlockHash. + * @function getBlockHash + * @memberof neutrinorpc.NeutrinoKit * @instance - * @returns {Object.} JSON object + * @param {neutrinorpc.IGetBlockHashRequest} request GetBlockHashRequest message or plain object + * @param {neutrinorpc.NeutrinoKit.GetBlockHashCallback} callback Node-style callback called with the error, if any, and GetBlockHashResponse + * @returns {undefined} + * @variation 1 */ - DisconnectPeerRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(NeutrinoKit.prototype.getBlockHash = function getBlockHash(request, callback) { + return this.rpcCall(getBlockHash, $root.neutrinorpc.GetBlockHashRequest, $root.neutrinorpc.GetBlockHashResponse, request, callback); + }, "name", { value: "GetBlockHash" }); /** - * Gets the default type url for DisconnectPeerRequest - * @function getTypeUrl - * @memberof neutrinorpc.DisconnectPeerRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls GetBlockHash. + * @function getBlockHash + * @memberof neutrinorpc.NeutrinoKit + * @instance + * @param {neutrinorpc.IGetBlockHashRequest} request GetBlockHashRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DisconnectPeerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/neutrinorpc.DisconnectPeerRequest"; - }; - return DisconnectPeerRequest; + return NeutrinoKit; })(); - neutrinorpc.DisconnectPeerResponse = (function() { + neutrinorpc.StatusRequest = (function() { /** - * Properties of a DisconnectPeerResponse. + * Properties of a StatusRequest. * @memberof neutrinorpc - * @interface IDisconnectPeerResponse + * @interface IStatusRequest */ /** - * Constructs a new DisconnectPeerResponse. + * Constructs a new StatusRequest. * @memberof neutrinorpc - * @classdesc Represents a DisconnectPeerResponse. - * @implements IDisconnectPeerResponse + * @classdesc Represents a StatusRequest. + * @implements IStatusRequest * @constructor - * @param {neutrinorpc.IDisconnectPeerResponse=} [properties] Properties to set + * @param {neutrinorpc.IStatusRequest=} [properties] Properties to set */ - function DisconnectPeerResponse(properties) { + function StatusRequest(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -80820,60 +81403,60 @@ export const neutrinorpc = $root.neutrinorpc = (() => { } /** - * Creates a new DisconnectPeerResponse instance using the specified properties. + * Creates a new StatusRequest instance using the specified properties. * @function create - * @memberof neutrinorpc.DisconnectPeerResponse + * @memberof neutrinorpc.StatusRequest * @static - * @param {neutrinorpc.IDisconnectPeerResponse=} [properties] Properties to set - * @returns {neutrinorpc.DisconnectPeerResponse} DisconnectPeerResponse instance + * @param {neutrinorpc.IStatusRequest=} [properties] Properties to set + * @returns {neutrinorpc.StatusRequest} StatusRequest instance */ - DisconnectPeerResponse.create = function create(properties) { - return new DisconnectPeerResponse(properties); + StatusRequest.create = function create(properties) { + return new StatusRequest(properties); }; /** - * Encodes the specified DisconnectPeerResponse message. Does not implicitly {@link neutrinorpc.DisconnectPeerResponse.verify|verify} messages. + * Encodes the specified StatusRequest message. Does not implicitly {@link neutrinorpc.StatusRequest.verify|verify} messages. * @function encode - * @memberof neutrinorpc.DisconnectPeerResponse + * @memberof neutrinorpc.StatusRequest * @static - * @param {neutrinorpc.IDisconnectPeerResponse} message DisconnectPeerResponse message or plain object to encode + * @param {neutrinorpc.IStatusRequest} message StatusRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DisconnectPeerResponse.encode = function encode(message, writer) { + StatusRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** - * Encodes the specified DisconnectPeerResponse message, length delimited. Does not implicitly {@link neutrinorpc.DisconnectPeerResponse.verify|verify} messages. + * Encodes the specified StatusRequest message, length delimited. Does not implicitly {@link neutrinorpc.StatusRequest.verify|verify} messages. * @function encodeDelimited - * @memberof neutrinorpc.DisconnectPeerResponse + * @memberof neutrinorpc.StatusRequest * @static - * @param {neutrinorpc.IDisconnectPeerResponse} message DisconnectPeerResponse message or plain object to encode + * @param {neutrinorpc.IStatusRequest} message StatusRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DisconnectPeerResponse.encodeDelimited = function encodeDelimited(message, writer) { + StatusRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DisconnectPeerResponse message from the specified reader or buffer. + * Decodes a StatusRequest message from the specified reader or buffer. * @function decode - * @memberof neutrinorpc.DisconnectPeerResponse + * @memberof neutrinorpc.StatusRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {neutrinorpc.DisconnectPeerResponse} DisconnectPeerResponse + * @returns {neutrinorpc.StatusRequest} StatusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DisconnectPeerResponse.decode = function decode(reader, length) { + StatusRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.DisconnectPeerResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.StatusRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { @@ -80886,109 +81469,114 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Decodes a DisconnectPeerResponse message from the specified reader or buffer, length delimited. + * Decodes a StatusRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof neutrinorpc.DisconnectPeerResponse + * @memberof neutrinorpc.StatusRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutrinorpc.DisconnectPeerResponse} DisconnectPeerResponse + * @returns {neutrinorpc.StatusRequest} StatusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DisconnectPeerResponse.decodeDelimited = function decodeDelimited(reader) { + StatusRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DisconnectPeerResponse message. + * Verifies a StatusRequest message. * @function verify - * @memberof neutrinorpc.DisconnectPeerResponse + * @memberof neutrinorpc.StatusRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DisconnectPeerResponse.verify = function verify(message) { + StatusRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** - * Creates a DisconnectPeerResponse message from a plain object. Also converts values to their respective internal types. + * Creates a StatusRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof neutrinorpc.DisconnectPeerResponse + * @memberof neutrinorpc.StatusRequest * @static * @param {Object.} object Plain object - * @returns {neutrinorpc.DisconnectPeerResponse} DisconnectPeerResponse + * @returns {neutrinorpc.StatusRequest} StatusRequest */ - DisconnectPeerResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutrinorpc.DisconnectPeerResponse) + StatusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.neutrinorpc.StatusRequest) return object; - return new $root.neutrinorpc.DisconnectPeerResponse(); + return new $root.neutrinorpc.StatusRequest(); }; /** - * Creates a plain object from a DisconnectPeerResponse message. Also converts values to other types if specified. + * Creates a plain object from a StatusRequest message. Also converts values to other types if specified. * @function toObject - * @memberof neutrinorpc.DisconnectPeerResponse + * @memberof neutrinorpc.StatusRequest * @static - * @param {neutrinorpc.DisconnectPeerResponse} message DisconnectPeerResponse + * @param {neutrinorpc.StatusRequest} message StatusRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DisconnectPeerResponse.toObject = function toObject() { + StatusRequest.toObject = function toObject() { return {}; }; /** - * Converts this DisconnectPeerResponse to JSON. + * Converts this StatusRequest to JSON. * @function toJSON - * @memberof neutrinorpc.DisconnectPeerResponse + * @memberof neutrinorpc.StatusRequest * @instance * @returns {Object.} JSON object */ - DisconnectPeerResponse.prototype.toJSON = function toJSON() { + StatusRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DisconnectPeerResponse + * Gets the default type url for StatusRequest * @function getTypeUrl - * @memberof neutrinorpc.DisconnectPeerResponse + * @memberof neutrinorpc.StatusRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DisconnectPeerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + StatusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/neutrinorpc.DisconnectPeerResponse"; + return typeUrlPrefix + "/neutrinorpc.StatusRequest"; }; - return DisconnectPeerResponse; + return StatusRequest; })(); - neutrinorpc.IsBannedRequest = (function() { + neutrinorpc.StatusResponse = (function() { /** - * Properties of an IsBannedRequest. + * Properties of a StatusResponse. * @memberof neutrinorpc - * @interface IIsBannedRequest - * @property {string|null} [peer_addrs] IsBannedRequest peer_addrs + * @interface IStatusResponse + * @property {boolean|null} [active] StatusResponse active + * @property {boolean|null} [synced] StatusResponse synced + * @property {number|null} [block_height] StatusResponse block_height + * @property {string|null} [block_hash] StatusResponse block_hash + * @property {Array.|null} [peers] StatusResponse peers */ /** - * Constructs a new IsBannedRequest. + * Constructs a new StatusResponse. * @memberof neutrinorpc - * @classdesc Represents an IsBannedRequest. - * @implements IIsBannedRequest + * @classdesc Represents a StatusResponse. + * @implements IStatusResponse * @constructor - * @param {neutrinorpc.IIsBannedRequest=} [properties] Properties to set + * @param {neutrinorpc.IStatusResponse=} [properties] Properties to set */ - function IsBannedRequest(properties) { + function StatusResponse(properties) { + this.peers = []; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -80996,75 +81584,134 @@ export const neutrinorpc = $root.neutrinorpc = (() => { } /** - * IsBannedRequest peer_addrs. - * @member {string} peer_addrs - * @memberof neutrinorpc.IsBannedRequest + * StatusResponse active. + * @member {boolean} active + * @memberof neutrinorpc.StatusResponse * @instance */ - IsBannedRequest.prototype.peer_addrs = ""; + StatusResponse.prototype.active = false; /** - * Creates a new IsBannedRequest instance using the specified properties. + * StatusResponse synced. + * @member {boolean} synced + * @memberof neutrinorpc.StatusResponse + * @instance + */ + StatusResponse.prototype.synced = false; + + /** + * StatusResponse block_height. + * @member {number} block_height + * @memberof neutrinorpc.StatusResponse + * @instance + */ + StatusResponse.prototype.block_height = 0; + + /** + * StatusResponse block_hash. + * @member {string} block_hash + * @memberof neutrinorpc.StatusResponse + * @instance + */ + StatusResponse.prototype.block_hash = ""; + + /** + * StatusResponse peers. + * @member {Array.} peers + * @memberof neutrinorpc.StatusResponse + * @instance + */ + StatusResponse.prototype.peers = $util.emptyArray; + + /** + * Creates a new StatusResponse instance using the specified properties. * @function create - * @memberof neutrinorpc.IsBannedRequest + * @memberof neutrinorpc.StatusResponse * @static - * @param {neutrinorpc.IIsBannedRequest=} [properties] Properties to set - * @returns {neutrinorpc.IsBannedRequest} IsBannedRequest instance + * @param {neutrinorpc.IStatusResponse=} [properties] Properties to set + * @returns {neutrinorpc.StatusResponse} StatusResponse instance */ - IsBannedRequest.create = function create(properties) { - return new IsBannedRequest(properties); + StatusResponse.create = function create(properties) { + return new StatusResponse(properties); }; /** - * Encodes the specified IsBannedRequest message. Does not implicitly {@link neutrinorpc.IsBannedRequest.verify|verify} messages. + * Encodes the specified StatusResponse message. Does not implicitly {@link neutrinorpc.StatusResponse.verify|verify} messages. * @function encode - * @memberof neutrinorpc.IsBannedRequest + * @memberof neutrinorpc.StatusResponse * @static - * @param {neutrinorpc.IIsBannedRequest} message IsBannedRequest message or plain object to encode + * @param {neutrinorpc.IStatusResponse} message StatusResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IsBannedRequest.encode = function encode(message, writer) { + StatusResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.peer_addrs != null && Object.hasOwnProperty.call(message, "peer_addrs")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.peer_addrs); + if (message.active != null && Object.hasOwnProperty.call(message, "active")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.active); + if (message.synced != null && Object.hasOwnProperty.call(message, "synced")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.synced); + if (message.block_height != null && Object.hasOwnProperty.call(message, "block_height")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.block_height); + if (message.block_hash != null && Object.hasOwnProperty.call(message, "block_hash")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.block_hash); + if (message.peers != null && message.peers.length) + for (let i = 0; i < message.peers.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.peers[i]); return writer; }; /** - * Encodes the specified IsBannedRequest message, length delimited. Does not implicitly {@link neutrinorpc.IsBannedRequest.verify|verify} messages. + * Encodes the specified StatusResponse message, length delimited. Does not implicitly {@link neutrinorpc.StatusResponse.verify|verify} messages. * @function encodeDelimited - * @memberof neutrinorpc.IsBannedRequest + * @memberof neutrinorpc.StatusResponse * @static - * @param {neutrinorpc.IIsBannedRequest} message IsBannedRequest message or plain object to encode + * @param {neutrinorpc.IStatusResponse} message StatusResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IsBannedRequest.encodeDelimited = function encodeDelimited(message, writer) { + StatusResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an IsBannedRequest message from the specified reader or buffer. + * Decodes a StatusResponse message from the specified reader or buffer. * @function decode - * @memberof neutrinorpc.IsBannedRequest + * @memberof neutrinorpc.StatusResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {neutrinorpc.IsBannedRequest} IsBannedRequest + * @returns {neutrinorpc.StatusResponse} StatusResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IsBannedRequest.decode = function decode(reader, length) { + StatusResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.IsBannedRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.StatusResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.peer_addrs = reader.string(); + message.active = reader.bool(); + break; + } + case 2: { + message.synced = reader.bool(); + break; + } + case 3: { + message.block_height = reader.int32(); + break; + } + case 4: { + message.block_hash = reader.string(); + break; + } + case 5: { + if (!(message.peers && message.peers.length)) + message.peers = []; + message.peers.push(reader.string()); break; } default: @@ -81076,122 +81723,168 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Decodes an IsBannedRequest message from the specified reader or buffer, length delimited. + * Decodes a StatusResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof neutrinorpc.IsBannedRequest + * @memberof neutrinorpc.StatusResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutrinorpc.IsBannedRequest} IsBannedRequest + * @returns {neutrinorpc.StatusResponse} StatusResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IsBannedRequest.decodeDelimited = function decodeDelimited(reader) { + StatusResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an IsBannedRequest message. + * Verifies a StatusResponse message. * @function verify - * @memberof neutrinorpc.IsBannedRequest + * @memberof neutrinorpc.StatusResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - IsBannedRequest.verify = function verify(message) { + StatusResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.peer_addrs != null && message.hasOwnProperty("peer_addrs")) - if (!$util.isString(message.peer_addrs)) - return "peer_addrs: string expected"; + if (message.active != null && message.hasOwnProperty("active")) + if (typeof message.active !== "boolean") + return "active: boolean expected"; + if (message.synced != null && message.hasOwnProperty("synced")) + if (typeof message.synced !== "boolean") + return "synced: boolean expected"; + if (message.block_height != null && message.hasOwnProperty("block_height")) + if (!$util.isInteger(message.block_height)) + return "block_height: integer expected"; + if (message.block_hash != null && message.hasOwnProperty("block_hash")) + if (!$util.isString(message.block_hash)) + return "block_hash: string expected"; + if (message.peers != null && message.hasOwnProperty("peers")) { + if (!Array.isArray(message.peers)) + return "peers: array expected"; + for (let i = 0; i < message.peers.length; ++i) + if (!$util.isString(message.peers[i])) + return "peers: string[] expected"; + } return null; }; /** - * Creates an IsBannedRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StatusResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof neutrinorpc.IsBannedRequest + * @memberof neutrinorpc.StatusResponse * @static * @param {Object.} object Plain object - * @returns {neutrinorpc.IsBannedRequest} IsBannedRequest + * @returns {neutrinorpc.StatusResponse} StatusResponse */ - IsBannedRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutrinorpc.IsBannedRequest) + StatusResponse.fromObject = function fromObject(object) { + if (object instanceof $root.neutrinorpc.StatusResponse) return object; - let message = new $root.neutrinorpc.IsBannedRequest(); - if (object.peer_addrs != null) - message.peer_addrs = String(object.peer_addrs); + let message = new $root.neutrinorpc.StatusResponse(); + if (object.active != null) + message.active = Boolean(object.active); + if (object.synced != null) + message.synced = Boolean(object.synced); + if (object.block_height != null) + message.block_height = object.block_height | 0; + if (object.block_hash != null) + message.block_hash = String(object.block_hash); + if (object.peers) { + if (!Array.isArray(object.peers)) + throw TypeError(".neutrinorpc.StatusResponse.peers: array expected"); + message.peers = []; + for (let i = 0; i < object.peers.length; ++i) + message.peers[i] = String(object.peers[i]); + } return message; }; /** - * Creates a plain object from an IsBannedRequest message. Also converts values to other types if specified. + * Creates a plain object from a StatusResponse message. Also converts values to other types if specified. * @function toObject - * @memberof neutrinorpc.IsBannedRequest + * @memberof neutrinorpc.StatusResponse * @static - * @param {neutrinorpc.IsBannedRequest} message IsBannedRequest + * @param {neutrinorpc.StatusResponse} message StatusResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IsBannedRequest.toObject = function toObject(message, options) { + StatusResponse.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.defaults) - object.peer_addrs = ""; - if (message.peer_addrs != null && message.hasOwnProperty("peer_addrs")) - object.peer_addrs = message.peer_addrs; + if (options.arrays || options.defaults) + object.peers = []; + if (options.defaults) { + object.active = false; + object.synced = false; + object.block_height = 0; + object.block_hash = ""; + } + if (message.active != null && message.hasOwnProperty("active")) + object.active = message.active; + if (message.synced != null && message.hasOwnProperty("synced")) + object.synced = message.synced; + if (message.block_height != null && message.hasOwnProperty("block_height")) + object.block_height = message.block_height; + if (message.block_hash != null && message.hasOwnProperty("block_hash")) + object.block_hash = message.block_hash; + if (message.peers && message.peers.length) { + object.peers = []; + for (let j = 0; j < message.peers.length; ++j) + object.peers[j] = message.peers[j]; + } return object; }; /** - * Converts this IsBannedRequest to JSON. + * Converts this StatusResponse to JSON. * @function toJSON - * @memberof neutrinorpc.IsBannedRequest + * @memberof neutrinorpc.StatusResponse * @instance * @returns {Object.} JSON object */ - IsBannedRequest.prototype.toJSON = function toJSON() { + StatusResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for IsBannedRequest + * Gets the default type url for StatusResponse * @function getTypeUrl - * @memberof neutrinorpc.IsBannedRequest + * @memberof neutrinorpc.StatusResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - IsBannedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + StatusResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/neutrinorpc.IsBannedRequest"; + return typeUrlPrefix + "/neutrinorpc.StatusResponse"; }; - return IsBannedRequest; + return StatusResponse; })(); - neutrinorpc.IsBannedResponse = (function() { + neutrinorpc.AddPeerRequest = (function() { /** - * Properties of an IsBannedResponse. + * Properties of an AddPeerRequest. * @memberof neutrinorpc - * @interface IIsBannedResponse - * @property {boolean|null} [banned] IsBannedResponse banned + * @interface IAddPeerRequest + * @property {string|null} [peer_addrs] AddPeerRequest peer_addrs */ /** - * Constructs a new IsBannedResponse. + * Constructs a new AddPeerRequest. * @memberof neutrinorpc - * @classdesc Represents an IsBannedResponse. - * @implements IIsBannedResponse + * @classdesc Represents an AddPeerRequest. + * @implements IAddPeerRequest * @constructor - * @param {neutrinorpc.IIsBannedResponse=} [properties] Properties to set + * @param {neutrinorpc.IAddPeerRequest=} [properties] Properties to set */ - function IsBannedResponse(properties) { + function AddPeerRequest(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -81199,75 +81892,75 @@ export const neutrinorpc = $root.neutrinorpc = (() => { } /** - * IsBannedResponse banned. - * @member {boolean} banned - * @memberof neutrinorpc.IsBannedResponse + * AddPeerRequest peer_addrs. + * @member {string} peer_addrs + * @memberof neutrinorpc.AddPeerRequest * @instance */ - IsBannedResponse.prototype.banned = false; + AddPeerRequest.prototype.peer_addrs = ""; /** - * Creates a new IsBannedResponse instance using the specified properties. + * Creates a new AddPeerRequest instance using the specified properties. * @function create - * @memberof neutrinorpc.IsBannedResponse + * @memberof neutrinorpc.AddPeerRequest * @static - * @param {neutrinorpc.IIsBannedResponse=} [properties] Properties to set - * @returns {neutrinorpc.IsBannedResponse} IsBannedResponse instance + * @param {neutrinorpc.IAddPeerRequest=} [properties] Properties to set + * @returns {neutrinorpc.AddPeerRequest} AddPeerRequest instance */ - IsBannedResponse.create = function create(properties) { - return new IsBannedResponse(properties); + AddPeerRequest.create = function create(properties) { + return new AddPeerRequest(properties); }; /** - * Encodes the specified IsBannedResponse message. Does not implicitly {@link neutrinorpc.IsBannedResponse.verify|verify} messages. + * Encodes the specified AddPeerRequest message. Does not implicitly {@link neutrinorpc.AddPeerRequest.verify|verify} messages. * @function encode - * @memberof neutrinorpc.IsBannedResponse + * @memberof neutrinorpc.AddPeerRequest * @static - * @param {neutrinorpc.IIsBannedResponse} message IsBannedResponse message or plain object to encode + * @param {neutrinorpc.IAddPeerRequest} message AddPeerRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IsBannedResponse.encode = function encode(message, writer) { + AddPeerRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.banned != null && Object.hasOwnProperty.call(message, "banned")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.banned); + if (message.peer_addrs != null && Object.hasOwnProperty.call(message, "peer_addrs")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.peer_addrs); return writer; }; /** - * Encodes the specified IsBannedResponse message, length delimited. Does not implicitly {@link neutrinorpc.IsBannedResponse.verify|verify} messages. + * Encodes the specified AddPeerRequest message, length delimited. Does not implicitly {@link neutrinorpc.AddPeerRequest.verify|verify} messages. * @function encodeDelimited - * @memberof neutrinorpc.IsBannedResponse + * @memberof neutrinorpc.AddPeerRequest * @static - * @param {neutrinorpc.IIsBannedResponse} message IsBannedResponse message or plain object to encode + * @param {neutrinorpc.IAddPeerRequest} message AddPeerRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IsBannedResponse.encodeDelimited = function encodeDelimited(message, writer) { + AddPeerRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an IsBannedResponse message from the specified reader or buffer. + * Decodes an AddPeerRequest message from the specified reader or buffer. * @function decode - * @memberof neutrinorpc.IsBannedResponse + * @memberof neutrinorpc.AddPeerRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {neutrinorpc.IsBannedResponse} IsBannedResponse + * @returns {neutrinorpc.AddPeerRequest} AddPeerRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IsBannedResponse.decode = function decode(reader, length) { + AddPeerRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.IsBannedResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.AddPeerRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.banned = reader.bool(); + message.peer_addrs = reader.string(); break; } default: @@ -81279,122 +81972,121 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Decodes an IsBannedResponse message from the specified reader or buffer, length delimited. + * Decodes an AddPeerRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof neutrinorpc.IsBannedResponse + * @memberof neutrinorpc.AddPeerRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutrinorpc.IsBannedResponse} IsBannedResponse + * @returns {neutrinorpc.AddPeerRequest} AddPeerRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IsBannedResponse.decodeDelimited = function decodeDelimited(reader) { + AddPeerRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an IsBannedResponse message. + * Verifies an AddPeerRequest message. * @function verify - * @memberof neutrinorpc.IsBannedResponse + * @memberof neutrinorpc.AddPeerRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - IsBannedResponse.verify = function verify(message) { + AddPeerRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.banned != null && message.hasOwnProperty("banned")) - if (typeof message.banned !== "boolean") - return "banned: boolean expected"; + if (message.peer_addrs != null && message.hasOwnProperty("peer_addrs")) + if (!$util.isString(message.peer_addrs)) + return "peer_addrs: string expected"; return null; }; /** - * Creates an IsBannedResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AddPeerRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof neutrinorpc.IsBannedResponse + * @memberof neutrinorpc.AddPeerRequest * @static * @param {Object.} object Plain object - * @returns {neutrinorpc.IsBannedResponse} IsBannedResponse + * @returns {neutrinorpc.AddPeerRequest} AddPeerRequest */ - IsBannedResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutrinorpc.IsBannedResponse) + AddPeerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.neutrinorpc.AddPeerRequest) return object; - let message = new $root.neutrinorpc.IsBannedResponse(); - if (object.banned != null) - message.banned = Boolean(object.banned); + let message = new $root.neutrinorpc.AddPeerRequest(); + if (object.peer_addrs != null) + message.peer_addrs = String(object.peer_addrs); return message; }; /** - * Creates a plain object from an IsBannedResponse message. Also converts values to other types if specified. + * Creates a plain object from an AddPeerRequest message. Also converts values to other types if specified. * @function toObject - * @memberof neutrinorpc.IsBannedResponse + * @memberof neutrinorpc.AddPeerRequest * @static - * @param {neutrinorpc.IsBannedResponse} message IsBannedResponse + * @param {neutrinorpc.AddPeerRequest} message AddPeerRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IsBannedResponse.toObject = function toObject(message, options) { + AddPeerRequest.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; if (options.defaults) - object.banned = false; - if (message.banned != null && message.hasOwnProperty("banned")) - object.banned = message.banned; + object.peer_addrs = ""; + if (message.peer_addrs != null && message.hasOwnProperty("peer_addrs")) + object.peer_addrs = message.peer_addrs; return object; }; /** - * Converts this IsBannedResponse to JSON. + * Converts this AddPeerRequest to JSON. * @function toJSON - * @memberof neutrinorpc.IsBannedResponse + * @memberof neutrinorpc.AddPeerRequest * @instance * @returns {Object.} JSON object */ - IsBannedResponse.prototype.toJSON = function toJSON() { + AddPeerRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for IsBannedResponse + * Gets the default type url for AddPeerRequest * @function getTypeUrl - * @memberof neutrinorpc.IsBannedResponse + * @memberof neutrinorpc.AddPeerRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - IsBannedResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AddPeerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/neutrinorpc.IsBannedResponse"; + return typeUrlPrefix + "/neutrinorpc.AddPeerRequest"; }; - return IsBannedResponse; + return AddPeerRequest; })(); - neutrinorpc.GetBlockHeaderRequest = (function() { + neutrinorpc.AddPeerResponse = (function() { /** - * Properties of a GetBlockHeaderRequest. + * Properties of an AddPeerResponse. * @memberof neutrinorpc - * @interface IGetBlockHeaderRequest - * @property {string|null} [hash] GetBlockHeaderRequest hash + * @interface IAddPeerResponse */ /** - * Constructs a new GetBlockHeaderRequest. + * Constructs a new AddPeerResponse. * @memberof neutrinorpc - * @classdesc Represents a GetBlockHeaderRequest. - * @implements IGetBlockHeaderRequest + * @classdesc Represents an AddPeerResponse. + * @implements IAddPeerResponse * @constructor - * @param {neutrinorpc.IGetBlockHeaderRequest=} [properties] Properties to set + * @param {neutrinorpc.IAddPeerResponse=} [properties] Properties to set */ - function GetBlockHeaderRequest(properties) { + function AddPeerResponse(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -81402,77 +82094,63 @@ export const neutrinorpc = $root.neutrinorpc = (() => { } /** - * GetBlockHeaderRequest hash. - * @member {string} hash - * @memberof neutrinorpc.GetBlockHeaderRequest - * @instance - */ - GetBlockHeaderRequest.prototype.hash = ""; - - /** - * Creates a new GetBlockHeaderRequest instance using the specified properties. + * Creates a new AddPeerResponse instance using the specified properties. * @function create - * @memberof neutrinorpc.GetBlockHeaderRequest + * @memberof neutrinorpc.AddPeerResponse * @static - * @param {neutrinorpc.IGetBlockHeaderRequest=} [properties] Properties to set - * @returns {neutrinorpc.GetBlockHeaderRequest} GetBlockHeaderRequest instance + * @param {neutrinorpc.IAddPeerResponse=} [properties] Properties to set + * @returns {neutrinorpc.AddPeerResponse} AddPeerResponse instance */ - GetBlockHeaderRequest.create = function create(properties) { - return new GetBlockHeaderRequest(properties); + AddPeerResponse.create = function create(properties) { + return new AddPeerResponse(properties); }; /** - * Encodes the specified GetBlockHeaderRequest message. Does not implicitly {@link neutrinorpc.GetBlockHeaderRequest.verify|verify} messages. + * Encodes the specified AddPeerResponse message. Does not implicitly {@link neutrinorpc.AddPeerResponse.verify|verify} messages. * @function encode - * @memberof neutrinorpc.GetBlockHeaderRequest + * @memberof neutrinorpc.AddPeerResponse * @static - * @param {neutrinorpc.IGetBlockHeaderRequest} message GetBlockHeaderRequest message or plain object to encode + * @param {neutrinorpc.IAddPeerResponse} message AddPeerResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBlockHeaderRequest.encode = function encode(message, writer) { + AddPeerResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); return writer; }; /** - * Encodes the specified GetBlockHeaderRequest message, length delimited. Does not implicitly {@link neutrinorpc.GetBlockHeaderRequest.verify|verify} messages. + * Encodes the specified AddPeerResponse message, length delimited. Does not implicitly {@link neutrinorpc.AddPeerResponse.verify|verify} messages. * @function encodeDelimited - * @memberof neutrinorpc.GetBlockHeaderRequest + * @memberof neutrinorpc.AddPeerResponse * @static - * @param {neutrinorpc.IGetBlockHeaderRequest} message GetBlockHeaderRequest message or plain object to encode + * @param {neutrinorpc.IAddPeerResponse} message AddPeerResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBlockHeaderRequest.encodeDelimited = function encodeDelimited(message, writer) { + AddPeerResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetBlockHeaderRequest message from the specified reader or buffer. + * Decodes an AddPeerResponse message from the specified reader or buffer. * @function decode - * @memberof neutrinorpc.GetBlockHeaderRequest + * @memberof neutrinorpc.AddPeerResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {neutrinorpc.GetBlockHeaderRequest} GetBlockHeaderRequest + * @returns {neutrinorpc.AddPeerResponse} AddPeerResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBlockHeaderRequest.decode = function decode(reader, length) { + AddPeerResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetBlockHeaderRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.AddPeerResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.hash = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -81482,136 +82160,109 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Decodes a GetBlockHeaderRequest message from the specified reader or buffer, length delimited. + * Decodes an AddPeerResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof neutrinorpc.GetBlockHeaderRequest + * @memberof neutrinorpc.AddPeerResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutrinorpc.GetBlockHeaderRequest} GetBlockHeaderRequest + * @returns {neutrinorpc.AddPeerResponse} AddPeerResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBlockHeaderRequest.decodeDelimited = function decodeDelimited(reader) { + AddPeerResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetBlockHeaderRequest message. + * Verifies an AddPeerResponse message. * @function verify - * @memberof neutrinorpc.GetBlockHeaderRequest + * @memberof neutrinorpc.AddPeerResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetBlockHeaderRequest.verify = function verify(message) { + AddPeerResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!$util.isString(message.hash)) - return "hash: string expected"; return null; }; /** - * Creates a GetBlockHeaderRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AddPeerResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof neutrinorpc.GetBlockHeaderRequest + * @memberof neutrinorpc.AddPeerResponse * @static * @param {Object.} object Plain object - * @returns {neutrinorpc.GetBlockHeaderRequest} GetBlockHeaderRequest + * @returns {neutrinorpc.AddPeerResponse} AddPeerResponse */ - GetBlockHeaderRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutrinorpc.GetBlockHeaderRequest) + AddPeerResponse.fromObject = function fromObject(object) { + if (object instanceof $root.neutrinorpc.AddPeerResponse) return object; - let message = new $root.neutrinorpc.GetBlockHeaderRequest(); - if (object.hash != null) - message.hash = String(object.hash); - return message; + return new $root.neutrinorpc.AddPeerResponse(); }; /** - * Creates a plain object from a GetBlockHeaderRequest message. Also converts values to other types if specified. + * Creates a plain object from an AddPeerResponse message. Also converts values to other types if specified. * @function toObject - * @memberof neutrinorpc.GetBlockHeaderRequest + * @memberof neutrinorpc.AddPeerResponse * @static - * @param {neutrinorpc.GetBlockHeaderRequest} message GetBlockHeaderRequest + * @param {neutrinorpc.AddPeerResponse} message AddPeerResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetBlockHeaderRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.hash = ""; - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = message.hash; - return object; + AddPeerResponse.toObject = function toObject() { + return {}; }; /** - * Converts this GetBlockHeaderRequest to JSON. + * Converts this AddPeerResponse to JSON. * @function toJSON - * @memberof neutrinorpc.GetBlockHeaderRequest + * @memberof neutrinorpc.AddPeerResponse * @instance * @returns {Object.} JSON object */ - GetBlockHeaderRequest.prototype.toJSON = function toJSON() { + AddPeerResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetBlockHeaderRequest + * Gets the default type url for AddPeerResponse * @function getTypeUrl - * @memberof neutrinorpc.GetBlockHeaderRequest + * @memberof neutrinorpc.AddPeerResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetBlockHeaderRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AddPeerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/neutrinorpc.GetBlockHeaderRequest"; + return typeUrlPrefix + "/neutrinorpc.AddPeerResponse"; }; - return GetBlockHeaderRequest; + return AddPeerResponse; })(); - neutrinorpc.GetBlockHeaderResponse = (function() { + neutrinorpc.DisconnectPeerRequest = (function() { /** - * Properties of a GetBlockHeaderResponse. + * Properties of a DisconnectPeerRequest. * @memberof neutrinorpc - * @interface IGetBlockHeaderResponse - * @property {string|null} [hash] GetBlockHeaderResponse hash - * @property {Long|null} [confirmations] GetBlockHeaderResponse confirmations - * @property {Long|null} [stripped_size] GetBlockHeaderResponse stripped_size - * @property {Long|null} [size] GetBlockHeaderResponse size - * @property {Long|null} [weight] GetBlockHeaderResponse weight - * @property {number|null} [height] GetBlockHeaderResponse height - * @property {number|null} [version] GetBlockHeaderResponse version - * @property {string|null} [version_hex] GetBlockHeaderResponse version_hex - * @property {string|null} [merkleroot] GetBlockHeaderResponse merkleroot - * @property {Long|null} [time] GetBlockHeaderResponse time - * @property {number|null} [nonce] GetBlockHeaderResponse nonce - * @property {string|null} [bits] GetBlockHeaderResponse bits - * @property {number|null} [ntx] GetBlockHeaderResponse ntx - * @property {string|null} [previous_block_hash] GetBlockHeaderResponse previous_block_hash - * @property {Uint8Array|null} [raw_hex] GetBlockHeaderResponse raw_hex + * @interface IDisconnectPeerRequest + * @property {string|null} [peer_addrs] DisconnectPeerRequest peer_addrs */ /** - * Constructs a new GetBlockHeaderResponse. + * Constructs a new DisconnectPeerRequest. * @memberof neutrinorpc - * @classdesc Represents a GetBlockHeaderResponse. - * @implements IGetBlockHeaderResponse + * @classdesc Represents a DisconnectPeerRequest. + * @implements IDisconnectPeerRequest * @constructor - * @param {neutrinorpc.IGetBlockHeaderResponse=} [properties] Properties to set + * @param {neutrinorpc.IDisconnectPeerRequest=} [properties] Properties to set */ - function GetBlockHeaderResponse(properties) { + function DisconnectPeerRequest(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -81619,273 +82270,265 @@ export const neutrinorpc = $root.neutrinorpc = (() => { } /** - * GetBlockHeaderResponse hash. - * @member {string} hash - * @memberof neutrinorpc.GetBlockHeaderResponse + * DisconnectPeerRequest peer_addrs. + * @member {string} peer_addrs + * @memberof neutrinorpc.DisconnectPeerRequest * @instance */ - GetBlockHeaderResponse.prototype.hash = ""; + DisconnectPeerRequest.prototype.peer_addrs = ""; /** - * GetBlockHeaderResponse confirmations. - * @member {Long} confirmations - * @memberof neutrinorpc.GetBlockHeaderResponse - * @instance + * Creates a new DisconnectPeerRequest instance using the specified properties. + * @function create + * @memberof neutrinorpc.DisconnectPeerRequest + * @static + * @param {neutrinorpc.IDisconnectPeerRequest=} [properties] Properties to set + * @returns {neutrinorpc.DisconnectPeerRequest} DisconnectPeerRequest instance */ - GetBlockHeaderResponse.prototype.confirmations = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + DisconnectPeerRequest.create = function create(properties) { + return new DisconnectPeerRequest(properties); + }; /** - * GetBlockHeaderResponse stripped_size. - * @member {Long} stripped_size - * @memberof neutrinorpc.GetBlockHeaderResponse - * @instance + * Encodes the specified DisconnectPeerRequest message. Does not implicitly {@link neutrinorpc.DisconnectPeerRequest.verify|verify} messages. + * @function encode + * @memberof neutrinorpc.DisconnectPeerRequest + * @static + * @param {neutrinorpc.IDisconnectPeerRequest} message DisconnectPeerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - GetBlockHeaderResponse.prototype.stripped_size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + DisconnectPeerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.peer_addrs != null && Object.hasOwnProperty.call(message, "peer_addrs")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.peer_addrs); + return writer; + }; /** - * GetBlockHeaderResponse size. - * @member {Long} size - * @memberof neutrinorpc.GetBlockHeaderResponse - * @instance + * Encodes the specified DisconnectPeerRequest message, length delimited. Does not implicitly {@link neutrinorpc.DisconnectPeerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof neutrinorpc.DisconnectPeerRequest + * @static + * @param {neutrinorpc.IDisconnectPeerRequest} message DisconnectPeerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - GetBlockHeaderResponse.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + DisconnectPeerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * GetBlockHeaderResponse weight. - * @member {Long} weight - * @memberof neutrinorpc.GetBlockHeaderResponse - * @instance + * Decodes a DisconnectPeerRequest message from the specified reader or buffer. + * @function decode + * @memberof neutrinorpc.DisconnectPeerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {neutrinorpc.DisconnectPeerRequest} DisconnectPeerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBlockHeaderResponse.prototype.weight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + DisconnectPeerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.DisconnectPeerRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.peer_addrs = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * GetBlockHeaderResponse height. - * @member {number} height - * @memberof neutrinorpc.GetBlockHeaderResponse - * @instance + * Decodes a DisconnectPeerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof neutrinorpc.DisconnectPeerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {neutrinorpc.DisconnectPeerRequest} DisconnectPeerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBlockHeaderResponse.prototype.height = 0; + DisconnectPeerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * GetBlockHeaderResponse version. - * @member {number} version - * @memberof neutrinorpc.GetBlockHeaderResponse - * @instance + * Verifies a DisconnectPeerRequest message. + * @function verify + * @memberof neutrinorpc.DisconnectPeerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetBlockHeaderResponse.prototype.version = 0; + DisconnectPeerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.peer_addrs != null && message.hasOwnProperty("peer_addrs")) + if (!$util.isString(message.peer_addrs)) + return "peer_addrs: string expected"; + return null; + }; /** - * GetBlockHeaderResponse version_hex. - * @member {string} version_hex - * @memberof neutrinorpc.GetBlockHeaderResponse - * @instance + * Creates a DisconnectPeerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof neutrinorpc.DisconnectPeerRequest + * @static + * @param {Object.} object Plain object + * @returns {neutrinorpc.DisconnectPeerRequest} DisconnectPeerRequest */ - GetBlockHeaderResponse.prototype.version_hex = ""; + DisconnectPeerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.neutrinorpc.DisconnectPeerRequest) + return object; + let message = new $root.neutrinorpc.DisconnectPeerRequest(); + if (object.peer_addrs != null) + message.peer_addrs = String(object.peer_addrs); + return message; + }; /** - * GetBlockHeaderResponse merkleroot. - * @member {string} merkleroot - * @memberof neutrinorpc.GetBlockHeaderResponse - * @instance + * Creates a plain object from a DisconnectPeerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof neutrinorpc.DisconnectPeerRequest + * @static + * @param {neutrinorpc.DisconnectPeerRequest} message DisconnectPeerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - GetBlockHeaderResponse.prototype.merkleroot = ""; + DisconnectPeerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.peer_addrs = ""; + if (message.peer_addrs != null && message.hasOwnProperty("peer_addrs")) + object.peer_addrs = message.peer_addrs; + return object; + }; /** - * GetBlockHeaderResponse time. - * @member {Long} time - * @memberof neutrinorpc.GetBlockHeaderResponse + * Converts this DisconnectPeerRequest to JSON. + * @function toJSON + * @memberof neutrinorpc.DisconnectPeerRequest * @instance + * @returns {Object.} JSON object */ - GetBlockHeaderResponse.prototype.time = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + DisconnectPeerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * GetBlockHeaderResponse nonce. - * @member {number} nonce - * @memberof neutrinorpc.GetBlockHeaderResponse - * @instance + * Gets the default type url for DisconnectPeerRequest + * @function getTypeUrl + * @memberof neutrinorpc.DisconnectPeerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - GetBlockHeaderResponse.prototype.nonce = 0; + DisconnectPeerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/neutrinorpc.DisconnectPeerRequest"; + }; - /** - * GetBlockHeaderResponse bits. - * @member {string} bits - * @memberof neutrinorpc.GetBlockHeaderResponse - * @instance - */ - GetBlockHeaderResponse.prototype.bits = ""; + return DisconnectPeerRequest; + })(); - /** - * GetBlockHeaderResponse ntx. - * @member {number} ntx - * @memberof neutrinorpc.GetBlockHeaderResponse - * @instance - */ - GetBlockHeaderResponse.prototype.ntx = 0; + neutrinorpc.DisconnectPeerResponse = (function() { /** - * GetBlockHeaderResponse previous_block_hash. - * @member {string} previous_block_hash - * @memberof neutrinorpc.GetBlockHeaderResponse - * @instance + * Properties of a DisconnectPeerResponse. + * @memberof neutrinorpc + * @interface IDisconnectPeerResponse */ - GetBlockHeaderResponse.prototype.previous_block_hash = ""; /** - * GetBlockHeaderResponse raw_hex. - * @member {Uint8Array} raw_hex - * @memberof neutrinorpc.GetBlockHeaderResponse - * @instance + * Constructs a new DisconnectPeerResponse. + * @memberof neutrinorpc + * @classdesc Represents a DisconnectPeerResponse. + * @implements IDisconnectPeerResponse + * @constructor + * @param {neutrinorpc.IDisconnectPeerResponse=} [properties] Properties to set */ - GetBlockHeaderResponse.prototype.raw_hex = $util.newBuffer([]); + function DisconnectPeerResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Creates a new GetBlockHeaderResponse instance using the specified properties. + * Creates a new DisconnectPeerResponse instance using the specified properties. * @function create - * @memberof neutrinorpc.GetBlockHeaderResponse + * @memberof neutrinorpc.DisconnectPeerResponse * @static - * @param {neutrinorpc.IGetBlockHeaderResponse=} [properties] Properties to set - * @returns {neutrinorpc.GetBlockHeaderResponse} GetBlockHeaderResponse instance + * @param {neutrinorpc.IDisconnectPeerResponse=} [properties] Properties to set + * @returns {neutrinorpc.DisconnectPeerResponse} DisconnectPeerResponse instance */ - GetBlockHeaderResponse.create = function create(properties) { - return new GetBlockHeaderResponse(properties); + DisconnectPeerResponse.create = function create(properties) { + return new DisconnectPeerResponse(properties); }; /** - * Encodes the specified GetBlockHeaderResponse message. Does not implicitly {@link neutrinorpc.GetBlockHeaderResponse.verify|verify} messages. + * Encodes the specified DisconnectPeerResponse message. Does not implicitly {@link neutrinorpc.DisconnectPeerResponse.verify|verify} messages. * @function encode - * @memberof neutrinorpc.GetBlockHeaderResponse + * @memberof neutrinorpc.DisconnectPeerResponse * @static - * @param {neutrinorpc.IGetBlockHeaderResponse} message GetBlockHeaderResponse message or plain object to encode + * @param {neutrinorpc.IDisconnectPeerResponse} message DisconnectPeerResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBlockHeaderResponse.encode = function encode(message, writer) { + DisconnectPeerResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); - if (message.confirmations != null && Object.hasOwnProperty.call(message, "confirmations")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.confirmations); - if (message.stripped_size != null && Object.hasOwnProperty.call(message, "stripped_size")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.stripped_size); - if (message.size != null && Object.hasOwnProperty.call(message, "size")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.size); - if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.weight); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.height); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.version); - if (message.version_hex != null && Object.hasOwnProperty.call(message, "version_hex")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.version_hex); - if (message.merkleroot != null && Object.hasOwnProperty.call(message, "merkleroot")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.merkleroot); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - writer.uint32(/* id 10, wireType 0 =*/80).int64(message.time); - if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce")) - writer.uint32(/* id 11, wireType 0 =*/88).uint32(message.nonce); - if (message.bits != null && Object.hasOwnProperty.call(message, "bits")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.bits); - if (message.ntx != null && Object.hasOwnProperty.call(message, "ntx")) - writer.uint32(/* id 13, wireType 0 =*/104).int32(message.ntx); - if (message.previous_block_hash != null && Object.hasOwnProperty.call(message, "previous_block_hash")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.previous_block_hash); - if (message.raw_hex != null && Object.hasOwnProperty.call(message, "raw_hex")) - writer.uint32(/* id 15, wireType 2 =*/122).bytes(message.raw_hex); return writer; }; /** - * Encodes the specified GetBlockHeaderResponse message, length delimited. Does not implicitly {@link neutrinorpc.GetBlockHeaderResponse.verify|verify} messages. + * Encodes the specified DisconnectPeerResponse message, length delimited. Does not implicitly {@link neutrinorpc.DisconnectPeerResponse.verify|verify} messages. * @function encodeDelimited - * @memberof neutrinorpc.GetBlockHeaderResponse + * @memberof neutrinorpc.DisconnectPeerResponse * @static - * @param {neutrinorpc.IGetBlockHeaderResponse} message GetBlockHeaderResponse message or plain object to encode + * @param {neutrinorpc.IDisconnectPeerResponse} message DisconnectPeerResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBlockHeaderResponse.encodeDelimited = function encodeDelimited(message, writer) { + DisconnectPeerResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetBlockHeaderResponse message from the specified reader or buffer. + * Decodes a DisconnectPeerResponse message from the specified reader or buffer. * @function decode - * @memberof neutrinorpc.GetBlockHeaderResponse + * @memberof neutrinorpc.DisconnectPeerResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {neutrinorpc.GetBlockHeaderResponse} GetBlockHeaderResponse + * @returns {neutrinorpc.DisconnectPeerResponse} DisconnectPeerResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBlockHeaderResponse.decode = function decode(reader, length) { + DisconnectPeerResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetBlockHeaderResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.DisconnectPeerResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.hash = reader.string(); - break; - } - case 2: { - message.confirmations = reader.int64(); - break; - } - case 3: { - message.stripped_size = reader.int64(); - break; - } - case 4: { - message.size = reader.int64(); - break; - } - case 5: { - message.weight = reader.int64(); - break; - } - case 6: { - message.height = reader.int32(); - break; - } - case 7: { - message.version = reader.int32(); - break; - } - case 8: { - message.version_hex = reader.string(); - break; - } - case 9: { - message.merkleroot = reader.string(); - break; - } - case 10: { - message.time = reader.int64(); - break; - } - case 11: { - message.nonce = reader.uint32(); - break; - } - case 12: { - message.bits = reader.string(); - break; - } - case 13: { - message.ntx = reader.int32(); - break; - } - case 14: { - message.previous_block_hash = reader.string(); - break; - } - case 15: { - message.raw_hex = reader.bytes(); - break; - } default: reader.skipType(tag & 7); break; @@ -81895,314 +82538,109 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Decodes a GetBlockHeaderResponse message from the specified reader or buffer, length delimited. + * Decodes a DisconnectPeerResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof neutrinorpc.GetBlockHeaderResponse + * @memberof neutrinorpc.DisconnectPeerResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutrinorpc.GetBlockHeaderResponse} GetBlockHeaderResponse + * @returns {neutrinorpc.DisconnectPeerResponse} DisconnectPeerResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBlockHeaderResponse.decodeDelimited = function decodeDelimited(reader) { + DisconnectPeerResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetBlockHeaderResponse message. + * Verifies a DisconnectPeerResponse message. * @function verify - * @memberof neutrinorpc.GetBlockHeaderResponse + * @memberof neutrinorpc.DisconnectPeerResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetBlockHeaderResponse.verify = function verify(message) { + DisconnectPeerResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!$util.isString(message.hash)) - return "hash: string expected"; - if (message.confirmations != null && message.hasOwnProperty("confirmations")) - if (!$util.isInteger(message.confirmations) && !(message.confirmations && $util.isInteger(message.confirmations.low) && $util.isInteger(message.confirmations.high))) - return "confirmations: integer|Long expected"; - if (message.stripped_size != null && message.hasOwnProperty("stripped_size")) - if (!$util.isInteger(message.stripped_size) && !(message.stripped_size && $util.isInteger(message.stripped_size.low) && $util.isInteger(message.stripped_size.high))) - return "stripped_size: integer|Long expected"; - if (message.size != null && message.hasOwnProperty("size")) - if (!$util.isInteger(message.size) && !(message.size && $util.isInteger(message.size.low) && $util.isInteger(message.size.high))) - return "size: integer|Long expected"; - if (message.weight != null && message.hasOwnProperty("weight")) - if (!$util.isInteger(message.weight) && !(message.weight && $util.isInteger(message.weight.low) && $util.isInteger(message.weight.high))) - return "weight: integer|Long expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height)) - return "height: integer expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - if (message.version_hex != null && message.hasOwnProperty("version_hex")) - if (!$util.isString(message.version_hex)) - return "version_hex: string expected"; - if (message.merkleroot != null && message.hasOwnProperty("merkleroot")) - if (!$util.isString(message.merkleroot)) - return "merkleroot: string expected"; - if (message.time != null && message.hasOwnProperty("time")) - if (!$util.isInteger(message.time) && !(message.time && $util.isInteger(message.time.low) && $util.isInteger(message.time.high))) - return "time: integer|Long expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce)) - return "nonce: integer expected"; - if (message.bits != null && message.hasOwnProperty("bits")) - if (!$util.isString(message.bits)) - return "bits: string expected"; - if (message.ntx != null && message.hasOwnProperty("ntx")) - if (!$util.isInteger(message.ntx)) - return "ntx: integer expected"; - if (message.previous_block_hash != null && message.hasOwnProperty("previous_block_hash")) - if (!$util.isString(message.previous_block_hash)) - return "previous_block_hash: string expected"; - if (message.raw_hex != null && message.hasOwnProperty("raw_hex")) - if (!(message.raw_hex && typeof message.raw_hex.length === "number" || $util.isString(message.raw_hex))) - return "raw_hex: buffer expected"; return null; }; /** - * Creates a GetBlockHeaderResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DisconnectPeerResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof neutrinorpc.GetBlockHeaderResponse + * @memberof neutrinorpc.DisconnectPeerResponse * @static * @param {Object.} object Plain object - * @returns {neutrinorpc.GetBlockHeaderResponse} GetBlockHeaderResponse + * @returns {neutrinorpc.DisconnectPeerResponse} DisconnectPeerResponse */ - GetBlockHeaderResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutrinorpc.GetBlockHeaderResponse) + DisconnectPeerResponse.fromObject = function fromObject(object) { + if (object instanceof $root.neutrinorpc.DisconnectPeerResponse) return object; - let message = new $root.neutrinorpc.GetBlockHeaderResponse(); - if (object.hash != null) - message.hash = String(object.hash); - if (object.confirmations != null) - if ($util.Long) - (message.confirmations = $util.Long.fromValue(object.confirmations)).unsigned = false; - else if (typeof object.confirmations === "string") - message.confirmations = parseInt(object.confirmations, 10); - else if (typeof object.confirmations === "number") - message.confirmations = object.confirmations; - else if (typeof object.confirmations === "object") - message.confirmations = new $util.LongBits(object.confirmations.low >>> 0, object.confirmations.high >>> 0).toNumber(); - if (object.stripped_size != null) - if ($util.Long) - (message.stripped_size = $util.Long.fromValue(object.stripped_size)).unsigned = false; - else if (typeof object.stripped_size === "string") - message.stripped_size = parseInt(object.stripped_size, 10); - else if (typeof object.stripped_size === "number") - message.stripped_size = object.stripped_size; - else if (typeof object.stripped_size === "object") - message.stripped_size = new $util.LongBits(object.stripped_size.low >>> 0, object.stripped_size.high >>> 0).toNumber(); - if (object.size != null) - if ($util.Long) - (message.size = $util.Long.fromValue(object.size)).unsigned = false; - else if (typeof object.size === "string") - message.size = parseInt(object.size, 10); - else if (typeof object.size === "number") - message.size = object.size; - else if (typeof object.size === "object") - message.size = new $util.LongBits(object.size.low >>> 0, object.size.high >>> 0).toNumber(); - if (object.weight != null) - if ($util.Long) - (message.weight = $util.Long.fromValue(object.weight)).unsigned = false; - else if (typeof object.weight === "string") - message.weight = parseInt(object.weight, 10); - else if (typeof object.weight === "number") - message.weight = object.weight; - else if (typeof object.weight === "object") - message.weight = new $util.LongBits(object.weight.low >>> 0, object.weight.high >>> 0).toNumber(); - if (object.height != null) - message.height = object.height | 0; - if (object.version != null) - message.version = object.version | 0; - if (object.version_hex != null) - message.version_hex = String(object.version_hex); - if (object.merkleroot != null) - message.merkleroot = String(object.merkleroot); - if (object.time != null) - if ($util.Long) - (message.time = $util.Long.fromValue(object.time)).unsigned = false; - else if (typeof object.time === "string") - message.time = parseInt(object.time, 10); - else if (typeof object.time === "number") - message.time = object.time; - else if (typeof object.time === "object") - message.time = new $util.LongBits(object.time.low >>> 0, object.time.high >>> 0).toNumber(); - if (object.nonce != null) - message.nonce = object.nonce >>> 0; - if (object.bits != null) - message.bits = String(object.bits); - if (object.ntx != null) - message.ntx = object.ntx | 0; - if (object.previous_block_hash != null) - message.previous_block_hash = String(object.previous_block_hash); - if (object.raw_hex != null) - if (typeof object.raw_hex === "string") - $util.base64.decode(object.raw_hex, message.raw_hex = $util.newBuffer($util.base64.length(object.raw_hex)), 0); - else if (object.raw_hex.length >= 0) - message.raw_hex = object.raw_hex; - return message; + return new $root.neutrinorpc.DisconnectPeerResponse(); }; /** - * Creates a plain object from a GetBlockHeaderResponse message. Also converts values to other types if specified. + * Creates a plain object from a DisconnectPeerResponse message. Also converts values to other types if specified. * @function toObject - * @memberof neutrinorpc.GetBlockHeaderResponse + * @memberof neutrinorpc.DisconnectPeerResponse * @static - * @param {neutrinorpc.GetBlockHeaderResponse} message GetBlockHeaderResponse + * @param {neutrinorpc.DisconnectPeerResponse} message DisconnectPeerResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetBlockHeaderResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - object.hash = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.confirmations = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.confirmations = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.stripped_size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.stripped_size = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.size = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.weight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.weight = options.longs === String ? "0" : 0; - object.height = 0; - object.version = 0; - object.version_hex = ""; - object.merkleroot = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.time = options.longs === String ? "0" : 0; - object.nonce = 0; - object.bits = ""; - object.ntx = 0; - object.previous_block_hash = ""; - if (options.bytes === String) - object.raw_hex = ""; - else { - object.raw_hex = []; - if (options.bytes !== Array) - object.raw_hex = $util.newBuffer(object.raw_hex); - } - } - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = message.hash; - if (message.confirmations != null && message.hasOwnProperty("confirmations")) - if (typeof message.confirmations === "number") - object.confirmations = options.longs === String ? String(message.confirmations) : message.confirmations; - else - object.confirmations = options.longs === String ? $util.Long.prototype.toString.call(message.confirmations) : options.longs === Number ? new $util.LongBits(message.confirmations.low >>> 0, message.confirmations.high >>> 0).toNumber() : message.confirmations; - if (message.stripped_size != null && message.hasOwnProperty("stripped_size")) - if (typeof message.stripped_size === "number") - object.stripped_size = options.longs === String ? String(message.stripped_size) : message.stripped_size; - else - object.stripped_size = options.longs === String ? $util.Long.prototype.toString.call(message.stripped_size) : options.longs === Number ? new $util.LongBits(message.stripped_size.low >>> 0, message.stripped_size.high >>> 0).toNumber() : message.stripped_size; - if (message.size != null && message.hasOwnProperty("size")) - if (typeof message.size === "number") - object.size = options.longs === String ? String(message.size) : message.size; - else - object.size = options.longs === String ? $util.Long.prototype.toString.call(message.size) : options.longs === Number ? new $util.LongBits(message.size.low >>> 0, message.size.high >>> 0).toNumber() : message.size; - if (message.weight != null && message.hasOwnProperty("weight")) - if (typeof message.weight === "number") - object.weight = options.longs === String ? String(message.weight) : message.weight; - else - object.weight = options.longs === String ? $util.Long.prototype.toString.call(message.weight) : options.longs === Number ? new $util.LongBits(message.weight.low >>> 0, message.weight.high >>> 0).toNumber() : message.weight; - if (message.height != null && message.hasOwnProperty("height")) - object.height = message.height; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.version_hex != null && message.hasOwnProperty("version_hex")) - object.version_hex = message.version_hex; - if (message.merkleroot != null && message.hasOwnProperty("merkleroot")) - object.merkleroot = message.merkleroot; - if (message.time != null && message.hasOwnProperty("time")) - if (typeof message.time === "number") - object.time = options.longs === String ? String(message.time) : message.time; - else - object.time = options.longs === String ? $util.Long.prototype.toString.call(message.time) : options.longs === Number ? new $util.LongBits(message.time.low >>> 0, message.time.high >>> 0).toNumber() : message.time; - if (message.nonce != null && message.hasOwnProperty("nonce")) - object.nonce = message.nonce; - if (message.bits != null && message.hasOwnProperty("bits")) - object.bits = message.bits; - if (message.ntx != null && message.hasOwnProperty("ntx")) - object.ntx = message.ntx; - if (message.previous_block_hash != null && message.hasOwnProperty("previous_block_hash")) - object.previous_block_hash = message.previous_block_hash; - if (message.raw_hex != null && message.hasOwnProperty("raw_hex")) - object.raw_hex = options.bytes === String ? $util.base64.encode(message.raw_hex, 0, message.raw_hex.length) : options.bytes === Array ? Array.prototype.slice.call(message.raw_hex) : message.raw_hex; - return object; + DisconnectPeerResponse.toObject = function toObject() { + return {}; }; /** - * Converts this GetBlockHeaderResponse to JSON. + * Converts this DisconnectPeerResponse to JSON. * @function toJSON - * @memberof neutrinorpc.GetBlockHeaderResponse + * @memberof neutrinorpc.DisconnectPeerResponse * @instance * @returns {Object.} JSON object */ - GetBlockHeaderResponse.prototype.toJSON = function toJSON() { + DisconnectPeerResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetBlockHeaderResponse + * Gets the default type url for DisconnectPeerResponse * @function getTypeUrl - * @memberof neutrinorpc.GetBlockHeaderResponse + * @memberof neutrinorpc.DisconnectPeerResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetBlockHeaderResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DisconnectPeerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/neutrinorpc.GetBlockHeaderResponse"; + return typeUrlPrefix + "/neutrinorpc.DisconnectPeerResponse"; }; - return GetBlockHeaderResponse; + return DisconnectPeerResponse; })(); - neutrinorpc.GetBlockRequest = (function() { + neutrinorpc.IsBannedRequest = (function() { /** - * Properties of a GetBlockRequest. + * Properties of an IsBannedRequest. * @memberof neutrinorpc - * @interface IGetBlockRequest - * @property {string|null} [hash] GetBlockRequest hash + * @interface IIsBannedRequest + * @property {string|null} [peer_addrs] IsBannedRequest peer_addrs */ /** - * Constructs a new GetBlockRequest. + * Constructs a new IsBannedRequest. * @memberof neutrinorpc - * @classdesc Represents a GetBlockRequest. - * @implements IGetBlockRequest + * @classdesc Represents an IsBannedRequest. + * @implements IIsBannedRequest * @constructor - * @param {neutrinorpc.IGetBlockRequest=} [properties] Properties to set + * @param {neutrinorpc.IIsBannedRequest=} [properties] Properties to set */ - function GetBlockRequest(properties) { + function IsBannedRequest(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -82210,75 +82648,75 @@ export const neutrinorpc = $root.neutrinorpc = (() => { } /** - * GetBlockRequest hash. - * @member {string} hash - * @memberof neutrinorpc.GetBlockRequest + * IsBannedRequest peer_addrs. + * @member {string} peer_addrs + * @memberof neutrinorpc.IsBannedRequest * @instance */ - GetBlockRequest.prototype.hash = ""; + IsBannedRequest.prototype.peer_addrs = ""; /** - * Creates a new GetBlockRequest instance using the specified properties. + * Creates a new IsBannedRequest instance using the specified properties. * @function create - * @memberof neutrinorpc.GetBlockRequest + * @memberof neutrinorpc.IsBannedRequest * @static - * @param {neutrinorpc.IGetBlockRequest=} [properties] Properties to set - * @returns {neutrinorpc.GetBlockRequest} GetBlockRequest instance + * @param {neutrinorpc.IIsBannedRequest=} [properties] Properties to set + * @returns {neutrinorpc.IsBannedRequest} IsBannedRequest instance */ - GetBlockRequest.create = function create(properties) { - return new GetBlockRequest(properties); + IsBannedRequest.create = function create(properties) { + return new IsBannedRequest(properties); }; /** - * Encodes the specified GetBlockRequest message. Does not implicitly {@link neutrinorpc.GetBlockRequest.verify|verify} messages. + * Encodes the specified IsBannedRequest message. Does not implicitly {@link neutrinorpc.IsBannedRequest.verify|verify} messages. * @function encode - * @memberof neutrinorpc.GetBlockRequest + * @memberof neutrinorpc.IsBannedRequest * @static - * @param {neutrinorpc.IGetBlockRequest} message GetBlockRequest message or plain object to encode + * @param {neutrinorpc.IIsBannedRequest} message IsBannedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBlockRequest.encode = function encode(message, writer) { + IsBannedRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); + if (message.peer_addrs != null && Object.hasOwnProperty.call(message, "peer_addrs")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.peer_addrs); return writer; }; /** - * Encodes the specified GetBlockRequest message, length delimited. Does not implicitly {@link neutrinorpc.GetBlockRequest.verify|verify} messages. + * Encodes the specified IsBannedRequest message, length delimited. Does not implicitly {@link neutrinorpc.IsBannedRequest.verify|verify} messages. * @function encodeDelimited - * @memberof neutrinorpc.GetBlockRequest + * @memberof neutrinorpc.IsBannedRequest * @static - * @param {neutrinorpc.IGetBlockRequest} message GetBlockRequest message or plain object to encode + * @param {neutrinorpc.IIsBannedRequest} message IsBannedRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBlockRequest.encodeDelimited = function encodeDelimited(message, writer) { + IsBannedRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetBlockRequest message from the specified reader or buffer. + * Decodes an IsBannedRequest message from the specified reader or buffer. * @function decode - * @memberof neutrinorpc.GetBlockRequest + * @memberof neutrinorpc.IsBannedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {neutrinorpc.GetBlockRequest} GetBlockRequest + * @returns {neutrinorpc.IsBannedRequest} IsBannedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBlockRequest.decode = function decode(reader, length) { + IsBannedRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetBlockRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.IsBannedRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.hash = reader.string(); + message.peer_addrs = reader.string(); break; } default: @@ -82290,138 +82728,122 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Decodes a GetBlockRequest message from the specified reader or buffer, length delimited. + * Decodes an IsBannedRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof neutrinorpc.GetBlockRequest + * @memberof neutrinorpc.IsBannedRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutrinorpc.GetBlockRequest} GetBlockRequest + * @returns {neutrinorpc.IsBannedRequest} IsBannedRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBlockRequest.decodeDelimited = function decodeDelimited(reader) { + IsBannedRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetBlockRequest message. + * Verifies an IsBannedRequest message. * @function verify - * @memberof neutrinorpc.GetBlockRequest + * @memberof neutrinorpc.IsBannedRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetBlockRequest.verify = function verify(message) { + IsBannedRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!$util.isString(message.hash)) - return "hash: string expected"; + if (message.peer_addrs != null && message.hasOwnProperty("peer_addrs")) + if (!$util.isString(message.peer_addrs)) + return "peer_addrs: string expected"; return null; }; /** - * Creates a GetBlockRequest message from a plain object. Also converts values to their respective internal types. + * Creates an IsBannedRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof neutrinorpc.GetBlockRequest + * @memberof neutrinorpc.IsBannedRequest * @static * @param {Object.} object Plain object - * @returns {neutrinorpc.GetBlockRequest} GetBlockRequest + * @returns {neutrinorpc.IsBannedRequest} IsBannedRequest */ - GetBlockRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutrinorpc.GetBlockRequest) + IsBannedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.neutrinorpc.IsBannedRequest) return object; - let message = new $root.neutrinorpc.GetBlockRequest(); - if (object.hash != null) - message.hash = String(object.hash); + let message = new $root.neutrinorpc.IsBannedRequest(); + if (object.peer_addrs != null) + message.peer_addrs = String(object.peer_addrs); return message; }; /** - * Creates a plain object from a GetBlockRequest message. Also converts values to other types if specified. + * Creates a plain object from an IsBannedRequest message. Also converts values to other types if specified. * @function toObject - * @memberof neutrinorpc.GetBlockRequest + * @memberof neutrinorpc.IsBannedRequest * @static - * @param {neutrinorpc.GetBlockRequest} message GetBlockRequest + * @param {neutrinorpc.IsBannedRequest} message IsBannedRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetBlockRequest.toObject = function toObject(message, options) { + IsBannedRequest.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; if (options.defaults) - object.hash = ""; - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = message.hash; + object.peer_addrs = ""; + if (message.peer_addrs != null && message.hasOwnProperty("peer_addrs")) + object.peer_addrs = message.peer_addrs; return object; }; /** - * Converts this GetBlockRequest to JSON. + * Converts this IsBannedRequest to JSON. * @function toJSON - * @memberof neutrinorpc.GetBlockRequest + * @memberof neutrinorpc.IsBannedRequest * @instance * @returns {Object.} JSON object */ - GetBlockRequest.prototype.toJSON = function toJSON() { + IsBannedRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetBlockRequest + * Gets the default type url for IsBannedRequest * @function getTypeUrl - * @memberof neutrinorpc.GetBlockRequest + * @memberof neutrinorpc.IsBannedRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetBlockRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + IsBannedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/neutrinorpc.GetBlockRequest"; + return typeUrlPrefix + "/neutrinorpc.IsBannedRequest"; }; - return GetBlockRequest; + return IsBannedRequest; })(); - neutrinorpc.GetBlockResponse = (function() { + neutrinorpc.IsBannedResponse = (function() { /** - * Properties of a GetBlockResponse. + * Properties of an IsBannedResponse. * @memberof neutrinorpc - * @interface IGetBlockResponse - * @property {string|null} [hash] GetBlockResponse hash - * @property {Long|null} [confirmations] GetBlockResponse confirmations - * @property {Long|null} [stripped_size] GetBlockResponse stripped_size - * @property {Long|null} [size] GetBlockResponse size - * @property {Long|null} [weight] GetBlockResponse weight - * @property {number|null} [height] GetBlockResponse height - * @property {number|null} [version] GetBlockResponse version - * @property {string|null} [version_hex] GetBlockResponse version_hex - * @property {string|null} [merkleroot] GetBlockResponse merkleroot - * @property {Array.|null} [tx] GetBlockResponse tx - * @property {Long|null} [time] GetBlockResponse time - * @property {number|null} [nonce] GetBlockResponse nonce - * @property {string|null} [bits] GetBlockResponse bits - * @property {number|null} [ntx] GetBlockResponse ntx - * @property {string|null} [previous_block_hash] GetBlockResponse previous_block_hash - * @property {Uint8Array|null} [raw_hex] GetBlockResponse raw_hex + * @interface IIsBannedResponse + * @property {boolean|null} [banned] IsBannedResponse banned */ /** - * Constructs a new GetBlockResponse. + * Constructs a new IsBannedResponse. * @memberof neutrinorpc - * @classdesc Represents a GetBlockResponse. - * @implements IGetBlockResponse + * @classdesc Represents an IsBannedResponse. + * @implements IIsBannedResponse * @constructor - * @param {neutrinorpc.IGetBlockResponse=} [properties] Properties to set + * @param {neutrinorpc.IIsBannedResponse=} [properties] Properties to set */ - function GetBlockResponse(properties) { - this.tx = []; + function IsBannedResponse(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -82429,288 +82851,75 @@ export const neutrinorpc = $root.neutrinorpc = (() => { } /** - * GetBlockResponse hash. - * @member {string} hash - * @memberof neutrinorpc.GetBlockResponse - * @instance - */ - GetBlockResponse.prototype.hash = ""; - - /** - * GetBlockResponse confirmations. - * @member {Long} confirmations - * @memberof neutrinorpc.GetBlockResponse - * @instance - */ - GetBlockResponse.prototype.confirmations = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * GetBlockResponse stripped_size. - * @member {Long} stripped_size - * @memberof neutrinorpc.GetBlockResponse - * @instance - */ - GetBlockResponse.prototype.stripped_size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * GetBlockResponse size. - * @member {Long} size - * @memberof neutrinorpc.GetBlockResponse - * @instance - */ - GetBlockResponse.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * GetBlockResponse weight. - * @member {Long} weight - * @memberof neutrinorpc.GetBlockResponse - * @instance - */ - GetBlockResponse.prototype.weight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * GetBlockResponse height. - * @member {number} height - * @memberof neutrinorpc.GetBlockResponse - * @instance - */ - GetBlockResponse.prototype.height = 0; - - /** - * GetBlockResponse version. - * @member {number} version - * @memberof neutrinorpc.GetBlockResponse - * @instance - */ - GetBlockResponse.prototype.version = 0; - - /** - * GetBlockResponse version_hex. - * @member {string} version_hex - * @memberof neutrinorpc.GetBlockResponse - * @instance - */ - GetBlockResponse.prototype.version_hex = ""; - - /** - * GetBlockResponse merkleroot. - * @member {string} merkleroot - * @memberof neutrinorpc.GetBlockResponse - * @instance - */ - GetBlockResponse.prototype.merkleroot = ""; - - /** - * GetBlockResponse tx. - * @member {Array.} tx - * @memberof neutrinorpc.GetBlockResponse - * @instance - */ - GetBlockResponse.prototype.tx = $util.emptyArray; - - /** - * GetBlockResponse time. - * @member {Long} time - * @memberof neutrinorpc.GetBlockResponse - * @instance - */ - GetBlockResponse.prototype.time = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * GetBlockResponse nonce. - * @member {number} nonce - * @memberof neutrinorpc.GetBlockResponse - * @instance - */ - GetBlockResponse.prototype.nonce = 0; - - /** - * GetBlockResponse bits. - * @member {string} bits - * @memberof neutrinorpc.GetBlockResponse - * @instance - */ - GetBlockResponse.prototype.bits = ""; - - /** - * GetBlockResponse ntx. - * @member {number} ntx - * @memberof neutrinorpc.GetBlockResponse - * @instance - */ - GetBlockResponse.prototype.ntx = 0; - - /** - * GetBlockResponse previous_block_hash. - * @member {string} previous_block_hash - * @memberof neutrinorpc.GetBlockResponse - * @instance - */ - GetBlockResponse.prototype.previous_block_hash = ""; - - /** - * GetBlockResponse raw_hex. - * @member {Uint8Array} raw_hex - * @memberof neutrinorpc.GetBlockResponse + * IsBannedResponse banned. + * @member {boolean} banned + * @memberof neutrinorpc.IsBannedResponse * @instance */ - GetBlockResponse.prototype.raw_hex = $util.newBuffer([]); + IsBannedResponse.prototype.banned = false; /** - * Creates a new GetBlockResponse instance using the specified properties. + * Creates a new IsBannedResponse instance using the specified properties. * @function create - * @memberof neutrinorpc.GetBlockResponse + * @memberof neutrinorpc.IsBannedResponse * @static - * @param {neutrinorpc.IGetBlockResponse=} [properties] Properties to set - * @returns {neutrinorpc.GetBlockResponse} GetBlockResponse instance + * @param {neutrinorpc.IIsBannedResponse=} [properties] Properties to set + * @returns {neutrinorpc.IsBannedResponse} IsBannedResponse instance */ - GetBlockResponse.create = function create(properties) { - return new GetBlockResponse(properties); + IsBannedResponse.create = function create(properties) { + return new IsBannedResponse(properties); }; /** - * Encodes the specified GetBlockResponse message. Does not implicitly {@link neutrinorpc.GetBlockResponse.verify|verify} messages. + * Encodes the specified IsBannedResponse message. Does not implicitly {@link neutrinorpc.IsBannedResponse.verify|verify} messages. * @function encode - * @memberof neutrinorpc.GetBlockResponse + * @memberof neutrinorpc.IsBannedResponse * @static - * @param {neutrinorpc.IGetBlockResponse} message GetBlockResponse message or plain object to encode + * @param {neutrinorpc.IIsBannedResponse} message IsBannedResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBlockResponse.encode = function encode(message, writer) { + IsBannedResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); - if (message.confirmations != null && Object.hasOwnProperty.call(message, "confirmations")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.confirmations); - if (message.stripped_size != null && Object.hasOwnProperty.call(message, "stripped_size")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.stripped_size); - if (message.size != null && Object.hasOwnProperty.call(message, "size")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.size); - if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.weight); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.height); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.version); - if (message.version_hex != null && Object.hasOwnProperty.call(message, "version_hex")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.version_hex); - if (message.merkleroot != null && Object.hasOwnProperty.call(message, "merkleroot")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.merkleroot); - if (message.tx != null && message.tx.length) - for (let i = 0; i < message.tx.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.tx[i]); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - writer.uint32(/* id 11, wireType 0 =*/88).int64(message.time); - if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce")) - writer.uint32(/* id 12, wireType 0 =*/96).uint32(message.nonce); - if (message.bits != null && Object.hasOwnProperty.call(message, "bits")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.bits); - if (message.ntx != null && Object.hasOwnProperty.call(message, "ntx")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.ntx); - if (message.previous_block_hash != null && Object.hasOwnProperty.call(message, "previous_block_hash")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.previous_block_hash); - if (message.raw_hex != null && Object.hasOwnProperty.call(message, "raw_hex")) - writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.raw_hex); + if (message.banned != null && Object.hasOwnProperty.call(message, "banned")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.banned); return writer; }; /** - * Encodes the specified GetBlockResponse message, length delimited. Does not implicitly {@link neutrinorpc.GetBlockResponse.verify|verify} messages. + * Encodes the specified IsBannedResponse message, length delimited. Does not implicitly {@link neutrinorpc.IsBannedResponse.verify|verify} messages. * @function encodeDelimited - * @memberof neutrinorpc.GetBlockResponse + * @memberof neutrinorpc.IsBannedResponse * @static - * @param {neutrinorpc.IGetBlockResponse} message GetBlockResponse message or plain object to encode + * @param {neutrinorpc.IIsBannedResponse} message IsBannedResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBlockResponse.encodeDelimited = function encodeDelimited(message, writer) { + IsBannedResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetBlockResponse message from the specified reader or buffer. + * Decodes an IsBannedResponse message from the specified reader or buffer. * @function decode - * @memberof neutrinorpc.GetBlockResponse + * @memberof neutrinorpc.IsBannedResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {neutrinorpc.GetBlockResponse} GetBlockResponse + * @returns {neutrinorpc.IsBannedResponse} IsBannedResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBlockResponse.decode = function decode(reader, length) { + IsBannedResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetBlockResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.IsBannedResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.hash = reader.string(); - break; - } - case 2: { - message.confirmations = reader.int64(); - break; - } - case 3: { - message.stripped_size = reader.int64(); - break; - } - case 4: { - message.size = reader.int64(); - break; - } - case 5: { - message.weight = reader.int64(); - break; - } - case 6: { - message.height = reader.int32(); - break; - } - case 7: { - message.version = reader.int32(); - break; - } - case 8: { - message.version_hex = reader.string(); - break; - } - case 9: { - message.merkleroot = reader.string(); - break; - } - case 10: { - if (!(message.tx && message.tx.length)) - message.tx = []; - message.tx.push(reader.string()); - break; - } - case 11: { - message.time = reader.int64(); - break; - } - case 12: { - message.nonce = reader.uint32(); - break; - } - case 13: { - message.bits = reader.string(); - break; - } - case 14: { - message.ntx = reader.int32(); - break; - } - case 15: { - message.previous_block_hash = reader.string(); - break; - } - case 16: { - message.raw_hex = reader.bytes(); + message.banned = reader.bool(); break; } default: @@ -82722,335 +82931,122 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Decodes a GetBlockResponse message from the specified reader or buffer, length delimited. + * Decodes an IsBannedResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof neutrinorpc.GetBlockResponse + * @memberof neutrinorpc.IsBannedResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutrinorpc.GetBlockResponse} GetBlockResponse + * @returns {neutrinorpc.IsBannedResponse} IsBannedResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBlockResponse.decodeDelimited = function decodeDelimited(reader) { + IsBannedResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetBlockResponse message. + * Verifies an IsBannedResponse message. * @function verify - * @memberof neutrinorpc.GetBlockResponse + * @memberof neutrinorpc.IsBannedResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetBlockResponse.verify = function verify(message) { + IsBannedResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.hash != null && message.hasOwnProperty("hash")) - if (!$util.isString(message.hash)) - return "hash: string expected"; - if (message.confirmations != null && message.hasOwnProperty("confirmations")) - if (!$util.isInteger(message.confirmations) && !(message.confirmations && $util.isInteger(message.confirmations.low) && $util.isInteger(message.confirmations.high))) - return "confirmations: integer|Long expected"; - if (message.stripped_size != null && message.hasOwnProperty("stripped_size")) - if (!$util.isInteger(message.stripped_size) && !(message.stripped_size && $util.isInteger(message.stripped_size.low) && $util.isInteger(message.stripped_size.high))) - return "stripped_size: integer|Long expected"; - if (message.size != null && message.hasOwnProperty("size")) - if (!$util.isInteger(message.size) && !(message.size && $util.isInteger(message.size.low) && $util.isInteger(message.size.high))) - return "size: integer|Long expected"; - if (message.weight != null && message.hasOwnProperty("weight")) - if (!$util.isInteger(message.weight) && !(message.weight && $util.isInteger(message.weight.low) && $util.isInteger(message.weight.high))) - return "weight: integer|Long expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height)) - return "height: integer expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - if (message.version_hex != null && message.hasOwnProperty("version_hex")) - if (!$util.isString(message.version_hex)) - return "version_hex: string expected"; - if (message.merkleroot != null && message.hasOwnProperty("merkleroot")) - if (!$util.isString(message.merkleroot)) - return "merkleroot: string expected"; - if (message.tx != null && message.hasOwnProperty("tx")) { - if (!Array.isArray(message.tx)) - return "tx: array expected"; - for (let i = 0; i < message.tx.length; ++i) - if (!$util.isString(message.tx[i])) - return "tx: string[] expected"; - } - if (message.time != null && message.hasOwnProperty("time")) - if (!$util.isInteger(message.time) && !(message.time && $util.isInteger(message.time.low) && $util.isInteger(message.time.high))) - return "time: integer|Long expected"; - if (message.nonce != null && message.hasOwnProperty("nonce")) - if (!$util.isInteger(message.nonce)) - return "nonce: integer expected"; - if (message.bits != null && message.hasOwnProperty("bits")) - if (!$util.isString(message.bits)) - return "bits: string expected"; - if (message.ntx != null && message.hasOwnProperty("ntx")) - if (!$util.isInteger(message.ntx)) - return "ntx: integer expected"; - if (message.previous_block_hash != null && message.hasOwnProperty("previous_block_hash")) - if (!$util.isString(message.previous_block_hash)) - return "previous_block_hash: string expected"; - if (message.raw_hex != null && message.hasOwnProperty("raw_hex")) - if (!(message.raw_hex && typeof message.raw_hex.length === "number" || $util.isString(message.raw_hex))) - return "raw_hex: buffer expected"; + if (message.banned != null && message.hasOwnProperty("banned")) + if (typeof message.banned !== "boolean") + return "banned: boolean expected"; return null; }; /** - * Creates a GetBlockResponse message from a plain object. Also converts values to their respective internal types. + * Creates an IsBannedResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof neutrinorpc.GetBlockResponse + * @memberof neutrinorpc.IsBannedResponse * @static * @param {Object.} object Plain object - * @returns {neutrinorpc.GetBlockResponse} GetBlockResponse + * @returns {neutrinorpc.IsBannedResponse} IsBannedResponse */ - GetBlockResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutrinorpc.GetBlockResponse) + IsBannedResponse.fromObject = function fromObject(object) { + if (object instanceof $root.neutrinorpc.IsBannedResponse) return object; - let message = new $root.neutrinorpc.GetBlockResponse(); - if (object.hash != null) - message.hash = String(object.hash); - if (object.confirmations != null) - if ($util.Long) - (message.confirmations = $util.Long.fromValue(object.confirmations)).unsigned = false; - else if (typeof object.confirmations === "string") - message.confirmations = parseInt(object.confirmations, 10); - else if (typeof object.confirmations === "number") - message.confirmations = object.confirmations; - else if (typeof object.confirmations === "object") - message.confirmations = new $util.LongBits(object.confirmations.low >>> 0, object.confirmations.high >>> 0).toNumber(); - if (object.stripped_size != null) - if ($util.Long) - (message.stripped_size = $util.Long.fromValue(object.stripped_size)).unsigned = false; - else if (typeof object.stripped_size === "string") - message.stripped_size = parseInt(object.stripped_size, 10); - else if (typeof object.stripped_size === "number") - message.stripped_size = object.stripped_size; - else if (typeof object.stripped_size === "object") - message.stripped_size = new $util.LongBits(object.stripped_size.low >>> 0, object.stripped_size.high >>> 0).toNumber(); - if (object.size != null) - if ($util.Long) - (message.size = $util.Long.fromValue(object.size)).unsigned = false; - else if (typeof object.size === "string") - message.size = parseInt(object.size, 10); - else if (typeof object.size === "number") - message.size = object.size; - else if (typeof object.size === "object") - message.size = new $util.LongBits(object.size.low >>> 0, object.size.high >>> 0).toNumber(); - if (object.weight != null) - if ($util.Long) - (message.weight = $util.Long.fromValue(object.weight)).unsigned = false; - else if (typeof object.weight === "string") - message.weight = parseInt(object.weight, 10); - else if (typeof object.weight === "number") - message.weight = object.weight; - else if (typeof object.weight === "object") - message.weight = new $util.LongBits(object.weight.low >>> 0, object.weight.high >>> 0).toNumber(); - if (object.height != null) - message.height = object.height | 0; - if (object.version != null) - message.version = object.version | 0; - if (object.version_hex != null) - message.version_hex = String(object.version_hex); - if (object.merkleroot != null) - message.merkleroot = String(object.merkleroot); - if (object.tx) { - if (!Array.isArray(object.tx)) - throw TypeError(".neutrinorpc.GetBlockResponse.tx: array expected"); - message.tx = []; - for (let i = 0; i < object.tx.length; ++i) - message.tx[i] = String(object.tx[i]); - } - if (object.time != null) - if ($util.Long) - (message.time = $util.Long.fromValue(object.time)).unsigned = false; - else if (typeof object.time === "string") - message.time = parseInt(object.time, 10); - else if (typeof object.time === "number") - message.time = object.time; - else if (typeof object.time === "object") - message.time = new $util.LongBits(object.time.low >>> 0, object.time.high >>> 0).toNumber(); - if (object.nonce != null) - message.nonce = object.nonce >>> 0; - if (object.bits != null) - message.bits = String(object.bits); - if (object.ntx != null) - message.ntx = object.ntx | 0; - if (object.previous_block_hash != null) - message.previous_block_hash = String(object.previous_block_hash); - if (object.raw_hex != null) - if (typeof object.raw_hex === "string") - $util.base64.decode(object.raw_hex, message.raw_hex = $util.newBuffer($util.base64.length(object.raw_hex)), 0); - else if (object.raw_hex.length >= 0) - message.raw_hex = object.raw_hex; + let message = new $root.neutrinorpc.IsBannedResponse(); + if (object.banned != null) + message.banned = Boolean(object.banned); return message; }; /** - * Creates a plain object from a GetBlockResponse message. Also converts values to other types if specified. + * Creates a plain object from an IsBannedResponse message. Also converts values to other types if specified. * @function toObject - * @memberof neutrinorpc.GetBlockResponse + * @memberof neutrinorpc.IsBannedResponse * @static - * @param {neutrinorpc.GetBlockResponse} message GetBlockResponse + * @param {neutrinorpc.IsBannedResponse} message IsBannedResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetBlockResponse.toObject = function toObject(message, options) { + IsBannedResponse.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.arrays || options.defaults) - object.tx = []; - if (options.defaults) { - object.hash = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.confirmations = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.confirmations = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.stripped_size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.stripped_size = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.size = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.weight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.weight = options.longs === String ? "0" : 0; - object.height = 0; - object.version = 0; - object.version_hex = ""; - object.merkleroot = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.time = options.longs === String ? "0" : 0; - object.nonce = 0; - object.bits = ""; - object.ntx = 0; - object.previous_block_hash = ""; - if (options.bytes === String) - object.raw_hex = ""; - else { - object.raw_hex = []; - if (options.bytes !== Array) - object.raw_hex = $util.newBuffer(object.raw_hex); - } - } - if (message.hash != null && message.hasOwnProperty("hash")) - object.hash = message.hash; - if (message.confirmations != null && message.hasOwnProperty("confirmations")) - if (typeof message.confirmations === "number") - object.confirmations = options.longs === String ? String(message.confirmations) : message.confirmations; - else - object.confirmations = options.longs === String ? $util.Long.prototype.toString.call(message.confirmations) : options.longs === Number ? new $util.LongBits(message.confirmations.low >>> 0, message.confirmations.high >>> 0).toNumber() : message.confirmations; - if (message.stripped_size != null && message.hasOwnProperty("stripped_size")) - if (typeof message.stripped_size === "number") - object.stripped_size = options.longs === String ? String(message.stripped_size) : message.stripped_size; - else - object.stripped_size = options.longs === String ? $util.Long.prototype.toString.call(message.stripped_size) : options.longs === Number ? new $util.LongBits(message.stripped_size.low >>> 0, message.stripped_size.high >>> 0).toNumber() : message.stripped_size; - if (message.size != null && message.hasOwnProperty("size")) - if (typeof message.size === "number") - object.size = options.longs === String ? String(message.size) : message.size; - else - object.size = options.longs === String ? $util.Long.prototype.toString.call(message.size) : options.longs === Number ? new $util.LongBits(message.size.low >>> 0, message.size.high >>> 0).toNumber() : message.size; - if (message.weight != null && message.hasOwnProperty("weight")) - if (typeof message.weight === "number") - object.weight = options.longs === String ? String(message.weight) : message.weight; - else - object.weight = options.longs === String ? $util.Long.prototype.toString.call(message.weight) : options.longs === Number ? new $util.LongBits(message.weight.low >>> 0, message.weight.high >>> 0).toNumber() : message.weight; - if (message.height != null && message.hasOwnProperty("height")) - object.height = message.height; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.version_hex != null && message.hasOwnProperty("version_hex")) - object.version_hex = message.version_hex; - if (message.merkleroot != null && message.hasOwnProperty("merkleroot")) - object.merkleroot = message.merkleroot; - if (message.tx && message.tx.length) { - object.tx = []; - for (let j = 0; j < message.tx.length; ++j) - object.tx[j] = message.tx[j]; - } - if (message.time != null && message.hasOwnProperty("time")) - if (typeof message.time === "number") - object.time = options.longs === String ? String(message.time) : message.time; - else - object.time = options.longs === String ? $util.Long.prototype.toString.call(message.time) : options.longs === Number ? new $util.LongBits(message.time.low >>> 0, message.time.high >>> 0).toNumber() : message.time; - if (message.nonce != null && message.hasOwnProperty("nonce")) - object.nonce = message.nonce; - if (message.bits != null && message.hasOwnProperty("bits")) - object.bits = message.bits; - if (message.ntx != null && message.hasOwnProperty("ntx")) - object.ntx = message.ntx; - if (message.previous_block_hash != null && message.hasOwnProperty("previous_block_hash")) - object.previous_block_hash = message.previous_block_hash; - if (message.raw_hex != null && message.hasOwnProperty("raw_hex")) - object.raw_hex = options.bytes === String ? $util.base64.encode(message.raw_hex, 0, message.raw_hex.length) : options.bytes === Array ? Array.prototype.slice.call(message.raw_hex) : message.raw_hex; + if (options.defaults) + object.banned = false; + if (message.banned != null && message.hasOwnProperty("banned")) + object.banned = message.banned; return object; }; /** - * Converts this GetBlockResponse to JSON. + * Converts this IsBannedResponse to JSON. * @function toJSON - * @memberof neutrinorpc.GetBlockResponse + * @memberof neutrinorpc.IsBannedResponse * @instance * @returns {Object.} JSON object */ - GetBlockResponse.prototype.toJSON = function toJSON() { + IsBannedResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetBlockResponse + * Gets the default type url for IsBannedResponse * @function getTypeUrl - * @memberof neutrinorpc.GetBlockResponse + * @memberof neutrinorpc.IsBannedResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetBlockResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + IsBannedResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/neutrinorpc.GetBlockResponse"; + return typeUrlPrefix + "/neutrinorpc.IsBannedResponse"; }; - return GetBlockResponse; + return IsBannedResponse; })(); - neutrinorpc.GetCFilterRequest = (function() { + neutrinorpc.GetBlockHeaderRequest = (function() { /** - * Properties of a GetCFilterRequest. + * Properties of a GetBlockHeaderRequest. * @memberof neutrinorpc - * @interface IGetCFilterRequest - * @property {string|null} [hash] GetCFilterRequest hash + * @interface IGetBlockHeaderRequest + * @property {string|null} [hash] GetBlockHeaderRequest hash */ /** - * Constructs a new GetCFilterRequest. + * Constructs a new GetBlockHeaderRequest. * @memberof neutrinorpc - * @classdesc Represents a GetCFilterRequest. - * @implements IGetCFilterRequest + * @classdesc Represents a GetBlockHeaderRequest. + * @implements IGetBlockHeaderRequest * @constructor - * @param {neutrinorpc.IGetCFilterRequest=} [properties] Properties to set + * @param {neutrinorpc.IGetBlockHeaderRequest=} [properties] Properties to set */ - function GetCFilterRequest(properties) { + function GetBlockHeaderRequest(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -83058,35 +83054,35 @@ export const neutrinorpc = $root.neutrinorpc = (() => { } /** - * GetCFilterRequest hash. + * GetBlockHeaderRequest hash. * @member {string} hash - * @memberof neutrinorpc.GetCFilterRequest + * @memberof neutrinorpc.GetBlockHeaderRequest * @instance */ - GetCFilterRequest.prototype.hash = ""; + GetBlockHeaderRequest.prototype.hash = ""; /** - * Creates a new GetCFilterRequest instance using the specified properties. + * Creates a new GetBlockHeaderRequest instance using the specified properties. * @function create - * @memberof neutrinorpc.GetCFilterRequest + * @memberof neutrinorpc.GetBlockHeaderRequest * @static - * @param {neutrinorpc.IGetCFilterRequest=} [properties] Properties to set - * @returns {neutrinorpc.GetCFilterRequest} GetCFilterRequest instance + * @param {neutrinorpc.IGetBlockHeaderRequest=} [properties] Properties to set + * @returns {neutrinorpc.GetBlockHeaderRequest} GetBlockHeaderRequest instance */ - GetCFilterRequest.create = function create(properties) { - return new GetCFilterRequest(properties); + GetBlockHeaderRequest.create = function create(properties) { + return new GetBlockHeaderRequest(properties); }; /** - * Encodes the specified GetCFilterRequest message. Does not implicitly {@link neutrinorpc.GetCFilterRequest.verify|verify} messages. + * Encodes the specified GetBlockHeaderRequest message. Does not implicitly {@link neutrinorpc.GetBlockHeaderRequest.verify|verify} messages. * @function encode - * @memberof neutrinorpc.GetCFilterRequest + * @memberof neutrinorpc.GetBlockHeaderRequest * @static - * @param {neutrinorpc.IGetCFilterRequest} message GetCFilterRequest message or plain object to encode + * @param {neutrinorpc.IGetBlockHeaderRequest} message GetBlockHeaderRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetCFilterRequest.encode = function encode(message, writer) { + GetBlockHeaderRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) @@ -83095,33 +83091,33 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Encodes the specified GetCFilterRequest message, length delimited. Does not implicitly {@link neutrinorpc.GetCFilterRequest.verify|verify} messages. + * Encodes the specified GetBlockHeaderRequest message, length delimited. Does not implicitly {@link neutrinorpc.GetBlockHeaderRequest.verify|verify} messages. * @function encodeDelimited - * @memberof neutrinorpc.GetCFilterRequest + * @memberof neutrinorpc.GetBlockHeaderRequest * @static - * @param {neutrinorpc.IGetCFilterRequest} message GetCFilterRequest message or plain object to encode + * @param {neutrinorpc.IGetBlockHeaderRequest} message GetBlockHeaderRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetCFilterRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetBlockHeaderRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetCFilterRequest message from the specified reader or buffer. + * Decodes a GetBlockHeaderRequest message from the specified reader or buffer. * @function decode - * @memberof neutrinorpc.GetCFilterRequest + * @memberof neutrinorpc.GetBlockHeaderRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {neutrinorpc.GetCFilterRequest} GetCFilterRequest + * @returns {neutrinorpc.GetBlockHeaderRequest} GetBlockHeaderRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetCFilterRequest.decode = function decode(reader, length) { + GetBlockHeaderRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetCFilterRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetBlockHeaderRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { @@ -83138,30 +83134,30 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Decodes a GetCFilterRequest message from the specified reader or buffer, length delimited. + * Decodes a GetBlockHeaderRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof neutrinorpc.GetCFilterRequest + * @memberof neutrinorpc.GetBlockHeaderRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutrinorpc.GetCFilterRequest} GetCFilterRequest + * @returns {neutrinorpc.GetBlockHeaderRequest} GetBlockHeaderRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetCFilterRequest.decodeDelimited = function decodeDelimited(reader) { + GetBlockHeaderRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetCFilterRequest message. + * Verifies a GetBlockHeaderRequest message. * @function verify - * @memberof neutrinorpc.GetCFilterRequest + * @memberof neutrinorpc.GetBlockHeaderRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetCFilterRequest.verify = function verify(message) { + GetBlockHeaderRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.hash != null && message.hasOwnProperty("hash")) @@ -83171,32 +83167,32 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Creates a GetCFilterRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetBlockHeaderRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof neutrinorpc.GetCFilterRequest + * @memberof neutrinorpc.GetBlockHeaderRequest * @static * @param {Object.} object Plain object - * @returns {neutrinorpc.GetCFilterRequest} GetCFilterRequest + * @returns {neutrinorpc.GetBlockHeaderRequest} GetBlockHeaderRequest */ - GetCFilterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutrinorpc.GetCFilterRequest) + GetBlockHeaderRequest.fromObject = function fromObject(object) { + if (object instanceof $root.neutrinorpc.GetBlockHeaderRequest) return object; - let message = new $root.neutrinorpc.GetCFilterRequest(); + let message = new $root.neutrinorpc.GetBlockHeaderRequest(); if (object.hash != null) message.hash = String(object.hash); return message; }; /** - * Creates a plain object from a GetCFilterRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetBlockHeaderRequest message. Also converts values to other types if specified. * @function toObject - * @memberof neutrinorpc.GetCFilterRequest + * @memberof neutrinorpc.GetBlockHeaderRequest * @static - * @param {neutrinorpc.GetCFilterRequest} message GetCFilterRequest + * @param {neutrinorpc.GetBlockHeaderRequest} message GetBlockHeaderRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetCFilterRequest.toObject = function toObject(message, options) { + GetBlockHeaderRequest.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; @@ -83208,52 +83204,66 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Converts this GetCFilterRequest to JSON. + * Converts this GetBlockHeaderRequest to JSON. * @function toJSON - * @memberof neutrinorpc.GetCFilterRequest + * @memberof neutrinorpc.GetBlockHeaderRequest * @instance * @returns {Object.} JSON object */ - GetCFilterRequest.prototype.toJSON = function toJSON() { + GetBlockHeaderRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetCFilterRequest + * Gets the default type url for GetBlockHeaderRequest * @function getTypeUrl - * @memberof neutrinorpc.GetCFilterRequest + * @memberof neutrinorpc.GetBlockHeaderRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetCFilterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetBlockHeaderRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/neutrinorpc.GetCFilterRequest"; + return typeUrlPrefix + "/neutrinorpc.GetBlockHeaderRequest"; }; - return GetCFilterRequest; + return GetBlockHeaderRequest; })(); - neutrinorpc.GetCFilterResponse = (function() { + neutrinorpc.GetBlockHeaderResponse = (function() { /** - * Properties of a GetCFilterResponse. + * Properties of a GetBlockHeaderResponse. * @memberof neutrinorpc - * @interface IGetCFilterResponse - * @property {Uint8Array|null} [filter] GetCFilterResponse filter + * @interface IGetBlockHeaderResponse + * @property {string|null} [hash] GetBlockHeaderResponse hash + * @property {Long|null} [confirmations] GetBlockHeaderResponse confirmations + * @property {Long|null} [stripped_size] GetBlockHeaderResponse stripped_size + * @property {Long|null} [size] GetBlockHeaderResponse size + * @property {Long|null} [weight] GetBlockHeaderResponse weight + * @property {number|null} [height] GetBlockHeaderResponse height + * @property {number|null} [version] GetBlockHeaderResponse version + * @property {string|null} [version_hex] GetBlockHeaderResponse version_hex + * @property {string|null} [merkleroot] GetBlockHeaderResponse merkleroot + * @property {Long|null} [time] GetBlockHeaderResponse time + * @property {number|null} [nonce] GetBlockHeaderResponse nonce + * @property {string|null} [bits] GetBlockHeaderResponse bits + * @property {number|null} [ntx] GetBlockHeaderResponse ntx + * @property {string|null} [previous_block_hash] GetBlockHeaderResponse previous_block_hash + * @property {Uint8Array|null} [raw_hex] GetBlockHeaderResponse raw_hex */ /** - * Constructs a new GetCFilterResponse. + * Constructs a new GetBlockHeaderResponse. * @memberof neutrinorpc - * @classdesc Represents a GetCFilterResponse. - * @implements IGetCFilterResponse + * @classdesc Represents a GetBlockHeaderResponse. + * @implements IGetBlockHeaderResponse * @constructor - * @param {neutrinorpc.IGetCFilterResponse=} [properties] Properties to set + * @param {neutrinorpc.IGetBlockHeaderResponse=} [properties] Properties to set */ - function GetCFilterResponse(properties) { + function GetBlockHeaderResponse(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -83261,289 +83271,273 @@ export const neutrinorpc = $root.neutrinorpc = (() => { } /** - * GetCFilterResponse filter. - * @member {Uint8Array} filter - * @memberof neutrinorpc.GetCFilterResponse + * GetBlockHeaderResponse hash. + * @member {string} hash + * @memberof neutrinorpc.GetBlockHeaderResponse * @instance */ - GetCFilterResponse.prototype.filter = $util.newBuffer([]); + GetBlockHeaderResponse.prototype.hash = ""; /** - * Creates a new GetCFilterResponse instance using the specified properties. - * @function create - * @memberof neutrinorpc.GetCFilterResponse - * @static - * @param {neutrinorpc.IGetCFilterResponse=} [properties] Properties to set - * @returns {neutrinorpc.GetCFilterResponse} GetCFilterResponse instance + * GetBlockHeaderResponse confirmations. + * @member {Long} confirmations + * @memberof neutrinorpc.GetBlockHeaderResponse + * @instance */ - GetCFilterResponse.create = function create(properties) { - return new GetCFilterResponse(properties); - }; + GetBlockHeaderResponse.prototype.confirmations = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Encodes the specified GetCFilterResponse message. Does not implicitly {@link neutrinorpc.GetCFilterResponse.verify|verify} messages. - * @function encode - * @memberof neutrinorpc.GetCFilterResponse - * @static - * @param {neutrinorpc.IGetCFilterResponse} message GetCFilterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * GetBlockHeaderResponse stripped_size. + * @member {Long} stripped_size + * @memberof neutrinorpc.GetBlockHeaderResponse + * @instance */ - GetCFilterResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.filter); - return writer; - }; + GetBlockHeaderResponse.prototype.stripped_size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Encodes the specified GetCFilterResponse message, length delimited. Does not implicitly {@link neutrinorpc.GetCFilterResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof neutrinorpc.GetCFilterResponse - * @static - * @param {neutrinorpc.IGetCFilterResponse} message GetCFilterResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * GetBlockHeaderResponse size. + * @member {Long} size + * @memberof neutrinorpc.GetBlockHeaderResponse + * @instance */ - GetCFilterResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + GetBlockHeaderResponse.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Decodes a GetCFilterResponse message from the specified reader or buffer. - * @function decode - * @memberof neutrinorpc.GetCFilterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {neutrinorpc.GetCFilterResponse} GetCFilterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * GetBlockHeaderResponse weight. + * @member {Long} weight + * @memberof neutrinorpc.GetBlockHeaderResponse + * @instance */ - GetCFilterResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetCFilterResponse(); - while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.filter = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + GetBlockHeaderResponse.prototype.weight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Decodes a GetCFilterResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof neutrinorpc.GetCFilterResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutrinorpc.GetCFilterResponse} GetCFilterResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * GetBlockHeaderResponse height. + * @member {number} height + * @memberof neutrinorpc.GetBlockHeaderResponse + * @instance */ - GetCFilterResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + GetBlockHeaderResponse.prototype.height = 0; /** - * Verifies a GetCFilterResponse message. - * @function verify - * @memberof neutrinorpc.GetCFilterResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * GetBlockHeaderResponse version. + * @member {number} version + * @memberof neutrinorpc.GetBlockHeaderResponse + * @instance */ - GetCFilterResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!(message.filter && typeof message.filter.length === "number" || $util.isString(message.filter))) - return "filter: buffer expected"; - return null; - }; + GetBlockHeaderResponse.prototype.version = 0; /** - * Creates a GetCFilterResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof neutrinorpc.GetCFilterResponse - * @static - * @param {Object.} object Plain object - * @returns {neutrinorpc.GetCFilterResponse} GetCFilterResponse + * GetBlockHeaderResponse version_hex. + * @member {string} version_hex + * @memberof neutrinorpc.GetBlockHeaderResponse + * @instance */ - GetCFilterResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutrinorpc.GetCFilterResponse) - return object; - let message = new $root.neutrinorpc.GetCFilterResponse(); - if (object.filter != null) - if (typeof object.filter === "string") - $util.base64.decode(object.filter, message.filter = $util.newBuffer($util.base64.length(object.filter)), 0); - else if (object.filter.length >= 0) - message.filter = object.filter; - return message; - }; + GetBlockHeaderResponse.prototype.version_hex = ""; /** - * Creates a plain object from a GetCFilterResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof neutrinorpc.GetCFilterResponse - * @static - * @param {neutrinorpc.GetCFilterResponse} message GetCFilterResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * GetBlockHeaderResponse merkleroot. + * @member {string} merkleroot + * @memberof neutrinorpc.GetBlockHeaderResponse + * @instance */ - GetCFilterResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - if (options.bytes === String) - object.filter = ""; - else { - object.filter = []; - if (options.bytes !== Array) - object.filter = $util.newBuffer(object.filter); - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = options.bytes === String ? $util.base64.encode(message.filter, 0, message.filter.length) : options.bytes === Array ? Array.prototype.slice.call(message.filter) : message.filter; - return object; - }; + GetBlockHeaderResponse.prototype.merkleroot = ""; /** - * Converts this GetCFilterResponse to JSON. - * @function toJSON - * @memberof neutrinorpc.GetCFilterResponse + * GetBlockHeaderResponse time. + * @member {Long} time + * @memberof neutrinorpc.GetBlockHeaderResponse * @instance - * @returns {Object.} JSON object */ - GetCFilterResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + GetBlockHeaderResponse.prototype.time = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Gets the default type url for GetCFilterResponse - * @function getTypeUrl - * @memberof neutrinorpc.GetCFilterResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * GetBlockHeaderResponse nonce. + * @member {number} nonce + * @memberof neutrinorpc.GetBlockHeaderResponse + * @instance */ - GetCFilterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/neutrinorpc.GetCFilterResponse"; - }; - - return GetCFilterResponse; - })(); + GetBlockHeaderResponse.prototype.nonce = 0; - neutrinorpc.GetBlockHashRequest = (function() { + /** + * GetBlockHeaderResponse bits. + * @member {string} bits + * @memberof neutrinorpc.GetBlockHeaderResponse + * @instance + */ + GetBlockHeaderResponse.prototype.bits = ""; /** - * Properties of a GetBlockHashRequest. - * @memberof neutrinorpc - * @interface IGetBlockHashRequest - * @property {number|null} [height] GetBlockHashRequest height + * GetBlockHeaderResponse ntx. + * @member {number} ntx + * @memberof neutrinorpc.GetBlockHeaderResponse + * @instance */ + GetBlockHeaderResponse.prototype.ntx = 0; /** - * Constructs a new GetBlockHashRequest. - * @memberof neutrinorpc - * @classdesc Represents a GetBlockHashRequest. - * @implements IGetBlockHashRequest - * @constructor - * @param {neutrinorpc.IGetBlockHashRequest=} [properties] Properties to set + * GetBlockHeaderResponse previous_block_hash. + * @member {string} previous_block_hash + * @memberof neutrinorpc.GetBlockHeaderResponse + * @instance */ - function GetBlockHashRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + GetBlockHeaderResponse.prototype.previous_block_hash = ""; /** - * GetBlockHashRequest height. - * @member {number} height - * @memberof neutrinorpc.GetBlockHashRequest + * GetBlockHeaderResponse raw_hex. + * @member {Uint8Array} raw_hex + * @memberof neutrinorpc.GetBlockHeaderResponse * @instance */ - GetBlockHashRequest.prototype.height = 0; + GetBlockHeaderResponse.prototype.raw_hex = $util.newBuffer([]); /** - * Creates a new GetBlockHashRequest instance using the specified properties. + * Creates a new GetBlockHeaderResponse instance using the specified properties. * @function create - * @memberof neutrinorpc.GetBlockHashRequest + * @memberof neutrinorpc.GetBlockHeaderResponse * @static - * @param {neutrinorpc.IGetBlockHashRequest=} [properties] Properties to set - * @returns {neutrinorpc.GetBlockHashRequest} GetBlockHashRequest instance + * @param {neutrinorpc.IGetBlockHeaderResponse=} [properties] Properties to set + * @returns {neutrinorpc.GetBlockHeaderResponse} GetBlockHeaderResponse instance */ - GetBlockHashRequest.create = function create(properties) { - return new GetBlockHashRequest(properties); + GetBlockHeaderResponse.create = function create(properties) { + return new GetBlockHeaderResponse(properties); }; /** - * Encodes the specified GetBlockHashRequest message. Does not implicitly {@link neutrinorpc.GetBlockHashRequest.verify|verify} messages. + * Encodes the specified GetBlockHeaderResponse message. Does not implicitly {@link neutrinorpc.GetBlockHeaderResponse.verify|verify} messages. * @function encode - * @memberof neutrinorpc.GetBlockHashRequest + * @memberof neutrinorpc.GetBlockHeaderResponse * @static - * @param {neutrinorpc.IGetBlockHashRequest} message GetBlockHashRequest message or plain object to encode + * @param {neutrinorpc.IGetBlockHeaderResponse} message GetBlockHeaderResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBlockHashRequest.encode = function encode(message, writer) { + GetBlockHeaderResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); + if (message.confirmations != null && Object.hasOwnProperty.call(message, "confirmations")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.confirmations); + if (message.stripped_size != null && Object.hasOwnProperty.call(message, "stripped_size")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.stripped_size); + if (message.size != null && Object.hasOwnProperty.call(message, "size")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.size); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.weight); if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.height); + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.height); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.version); + if (message.version_hex != null && Object.hasOwnProperty.call(message, "version_hex")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.version_hex); + if (message.merkleroot != null && Object.hasOwnProperty.call(message, "merkleroot")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.merkleroot); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.time); + if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce")) + writer.uint32(/* id 11, wireType 0 =*/88).uint32(message.nonce); + if (message.bits != null && Object.hasOwnProperty.call(message, "bits")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.bits); + if (message.ntx != null && Object.hasOwnProperty.call(message, "ntx")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.ntx); + if (message.previous_block_hash != null && Object.hasOwnProperty.call(message, "previous_block_hash")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.previous_block_hash); + if (message.raw_hex != null && Object.hasOwnProperty.call(message, "raw_hex")) + writer.uint32(/* id 15, wireType 2 =*/122).bytes(message.raw_hex); return writer; }; /** - * Encodes the specified GetBlockHashRequest message, length delimited. Does not implicitly {@link neutrinorpc.GetBlockHashRequest.verify|verify} messages. + * Encodes the specified GetBlockHeaderResponse message, length delimited. Does not implicitly {@link neutrinorpc.GetBlockHeaderResponse.verify|verify} messages. * @function encodeDelimited - * @memberof neutrinorpc.GetBlockHashRequest + * @memberof neutrinorpc.GetBlockHeaderResponse * @static - * @param {neutrinorpc.IGetBlockHashRequest} message GetBlockHashRequest message or plain object to encode + * @param {neutrinorpc.IGetBlockHeaderResponse} message GetBlockHeaderResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBlockHashRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetBlockHeaderResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetBlockHashRequest message from the specified reader or buffer. + * Decodes a GetBlockHeaderResponse message from the specified reader or buffer. * @function decode - * @memberof neutrinorpc.GetBlockHashRequest + * @memberof neutrinorpc.GetBlockHeaderResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {neutrinorpc.GetBlockHashRequest} GetBlockHashRequest + * @returns {neutrinorpc.GetBlockHeaderResponse} GetBlockHeaderResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBlockHashRequest.decode = function decode(reader, length) { + GetBlockHeaderResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetBlockHashRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetBlockHeaderResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { + message.hash = reader.string(); + break; + } + case 2: { + message.confirmations = reader.int64(); + break; + } + case 3: { + message.stripped_size = reader.int64(); + break; + } + case 4: { + message.size = reader.int64(); + break; + } + case 5: { + message.weight = reader.int64(); + break; + } + case 6: { message.height = reader.int32(); break; } + case 7: { + message.version = reader.int32(); + break; + } + case 8: { + message.version_hex = reader.string(); + break; + } + case 9: { + message.merkleroot = reader.string(); + break; + } + case 10: { + message.time = reader.int64(); + break; + } + case 11: { + message.nonce = reader.uint32(); + break; + } + case 12: { + message.bits = reader.string(); + break; + } + case 13: { + message.ntx = reader.int32(); + break; + } + case 14: { + message.previous_block_hash = reader.string(); + break; + } + case 15: { + message.raw_hex = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -83553,122 +83547,314 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Decodes a GetBlockHashRequest message from the specified reader or buffer, length delimited. + * Decodes a GetBlockHeaderResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof neutrinorpc.GetBlockHashRequest + * @memberof neutrinorpc.GetBlockHeaderResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutrinorpc.GetBlockHashRequest} GetBlockHashRequest + * @returns {neutrinorpc.GetBlockHeaderResponse} GetBlockHeaderResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBlockHashRequest.decodeDelimited = function decodeDelimited(reader) { + GetBlockHeaderResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetBlockHashRequest message. + * Verifies a GetBlockHeaderResponse message. * @function verify - * @memberof neutrinorpc.GetBlockHashRequest + * @memberof neutrinorpc.GetBlockHeaderResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetBlockHashRequest.verify = function verify(message) { + GetBlockHeaderResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + if (message.confirmations != null && message.hasOwnProperty("confirmations")) + if (!$util.isInteger(message.confirmations) && !(message.confirmations && $util.isInteger(message.confirmations.low) && $util.isInteger(message.confirmations.high))) + return "confirmations: integer|Long expected"; + if (message.stripped_size != null && message.hasOwnProperty("stripped_size")) + if (!$util.isInteger(message.stripped_size) && !(message.stripped_size && $util.isInteger(message.stripped_size.low) && $util.isInteger(message.stripped_size.high))) + return "stripped_size: integer|Long expected"; + if (message.size != null && message.hasOwnProperty("size")) + if (!$util.isInteger(message.size) && !(message.size && $util.isInteger(message.size.low) && $util.isInteger(message.size.high))) + return "size: integer|Long expected"; + if (message.weight != null && message.hasOwnProperty("weight")) + if (!$util.isInteger(message.weight) && !(message.weight && $util.isInteger(message.weight.low) && $util.isInteger(message.weight.high))) + return "weight: integer|Long expected"; if (message.height != null && message.hasOwnProperty("height")) if (!$util.isInteger(message.height)) return "height: integer expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.version_hex != null && message.hasOwnProperty("version_hex")) + if (!$util.isString(message.version_hex)) + return "version_hex: string expected"; + if (message.merkleroot != null && message.hasOwnProperty("merkleroot")) + if (!$util.isString(message.merkleroot)) + return "merkleroot: string expected"; + if (message.time != null && message.hasOwnProperty("time")) + if (!$util.isInteger(message.time) && !(message.time && $util.isInteger(message.time.low) && $util.isInteger(message.time.high))) + return "time: integer|Long expected"; + if (message.nonce != null && message.hasOwnProperty("nonce")) + if (!$util.isInteger(message.nonce)) + return "nonce: integer expected"; + if (message.bits != null && message.hasOwnProperty("bits")) + if (!$util.isString(message.bits)) + return "bits: string expected"; + if (message.ntx != null && message.hasOwnProperty("ntx")) + if (!$util.isInteger(message.ntx)) + return "ntx: integer expected"; + if (message.previous_block_hash != null && message.hasOwnProperty("previous_block_hash")) + if (!$util.isString(message.previous_block_hash)) + return "previous_block_hash: string expected"; + if (message.raw_hex != null && message.hasOwnProperty("raw_hex")) + if (!(message.raw_hex && typeof message.raw_hex.length === "number" || $util.isString(message.raw_hex))) + return "raw_hex: buffer expected"; return null; }; /** - * Creates a GetBlockHashRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetBlockHeaderResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof neutrinorpc.GetBlockHashRequest + * @memberof neutrinorpc.GetBlockHeaderResponse * @static * @param {Object.} object Plain object - * @returns {neutrinorpc.GetBlockHashRequest} GetBlockHashRequest + * @returns {neutrinorpc.GetBlockHeaderResponse} GetBlockHeaderResponse */ - GetBlockHashRequest.fromObject = function fromObject(object) { - if (object instanceof $root.neutrinorpc.GetBlockHashRequest) + GetBlockHeaderResponse.fromObject = function fromObject(object) { + if (object instanceof $root.neutrinorpc.GetBlockHeaderResponse) return object; - let message = new $root.neutrinorpc.GetBlockHashRequest(); + let message = new $root.neutrinorpc.GetBlockHeaderResponse(); + if (object.hash != null) + message.hash = String(object.hash); + if (object.confirmations != null) + if ($util.Long) + (message.confirmations = $util.Long.fromValue(object.confirmations)).unsigned = false; + else if (typeof object.confirmations === "string") + message.confirmations = parseInt(object.confirmations, 10); + else if (typeof object.confirmations === "number") + message.confirmations = object.confirmations; + else if (typeof object.confirmations === "object") + message.confirmations = new $util.LongBits(object.confirmations.low >>> 0, object.confirmations.high >>> 0).toNumber(); + if (object.stripped_size != null) + if ($util.Long) + (message.stripped_size = $util.Long.fromValue(object.stripped_size)).unsigned = false; + else if (typeof object.stripped_size === "string") + message.stripped_size = parseInt(object.stripped_size, 10); + else if (typeof object.stripped_size === "number") + message.stripped_size = object.stripped_size; + else if (typeof object.stripped_size === "object") + message.stripped_size = new $util.LongBits(object.stripped_size.low >>> 0, object.stripped_size.high >>> 0).toNumber(); + if (object.size != null) + if ($util.Long) + (message.size = $util.Long.fromValue(object.size)).unsigned = false; + else if (typeof object.size === "string") + message.size = parseInt(object.size, 10); + else if (typeof object.size === "number") + message.size = object.size; + else if (typeof object.size === "object") + message.size = new $util.LongBits(object.size.low >>> 0, object.size.high >>> 0).toNumber(); + if (object.weight != null) + if ($util.Long) + (message.weight = $util.Long.fromValue(object.weight)).unsigned = false; + else if (typeof object.weight === "string") + message.weight = parseInt(object.weight, 10); + else if (typeof object.weight === "number") + message.weight = object.weight; + else if (typeof object.weight === "object") + message.weight = new $util.LongBits(object.weight.low >>> 0, object.weight.high >>> 0).toNumber(); if (object.height != null) message.height = object.height | 0; + if (object.version != null) + message.version = object.version | 0; + if (object.version_hex != null) + message.version_hex = String(object.version_hex); + if (object.merkleroot != null) + message.merkleroot = String(object.merkleroot); + if (object.time != null) + if ($util.Long) + (message.time = $util.Long.fromValue(object.time)).unsigned = false; + else if (typeof object.time === "string") + message.time = parseInt(object.time, 10); + else if (typeof object.time === "number") + message.time = object.time; + else if (typeof object.time === "object") + message.time = new $util.LongBits(object.time.low >>> 0, object.time.high >>> 0).toNumber(); + if (object.nonce != null) + message.nonce = object.nonce >>> 0; + if (object.bits != null) + message.bits = String(object.bits); + if (object.ntx != null) + message.ntx = object.ntx | 0; + if (object.previous_block_hash != null) + message.previous_block_hash = String(object.previous_block_hash); + if (object.raw_hex != null) + if (typeof object.raw_hex === "string") + $util.base64.decode(object.raw_hex, message.raw_hex = $util.newBuffer($util.base64.length(object.raw_hex)), 0); + else if (object.raw_hex.length >= 0) + message.raw_hex = object.raw_hex; return message; }; /** - * Creates a plain object from a GetBlockHashRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetBlockHeaderResponse message. Also converts values to other types if specified. * @function toObject - * @memberof neutrinorpc.GetBlockHashRequest + * @memberof neutrinorpc.GetBlockHeaderResponse * @static - * @param {neutrinorpc.GetBlockHashRequest} message GetBlockHashRequest + * @param {neutrinorpc.GetBlockHeaderResponse} message GetBlockHeaderResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetBlockHashRequest.toObject = function toObject(message, options) { + GetBlockHeaderResponse.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.defaults) + if (options.defaults) { + object.hash = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.confirmations = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.confirmations = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.stripped_size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.stripped_size = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.size = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.weight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.weight = options.longs === String ? "0" : 0; object.height = 0; - if (message.height != null && message.hasOwnProperty("height")) - object.height = message.height; - return object; - }; - - /** - * Converts this GetBlockHashRequest to JSON. - * @function toJSON - * @memberof neutrinorpc.GetBlockHashRequest - * @instance - * @returns {Object.} JSON object - */ - GetBlockHashRequest.prototype.toJSON = function toJSON() { + object.version = 0; + object.version_hex = ""; + object.merkleroot = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.time = options.longs === String ? "0" : 0; + object.nonce = 0; + object.bits = ""; + object.ntx = 0; + object.previous_block_hash = ""; + if (options.bytes === String) + object.raw_hex = ""; + else { + object.raw_hex = []; + if (options.bytes !== Array) + object.raw_hex = $util.newBuffer(object.raw_hex); + } + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + if (message.confirmations != null && message.hasOwnProperty("confirmations")) + if (typeof message.confirmations === "number") + object.confirmations = options.longs === String ? String(message.confirmations) : message.confirmations; + else + object.confirmations = options.longs === String ? $util.Long.prototype.toString.call(message.confirmations) : options.longs === Number ? new $util.LongBits(message.confirmations.low >>> 0, message.confirmations.high >>> 0).toNumber() : message.confirmations; + if (message.stripped_size != null && message.hasOwnProperty("stripped_size")) + if (typeof message.stripped_size === "number") + object.stripped_size = options.longs === String ? String(message.stripped_size) : message.stripped_size; + else + object.stripped_size = options.longs === String ? $util.Long.prototype.toString.call(message.stripped_size) : options.longs === Number ? new $util.LongBits(message.stripped_size.low >>> 0, message.stripped_size.high >>> 0).toNumber() : message.stripped_size; + if (message.size != null && message.hasOwnProperty("size")) + if (typeof message.size === "number") + object.size = options.longs === String ? String(message.size) : message.size; + else + object.size = options.longs === String ? $util.Long.prototype.toString.call(message.size) : options.longs === Number ? new $util.LongBits(message.size.low >>> 0, message.size.high >>> 0).toNumber() : message.size; + if (message.weight != null && message.hasOwnProperty("weight")) + if (typeof message.weight === "number") + object.weight = options.longs === String ? String(message.weight) : message.weight; + else + object.weight = options.longs === String ? $util.Long.prototype.toString.call(message.weight) : options.longs === Number ? new $util.LongBits(message.weight.low >>> 0, message.weight.high >>> 0).toNumber() : message.weight; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.version_hex != null && message.hasOwnProperty("version_hex")) + object.version_hex = message.version_hex; + if (message.merkleroot != null && message.hasOwnProperty("merkleroot")) + object.merkleroot = message.merkleroot; + if (message.time != null && message.hasOwnProperty("time")) + if (typeof message.time === "number") + object.time = options.longs === String ? String(message.time) : message.time; + else + object.time = options.longs === String ? $util.Long.prototype.toString.call(message.time) : options.longs === Number ? new $util.LongBits(message.time.low >>> 0, message.time.high >>> 0).toNumber() : message.time; + if (message.nonce != null && message.hasOwnProperty("nonce")) + object.nonce = message.nonce; + if (message.bits != null && message.hasOwnProperty("bits")) + object.bits = message.bits; + if (message.ntx != null && message.hasOwnProperty("ntx")) + object.ntx = message.ntx; + if (message.previous_block_hash != null && message.hasOwnProperty("previous_block_hash")) + object.previous_block_hash = message.previous_block_hash; + if (message.raw_hex != null && message.hasOwnProperty("raw_hex")) + object.raw_hex = options.bytes === String ? $util.base64.encode(message.raw_hex, 0, message.raw_hex.length) : options.bytes === Array ? Array.prototype.slice.call(message.raw_hex) : message.raw_hex; + return object; + }; + + /** + * Converts this GetBlockHeaderResponse to JSON. + * @function toJSON + * @memberof neutrinorpc.GetBlockHeaderResponse + * @instance + * @returns {Object.} JSON object + */ + GetBlockHeaderResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetBlockHashRequest + * Gets the default type url for GetBlockHeaderResponse * @function getTypeUrl - * @memberof neutrinorpc.GetBlockHashRequest + * @memberof neutrinorpc.GetBlockHeaderResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetBlockHashRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetBlockHeaderResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/neutrinorpc.GetBlockHashRequest"; + return typeUrlPrefix + "/neutrinorpc.GetBlockHeaderResponse"; }; - return GetBlockHashRequest; + return GetBlockHeaderResponse; })(); - neutrinorpc.GetBlockHashResponse = (function() { + neutrinorpc.GetBlockRequest = (function() { /** - * Properties of a GetBlockHashResponse. + * Properties of a GetBlockRequest. * @memberof neutrinorpc - * @interface IGetBlockHashResponse - * @property {string|null} [hash] GetBlockHashResponse hash + * @interface IGetBlockRequest + * @property {string|null} [hash] GetBlockRequest hash */ /** - * Constructs a new GetBlockHashResponse. + * Constructs a new GetBlockRequest. * @memberof neutrinorpc - * @classdesc Represents a GetBlockHashResponse. - * @implements IGetBlockHashResponse + * @classdesc Represents a GetBlockRequest. + * @implements IGetBlockRequest * @constructor - * @param {neutrinorpc.IGetBlockHashResponse=} [properties] Properties to set + * @param {neutrinorpc.IGetBlockRequest=} [properties] Properties to set */ - function GetBlockHashResponse(properties) { + function GetBlockRequest(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -83676,35 +83862,35 @@ export const neutrinorpc = $root.neutrinorpc = (() => { } /** - * GetBlockHashResponse hash. + * GetBlockRequest hash. * @member {string} hash - * @memberof neutrinorpc.GetBlockHashResponse + * @memberof neutrinorpc.GetBlockRequest * @instance */ - GetBlockHashResponse.prototype.hash = ""; + GetBlockRequest.prototype.hash = ""; /** - * Creates a new GetBlockHashResponse instance using the specified properties. + * Creates a new GetBlockRequest instance using the specified properties. * @function create - * @memberof neutrinorpc.GetBlockHashResponse + * @memberof neutrinorpc.GetBlockRequest * @static - * @param {neutrinorpc.IGetBlockHashResponse=} [properties] Properties to set - * @returns {neutrinorpc.GetBlockHashResponse} GetBlockHashResponse instance + * @param {neutrinorpc.IGetBlockRequest=} [properties] Properties to set + * @returns {neutrinorpc.GetBlockRequest} GetBlockRequest instance */ - GetBlockHashResponse.create = function create(properties) { - return new GetBlockHashResponse(properties); + GetBlockRequest.create = function create(properties) { + return new GetBlockRequest(properties); }; /** - * Encodes the specified GetBlockHashResponse message. Does not implicitly {@link neutrinorpc.GetBlockHashResponse.verify|verify} messages. + * Encodes the specified GetBlockRequest message. Does not implicitly {@link neutrinorpc.GetBlockRequest.verify|verify} messages. * @function encode - * @memberof neutrinorpc.GetBlockHashResponse + * @memberof neutrinorpc.GetBlockRequest * @static - * @param {neutrinorpc.IGetBlockHashResponse} message GetBlockHashResponse message or plain object to encode + * @param {neutrinorpc.IGetBlockRequest} message GetBlockRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBlockHashResponse.encode = function encode(message, writer) { + GetBlockRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) @@ -83713,33 +83899,33 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Encodes the specified GetBlockHashResponse message, length delimited. Does not implicitly {@link neutrinorpc.GetBlockHashResponse.verify|verify} messages. + * Encodes the specified GetBlockRequest message, length delimited. Does not implicitly {@link neutrinorpc.GetBlockRequest.verify|verify} messages. * @function encodeDelimited - * @memberof neutrinorpc.GetBlockHashResponse + * @memberof neutrinorpc.GetBlockRequest * @static - * @param {neutrinorpc.IGetBlockHashResponse} message GetBlockHashResponse message or plain object to encode + * @param {neutrinorpc.IGetBlockRequest} message GetBlockRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBlockHashResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetBlockRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetBlockHashResponse message from the specified reader or buffer. + * Decodes a GetBlockRequest message from the specified reader or buffer. * @function decode - * @memberof neutrinorpc.GetBlockHashResponse + * @memberof neutrinorpc.GetBlockRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {neutrinorpc.GetBlockHashResponse} GetBlockHashResponse + * @returns {neutrinorpc.GetBlockRequest} GetBlockRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBlockHashResponse.decode = function decode(reader, length) { + GetBlockRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetBlockHashResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetBlockRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { @@ -83756,30 +83942,30 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Decodes a GetBlockHashResponse message from the specified reader or buffer, length delimited. + * Decodes a GetBlockRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof neutrinorpc.GetBlockHashResponse + * @memberof neutrinorpc.GetBlockRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {neutrinorpc.GetBlockHashResponse} GetBlockHashResponse + * @returns {neutrinorpc.GetBlockRequest} GetBlockRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBlockHashResponse.decodeDelimited = function decodeDelimited(reader) { + GetBlockRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetBlockHashResponse message. + * Verifies a GetBlockRequest message. * @function verify - * @memberof neutrinorpc.GetBlockHashResponse + * @memberof neutrinorpc.GetBlockRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetBlockHashResponse.verify = function verify(message) { + GetBlockRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.hash != null && message.hasOwnProperty("hash")) @@ -83789,32 +83975,32 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Creates a GetBlockHashResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetBlockRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof neutrinorpc.GetBlockHashResponse + * @memberof neutrinorpc.GetBlockRequest * @static * @param {Object.} object Plain object - * @returns {neutrinorpc.GetBlockHashResponse} GetBlockHashResponse + * @returns {neutrinorpc.GetBlockRequest} GetBlockRequest */ - GetBlockHashResponse.fromObject = function fromObject(object) { - if (object instanceof $root.neutrinorpc.GetBlockHashResponse) + GetBlockRequest.fromObject = function fromObject(object) { + if (object instanceof $root.neutrinorpc.GetBlockRequest) return object; - let message = new $root.neutrinorpc.GetBlockHashResponse(); + let message = new $root.neutrinorpc.GetBlockRequest(); if (object.hash != null) message.hash = String(object.hash); return message; }; /** - * Creates a plain object from a GetBlockHashResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetBlockRequest message. Also converts values to other types if specified. * @function toObject - * @memberof neutrinorpc.GetBlockHashResponse + * @memberof neutrinorpc.GetBlockRequest * @static - * @param {neutrinorpc.GetBlockHashResponse} message GetBlockHashResponse + * @param {neutrinorpc.GetBlockRequest} message GetBlockRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetBlockHashResponse.toObject = function toObject(message, options) { + GetBlockRequest.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; @@ -83826,727 +84012,1112 @@ export const neutrinorpc = $root.neutrinorpc = (() => { }; /** - * Converts this GetBlockHashResponse to JSON. + * Converts this GetBlockRequest to JSON. * @function toJSON - * @memberof neutrinorpc.GetBlockHashResponse + * @memberof neutrinorpc.GetBlockRequest * @instance * @returns {Object.} JSON object */ - GetBlockHashResponse.prototype.toJSON = function toJSON() { + GetBlockRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetBlockHashResponse + * Gets the default type url for GetBlockRequest * @function getTypeUrl - * @memberof neutrinorpc.GetBlockHashResponse + * @memberof neutrinorpc.GetBlockRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetBlockHashResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetBlockRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/neutrinorpc.GetBlockHashResponse"; + return typeUrlPrefix + "/neutrinorpc.GetBlockRequest"; }; - return GetBlockHashResponse; + return GetBlockRequest; })(); - return neutrinorpc; -})(); - -export const routerrpc = $root.routerrpc = (() => { - - /** - * Namespace routerrpc. - * @exports routerrpc - * @namespace - */ - const routerrpc = {}; - - routerrpc.Router = (function() { - - /** - * Constructs a new Router service. - * @memberof routerrpc - * @classdesc Represents a Router - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Router(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Router.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Router; + neutrinorpc.GetBlockResponse = (function() { /** - * Creates new Router service using the specified rpc implementation. - * @function create - * @memberof routerrpc.Router - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Router} RPC service. Useful where requests and/or responses are streamed. + * Properties of a GetBlockResponse. + * @memberof neutrinorpc + * @interface IGetBlockResponse + * @property {string|null} [hash] GetBlockResponse hash + * @property {Long|null} [confirmations] GetBlockResponse confirmations + * @property {Long|null} [stripped_size] GetBlockResponse stripped_size + * @property {Long|null} [size] GetBlockResponse size + * @property {Long|null} [weight] GetBlockResponse weight + * @property {number|null} [height] GetBlockResponse height + * @property {number|null} [version] GetBlockResponse version + * @property {string|null} [version_hex] GetBlockResponse version_hex + * @property {string|null} [merkleroot] GetBlockResponse merkleroot + * @property {Array.|null} [tx] GetBlockResponse tx + * @property {Long|null} [time] GetBlockResponse time + * @property {number|null} [nonce] GetBlockResponse nonce + * @property {string|null} [bits] GetBlockResponse bits + * @property {number|null} [ntx] GetBlockResponse ntx + * @property {string|null} [previous_block_hash] GetBlockResponse previous_block_hash + * @property {Uint8Array|null} [raw_hex] GetBlockResponse raw_hex */ - Router.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; /** - * Callback as used by {@link routerrpc.Router#sendPaymentV2}. - * @memberof routerrpc.Router - * @typedef SendPaymentV2Callback - * @type {function} - * @param {Error|null} error Error, if any - * @param {lnrpc.Payment} [response] Payment + * Constructs a new GetBlockResponse. + * @memberof neutrinorpc + * @classdesc Represents a GetBlockResponse. + * @implements IGetBlockResponse + * @constructor + * @param {neutrinorpc.IGetBlockResponse=} [properties] Properties to set */ + function GetBlockResponse(properties) { + this.tx = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls SendPaymentV2. - * @function sendPaymentV2 - * @memberof routerrpc.Router + * GetBlockResponse hash. + * @member {string} hash + * @memberof neutrinorpc.GetBlockResponse * @instance - * @param {routerrpc.ISendPaymentRequest} request SendPaymentRequest message or plain object - * @param {routerrpc.Router.SendPaymentV2Callback} callback Node-style callback called with the error, if any, and Payment - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Router.prototype.sendPaymentV2 = function sendPaymentV2(request, callback) { - return this.rpcCall(sendPaymentV2, $root.routerrpc.SendPaymentRequest, $root.lnrpc.Payment, request, callback); - }, "name", { value: "SendPaymentV2" }); + GetBlockResponse.prototype.hash = ""; /** - * Calls SendPaymentV2. - * @function sendPaymentV2 - * @memberof routerrpc.Router + * GetBlockResponse confirmations. + * @member {Long} confirmations + * @memberof neutrinorpc.GetBlockResponse * @instance - * @param {routerrpc.ISendPaymentRequest} request SendPaymentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link routerrpc.Router#trackPaymentV2}. - * @memberof routerrpc.Router - * @typedef TrackPaymentV2Callback - * @type {function} - * @param {Error|null} error Error, if any - * @param {lnrpc.Payment} [response] Payment */ + GetBlockResponse.prototype.confirmations = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Calls TrackPaymentV2. - * @function trackPaymentV2 - * @memberof routerrpc.Router + * GetBlockResponse stripped_size. + * @member {Long} stripped_size + * @memberof neutrinorpc.GetBlockResponse * @instance - * @param {routerrpc.ITrackPaymentRequest} request TrackPaymentRequest message or plain object - * @param {routerrpc.Router.TrackPaymentV2Callback} callback Node-style callback called with the error, if any, and Payment - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Router.prototype.trackPaymentV2 = function trackPaymentV2(request, callback) { - return this.rpcCall(trackPaymentV2, $root.routerrpc.TrackPaymentRequest, $root.lnrpc.Payment, request, callback); - }, "name", { value: "TrackPaymentV2" }); + GetBlockResponse.prototype.stripped_size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Calls TrackPaymentV2. - * @function trackPaymentV2 - * @memberof routerrpc.Router + * GetBlockResponse size. + * @member {Long} size + * @memberof neutrinorpc.GetBlockResponse * @instance - * @param {routerrpc.ITrackPaymentRequest} request TrackPaymentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link routerrpc.Router#trackPayments}. - * @memberof routerrpc.Router - * @typedef TrackPaymentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {lnrpc.Payment} [response] Payment */ + GetBlockResponse.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Calls TrackPayments. - * @function trackPayments - * @memberof routerrpc.Router + * GetBlockResponse weight. + * @member {Long} weight + * @memberof neutrinorpc.GetBlockResponse * @instance - * @param {routerrpc.ITrackPaymentsRequest} request TrackPaymentsRequest message or plain object - * @param {routerrpc.Router.TrackPaymentsCallback} callback Node-style callback called with the error, if any, and Payment - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Router.prototype.trackPayments = function trackPayments(request, callback) { - return this.rpcCall(trackPayments, $root.routerrpc.TrackPaymentsRequest, $root.lnrpc.Payment, request, callback); - }, "name", { value: "TrackPayments" }); + GetBlockResponse.prototype.weight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Calls TrackPayments. - * @function trackPayments - * @memberof routerrpc.Router + * GetBlockResponse height. + * @member {number} height + * @memberof neutrinorpc.GetBlockResponse * @instance - * @param {routerrpc.ITrackPaymentsRequest} request TrackPaymentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link routerrpc.Router#estimateRouteFee}. - * @memberof routerrpc.Router - * @typedef EstimateRouteFeeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {routerrpc.RouteFeeResponse} [response] RouteFeeResponse */ + GetBlockResponse.prototype.height = 0; /** - * Calls EstimateRouteFee. - * @function estimateRouteFee - * @memberof routerrpc.Router + * GetBlockResponse version. + * @member {number} version + * @memberof neutrinorpc.GetBlockResponse * @instance - * @param {routerrpc.IRouteFeeRequest} request RouteFeeRequest message or plain object - * @param {routerrpc.Router.EstimateRouteFeeCallback} callback Node-style callback called with the error, if any, and RouteFeeResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Router.prototype.estimateRouteFee = function estimateRouteFee(request, callback) { - return this.rpcCall(estimateRouteFee, $root.routerrpc.RouteFeeRequest, $root.routerrpc.RouteFeeResponse, request, callback); - }, "name", { value: "EstimateRouteFee" }); + GetBlockResponse.prototype.version = 0; /** - * Calls EstimateRouteFee. - * @function estimateRouteFee - * @memberof routerrpc.Router + * GetBlockResponse version_hex. + * @member {string} version_hex + * @memberof neutrinorpc.GetBlockResponse * @instance - * @param {routerrpc.IRouteFeeRequest} request RouteFeeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + GetBlockResponse.prototype.version_hex = ""; /** - * Callback as used by {@link routerrpc.Router#sendToRoute}. - * @memberof routerrpc.Router - * @typedef SendToRouteCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {routerrpc.SendToRouteResponse} [response] SendToRouteResponse + * GetBlockResponse merkleroot. + * @member {string} merkleroot + * @memberof neutrinorpc.GetBlockResponse + * @instance */ + GetBlockResponse.prototype.merkleroot = ""; /** - * Calls SendToRoute. - * @function sendToRoute - * @memberof routerrpc.Router + * GetBlockResponse tx. + * @member {Array.} tx + * @memberof neutrinorpc.GetBlockResponse * @instance - * @param {routerrpc.ISendToRouteRequest} request SendToRouteRequest message or plain object - * @param {routerrpc.Router.SendToRouteCallback} callback Node-style callback called with the error, if any, and SendToRouteResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Router.prototype.sendToRoute = function sendToRoute(request, callback) { - return this.rpcCall(sendToRoute, $root.routerrpc.SendToRouteRequest, $root.routerrpc.SendToRouteResponse, request, callback); - }, "name", { value: "SendToRoute" }); + GetBlockResponse.prototype.tx = $util.emptyArray; /** - * Calls SendToRoute. - * @function sendToRoute - * @memberof routerrpc.Router + * GetBlockResponse time. + * @member {Long} time + * @memberof neutrinorpc.GetBlockResponse * @instance - * @param {routerrpc.ISendToRouteRequest} request SendToRouteRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + GetBlockResponse.prototype.time = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Callback as used by {@link routerrpc.Router#sendToRouteV2}. - * @memberof routerrpc.Router - * @typedef SendToRouteV2Callback - * @type {function} - * @param {Error|null} error Error, if any - * @param {lnrpc.HTLCAttempt} [response] HTLCAttempt + * GetBlockResponse nonce. + * @member {number} nonce + * @memberof neutrinorpc.GetBlockResponse + * @instance */ + GetBlockResponse.prototype.nonce = 0; /** - * Calls SendToRouteV2. - * @function sendToRouteV2 - * @memberof routerrpc.Router + * GetBlockResponse bits. + * @member {string} bits + * @memberof neutrinorpc.GetBlockResponse * @instance - * @param {routerrpc.ISendToRouteRequest} request SendToRouteRequest message or plain object - * @param {routerrpc.Router.SendToRouteV2Callback} callback Node-style callback called with the error, if any, and HTLCAttempt - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Router.prototype.sendToRouteV2 = function sendToRouteV2(request, callback) { - return this.rpcCall(sendToRouteV2, $root.routerrpc.SendToRouteRequest, $root.lnrpc.HTLCAttempt, request, callback); - }, "name", { value: "SendToRouteV2" }); + GetBlockResponse.prototype.bits = ""; /** - * Calls SendToRouteV2. - * @function sendToRouteV2 - * @memberof routerrpc.Router + * GetBlockResponse ntx. + * @member {number} ntx + * @memberof neutrinorpc.GetBlockResponse * @instance - * @param {routerrpc.ISendToRouteRequest} request SendToRouteRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + GetBlockResponse.prototype.ntx = 0; /** - * Callback as used by {@link routerrpc.Router#resetMissionControl}. - * @memberof routerrpc.Router - * @typedef ResetMissionControlCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {routerrpc.ResetMissionControlResponse} [response] ResetMissionControlResponse + * GetBlockResponse previous_block_hash. + * @member {string} previous_block_hash + * @memberof neutrinorpc.GetBlockResponse + * @instance */ + GetBlockResponse.prototype.previous_block_hash = ""; /** - * Calls ResetMissionControl. - * @function resetMissionControl - * @memberof routerrpc.Router + * GetBlockResponse raw_hex. + * @member {Uint8Array} raw_hex + * @memberof neutrinorpc.GetBlockResponse * @instance - * @param {routerrpc.IResetMissionControlRequest} request ResetMissionControlRequest message or plain object - * @param {routerrpc.Router.ResetMissionControlCallback} callback Node-style callback called with the error, if any, and ResetMissionControlResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Router.prototype.resetMissionControl = function resetMissionControl(request, callback) { - return this.rpcCall(resetMissionControl, $root.routerrpc.ResetMissionControlRequest, $root.routerrpc.ResetMissionControlResponse, request, callback); - }, "name", { value: "ResetMissionControl" }); + GetBlockResponse.prototype.raw_hex = $util.newBuffer([]); /** - * Calls ResetMissionControl. - * @function resetMissionControl - * @memberof routerrpc.Router - * @instance - * @param {routerrpc.IResetMissionControlRequest} request ResetMissionControlRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new GetBlockResponse instance using the specified properties. + * @function create + * @memberof neutrinorpc.GetBlockResponse + * @static + * @param {neutrinorpc.IGetBlockResponse=} [properties] Properties to set + * @returns {neutrinorpc.GetBlockResponse} GetBlockResponse instance */ + GetBlockResponse.create = function create(properties) { + return new GetBlockResponse(properties); + }; /** - * Callback as used by {@link routerrpc.Router#queryMissionControl}. - * @memberof routerrpc.Router - * @typedef QueryMissionControlCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {routerrpc.QueryMissionControlResponse} [response] QueryMissionControlResponse + * Encodes the specified GetBlockResponse message. Does not implicitly {@link neutrinorpc.GetBlockResponse.verify|verify} messages. + * @function encode + * @memberof neutrinorpc.GetBlockResponse + * @static + * @param {neutrinorpc.IGetBlockResponse} message GetBlockResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + GetBlockResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); + if (message.confirmations != null && Object.hasOwnProperty.call(message, "confirmations")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.confirmations); + if (message.stripped_size != null && Object.hasOwnProperty.call(message, "stripped_size")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.stripped_size); + if (message.size != null && Object.hasOwnProperty.call(message, "size")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.size); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.weight); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.height); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.version); + if (message.version_hex != null && Object.hasOwnProperty.call(message, "version_hex")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.version_hex); + if (message.merkleroot != null && Object.hasOwnProperty.call(message, "merkleroot")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.merkleroot); + if (message.tx != null && message.tx.length) + for (let i = 0; i < message.tx.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.tx[i]); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.time); + if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce")) + writer.uint32(/* id 12, wireType 0 =*/96).uint32(message.nonce); + if (message.bits != null && Object.hasOwnProperty.call(message, "bits")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.bits); + if (message.ntx != null && Object.hasOwnProperty.call(message, "ntx")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.ntx); + if (message.previous_block_hash != null && Object.hasOwnProperty.call(message, "previous_block_hash")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.previous_block_hash); + if (message.raw_hex != null && Object.hasOwnProperty.call(message, "raw_hex")) + writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.raw_hex); + return writer; + }; /** - * Calls QueryMissionControl. - * @function queryMissionControl - * @memberof routerrpc.Router - * @instance - * @param {routerrpc.IQueryMissionControlRequest} request QueryMissionControlRequest message or plain object - * @param {routerrpc.Router.QueryMissionControlCallback} callback Node-style callback called with the error, if any, and QueryMissionControlResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified GetBlockResponse message, length delimited. Does not implicitly {@link neutrinorpc.GetBlockResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof neutrinorpc.GetBlockResponse + * @static + * @param {neutrinorpc.IGetBlockResponse} message GetBlockResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(Router.prototype.queryMissionControl = function queryMissionControl(request, callback) { - return this.rpcCall(queryMissionControl, $root.routerrpc.QueryMissionControlRequest, $root.routerrpc.QueryMissionControlResponse, request, callback); - }, "name", { value: "QueryMissionControl" }); + GetBlockResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls QueryMissionControl. - * @function queryMissionControl - * @memberof routerrpc.Router - * @instance - * @param {routerrpc.IQueryMissionControlRequest} request QueryMissionControlRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a GetBlockResponse message from the specified reader or buffer. + * @function decode + * @memberof neutrinorpc.GetBlockResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {neutrinorpc.GetBlockResponse} GetBlockResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetBlockResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetBlockResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hash = reader.string(); + break; + } + case 2: { + message.confirmations = reader.int64(); + break; + } + case 3: { + message.stripped_size = reader.int64(); + break; + } + case 4: { + message.size = reader.int64(); + break; + } + case 5: { + message.weight = reader.int64(); + break; + } + case 6: { + message.height = reader.int32(); + break; + } + case 7: { + message.version = reader.int32(); + break; + } + case 8: { + message.version_hex = reader.string(); + break; + } + case 9: { + message.merkleroot = reader.string(); + break; + } + case 10: { + if (!(message.tx && message.tx.length)) + message.tx = []; + message.tx.push(reader.string()); + break; + } + case 11: { + message.time = reader.int64(); + break; + } + case 12: { + message.nonce = reader.uint32(); + break; + } + case 13: { + message.bits = reader.string(); + break; + } + case 14: { + message.ntx = reader.int32(); + break; + } + case 15: { + message.previous_block_hash = reader.string(); + break; + } + case 16: { + message.raw_hex = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link routerrpc.Router#xImportMissionControl}. - * @memberof routerrpc.Router - * @typedef XImportMissionControlCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {routerrpc.XImportMissionControlResponse} [response] XImportMissionControlResponse + * Decodes a GetBlockResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof neutrinorpc.GetBlockResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {neutrinorpc.GetBlockResponse} GetBlockResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetBlockResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls XImportMissionControl. - * @function xImportMissionControl - * @memberof routerrpc.Router - * @instance - * @param {routerrpc.IXImportMissionControlRequest} request XImportMissionControlRequest message or plain object - * @param {routerrpc.Router.XImportMissionControlCallback} callback Node-style callback called with the error, if any, and XImportMissionControlResponse - * @returns {undefined} - * @variation 1 + * Verifies a GetBlockResponse message. + * @function verify + * @memberof neutrinorpc.GetBlockResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(Router.prototype.xImportMissionControl = function xImportMissionControl(request, callback) { - return this.rpcCall(xImportMissionControl, $root.routerrpc.XImportMissionControlRequest, $root.routerrpc.XImportMissionControlResponse, request, callback); - }, "name", { value: "XImportMissionControl" }); + GetBlockResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + if (message.confirmations != null && message.hasOwnProperty("confirmations")) + if (!$util.isInteger(message.confirmations) && !(message.confirmations && $util.isInteger(message.confirmations.low) && $util.isInteger(message.confirmations.high))) + return "confirmations: integer|Long expected"; + if (message.stripped_size != null && message.hasOwnProperty("stripped_size")) + if (!$util.isInteger(message.stripped_size) && !(message.stripped_size && $util.isInteger(message.stripped_size.low) && $util.isInteger(message.stripped_size.high))) + return "stripped_size: integer|Long expected"; + if (message.size != null && message.hasOwnProperty("size")) + if (!$util.isInteger(message.size) && !(message.size && $util.isInteger(message.size.low) && $util.isInteger(message.size.high))) + return "size: integer|Long expected"; + if (message.weight != null && message.hasOwnProperty("weight")) + if (!$util.isInteger(message.weight) && !(message.weight && $util.isInteger(message.weight.low) && $util.isInteger(message.weight.high))) + return "weight: integer|Long expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.version_hex != null && message.hasOwnProperty("version_hex")) + if (!$util.isString(message.version_hex)) + return "version_hex: string expected"; + if (message.merkleroot != null && message.hasOwnProperty("merkleroot")) + if (!$util.isString(message.merkleroot)) + return "merkleroot: string expected"; + if (message.tx != null && message.hasOwnProperty("tx")) { + if (!Array.isArray(message.tx)) + return "tx: array expected"; + for (let i = 0; i < message.tx.length; ++i) + if (!$util.isString(message.tx[i])) + return "tx: string[] expected"; + } + if (message.time != null && message.hasOwnProperty("time")) + if (!$util.isInteger(message.time) && !(message.time && $util.isInteger(message.time.low) && $util.isInteger(message.time.high))) + return "time: integer|Long expected"; + if (message.nonce != null && message.hasOwnProperty("nonce")) + if (!$util.isInteger(message.nonce)) + return "nonce: integer expected"; + if (message.bits != null && message.hasOwnProperty("bits")) + if (!$util.isString(message.bits)) + return "bits: string expected"; + if (message.ntx != null && message.hasOwnProperty("ntx")) + if (!$util.isInteger(message.ntx)) + return "ntx: integer expected"; + if (message.previous_block_hash != null && message.hasOwnProperty("previous_block_hash")) + if (!$util.isString(message.previous_block_hash)) + return "previous_block_hash: string expected"; + if (message.raw_hex != null && message.hasOwnProperty("raw_hex")) + if (!(message.raw_hex && typeof message.raw_hex.length === "number" || $util.isString(message.raw_hex))) + return "raw_hex: buffer expected"; + return null; + }; /** - * Calls XImportMissionControl. - * @function xImportMissionControl - * @memberof routerrpc.Router - * @instance - * @param {routerrpc.IXImportMissionControlRequest} request XImportMissionControlRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a GetBlockResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof neutrinorpc.GetBlockResponse + * @static + * @param {Object.} object Plain object + * @returns {neutrinorpc.GetBlockResponse} GetBlockResponse */ + GetBlockResponse.fromObject = function fromObject(object) { + if (object instanceof $root.neutrinorpc.GetBlockResponse) + return object; + let message = new $root.neutrinorpc.GetBlockResponse(); + if (object.hash != null) + message.hash = String(object.hash); + if (object.confirmations != null) + if ($util.Long) + (message.confirmations = $util.Long.fromValue(object.confirmations)).unsigned = false; + else if (typeof object.confirmations === "string") + message.confirmations = parseInt(object.confirmations, 10); + else if (typeof object.confirmations === "number") + message.confirmations = object.confirmations; + else if (typeof object.confirmations === "object") + message.confirmations = new $util.LongBits(object.confirmations.low >>> 0, object.confirmations.high >>> 0).toNumber(); + if (object.stripped_size != null) + if ($util.Long) + (message.stripped_size = $util.Long.fromValue(object.stripped_size)).unsigned = false; + else if (typeof object.stripped_size === "string") + message.stripped_size = parseInt(object.stripped_size, 10); + else if (typeof object.stripped_size === "number") + message.stripped_size = object.stripped_size; + else if (typeof object.stripped_size === "object") + message.stripped_size = new $util.LongBits(object.stripped_size.low >>> 0, object.stripped_size.high >>> 0).toNumber(); + if (object.size != null) + if ($util.Long) + (message.size = $util.Long.fromValue(object.size)).unsigned = false; + else if (typeof object.size === "string") + message.size = parseInt(object.size, 10); + else if (typeof object.size === "number") + message.size = object.size; + else if (typeof object.size === "object") + message.size = new $util.LongBits(object.size.low >>> 0, object.size.high >>> 0).toNumber(); + if (object.weight != null) + if ($util.Long) + (message.weight = $util.Long.fromValue(object.weight)).unsigned = false; + else if (typeof object.weight === "string") + message.weight = parseInt(object.weight, 10); + else if (typeof object.weight === "number") + message.weight = object.weight; + else if (typeof object.weight === "object") + message.weight = new $util.LongBits(object.weight.low >>> 0, object.weight.high >>> 0).toNumber(); + if (object.height != null) + message.height = object.height | 0; + if (object.version != null) + message.version = object.version | 0; + if (object.version_hex != null) + message.version_hex = String(object.version_hex); + if (object.merkleroot != null) + message.merkleroot = String(object.merkleroot); + if (object.tx) { + if (!Array.isArray(object.tx)) + throw TypeError(".neutrinorpc.GetBlockResponse.tx: array expected"); + message.tx = []; + for (let i = 0; i < object.tx.length; ++i) + message.tx[i] = String(object.tx[i]); + } + if (object.time != null) + if ($util.Long) + (message.time = $util.Long.fromValue(object.time)).unsigned = false; + else if (typeof object.time === "string") + message.time = parseInt(object.time, 10); + else if (typeof object.time === "number") + message.time = object.time; + else if (typeof object.time === "object") + message.time = new $util.LongBits(object.time.low >>> 0, object.time.high >>> 0).toNumber(); + if (object.nonce != null) + message.nonce = object.nonce >>> 0; + if (object.bits != null) + message.bits = String(object.bits); + if (object.ntx != null) + message.ntx = object.ntx | 0; + if (object.previous_block_hash != null) + message.previous_block_hash = String(object.previous_block_hash); + if (object.raw_hex != null) + if (typeof object.raw_hex === "string") + $util.base64.decode(object.raw_hex, message.raw_hex = $util.newBuffer($util.base64.length(object.raw_hex)), 0); + else if (object.raw_hex.length >= 0) + message.raw_hex = object.raw_hex; + return message; + }; /** - * Callback as used by {@link routerrpc.Router#getMissionControlConfig}. - * @memberof routerrpc.Router - * @typedef GetMissionControlConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {routerrpc.GetMissionControlConfigResponse} [response] GetMissionControlConfigResponse + * Creates a plain object from a GetBlockResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof neutrinorpc.GetBlockResponse + * @static + * @param {neutrinorpc.GetBlockResponse} message GetBlockResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + GetBlockResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.tx = []; + if (options.defaults) { + object.hash = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.confirmations = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.confirmations = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.stripped_size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.stripped_size = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.size = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.weight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.weight = options.longs === String ? "0" : 0; + object.height = 0; + object.version = 0; + object.version_hex = ""; + object.merkleroot = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.time = options.longs === String ? "0" : 0; + object.nonce = 0; + object.bits = ""; + object.ntx = 0; + object.previous_block_hash = ""; + if (options.bytes === String) + object.raw_hex = ""; + else { + object.raw_hex = []; + if (options.bytes !== Array) + object.raw_hex = $util.newBuffer(object.raw_hex); + } + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + if (message.confirmations != null && message.hasOwnProperty("confirmations")) + if (typeof message.confirmations === "number") + object.confirmations = options.longs === String ? String(message.confirmations) : message.confirmations; + else + object.confirmations = options.longs === String ? $util.Long.prototype.toString.call(message.confirmations) : options.longs === Number ? new $util.LongBits(message.confirmations.low >>> 0, message.confirmations.high >>> 0).toNumber() : message.confirmations; + if (message.stripped_size != null && message.hasOwnProperty("stripped_size")) + if (typeof message.stripped_size === "number") + object.stripped_size = options.longs === String ? String(message.stripped_size) : message.stripped_size; + else + object.stripped_size = options.longs === String ? $util.Long.prototype.toString.call(message.stripped_size) : options.longs === Number ? new $util.LongBits(message.stripped_size.low >>> 0, message.stripped_size.high >>> 0).toNumber() : message.stripped_size; + if (message.size != null && message.hasOwnProperty("size")) + if (typeof message.size === "number") + object.size = options.longs === String ? String(message.size) : message.size; + else + object.size = options.longs === String ? $util.Long.prototype.toString.call(message.size) : options.longs === Number ? new $util.LongBits(message.size.low >>> 0, message.size.high >>> 0).toNumber() : message.size; + if (message.weight != null && message.hasOwnProperty("weight")) + if (typeof message.weight === "number") + object.weight = options.longs === String ? String(message.weight) : message.weight; + else + object.weight = options.longs === String ? $util.Long.prototype.toString.call(message.weight) : options.longs === Number ? new $util.LongBits(message.weight.low >>> 0, message.weight.high >>> 0).toNumber() : message.weight; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.version_hex != null && message.hasOwnProperty("version_hex")) + object.version_hex = message.version_hex; + if (message.merkleroot != null && message.hasOwnProperty("merkleroot")) + object.merkleroot = message.merkleroot; + if (message.tx && message.tx.length) { + object.tx = []; + for (let j = 0; j < message.tx.length; ++j) + object.tx[j] = message.tx[j]; + } + if (message.time != null && message.hasOwnProperty("time")) + if (typeof message.time === "number") + object.time = options.longs === String ? String(message.time) : message.time; + else + object.time = options.longs === String ? $util.Long.prototype.toString.call(message.time) : options.longs === Number ? new $util.LongBits(message.time.low >>> 0, message.time.high >>> 0).toNumber() : message.time; + if (message.nonce != null && message.hasOwnProperty("nonce")) + object.nonce = message.nonce; + if (message.bits != null && message.hasOwnProperty("bits")) + object.bits = message.bits; + if (message.ntx != null && message.hasOwnProperty("ntx")) + object.ntx = message.ntx; + if (message.previous_block_hash != null && message.hasOwnProperty("previous_block_hash")) + object.previous_block_hash = message.previous_block_hash; + if (message.raw_hex != null && message.hasOwnProperty("raw_hex")) + object.raw_hex = options.bytes === String ? $util.base64.encode(message.raw_hex, 0, message.raw_hex.length) : options.bytes === Array ? Array.prototype.slice.call(message.raw_hex) : message.raw_hex; + return object; + }; /** - * Calls GetMissionControlConfig. - * @function getMissionControlConfig - * @memberof routerrpc.Router + * Converts this GetBlockResponse to JSON. + * @function toJSON + * @memberof neutrinorpc.GetBlockResponse * @instance - * @param {routerrpc.IGetMissionControlConfigRequest} request GetMissionControlConfigRequest message or plain object - * @param {routerrpc.Router.GetMissionControlConfigCallback} callback Node-style callback called with the error, if any, and GetMissionControlConfigResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(Router.prototype.getMissionControlConfig = function getMissionControlConfig(request, callback) { - return this.rpcCall(getMissionControlConfig, $root.routerrpc.GetMissionControlConfigRequest, $root.routerrpc.GetMissionControlConfigResponse, request, callback); - }, "name", { value: "GetMissionControlConfig" }); + GetBlockResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls GetMissionControlConfig. - * @function getMissionControlConfig - * @memberof routerrpc.Router - * @instance - * @param {routerrpc.IGetMissionControlConfigRequest} request GetMissionControlConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for GetBlockResponse + * @function getTypeUrl + * @memberof neutrinorpc.GetBlockResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + GetBlockResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/neutrinorpc.GetBlockResponse"; + }; + + return GetBlockResponse; + })(); + + neutrinorpc.GetCFilterRequest = (function() { /** - * Callback as used by {@link routerrpc.Router#setMissionControlConfig}. - * @memberof routerrpc.Router - * @typedef SetMissionControlConfigCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {routerrpc.SetMissionControlConfigResponse} [response] SetMissionControlConfigResponse + * Properties of a GetCFilterRequest. + * @memberof neutrinorpc + * @interface IGetCFilterRequest + * @property {string|null} [hash] GetCFilterRequest hash */ /** - * Calls SetMissionControlConfig. - * @function setMissionControlConfig - * @memberof routerrpc.Router - * @instance - * @param {routerrpc.ISetMissionControlConfigRequest} request SetMissionControlConfigRequest message or plain object - * @param {routerrpc.Router.SetMissionControlConfigCallback} callback Node-style callback called with the error, if any, and SetMissionControlConfigResponse - * @returns {undefined} - * @variation 1 + * Constructs a new GetCFilterRequest. + * @memberof neutrinorpc + * @classdesc Represents a GetCFilterRequest. + * @implements IGetCFilterRequest + * @constructor + * @param {neutrinorpc.IGetCFilterRequest=} [properties] Properties to set */ - Object.defineProperty(Router.prototype.setMissionControlConfig = function setMissionControlConfig(request, callback) { - return this.rpcCall(setMissionControlConfig, $root.routerrpc.SetMissionControlConfigRequest, $root.routerrpc.SetMissionControlConfigResponse, request, callback); - }, "name", { value: "SetMissionControlConfig" }); + function GetCFilterRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls SetMissionControlConfig. - * @function setMissionControlConfig - * @memberof routerrpc.Router + * GetCFilterRequest hash. + * @member {string} hash + * @memberof neutrinorpc.GetCFilterRequest * @instance - * @param {routerrpc.ISetMissionControlConfigRequest} request SetMissionControlConfigRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + GetCFilterRequest.prototype.hash = ""; /** - * Callback as used by {@link routerrpc.Router#queryProbability}. - * @memberof routerrpc.Router - * @typedef QueryProbabilityCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {routerrpc.QueryProbabilityResponse} [response] QueryProbabilityResponse + * Creates a new GetCFilterRequest instance using the specified properties. + * @function create + * @memberof neutrinorpc.GetCFilterRequest + * @static + * @param {neutrinorpc.IGetCFilterRequest=} [properties] Properties to set + * @returns {neutrinorpc.GetCFilterRequest} GetCFilterRequest instance */ + GetCFilterRequest.create = function create(properties) { + return new GetCFilterRequest(properties); + }; /** - * Calls QueryProbability. - * @function queryProbability - * @memberof routerrpc.Router - * @instance - * @param {routerrpc.IQueryProbabilityRequest} request QueryProbabilityRequest message or plain object - * @param {routerrpc.Router.QueryProbabilityCallback} callback Node-style callback called with the error, if any, and QueryProbabilityResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified GetCFilterRequest message. Does not implicitly {@link neutrinorpc.GetCFilterRequest.verify|verify} messages. + * @function encode + * @memberof neutrinorpc.GetCFilterRequest + * @static + * @param {neutrinorpc.IGetCFilterRequest} message GetCFilterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(Router.prototype.queryProbability = function queryProbability(request, callback) { - return this.rpcCall(queryProbability, $root.routerrpc.QueryProbabilityRequest, $root.routerrpc.QueryProbabilityResponse, request, callback); - }, "name", { value: "QueryProbability" }); + GetCFilterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); + return writer; + }; /** - * Calls QueryProbability. - * @function queryProbability - * @memberof routerrpc.Router - * @instance - * @param {routerrpc.IQueryProbabilityRequest} request QueryProbabilityRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified GetCFilterRequest message, length delimited. Does not implicitly {@link neutrinorpc.GetCFilterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof neutrinorpc.GetCFilterRequest + * @static + * @param {neutrinorpc.IGetCFilterRequest} message GetCFilterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + GetCFilterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link routerrpc.Router#buildRoute}. - * @memberof routerrpc.Router - * @typedef BuildRouteCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {routerrpc.BuildRouteResponse} [response] BuildRouteResponse + * Decodes a GetCFilterRequest message from the specified reader or buffer. + * @function decode + * @memberof neutrinorpc.GetCFilterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {neutrinorpc.GetCFilterRequest} GetCFilterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetCFilterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetCFilterRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hash = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls BuildRoute. - * @function buildRoute - * @memberof routerrpc.Router - * @instance - * @param {routerrpc.IBuildRouteRequest} request BuildRouteRequest message or plain object - * @param {routerrpc.Router.BuildRouteCallback} callback Node-style callback called with the error, if any, and BuildRouteResponse - * @returns {undefined} - * @variation 1 + * Decodes a GetCFilterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof neutrinorpc.GetCFilterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {neutrinorpc.GetCFilterRequest} GetCFilterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(Router.prototype.buildRoute = function buildRoute(request, callback) { - return this.rpcCall(buildRoute, $root.routerrpc.BuildRouteRequest, $root.routerrpc.BuildRouteResponse, request, callback); - }, "name", { value: "BuildRoute" }); + GetCFilterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls BuildRoute. - * @function buildRoute - * @memberof routerrpc.Router - * @instance - * @param {routerrpc.IBuildRouteRequest} request BuildRouteRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a GetCFilterRequest message. + * @function verify + * @memberof neutrinorpc.GetCFilterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + GetCFilterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + return null; + }; /** - * Callback as used by {@link routerrpc.Router#subscribeHtlcEvents}. - * @memberof routerrpc.Router - * @typedef SubscribeHtlcEventsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {routerrpc.HtlcEvent} [response] HtlcEvent + * Creates a GetCFilterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof neutrinorpc.GetCFilterRequest + * @static + * @param {Object.} object Plain object + * @returns {neutrinorpc.GetCFilterRequest} GetCFilterRequest */ + GetCFilterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.neutrinorpc.GetCFilterRequest) + return object; + let message = new $root.neutrinorpc.GetCFilterRequest(); + if (object.hash != null) + message.hash = String(object.hash); + return message; + }; /** - * Calls SubscribeHtlcEvents. - * @function subscribeHtlcEvents - * @memberof routerrpc.Router - * @instance - * @param {routerrpc.ISubscribeHtlcEventsRequest} request SubscribeHtlcEventsRequest message or plain object - * @param {routerrpc.Router.SubscribeHtlcEventsCallback} callback Node-style callback called with the error, if any, and HtlcEvent - * @returns {undefined} - * @variation 1 + * Creates a plain object from a GetCFilterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof neutrinorpc.GetCFilterRequest + * @static + * @param {neutrinorpc.GetCFilterRequest} message GetCFilterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(Router.prototype.subscribeHtlcEvents = function subscribeHtlcEvents(request, callback) { - return this.rpcCall(subscribeHtlcEvents, $root.routerrpc.SubscribeHtlcEventsRequest, $root.routerrpc.HtlcEvent, request, callback); - }, "name", { value: "SubscribeHtlcEvents" }); + GetCFilterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.hash = ""; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + return object; + }; /** - * Calls SubscribeHtlcEvents. - * @function subscribeHtlcEvents - * @memberof routerrpc.Router + * Converts this GetCFilterRequest to JSON. + * @function toJSON + * @memberof neutrinorpc.GetCFilterRequest * @instance - * @param {routerrpc.ISubscribeHtlcEventsRequest} request SubscribeHtlcEventsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + GetCFilterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Callback as used by {@link routerrpc.Router#sendPayment}. - * @memberof routerrpc.Router - * @typedef SendPaymentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {routerrpc.PaymentStatus} [response] PaymentStatus + * Gets the default type url for GetCFilterRequest + * @function getTypeUrl + * @memberof neutrinorpc.GetCFilterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCFilterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/neutrinorpc.GetCFilterRequest"; + }; + + return GetCFilterRequest; + })(); + + neutrinorpc.GetCFilterResponse = (function() { + + /** + * Properties of a GetCFilterResponse. + * @memberof neutrinorpc + * @interface IGetCFilterResponse + * @property {Uint8Array|null} [filter] GetCFilterResponse filter */ /** - * Calls SendPayment. - * @function sendPayment - * @memberof routerrpc.Router - * @instance - * @param {routerrpc.ISendPaymentRequest} request SendPaymentRequest message or plain object - * @param {routerrpc.Router.SendPaymentCallback} callback Node-style callback called with the error, if any, and PaymentStatus - * @returns {undefined} - * @variation 1 + * Constructs a new GetCFilterResponse. + * @memberof neutrinorpc + * @classdesc Represents a GetCFilterResponse. + * @implements IGetCFilterResponse + * @constructor + * @param {neutrinorpc.IGetCFilterResponse=} [properties] Properties to set */ - Object.defineProperty(Router.prototype.sendPayment = function sendPayment(request, callback) { - return this.rpcCall(sendPayment, $root.routerrpc.SendPaymentRequest, $root.routerrpc.PaymentStatus, request, callback); - }, "name", { value: "SendPayment" }); + function GetCFilterResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls SendPayment. - * @function sendPayment - * @memberof routerrpc.Router + * GetCFilterResponse filter. + * @member {Uint8Array} filter + * @memberof neutrinorpc.GetCFilterResponse * @instance - * @param {routerrpc.ISendPaymentRequest} request SendPaymentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + GetCFilterResponse.prototype.filter = $util.newBuffer([]); /** - * Callback as used by {@link routerrpc.Router#trackPayment}. - * @memberof routerrpc.Router - * @typedef TrackPaymentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {routerrpc.PaymentStatus} [response] PaymentStatus + * Creates a new GetCFilterResponse instance using the specified properties. + * @function create + * @memberof neutrinorpc.GetCFilterResponse + * @static + * @param {neutrinorpc.IGetCFilterResponse=} [properties] Properties to set + * @returns {neutrinorpc.GetCFilterResponse} GetCFilterResponse instance */ + GetCFilterResponse.create = function create(properties) { + return new GetCFilterResponse(properties); + }; /** - * Calls TrackPayment. - * @function trackPayment - * @memberof routerrpc.Router - * @instance - * @param {routerrpc.ITrackPaymentRequest} request TrackPaymentRequest message or plain object - * @param {routerrpc.Router.TrackPaymentCallback} callback Node-style callback called with the error, if any, and PaymentStatus - * @returns {undefined} - * @variation 1 + * Encodes the specified GetCFilterResponse message. Does not implicitly {@link neutrinorpc.GetCFilterResponse.verify|verify} messages. + * @function encode + * @memberof neutrinorpc.GetCFilterResponse + * @static + * @param {neutrinorpc.IGetCFilterResponse} message GetCFilterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(Router.prototype.trackPayment = function trackPayment(request, callback) { - return this.rpcCall(trackPayment, $root.routerrpc.TrackPaymentRequest, $root.routerrpc.PaymentStatus, request, callback); - }, "name", { value: "TrackPayment" }); + GetCFilterResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.filter); + return writer; + }; /** - * Calls TrackPayment. - * @function trackPayment - * @memberof routerrpc.Router - * @instance - * @param {routerrpc.ITrackPaymentRequest} request TrackPaymentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified GetCFilterResponse message, length delimited. Does not implicitly {@link neutrinorpc.GetCFilterResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof neutrinorpc.GetCFilterResponse + * @static + * @param {neutrinorpc.IGetCFilterResponse} message GetCFilterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + GetCFilterResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link routerrpc.Router#htlcInterceptor}. - * @memberof routerrpc.Router - * @typedef HtlcInterceptorCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {routerrpc.ForwardHtlcInterceptRequest} [response] ForwardHtlcInterceptRequest + * Decodes a GetCFilterResponse message from the specified reader or buffer. + * @function decode + * @memberof neutrinorpc.GetCFilterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {neutrinorpc.GetCFilterResponse} GetCFilterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetCFilterResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetCFilterResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.filter = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * HtlcInterceptor dispatches a bi-directional streaming RPC in which - * Forwarded HTLC requests are sent to the client and the client responds with - * a boolean that tells LND if this htlc should be intercepted. - * In case of interception, the htlc can be either settled, cancelled or - * resumed later by using the ResolveHoldForward endpoint. - * @function htlcInterceptor - * @memberof routerrpc.Router - * @instance - * @param {routerrpc.IForwardHtlcInterceptResponse} request ForwardHtlcInterceptResponse message or plain object - * @param {routerrpc.Router.HtlcInterceptorCallback} callback Node-style callback called with the error, if any, and ForwardHtlcInterceptRequest - * @returns {undefined} - * @variation 1 + * Decodes a GetCFilterResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof neutrinorpc.GetCFilterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {neutrinorpc.GetCFilterResponse} GetCFilterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(Router.prototype.htlcInterceptor = function htlcInterceptor(request, callback) { - return this.rpcCall(htlcInterceptor, $root.routerrpc.ForwardHtlcInterceptResponse, $root.routerrpc.ForwardHtlcInterceptRequest, request, callback); - }, "name", { value: "HtlcInterceptor" }); + GetCFilterResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * HtlcInterceptor dispatches a bi-directional streaming RPC in which - * Forwarded HTLC requests are sent to the client and the client responds with - * a boolean that tells LND if this htlc should be intercepted. - * In case of interception, the htlc can be either settled, cancelled or - * resumed later by using the ResolveHoldForward endpoint. - * @function htlcInterceptor - * @memberof routerrpc.Router - * @instance - * @param {routerrpc.IForwardHtlcInterceptResponse} request ForwardHtlcInterceptResponse message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a GetCFilterResponse message. + * @function verify + * @memberof neutrinorpc.GetCFilterResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + GetCFilterResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!(message.filter && typeof message.filter.length === "number" || $util.isString(message.filter))) + return "filter: buffer expected"; + return null; + }; /** - * Callback as used by {@link routerrpc.Router#updateChanStatus}. - * @memberof routerrpc.Router - * @typedef UpdateChanStatusCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {routerrpc.UpdateChanStatusResponse} [response] UpdateChanStatusResponse + * Creates a GetCFilterResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof neutrinorpc.GetCFilterResponse + * @static + * @param {Object.} object Plain object + * @returns {neutrinorpc.GetCFilterResponse} GetCFilterResponse */ + GetCFilterResponse.fromObject = function fromObject(object) { + if (object instanceof $root.neutrinorpc.GetCFilterResponse) + return object; + let message = new $root.neutrinorpc.GetCFilterResponse(); + if (object.filter != null) + if (typeof object.filter === "string") + $util.base64.decode(object.filter, message.filter = $util.newBuffer($util.base64.length(object.filter)), 0); + else if (object.filter.length >= 0) + message.filter = object.filter; + return message; + }; /** - * Calls UpdateChanStatus. - * @function updateChanStatus - * @memberof routerrpc.Router - * @instance - * @param {routerrpc.IUpdateChanStatusRequest} request UpdateChanStatusRequest message or plain object - * @param {routerrpc.Router.UpdateChanStatusCallback} callback Node-style callback called with the error, if any, and UpdateChanStatusResponse - * @returns {undefined} - * @variation 1 + * Creates a plain object from a GetCFilterResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof neutrinorpc.GetCFilterResponse + * @static + * @param {neutrinorpc.GetCFilterResponse} message GetCFilterResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(Router.prototype.updateChanStatus = function updateChanStatus(request, callback) { - return this.rpcCall(updateChanStatus, $root.routerrpc.UpdateChanStatusRequest, $root.routerrpc.UpdateChanStatusResponse, request, callback); - }, "name", { value: "UpdateChanStatus" }); + GetCFilterResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if (options.bytes === String) + object.filter = ""; + else { + object.filter = []; + if (options.bytes !== Array) + object.filter = $util.newBuffer(object.filter); + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = options.bytes === String ? $util.base64.encode(message.filter, 0, message.filter.length) : options.bytes === Array ? Array.prototype.slice.call(message.filter) : message.filter; + return object; + }; /** - * Calls UpdateChanStatus. - * @function updateChanStatus - * @memberof routerrpc.Router + * Converts this GetCFilterResponse to JSON. + * @function toJSON + * @memberof neutrinorpc.GetCFilterResponse * @instance - * @param {routerrpc.IUpdateChanStatusRequest} request UpdateChanStatusRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + GetCFilterResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Router; + /** + * Gets the default type url for GetCFilterResponse + * @function getTypeUrl + * @memberof neutrinorpc.GetCFilterResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCFilterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/neutrinorpc.GetCFilterResponse"; + }; + + return GetCFilterResponse; })(); - routerrpc.SendPaymentRequest = (function() { + neutrinorpc.GetBlockHashRequest = (function() { /** - * Properties of a SendPaymentRequest. - * @memberof routerrpc - * @interface ISendPaymentRequest - * @property {Uint8Array|null} [dest] SendPaymentRequest dest - * @property {Long|null} [amt] SendPaymentRequest amt - * @property {Uint8Array|null} [payment_hash] SendPaymentRequest payment_hash - * @property {number|null} [final_cltv_delta] SendPaymentRequest final_cltv_delta - * @property {string|null} [payment_request] SendPaymentRequest payment_request - * @property {number|null} [timeout_seconds] SendPaymentRequest timeout_seconds - * @property {Long|null} [fee_limit_sat] SendPaymentRequest fee_limit_sat - * @property {Long|null} [outgoing_chan_id] SendPaymentRequest outgoing_chan_id - * @property {number|null} [cltv_limit] SendPaymentRequest cltv_limit - * @property {Array.|null} [route_hints] SendPaymentRequest route_hints - * @property {Object.|null} [dest_custom_records] SendPaymentRequest dest_custom_records - * @property {Long|null} [amt_msat] SendPaymentRequest amt_msat - * @property {Long|null} [fee_limit_msat] SendPaymentRequest fee_limit_msat - * @property {Uint8Array|null} [last_hop_pubkey] SendPaymentRequest last_hop_pubkey - * @property {boolean|null} [allow_self_payment] SendPaymentRequest allow_self_payment - * @property {Array.|null} [dest_features] SendPaymentRequest dest_features - * @property {number|null} [max_parts] SendPaymentRequest max_parts - * @property {boolean|null} [no_inflight_updates] SendPaymentRequest no_inflight_updates - * @property {Array.|null} [outgoing_chan_ids] SendPaymentRequest outgoing_chan_ids - * @property {Uint8Array|null} [payment_addr] SendPaymentRequest payment_addr - * @property {Long|null} [max_shard_size_msat] SendPaymentRequest max_shard_size_msat - * @property {boolean|null} [amp] SendPaymentRequest amp - * @property {number|null} [time_pref] SendPaymentRequest time_pref + * Properties of a GetBlockHashRequest. + * @memberof neutrinorpc + * @interface IGetBlockHashRequest + * @property {number|null} [height] GetBlockHashRequest height */ /** - * Constructs a new SendPaymentRequest. - * @memberof routerrpc - * @classdesc Represents a SendPaymentRequest. - * @implements ISendPaymentRequest + * Constructs a new GetBlockHashRequest. + * @memberof neutrinorpc + * @classdesc Represents a GetBlockHashRequest. + * @implements IGetBlockHashRequest * @constructor - * @param {routerrpc.ISendPaymentRequest=} [properties] Properties to set + * @param {neutrinorpc.IGetBlockHashRequest=} [properties] Properties to set */ - function SendPaymentRequest(properties) { - this.route_hints = []; - this.dest_custom_records = {}; - this.dest_features = []; - this.outgoing_chan_ids = []; + function GetBlockHashRequest(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -84554,428 +85125,2616 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * SendPaymentRequest dest. - * @member {Uint8Array} dest - * @memberof routerrpc.SendPaymentRequest + * GetBlockHashRequest height. + * @member {number} height + * @memberof neutrinorpc.GetBlockHashRequest * @instance */ - SendPaymentRequest.prototype.dest = $util.newBuffer([]); + GetBlockHashRequest.prototype.height = 0; /** - * SendPaymentRequest amt. - * @member {Long} amt - * @memberof routerrpc.SendPaymentRequest - * @instance + * Creates a new GetBlockHashRequest instance using the specified properties. + * @function create + * @memberof neutrinorpc.GetBlockHashRequest + * @static + * @param {neutrinorpc.IGetBlockHashRequest=} [properties] Properties to set + * @returns {neutrinorpc.GetBlockHashRequest} GetBlockHashRequest instance */ - SendPaymentRequest.prototype.amt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + GetBlockHashRequest.create = function create(properties) { + return new GetBlockHashRequest(properties); + }; /** - * SendPaymentRequest payment_hash. - * @member {Uint8Array} payment_hash - * @memberof routerrpc.SendPaymentRequest + * Encodes the specified GetBlockHashRequest message. Does not implicitly {@link neutrinorpc.GetBlockHashRequest.verify|verify} messages. + * @function encode + * @memberof neutrinorpc.GetBlockHashRequest + * @static + * @param {neutrinorpc.IGetBlockHashRequest} message GetBlockHashRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBlockHashRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.height); + return writer; + }; + + /** + * Encodes the specified GetBlockHashRequest message, length delimited. Does not implicitly {@link neutrinorpc.GetBlockHashRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof neutrinorpc.GetBlockHashRequest + * @static + * @param {neutrinorpc.IGetBlockHashRequest} message GetBlockHashRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBlockHashRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBlockHashRequest message from the specified reader or buffer. + * @function decode + * @memberof neutrinorpc.GetBlockHashRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {neutrinorpc.GetBlockHashRequest} GetBlockHashRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBlockHashRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetBlockHashRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.height = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBlockHashRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof neutrinorpc.GetBlockHashRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {neutrinorpc.GetBlockHashRequest} GetBlockHashRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBlockHashRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBlockHashRequest message. + * @function verify + * @memberof neutrinorpc.GetBlockHashRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBlockHashRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + return null; + }; + + /** + * Creates a GetBlockHashRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof neutrinorpc.GetBlockHashRequest + * @static + * @param {Object.} object Plain object + * @returns {neutrinorpc.GetBlockHashRequest} GetBlockHashRequest + */ + GetBlockHashRequest.fromObject = function fromObject(object) { + if (object instanceof $root.neutrinorpc.GetBlockHashRequest) + return object; + let message = new $root.neutrinorpc.GetBlockHashRequest(); + if (object.height != null) + message.height = object.height | 0; + return message; + }; + + /** + * Creates a plain object from a GetBlockHashRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof neutrinorpc.GetBlockHashRequest + * @static + * @param {neutrinorpc.GetBlockHashRequest} message GetBlockHashRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBlockHashRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.height = 0; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + return object; + }; + + /** + * Converts this GetBlockHashRequest to JSON. + * @function toJSON + * @memberof neutrinorpc.GetBlockHashRequest * @instance + * @returns {Object.} JSON object */ - SendPaymentRequest.prototype.payment_hash = $util.newBuffer([]); + GetBlockHashRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * SendPaymentRequest final_cltv_delta. - * @member {number} final_cltv_delta - * @memberof routerrpc.SendPaymentRequest + * Gets the default type url for GetBlockHashRequest + * @function getTypeUrl + * @memberof neutrinorpc.GetBlockHashRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBlockHashRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/neutrinorpc.GetBlockHashRequest"; + }; + + return GetBlockHashRequest; + })(); + + neutrinorpc.GetBlockHashResponse = (function() { + + /** + * Properties of a GetBlockHashResponse. + * @memberof neutrinorpc + * @interface IGetBlockHashResponse + * @property {string|null} [hash] GetBlockHashResponse hash + */ + + /** + * Constructs a new GetBlockHashResponse. + * @memberof neutrinorpc + * @classdesc Represents a GetBlockHashResponse. + * @implements IGetBlockHashResponse + * @constructor + * @param {neutrinorpc.IGetBlockHashResponse=} [properties] Properties to set + */ + function GetBlockHashResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBlockHashResponse hash. + * @member {string} hash + * @memberof neutrinorpc.GetBlockHashResponse * @instance */ - SendPaymentRequest.prototype.final_cltv_delta = 0; + GetBlockHashResponse.prototype.hash = ""; /** - * SendPaymentRequest payment_request. - * @member {string} payment_request - * @memberof routerrpc.SendPaymentRequest + * Creates a new GetBlockHashResponse instance using the specified properties. + * @function create + * @memberof neutrinorpc.GetBlockHashResponse + * @static + * @param {neutrinorpc.IGetBlockHashResponse=} [properties] Properties to set + * @returns {neutrinorpc.GetBlockHashResponse} GetBlockHashResponse instance + */ + GetBlockHashResponse.create = function create(properties) { + return new GetBlockHashResponse(properties); + }; + + /** + * Encodes the specified GetBlockHashResponse message. Does not implicitly {@link neutrinorpc.GetBlockHashResponse.verify|verify} messages. + * @function encode + * @memberof neutrinorpc.GetBlockHashResponse + * @static + * @param {neutrinorpc.IGetBlockHashResponse} message GetBlockHashResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBlockHashResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); + return writer; + }; + + /** + * Encodes the specified GetBlockHashResponse message, length delimited. Does not implicitly {@link neutrinorpc.GetBlockHashResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof neutrinorpc.GetBlockHashResponse + * @static + * @param {neutrinorpc.IGetBlockHashResponse} message GetBlockHashResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBlockHashResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBlockHashResponse message from the specified reader or buffer. + * @function decode + * @memberof neutrinorpc.GetBlockHashResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {neutrinorpc.GetBlockHashResponse} GetBlockHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBlockHashResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetBlockHashResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hash = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBlockHashResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof neutrinorpc.GetBlockHashResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {neutrinorpc.GetBlockHashResponse} GetBlockHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBlockHashResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBlockHashResponse message. + * @function verify + * @memberof neutrinorpc.GetBlockHashResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBlockHashResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + return null; + }; + + /** + * Creates a GetBlockHashResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof neutrinorpc.GetBlockHashResponse + * @static + * @param {Object.} object Plain object + * @returns {neutrinorpc.GetBlockHashResponse} GetBlockHashResponse + */ + GetBlockHashResponse.fromObject = function fromObject(object) { + if (object instanceof $root.neutrinorpc.GetBlockHashResponse) + return object; + let message = new $root.neutrinorpc.GetBlockHashResponse(); + if (object.hash != null) + message.hash = String(object.hash); + return message; + }; + + /** + * Creates a plain object from a GetBlockHashResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof neutrinorpc.GetBlockHashResponse + * @static + * @param {neutrinorpc.GetBlockHashResponse} message GetBlockHashResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBlockHashResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.hash = ""; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + return object; + }; + + /** + * Converts this GetBlockHashResponse to JSON. + * @function toJSON + * @memberof neutrinorpc.GetBlockHashResponse * @instance + * @returns {Object.} JSON object */ - SendPaymentRequest.prototype.payment_request = ""; + GetBlockHashResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * SendPaymentRequest timeout_seconds. - * @member {number} timeout_seconds - * @memberof routerrpc.SendPaymentRequest + * Gets the default type url for GetBlockHashResponse + * @function getTypeUrl + * @memberof neutrinorpc.GetBlockHashResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBlockHashResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/neutrinorpc.GetBlockHashResponse"; + }; + + return GetBlockHashResponse; + })(); + + return neutrinorpc; +})(); + +export const routerrpc = $root.routerrpc = (() => { + + /** + * Namespace routerrpc. + * @exports routerrpc + * @namespace + */ + const routerrpc = {}; + + routerrpc.Router = (function() { + + /** + * Constructs a new Router service. + * @memberof routerrpc + * @classdesc Represents a Router + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Router(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Router.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Router; + + /** + * Creates new Router service using the specified rpc implementation. + * @function create + * @memberof routerrpc.Router + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Router} RPC service. Useful where requests and/or responses are streamed. + */ + Router.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link routerrpc.Router#sendPaymentV2}. + * @memberof routerrpc.Router + * @typedef SendPaymentV2Callback + * @type {function} + * @param {Error|null} error Error, if any + * @param {lnrpc.Payment} [response] Payment + */ + + /** + * Calls SendPaymentV2. + * @function sendPaymentV2 + * @memberof routerrpc.Router * @instance + * @param {routerrpc.ISendPaymentRequest} request SendPaymentRequest message or plain object + * @param {routerrpc.Router.SendPaymentV2Callback} callback Node-style callback called with the error, if any, and Payment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.sendPaymentV2 = function sendPaymentV2(request, callback) { + return this.rpcCall(sendPaymentV2, $root.routerrpc.SendPaymentRequest, $root.lnrpc.Payment, request, callback); + }, "name", { value: "SendPaymentV2" }); + + /** + * Calls SendPaymentV2. + * @function sendPaymentV2 + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.ISendPaymentRequest} request SendPaymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#trackPaymentV2}. + * @memberof routerrpc.Router + * @typedef TrackPaymentV2Callback + * @type {function} + * @param {Error|null} error Error, if any + * @param {lnrpc.Payment} [response] Payment + */ + + /** + * Calls TrackPaymentV2. + * @function trackPaymentV2 + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.ITrackPaymentRequest} request TrackPaymentRequest message or plain object + * @param {routerrpc.Router.TrackPaymentV2Callback} callback Node-style callback called with the error, if any, and Payment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.trackPaymentV2 = function trackPaymentV2(request, callback) { + return this.rpcCall(trackPaymentV2, $root.routerrpc.TrackPaymentRequest, $root.lnrpc.Payment, request, callback); + }, "name", { value: "TrackPaymentV2" }); + + /** + * Calls TrackPaymentV2. + * @function trackPaymentV2 + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.ITrackPaymentRequest} request TrackPaymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#trackPayments}. + * @memberof routerrpc.Router + * @typedef TrackPaymentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {lnrpc.Payment} [response] Payment + */ + + /** + * Calls TrackPayments. + * @function trackPayments + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.ITrackPaymentsRequest} request TrackPaymentsRequest message or plain object + * @param {routerrpc.Router.TrackPaymentsCallback} callback Node-style callback called with the error, if any, and Payment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.trackPayments = function trackPayments(request, callback) { + return this.rpcCall(trackPayments, $root.routerrpc.TrackPaymentsRequest, $root.lnrpc.Payment, request, callback); + }, "name", { value: "TrackPayments" }); + + /** + * Calls TrackPayments. + * @function trackPayments + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.ITrackPaymentsRequest} request TrackPaymentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#estimateRouteFee}. + * @memberof routerrpc.Router + * @typedef EstimateRouteFeeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {routerrpc.RouteFeeResponse} [response] RouteFeeResponse + */ + + /** + * Calls EstimateRouteFee. + * @function estimateRouteFee + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IRouteFeeRequest} request RouteFeeRequest message or plain object + * @param {routerrpc.Router.EstimateRouteFeeCallback} callback Node-style callback called with the error, if any, and RouteFeeResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.estimateRouteFee = function estimateRouteFee(request, callback) { + return this.rpcCall(estimateRouteFee, $root.routerrpc.RouteFeeRequest, $root.routerrpc.RouteFeeResponse, request, callback); + }, "name", { value: "EstimateRouteFee" }); + + /** + * Calls EstimateRouteFee. + * @function estimateRouteFee + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IRouteFeeRequest} request RouteFeeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#sendToRoute}. + * @memberof routerrpc.Router + * @typedef SendToRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {routerrpc.SendToRouteResponse} [response] SendToRouteResponse + */ + + /** + * Calls SendToRoute. + * @function sendToRoute + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.ISendToRouteRequest} request SendToRouteRequest message or plain object + * @param {routerrpc.Router.SendToRouteCallback} callback Node-style callback called with the error, if any, and SendToRouteResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.sendToRoute = function sendToRoute(request, callback) { + return this.rpcCall(sendToRoute, $root.routerrpc.SendToRouteRequest, $root.routerrpc.SendToRouteResponse, request, callback); + }, "name", { value: "SendToRoute" }); + + /** + * Calls SendToRoute. + * @function sendToRoute + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.ISendToRouteRequest} request SendToRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#sendToRouteV2}. + * @memberof routerrpc.Router + * @typedef SendToRouteV2Callback + * @type {function} + * @param {Error|null} error Error, if any + * @param {lnrpc.HTLCAttempt} [response] HTLCAttempt + */ + + /** + * Calls SendToRouteV2. + * @function sendToRouteV2 + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.ISendToRouteRequest} request SendToRouteRequest message or plain object + * @param {routerrpc.Router.SendToRouteV2Callback} callback Node-style callback called with the error, if any, and HTLCAttempt + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.sendToRouteV2 = function sendToRouteV2(request, callback) { + return this.rpcCall(sendToRouteV2, $root.routerrpc.SendToRouteRequest, $root.lnrpc.HTLCAttempt, request, callback); + }, "name", { value: "SendToRouteV2" }); + + /** + * Calls SendToRouteV2. + * @function sendToRouteV2 + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.ISendToRouteRequest} request SendToRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#resetMissionControl}. + * @memberof routerrpc.Router + * @typedef ResetMissionControlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {routerrpc.ResetMissionControlResponse} [response] ResetMissionControlResponse + */ + + /** + * Calls ResetMissionControl. + * @function resetMissionControl + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IResetMissionControlRequest} request ResetMissionControlRequest message or plain object + * @param {routerrpc.Router.ResetMissionControlCallback} callback Node-style callback called with the error, if any, and ResetMissionControlResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.resetMissionControl = function resetMissionControl(request, callback) { + return this.rpcCall(resetMissionControl, $root.routerrpc.ResetMissionControlRequest, $root.routerrpc.ResetMissionControlResponse, request, callback); + }, "name", { value: "ResetMissionControl" }); + + /** + * Calls ResetMissionControl. + * @function resetMissionControl + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IResetMissionControlRequest} request ResetMissionControlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#queryMissionControl}. + * @memberof routerrpc.Router + * @typedef QueryMissionControlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {routerrpc.QueryMissionControlResponse} [response] QueryMissionControlResponse + */ + + /** + * Calls QueryMissionControl. + * @function queryMissionControl + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IQueryMissionControlRequest} request QueryMissionControlRequest message or plain object + * @param {routerrpc.Router.QueryMissionControlCallback} callback Node-style callback called with the error, if any, and QueryMissionControlResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.queryMissionControl = function queryMissionControl(request, callback) { + return this.rpcCall(queryMissionControl, $root.routerrpc.QueryMissionControlRequest, $root.routerrpc.QueryMissionControlResponse, request, callback); + }, "name", { value: "QueryMissionControl" }); + + /** + * Calls QueryMissionControl. + * @function queryMissionControl + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IQueryMissionControlRequest} request QueryMissionControlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#xImportMissionControl}. + * @memberof routerrpc.Router + * @typedef XImportMissionControlCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {routerrpc.XImportMissionControlResponse} [response] XImportMissionControlResponse + */ + + /** + * Calls XImportMissionControl. + * @function xImportMissionControl + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IXImportMissionControlRequest} request XImportMissionControlRequest message or plain object + * @param {routerrpc.Router.XImportMissionControlCallback} callback Node-style callback called with the error, if any, and XImportMissionControlResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.xImportMissionControl = function xImportMissionControl(request, callback) { + return this.rpcCall(xImportMissionControl, $root.routerrpc.XImportMissionControlRequest, $root.routerrpc.XImportMissionControlResponse, request, callback); + }, "name", { value: "XImportMissionControl" }); + + /** + * Calls XImportMissionControl. + * @function xImportMissionControl + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IXImportMissionControlRequest} request XImportMissionControlRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#getMissionControlConfig}. + * @memberof routerrpc.Router + * @typedef GetMissionControlConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {routerrpc.GetMissionControlConfigResponse} [response] GetMissionControlConfigResponse + */ + + /** + * Calls GetMissionControlConfig. + * @function getMissionControlConfig + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IGetMissionControlConfigRequest} request GetMissionControlConfigRequest message or plain object + * @param {routerrpc.Router.GetMissionControlConfigCallback} callback Node-style callback called with the error, if any, and GetMissionControlConfigResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.getMissionControlConfig = function getMissionControlConfig(request, callback) { + return this.rpcCall(getMissionControlConfig, $root.routerrpc.GetMissionControlConfigRequest, $root.routerrpc.GetMissionControlConfigResponse, request, callback); + }, "name", { value: "GetMissionControlConfig" }); + + /** + * Calls GetMissionControlConfig. + * @function getMissionControlConfig + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IGetMissionControlConfigRequest} request GetMissionControlConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#setMissionControlConfig}. + * @memberof routerrpc.Router + * @typedef SetMissionControlConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {routerrpc.SetMissionControlConfigResponse} [response] SetMissionControlConfigResponse + */ + + /** + * Calls SetMissionControlConfig. + * @function setMissionControlConfig + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.ISetMissionControlConfigRequest} request SetMissionControlConfigRequest message or plain object + * @param {routerrpc.Router.SetMissionControlConfigCallback} callback Node-style callback called with the error, if any, and SetMissionControlConfigResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.setMissionControlConfig = function setMissionControlConfig(request, callback) { + return this.rpcCall(setMissionControlConfig, $root.routerrpc.SetMissionControlConfigRequest, $root.routerrpc.SetMissionControlConfigResponse, request, callback); + }, "name", { value: "SetMissionControlConfig" }); + + /** + * Calls SetMissionControlConfig. + * @function setMissionControlConfig + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.ISetMissionControlConfigRequest} request SetMissionControlConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#queryProbability}. + * @memberof routerrpc.Router + * @typedef QueryProbabilityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {routerrpc.QueryProbabilityResponse} [response] QueryProbabilityResponse + */ + + /** + * Calls QueryProbability. + * @function queryProbability + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IQueryProbabilityRequest} request QueryProbabilityRequest message or plain object + * @param {routerrpc.Router.QueryProbabilityCallback} callback Node-style callback called with the error, if any, and QueryProbabilityResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.queryProbability = function queryProbability(request, callback) { + return this.rpcCall(queryProbability, $root.routerrpc.QueryProbabilityRequest, $root.routerrpc.QueryProbabilityResponse, request, callback); + }, "name", { value: "QueryProbability" }); + + /** + * Calls QueryProbability. + * @function queryProbability + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IQueryProbabilityRequest} request QueryProbabilityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#buildRoute}. + * @memberof routerrpc.Router + * @typedef BuildRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {routerrpc.BuildRouteResponse} [response] BuildRouteResponse + */ + + /** + * Calls BuildRoute. + * @function buildRoute + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IBuildRouteRequest} request BuildRouteRequest message or plain object + * @param {routerrpc.Router.BuildRouteCallback} callback Node-style callback called with the error, if any, and BuildRouteResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.buildRoute = function buildRoute(request, callback) { + return this.rpcCall(buildRoute, $root.routerrpc.BuildRouteRequest, $root.routerrpc.BuildRouteResponse, request, callback); + }, "name", { value: "BuildRoute" }); + + /** + * Calls BuildRoute. + * @function buildRoute + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IBuildRouteRequest} request BuildRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#subscribeHtlcEvents}. + * @memberof routerrpc.Router + * @typedef SubscribeHtlcEventsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {routerrpc.HtlcEvent} [response] HtlcEvent + */ + + /** + * Calls SubscribeHtlcEvents. + * @function subscribeHtlcEvents + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.ISubscribeHtlcEventsRequest} request SubscribeHtlcEventsRequest message or plain object + * @param {routerrpc.Router.SubscribeHtlcEventsCallback} callback Node-style callback called with the error, if any, and HtlcEvent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.subscribeHtlcEvents = function subscribeHtlcEvents(request, callback) { + return this.rpcCall(subscribeHtlcEvents, $root.routerrpc.SubscribeHtlcEventsRequest, $root.routerrpc.HtlcEvent, request, callback); + }, "name", { value: "SubscribeHtlcEvents" }); + + /** + * Calls SubscribeHtlcEvents. + * @function subscribeHtlcEvents + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.ISubscribeHtlcEventsRequest} request SubscribeHtlcEventsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#sendPayment}. + * @memberof routerrpc.Router + * @typedef SendPaymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {routerrpc.PaymentStatus} [response] PaymentStatus + */ + + /** + * Calls SendPayment. + * @function sendPayment + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.ISendPaymentRequest} request SendPaymentRequest message or plain object + * @param {routerrpc.Router.SendPaymentCallback} callback Node-style callback called with the error, if any, and PaymentStatus + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.sendPayment = function sendPayment(request, callback) { + return this.rpcCall(sendPayment, $root.routerrpc.SendPaymentRequest, $root.routerrpc.PaymentStatus, request, callback); + }, "name", { value: "SendPayment" }); + + /** + * Calls SendPayment. + * @function sendPayment + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.ISendPaymentRequest} request SendPaymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#trackPayment}. + * @memberof routerrpc.Router + * @typedef TrackPaymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {routerrpc.PaymentStatus} [response] PaymentStatus + */ + + /** + * Calls TrackPayment. + * @function trackPayment + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.ITrackPaymentRequest} request TrackPaymentRequest message or plain object + * @param {routerrpc.Router.TrackPaymentCallback} callback Node-style callback called with the error, if any, and PaymentStatus + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.trackPayment = function trackPayment(request, callback) { + return this.rpcCall(trackPayment, $root.routerrpc.TrackPaymentRequest, $root.routerrpc.PaymentStatus, request, callback); + }, "name", { value: "TrackPayment" }); + + /** + * Calls TrackPayment. + * @function trackPayment + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.ITrackPaymentRequest} request TrackPaymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#htlcInterceptor}. + * @memberof routerrpc.Router + * @typedef HtlcInterceptorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {routerrpc.ForwardHtlcInterceptRequest} [response] ForwardHtlcInterceptRequest + */ + + /** + * HtlcInterceptor dispatches a bi-directional streaming RPC in which + * Forwarded HTLC requests are sent to the client and the client responds with + * a boolean that tells LND if this htlc should be intercepted. + * In case of interception, the htlc can be either settled, cancelled or + * resumed later by using the ResolveHoldForward endpoint. + * @function htlcInterceptor + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IForwardHtlcInterceptResponse} request ForwardHtlcInterceptResponse message or plain object + * @param {routerrpc.Router.HtlcInterceptorCallback} callback Node-style callback called with the error, if any, and ForwardHtlcInterceptRequest + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.htlcInterceptor = function htlcInterceptor(request, callback) { + return this.rpcCall(htlcInterceptor, $root.routerrpc.ForwardHtlcInterceptResponse, $root.routerrpc.ForwardHtlcInterceptRequest, request, callback); + }, "name", { value: "HtlcInterceptor" }); + + /** + * HtlcInterceptor dispatches a bi-directional streaming RPC in which + * Forwarded HTLC requests are sent to the client and the client responds with + * a boolean that tells LND if this htlc should be intercepted. + * In case of interception, the htlc can be either settled, cancelled or + * resumed later by using the ResolveHoldForward endpoint. + * @function htlcInterceptor + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IForwardHtlcInterceptResponse} request ForwardHtlcInterceptResponse message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#updateChanStatus}. + * @memberof routerrpc.Router + * @typedef UpdateChanStatusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {routerrpc.UpdateChanStatusResponse} [response] UpdateChanStatusResponse + */ + + /** + * Calls UpdateChanStatus. + * @function updateChanStatus + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IUpdateChanStatusRequest} request UpdateChanStatusRequest message or plain object + * @param {routerrpc.Router.UpdateChanStatusCallback} callback Node-style callback called with the error, if any, and UpdateChanStatusResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.updateChanStatus = function updateChanStatus(request, callback) { + return this.rpcCall(updateChanStatus, $root.routerrpc.UpdateChanStatusRequest, $root.routerrpc.UpdateChanStatusResponse, request, callback); + }, "name", { value: "UpdateChanStatus" }); + + /** + * Calls UpdateChanStatus. + * @function updateChanStatus + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IUpdateChanStatusRequest} request UpdateChanStatusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#xAddLocalChanAliases}. + * @memberof routerrpc.Router + * @typedef XAddLocalChanAliasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {routerrpc.AddAliasesResponse} [response] AddAliasesResponse + */ + + /** + * Calls XAddLocalChanAliases. + * @function xAddLocalChanAliases + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IAddAliasesRequest} request AddAliasesRequest message or plain object + * @param {routerrpc.Router.XAddLocalChanAliasesCallback} callback Node-style callback called with the error, if any, and AddAliasesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.xAddLocalChanAliases = function xAddLocalChanAliases(request, callback) { + return this.rpcCall(xAddLocalChanAliases, $root.routerrpc.AddAliasesRequest, $root.routerrpc.AddAliasesResponse, request, callback); + }, "name", { value: "XAddLocalChanAliases" }); + + /** + * Calls XAddLocalChanAliases. + * @function xAddLocalChanAliases + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IAddAliasesRequest} request AddAliasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link routerrpc.Router#xDeleteLocalChanAliases}. + * @memberof routerrpc.Router + * @typedef XDeleteLocalChanAliasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {routerrpc.DeleteAliasesResponse} [response] DeleteAliasesResponse + */ + + /** + * Calls XDeleteLocalChanAliases. + * @function xDeleteLocalChanAliases + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IDeleteAliasesRequest} request DeleteAliasesRequest message or plain object + * @param {routerrpc.Router.XDeleteLocalChanAliasesCallback} callback Node-style callback called with the error, if any, and DeleteAliasesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Router.prototype.xDeleteLocalChanAliases = function xDeleteLocalChanAliases(request, callback) { + return this.rpcCall(xDeleteLocalChanAliases, $root.routerrpc.DeleteAliasesRequest, $root.routerrpc.DeleteAliasesResponse, request, callback); + }, "name", { value: "XDeleteLocalChanAliases" }); + + /** + * Calls XDeleteLocalChanAliases. + * @function xDeleteLocalChanAliases + * @memberof routerrpc.Router + * @instance + * @param {routerrpc.IDeleteAliasesRequest} request DeleteAliasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Router; + })(); + + routerrpc.SendPaymentRequest = (function() { + + /** + * Properties of a SendPaymentRequest. + * @memberof routerrpc + * @interface ISendPaymentRequest + * @property {Uint8Array|null} [dest] SendPaymentRequest dest + * @property {Long|null} [amt] SendPaymentRequest amt + * @property {Uint8Array|null} [payment_hash] SendPaymentRequest payment_hash + * @property {number|null} [final_cltv_delta] SendPaymentRequest final_cltv_delta + * @property {string|null} [payment_request] SendPaymentRequest payment_request + * @property {number|null} [timeout_seconds] SendPaymentRequest timeout_seconds + * @property {Long|null} [fee_limit_sat] SendPaymentRequest fee_limit_sat + * @property {Long|null} [outgoing_chan_id] SendPaymentRequest outgoing_chan_id + * @property {number|null} [cltv_limit] SendPaymentRequest cltv_limit + * @property {Array.|null} [route_hints] SendPaymentRequest route_hints + * @property {Object.|null} [dest_custom_records] SendPaymentRequest dest_custom_records + * @property {Long|null} [amt_msat] SendPaymentRequest amt_msat + * @property {Long|null} [fee_limit_msat] SendPaymentRequest fee_limit_msat + * @property {Uint8Array|null} [last_hop_pubkey] SendPaymentRequest last_hop_pubkey + * @property {boolean|null} [allow_self_payment] SendPaymentRequest allow_self_payment + * @property {Array.|null} [dest_features] SendPaymentRequest dest_features + * @property {number|null} [max_parts] SendPaymentRequest max_parts + * @property {boolean|null} [no_inflight_updates] SendPaymentRequest no_inflight_updates + * @property {Array.|null} [outgoing_chan_ids] SendPaymentRequest outgoing_chan_ids + * @property {Uint8Array|null} [payment_addr] SendPaymentRequest payment_addr + * @property {Long|null} [max_shard_size_msat] SendPaymentRequest max_shard_size_msat + * @property {boolean|null} [amp] SendPaymentRequest amp + * @property {number|null} [time_pref] SendPaymentRequest time_pref + * @property {boolean|null} [cancelable] SendPaymentRequest cancelable + * @property {Object.|null} [first_hop_custom_records] SendPaymentRequest first_hop_custom_records + */ + + /** + * Constructs a new SendPaymentRequest. + * @memberof routerrpc + * @classdesc Represents a SendPaymentRequest. + * @implements ISendPaymentRequest + * @constructor + * @param {routerrpc.ISendPaymentRequest=} [properties] Properties to set + */ + function SendPaymentRequest(properties) { + this.route_hints = []; + this.dest_custom_records = {}; + this.dest_features = []; + this.outgoing_chan_ids = []; + this.first_hop_custom_records = {}; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SendPaymentRequest dest. + * @member {Uint8Array} dest + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.dest = $util.newBuffer([]); + + /** + * SendPaymentRequest amt. + * @member {Long} amt + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.amt = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SendPaymentRequest payment_hash. + * @member {Uint8Array} payment_hash + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.payment_hash = $util.newBuffer([]); + + /** + * SendPaymentRequest final_cltv_delta. + * @member {number} final_cltv_delta + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.final_cltv_delta = 0; + + /** + * SendPaymentRequest payment_request. + * @member {string} payment_request + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.payment_request = ""; + + /** + * SendPaymentRequest timeout_seconds. + * @member {number} timeout_seconds + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.timeout_seconds = 0; + + /** + * SendPaymentRequest fee_limit_sat. + * @member {Long} fee_limit_sat + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.fee_limit_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SendPaymentRequest outgoing_chan_id. + * @member {Long} outgoing_chan_id + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.outgoing_chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * SendPaymentRequest cltv_limit. + * @member {number} cltv_limit + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.cltv_limit = 0; + + /** + * SendPaymentRequest route_hints. + * @member {Array.} route_hints + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.route_hints = $util.emptyArray; + + /** + * SendPaymentRequest dest_custom_records. + * @member {Object.} dest_custom_records + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.dest_custom_records = $util.emptyObject; + + /** + * SendPaymentRequest amt_msat. + * @member {Long} amt_msat + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SendPaymentRequest fee_limit_msat. + * @member {Long} fee_limit_msat + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.fee_limit_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SendPaymentRequest last_hop_pubkey. + * @member {Uint8Array} last_hop_pubkey + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.last_hop_pubkey = $util.newBuffer([]); + + /** + * SendPaymentRequest allow_self_payment. + * @member {boolean} allow_self_payment + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.allow_self_payment = false; + + /** + * SendPaymentRequest dest_features. + * @member {Array.} dest_features + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.dest_features = $util.emptyArray; + + /** + * SendPaymentRequest max_parts. + * @member {number} max_parts + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.max_parts = 0; + + /** + * SendPaymentRequest no_inflight_updates. + * @member {boolean} no_inflight_updates + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.no_inflight_updates = false; + + /** + * SendPaymentRequest outgoing_chan_ids. + * @member {Array.} outgoing_chan_ids + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.outgoing_chan_ids = $util.emptyArray; + + /** + * SendPaymentRequest payment_addr. + * @member {Uint8Array} payment_addr + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.payment_addr = $util.newBuffer([]); + + /** + * SendPaymentRequest max_shard_size_msat. + * @member {Long} max_shard_size_msat + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.max_shard_size_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * SendPaymentRequest amp. + * @member {boolean} amp + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.amp = false; + + /** + * SendPaymentRequest time_pref. + * @member {number} time_pref + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.time_pref = 0; + + /** + * SendPaymentRequest cancelable. + * @member {boolean} cancelable + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.cancelable = false; + + /** + * SendPaymentRequest first_hop_custom_records. + * @member {Object.} first_hop_custom_records + * @memberof routerrpc.SendPaymentRequest + * @instance + */ + SendPaymentRequest.prototype.first_hop_custom_records = $util.emptyObject; + + /** + * Creates a new SendPaymentRequest instance using the specified properties. + * @function create + * @memberof routerrpc.SendPaymentRequest + * @static + * @param {routerrpc.ISendPaymentRequest=} [properties] Properties to set + * @returns {routerrpc.SendPaymentRequest} SendPaymentRequest instance + */ + SendPaymentRequest.create = function create(properties) { + return new SendPaymentRequest(properties); + }; + + /** + * Encodes the specified SendPaymentRequest message. Does not implicitly {@link routerrpc.SendPaymentRequest.verify|verify} messages. + * @function encode + * @memberof routerrpc.SendPaymentRequest + * @static + * @param {routerrpc.ISendPaymentRequest} message SendPaymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SendPaymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dest != null && Object.hasOwnProperty.call(message, "dest")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dest); + if (message.amt != null && Object.hasOwnProperty.call(message, "amt")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.amt); + if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.payment_hash); + if (message.final_cltv_delta != null && Object.hasOwnProperty.call(message, "final_cltv_delta")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.final_cltv_delta); + if (message.payment_request != null && Object.hasOwnProperty.call(message, "payment_request")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.payment_request); + if (message.timeout_seconds != null && Object.hasOwnProperty.call(message, "timeout_seconds")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.timeout_seconds); + if (message.fee_limit_sat != null && Object.hasOwnProperty.call(message, "fee_limit_sat")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.fee_limit_sat); + if (message.outgoing_chan_id != null && Object.hasOwnProperty.call(message, "outgoing_chan_id")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.outgoing_chan_id); + if (message.cltv_limit != null && Object.hasOwnProperty.call(message, "cltv_limit")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.cltv_limit); + if (message.route_hints != null && message.route_hints.length) + for (let i = 0; i < message.route_hints.length; ++i) + $root.lnrpc.RouteHint.encode(message.route_hints[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.dest_custom_records != null && Object.hasOwnProperty.call(message, "dest_custom_records")) + for (let keys = Object.keys(message.dest_custom_records), i = 0; i < keys.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.dest_custom_records[keys[i]]).ldelim(); + if (message.amt_msat != null && Object.hasOwnProperty.call(message, "amt_msat")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.amt_msat); + if (message.fee_limit_msat != null && Object.hasOwnProperty.call(message, "fee_limit_msat")) + writer.uint32(/* id 13, wireType 0 =*/104).int64(message.fee_limit_msat); + if (message.last_hop_pubkey != null && Object.hasOwnProperty.call(message, "last_hop_pubkey")) + writer.uint32(/* id 14, wireType 2 =*/114).bytes(message.last_hop_pubkey); + if (message.allow_self_payment != null && Object.hasOwnProperty.call(message, "allow_self_payment")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.allow_self_payment); + if (message.dest_features != null && message.dest_features.length) { + writer.uint32(/* id 16, wireType 2 =*/130).fork(); + for (let i = 0; i < message.dest_features.length; ++i) + writer.int32(message.dest_features[i]); + writer.ldelim(); + } + if (message.max_parts != null && Object.hasOwnProperty.call(message, "max_parts")) + writer.uint32(/* id 17, wireType 0 =*/136).uint32(message.max_parts); + if (message.no_inflight_updates != null && Object.hasOwnProperty.call(message, "no_inflight_updates")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.no_inflight_updates); + if (message.outgoing_chan_ids != null && message.outgoing_chan_ids.length) { + writer.uint32(/* id 19, wireType 2 =*/154).fork(); + for (let i = 0; i < message.outgoing_chan_ids.length; ++i) + writer.uint64(message.outgoing_chan_ids[i]); + writer.ldelim(); + } + if (message.payment_addr != null && Object.hasOwnProperty.call(message, "payment_addr")) + writer.uint32(/* id 20, wireType 2 =*/162).bytes(message.payment_addr); + if (message.max_shard_size_msat != null && Object.hasOwnProperty.call(message, "max_shard_size_msat")) + writer.uint32(/* id 21, wireType 0 =*/168).uint64(message.max_shard_size_msat); + if (message.amp != null && Object.hasOwnProperty.call(message, "amp")) + writer.uint32(/* id 22, wireType 0 =*/176).bool(message.amp); + if (message.time_pref != null && Object.hasOwnProperty.call(message, "time_pref")) + writer.uint32(/* id 23, wireType 1 =*/185).double(message.time_pref); + if (message.cancelable != null && Object.hasOwnProperty.call(message, "cancelable")) + writer.uint32(/* id 24, wireType 0 =*/192).bool(message.cancelable); + if (message.first_hop_custom_records != null && Object.hasOwnProperty.call(message, "first_hop_custom_records")) + for (let keys = Object.keys(message.first_hop_custom_records), i = 0; i < keys.length; ++i) + writer.uint32(/* id 25, wireType 2 =*/202).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.first_hop_custom_records[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified SendPaymentRequest message, length delimited. Does not implicitly {@link routerrpc.SendPaymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof routerrpc.SendPaymentRequest + * @static + * @param {routerrpc.ISendPaymentRequest} message SendPaymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SendPaymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SendPaymentRequest message from the specified reader or buffer. + * @function decode + * @memberof routerrpc.SendPaymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {routerrpc.SendPaymentRequest} SendPaymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SendPaymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SendPaymentRequest(), key, value; + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dest = reader.bytes(); + break; + } + case 2: { + message.amt = reader.int64(); + break; + } + case 3: { + message.payment_hash = reader.bytes(); + break; + } + case 4: { + message.final_cltv_delta = reader.int32(); + break; + } + case 5: { + message.payment_request = reader.string(); + break; + } + case 6: { + message.timeout_seconds = reader.int32(); + break; + } + case 7: { + message.fee_limit_sat = reader.int64(); + break; + } + case 8: { + message.outgoing_chan_id = reader.uint64(); + break; + } + case 9: { + message.cltv_limit = reader.int32(); + break; + } + case 10: { + if (!(message.route_hints && message.route_hints.length)) + message.route_hints = []; + message.route_hints.push($root.lnrpc.RouteHint.decode(reader, reader.uint32())); + break; + } + case 11: { + if (message.dest_custom_records === $util.emptyObject) + message.dest_custom_records = {}; + let end2 = reader.uint32() + reader.pos; + key = 0; + value = []; + while (reader.pos < end2) { + let tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint64(); + break; + case 2: + value = reader.bytes(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.dest_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value; + break; + } + case 12: { + message.amt_msat = reader.int64(); + break; + } + case 13: { + message.fee_limit_msat = reader.int64(); + break; + } + case 14: { + message.last_hop_pubkey = reader.bytes(); + break; + } + case 15: { + message.allow_self_payment = reader.bool(); + break; + } + case 16: { + if (!(message.dest_features && message.dest_features.length)) + message.dest_features = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.dest_features.push(reader.int32()); + } else + message.dest_features.push(reader.int32()); + break; + } + case 17: { + message.max_parts = reader.uint32(); + break; + } + case 18: { + message.no_inflight_updates = reader.bool(); + break; + } + case 19: { + if (!(message.outgoing_chan_ids && message.outgoing_chan_ids.length)) + message.outgoing_chan_ids = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.outgoing_chan_ids.push(reader.uint64()); + } else + message.outgoing_chan_ids.push(reader.uint64()); + break; + } + case 20: { + message.payment_addr = reader.bytes(); + break; + } + case 21: { + message.max_shard_size_msat = reader.uint64(); + break; + } + case 22: { + message.amp = reader.bool(); + break; + } + case 23: { + message.time_pref = reader.double(); + break; + } + case 24: { + message.cancelable = reader.bool(); + break; + } + case 25: { + if (message.first_hop_custom_records === $util.emptyObject) + message.first_hop_custom_records = {}; + let end2 = reader.uint32() + reader.pos; + key = 0; + value = []; + while (reader.pos < end2) { + let tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint64(); + break; + case 2: + value = reader.bytes(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.first_hop_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SendPaymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof routerrpc.SendPaymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {routerrpc.SendPaymentRequest} SendPaymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SendPaymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SendPaymentRequest message. + * @function verify + * @memberof routerrpc.SendPaymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SendPaymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dest != null && message.hasOwnProperty("dest")) + if (!(message.dest && typeof message.dest.length === "number" || $util.isString(message.dest))) + return "dest: buffer expected"; + if (message.amt != null && message.hasOwnProperty("amt")) + if (!$util.isInteger(message.amt) && !(message.amt && $util.isInteger(message.amt.low) && $util.isInteger(message.amt.high))) + return "amt: integer|Long expected"; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + if (!(message.payment_hash && typeof message.payment_hash.length === "number" || $util.isString(message.payment_hash))) + return "payment_hash: buffer expected"; + if (message.final_cltv_delta != null && message.hasOwnProperty("final_cltv_delta")) + if (!$util.isInteger(message.final_cltv_delta)) + return "final_cltv_delta: integer expected"; + if (message.payment_request != null && message.hasOwnProperty("payment_request")) + if (!$util.isString(message.payment_request)) + return "payment_request: string expected"; + if (message.timeout_seconds != null && message.hasOwnProperty("timeout_seconds")) + if (!$util.isInteger(message.timeout_seconds)) + return "timeout_seconds: integer expected"; + if (message.fee_limit_sat != null && message.hasOwnProperty("fee_limit_sat")) + if (!$util.isInteger(message.fee_limit_sat) && !(message.fee_limit_sat && $util.isInteger(message.fee_limit_sat.low) && $util.isInteger(message.fee_limit_sat.high))) + return "fee_limit_sat: integer|Long expected"; + if (message.outgoing_chan_id != null && message.hasOwnProperty("outgoing_chan_id")) + if (!$util.isInteger(message.outgoing_chan_id) && !(message.outgoing_chan_id && $util.isInteger(message.outgoing_chan_id.low) && $util.isInteger(message.outgoing_chan_id.high))) + return "outgoing_chan_id: integer|Long expected"; + if (message.cltv_limit != null && message.hasOwnProperty("cltv_limit")) + if (!$util.isInteger(message.cltv_limit)) + return "cltv_limit: integer expected"; + if (message.route_hints != null && message.hasOwnProperty("route_hints")) { + if (!Array.isArray(message.route_hints)) + return "route_hints: array expected"; + for (let i = 0; i < message.route_hints.length; ++i) { + let error = $root.lnrpc.RouteHint.verify(message.route_hints[i]); + if (error) + return "route_hints." + error; + } + } + if (message.dest_custom_records != null && message.hasOwnProperty("dest_custom_records")) { + if (!$util.isObject(message.dest_custom_records)) + return "dest_custom_records: object expected"; + let key = Object.keys(message.dest_custom_records); + for (let i = 0; i < key.length; ++i) { + if (!$util.key64Re.test(key[i])) + return "dest_custom_records: integer|Long key{k:uint64} expected"; + if (!(message.dest_custom_records[key[i]] && typeof message.dest_custom_records[key[i]].length === "number" || $util.isString(message.dest_custom_records[key[i]]))) + return "dest_custom_records: buffer{k:uint64} expected"; + } + } + if (message.amt_msat != null && message.hasOwnProperty("amt_msat")) + if (!$util.isInteger(message.amt_msat) && !(message.amt_msat && $util.isInteger(message.amt_msat.low) && $util.isInteger(message.amt_msat.high))) + return "amt_msat: integer|Long expected"; + if (message.fee_limit_msat != null && message.hasOwnProperty("fee_limit_msat")) + if (!$util.isInteger(message.fee_limit_msat) && !(message.fee_limit_msat && $util.isInteger(message.fee_limit_msat.low) && $util.isInteger(message.fee_limit_msat.high))) + return "fee_limit_msat: integer|Long expected"; + if (message.last_hop_pubkey != null && message.hasOwnProperty("last_hop_pubkey")) + if (!(message.last_hop_pubkey && typeof message.last_hop_pubkey.length === "number" || $util.isString(message.last_hop_pubkey))) + return "last_hop_pubkey: buffer expected"; + if (message.allow_self_payment != null && message.hasOwnProperty("allow_self_payment")) + if (typeof message.allow_self_payment !== "boolean") + return "allow_self_payment: boolean expected"; + if (message.dest_features != null && message.hasOwnProperty("dest_features")) { + if (!Array.isArray(message.dest_features)) + return "dest_features: array expected"; + for (let i = 0; i < message.dest_features.length; ++i) + switch (message.dest_features[i]) { + default: + return "dest_features: enum value[] expected"; + case 0: + case 1: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 30: + case 31: + break; + } + } + if (message.max_parts != null && message.hasOwnProperty("max_parts")) + if (!$util.isInteger(message.max_parts)) + return "max_parts: integer expected"; + if (message.no_inflight_updates != null && message.hasOwnProperty("no_inflight_updates")) + if (typeof message.no_inflight_updates !== "boolean") + return "no_inflight_updates: boolean expected"; + if (message.outgoing_chan_ids != null && message.hasOwnProperty("outgoing_chan_ids")) { + if (!Array.isArray(message.outgoing_chan_ids)) + return "outgoing_chan_ids: array expected"; + for (let i = 0; i < message.outgoing_chan_ids.length; ++i) + if (!$util.isInteger(message.outgoing_chan_ids[i]) && !(message.outgoing_chan_ids[i] && $util.isInteger(message.outgoing_chan_ids[i].low) && $util.isInteger(message.outgoing_chan_ids[i].high))) + return "outgoing_chan_ids: integer|Long[] expected"; + } + if (message.payment_addr != null && message.hasOwnProperty("payment_addr")) + if (!(message.payment_addr && typeof message.payment_addr.length === "number" || $util.isString(message.payment_addr))) + return "payment_addr: buffer expected"; + if (message.max_shard_size_msat != null && message.hasOwnProperty("max_shard_size_msat")) + if (!$util.isInteger(message.max_shard_size_msat) && !(message.max_shard_size_msat && $util.isInteger(message.max_shard_size_msat.low) && $util.isInteger(message.max_shard_size_msat.high))) + return "max_shard_size_msat: integer|Long expected"; + if (message.amp != null && message.hasOwnProperty("amp")) + if (typeof message.amp !== "boolean") + return "amp: boolean expected"; + if (message.time_pref != null && message.hasOwnProperty("time_pref")) + if (typeof message.time_pref !== "number") + return "time_pref: number expected"; + if (message.cancelable != null && message.hasOwnProperty("cancelable")) + if (typeof message.cancelable !== "boolean") + return "cancelable: boolean expected"; + if (message.first_hop_custom_records != null && message.hasOwnProperty("first_hop_custom_records")) { + if (!$util.isObject(message.first_hop_custom_records)) + return "first_hop_custom_records: object expected"; + let key = Object.keys(message.first_hop_custom_records); + for (let i = 0; i < key.length; ++i) { + if (!$util.key64Re.test(key[i])) + return "first_hop_custom_records: integer|Long key{k:uint64} expected"; + if (!(message.first_hop_custom_records[key[i]] && typeof message.first_hop_custom_records[key[i]].length === "number" || $util.isString(message.first_hop_custom_records[key[i]]))) + return "first_hop_custom_records: buffer{k:uint64} expected"; + } + } + return null; + }; + + /** + * Creates a SendPaymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof routerrpc.SendPaymentRequest + * @static + * @param {Object.} object Plain object + * @returns {routerrpc.SendPaymentRequest} SendPaymentRequest + */ + SendPaymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.SendPaymentRequest) + return object; + let message = new $root.routerrpc.SendPaymentRequest(); + if (object.dest != null) + if (typeof object.dest === "string") + $util.base64.decode(object.dest, message.dest = $util.newBuffer($util.base64.length(object.dest)), 0); + else if (object.dest.length >= 0) + message.dest = object.dest; + if (object.amt != null) + if ($util.Long) + (message.amt = $util.Long.fromValue(object.amt)).unsigned = false; + else if (typeof object.amt === "string") + message.amt = parseInt(object.amt, 10); + else if (typeof object.amt === "number") + message.amt = object.amt; + else if (typeof object.amt === "object") + message.amt = new $util.LongBits(object.amt.low >>> 0, object.amt.high >>> 0).toNumber(); + if (object.payment_hash != null) + if (typeof object.payment_hash === "string") + $util.base64.decode(object.payment_hash, message.payment_hash = $util.newBuffer($util.base64.length(object.payment_hash)), 0); + else if (object.payment_hash.length >= 0) + message.payment_hash = object.payment_hash; + if (object.final_cltv_delta != null) + message.final_cltv_delta = object.final_cltv_delta | 0; + if (object.payment_request != null) + message.payment_request = String(object.payment_request); + if (object.timeout_seconds != null) + message.timeout_seconds = object.timeout_seconds | 0; + if (object.fee_limit_sat != null) + if ($util.Long) + (message.fee_limit_sat = $util.Long.fromValue(object.fee_limit_sat)).unsigned = false; + else if (typeof object.fee_limit_sat === "string") + message.fee_limit_sat = parseInt(object.fee_limit_sat, 10); + else if (typeof object.fee_limit_sat === "number") + message.fee_limit_sat = object.fee_limit_sat; + else if (typeof object.fee_limit_sat === "object") + message.fee_limit_sat = new $util.LongBits(object.fee_limit_sat.low >>> 0, object.fee_limit_sat.high >>> 0).toNumber(); + if (object.outgoing_chan_id != null) + if ($util.Long) + (message.outgoing_chan_id = $util.Long.fromValue(object.outgoing_chan_id)).unsigned = true; + else if (typeof object.outgoing_chan_id === "string") + message.outgoing_chan_id = parseInt(object.outgoing_chan_id, 10); + else if (typeof object.outgoing_chan_id === "number") + message.outgoing_chan_id = object.outgoing_chan_id; + else if (typeof object.outgoing_chan_id === "object") + message.outgoing_chan_id = new $util.LongBits(object.outgoing_chan_id.low >>> 0, object.outgoing_chan_id.high >>> 0).toNumber(true); + if (object.cltv_limit != null) + message.cltv_limit = object.cltv_limit | 0; + if (object.route_hints) { + if (!Array.isArray(object.route_hints)) + throw TypeError(".routerrpc.SendPaymentRequest.route_hints: array expected"); + message.route_hints = []; + for (let i = 0; i < object.route_hints.length; ++i) { + if (typeof object.route_hints[i] !== "object") + throw TypeError(".routerrpc.SendPaymentRequest.route_hints: object expected"); + message.route_hints[i] = $root.lnrpc.RouteHint.fromObject(object.route_hints[i]); + } + } + if (object.dest_custom_records) { + if (typeof object.dest_custom_records !== "object") + throw TypeError(".routerrpc.SendPaymentRequest.dest_custom_records: object expected"); + message.dest_custom_records = {}; + for (let keys = Object.keys(object.dest_custom_records), i = 0; i < keys.length; ++i) + if (typeof object.dest_custom_records[keys[i]] === "string") + $util.base64.decode(object.dest_custom_records[keys[i]], message.dest_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.dest_custom_records[keys[i]])), 0); + else if (object.dest_custom_records[keys[i]].length >= 0) + message.dest_custom_records[keys[i]] = object.dest_custom_records[keys[i]]; + } + if (object.amt_msat != null) + if ($util.Long) + (message.amt_msat = $util.Long.fromValue(object.amt_msat)).unsigned = false; + else if (typeof object.amt_msat === "string") + message.amt_msat = parseInt(object.amt_msat, 10); + else if (typeof object.amt_msat === "number") + message.amt_msat = object.amt_msat; + else if (typeof object.amt_msat === "object") + message.amt_msat = new $util.LongBits(object.amt_msat.low >>> 0, object.amt_msat.high >>> 0).toNumber(); + if (object.fee_limit_msat != null) + if ($util.Long) + (message.fee_limit_msat = $util.Long.fromValue(object.fee_limit_msat)).unsigned = false; + else if (typeof object.fee_limit_msat === "string") + message.fee_limit_msat = parseInt(object.fee_limit_msat, 10); + else if (typeof object.fee_limit_msat === "number") + message.fee_limit_msat = object.fee_limit_msat; + else if (typeof object.fee_limit_msat === "object") + message.fee_limit_msat = new $util.LongBits(object.fee_limit_msat.low >>> 0, object.fee_limit_msat.high >>> 0).toNumber(); + if (object.last_hop_pubkey != null) + if (typeof object.last_hop_pubkey === "string") + $util.base64.decode(object.last_hop_pubkey, message.last_hop_pubkey = $util.newBuffer($util.base64.length(object.last_hop_pubkey)), 0); + else if (object.last_hop_pubkey.length >= 0) + message.last_hop_pubkey = object.last_hop_pubkey; + if (object.allow_self_payment != null) + message.allow_self_payment = Boolean(object.allow_self_payment); + if (object.dest_features) { + if (!Array.isArray(object.dest_features)) + throw TypeError(".routerrpc.SendPaymentRequest.dest_features: array expected"); + message.dest_features = []; + for (let i = 0; i < object.dest_features.length; ++i) + switch (object.dest_features[i]) { + default: + if (typeof object.dest_features[i] === "number") { + message.dest_features[i] = object.dest_features[i]; + break; + } + case "DATALOSS_PROTECT_REQ": + case 0: + message.dest_features[i] = 0; + break; + case "DATALOSS_PROTECT_OPT": + case 1: + message.dest_features[i] = 1; + break; + case "INITIAL_ROUING_SYNC": + case 3: + message.dest_features[i] = 3; + break; + case "UPFRONT_SHUTDOWN_SCRIPT_REQ": + case 4: + message.dest_features[i] = 4; + break; + case "UPFRONT_SHUTDOWN_SCRIPT_OPT": + case 5: + message.dest_features[i] = 5; + break; + case "GOSSIP_QUERIES_REQ": + case 6: + message.dest_features[i] = 6; + break; + case "GOSSIP_QUERIES_OPT": + case 7: + message.dest_features[i] = 7; + break; + case "TLV_ONION_REQ": + case 8: + message.dest_features[i] = 8; + break; + case "TLV_ONION_OPT": + case 9: + message.dest_features[i] = 9; + break; + case "EXT_GOSSIP_QUERIES_REQ": + case 10: + message.dest_features[i] = 10; + break; + case "EXT_GOSSIP_QUERIES_OPT": + case 11: + message.dest_features[i] = 11; + break; + case "STATIC_REMOTE_KEY_REQ": + case 12: + message.dest_features[i] = 12; + break; + case "STATIC_REMOTE_KEY_OPT": + case 13: + message.dest_features[i] = 13; + break; + case "PAYMENT_ADDR_REQ": + case 14: + message.dest_features[i] = 14; + break; + case "PAYMENT_ADDR_OPT": + case 15: + message.dest_features[i] = 15; + break; + case "MPP_REQ": + case 16: + message.dest_features[i] = 16; + break; + case "MPP_OPT": + case 17: + message.dest_features[i] = 17; + break; + case "WUMBO_CHANNELS_REQ": + case 18: + message.dest_features[i] = 18; + break; + case "WUMBO_CHANNELS_OPT": + case 19: + message.dest_features[i] = 19; + break; + case "ANCHORS_REQ": + case 20: + message.dest_features[i] = 20; + break; + case "ANCHORS_OPT": + case 21: + message.dest_features[i] = 21; + break; + case "ANCHORS_ZERO_FEE_HTLC_REQ": + case 22: + message.dest_features[i] = 22; + break; + case "ANCHORS_ZERO_FEE_HTLC_OPT": + case 23: + message.dest_features[i] = 23; + break; + case "ROUTE_BLINDING_REQUIRED": + case 24: + message.dest_features[i] = 24; + break; + case "ROUTE_BLINDING_OPTIONAL": + case 25: + message.dest_features[i] = 25; + break; + case "AMP_REQ": + case 30: + message.dest_features[i] = 30; + break; + case "AMP_OPT": + case 31: + message.dest_features[i] = 31; + break; + } + } + if (object.max_parts != null) + message.max_parts = object.max_parts >>> 0; + if (object.no_inflight_updates != null) + message.no_inflight_updates = Boolean(object.no_inflight_updates); + if (object.outgoing_chan_ids) { + if (!Array.isArray(object.outgoing_chan_ids)) + throw TypeError(".routerrpc.SendPaymentRequest.outgoing_chan_ids: array expected"); + message.outgoing_chan_ids = []; + for (let i = 0; i < object.outgoing_chan_ids.length; ++i) + if ($util.Long) + (message.outgoing_chan_ids[i] = $util.Long.fromValue(object.outgoing_chan_ids[i])).unsigned = true; + else if (typeof object.outgoing_chan_ids[i] === "string") + message.outgoing_chan_ids[i] = parseInt(object.outgoing_chan_ids[i], 10); + else if (typeof object.outgoing_chan_ids[i] === "number") + message.outgoing_chan_ids[i] = object.outgoing_chan_ids[i]; + else if (typeof object.outgoing_chan_ids[i] === "object") + message.outgoing_chan_ids[i] = new $util.LongBits(object.outgoing_chan_ids[i].low >>> 0, object.outgoing_chan_ids[i].high >>> 0).toNumber(true); + } + if (object.payment_addr != null) + if (typeof object.payment_addr === "string") + $util.base64.decode(object.payment_addr, message.payment_addr = $util.newBuffer($util.base64.length(object.payment_addr)), 0); + else if (object.payment_addr.length >= 0) + message.payment_addr = object.payment_addr; + if (object.max_shard_size_msat != null) + if ($util.Long) + (message.max_shard_size_msat = $util.Long.fromValue(object.max_shard_size_msat)).unsigned = true; + else if (typeof object.max_shard_size_msat === "string") + message.max_shard_size_msat = parseInt(object.max_shard_size_msat, 10); + else if (typeof object.max_shard_size_msat === "number") + message.max_shard_size_msat = object.max_shard_size_msat; + else if (typeof object.max_shard_size_msat === "object") + message.max_shard_size_msat = new $util.LongBits(object.max_shard_size_msat.low >>> 0, object.max_shard_size_msat.high >>> 0).toNumber(true); + if (object.amp != null) + message.amp = Boolean(object.amp); + if (object.time_pref != null) + message.time_pref = Number(object.time_pref); + if (object.cancelable != null) + message.cancelable = Boolean(object.cancelable); + if (object.first_hop_custom_records) { + if (typeof object.first_hop_custom_records !== "object") + throw TypeError(".routerrpc.SendPaymentRequest.first_hop_custom_records: object expected"); + message.first_hop_custom_records = {}; + for (let keys = Object.keys(object.first_hop_custom_records), i = 0; i < keys.length; ++i) + if (typeof object.first_hop_custom_records[keys[i]] === "string") + $util.base64.decode(object.first_hop_custom_records[keys[i]], message.first_hop_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.first_hop_custom_records[keys[i]])), 0); + else if (object.first_hop_custom_records[keys[i]].length >= 0) + message.first_hop_custom_records[keys[i]] = object.first_hop_custom_records[keys[i]]; + } + return message; + }; + + /** + * Creates a plain object from a SendPaymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof routerrpc.SendPaymentRequest + * @static + * @param {routerrpc.SendPaymentRequest} message SendPaymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SendPaymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.route_hints = []; + object.dest_features = []; + object.outgoing_chan_ids = []; + } + if (options.objects || options.defaults) { + object.dest_custom_records = {}; + object.first_hop_custom_records = {}; + } + if (options.defaults) { + if (options.bytes === String) + object.dest = ""; + else { + object.dest = []; + if (options.bytes !== Array) + object.dest = $util.newBuffer(object.dest); + } + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.amt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amt = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.payment_hash = ""; + else { + object.payment_hash = []; + if (options.bytes !== Array) + object.payment_hash = $util.newBuffer(object.payment_hash); + } + object.final_cltv_delta = 0; + object.payment_request = ""; + object.timeout_seconds = 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.fee_limit_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fee_limit_sat = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.outgoing_chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.outgoing_chan_id = options.longs === String ? "0" : 0; + object.cltv_limit = 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amt_msat = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.fee_limit_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fee_limit_msat = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.last_hop_pubkey = ""; + else { + object.last_hop_pubkey = []; + if (options.bytes !== Array) + object.last_hop_pubkey = $util.newBuffer(object.last_hop_pubkey); + } + object.allow_self_payment = false; + object.max_parts = 0; + object.no_inflight_updates = false; + if (options.bytes === String) + object.payment_addr = ""; + else { + object.payment_addr = []; + if (options.bytes !== Array) + object.payment_addr = $util.newBuffer(object.payment_addr); + } + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.max_shard_size_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.max_shard_size_msat = options.longs === String ? "0" : 0; + object.amp = false; + object.time_pref = 0; + object.cancelable = false; + } + if (message.dest != null && message.hasOwnProperty("dest")) + object.dest = options.bytes === String ? $util.base64.encode(message.dest, 0, message.dest.length) : options.bytes === Array ? Array.prototype.slice.call(message.dest) : message.dest; + if (message.amt != null && message.hasOwnProperty("amt")) + if (typeof message.amt === "number") + object.amt = options.longs === String ? String(message.amt) : message.amt; + else + object.amt = options.longs === String ? $util.Long.prototype.toString.call(message.amt) : options.longs === Number ? new $util.LongBits(message.amt.low >>> 0, message.amt.high >>> 0).toNumber() : message.amt; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + object.payment_hash = options.bytes === String ? $util.base64.encode(message.payment_hash, 0, message.payment_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_hash) : message.payment_hash; + if (message.final_cltv_delta != null && message.hasOwnProperty("final_cltv_delta")) + object.final_cltv_delta = message.final_cltv_delta; + if (message.payment_request != null && message.hasOwnProperty("payment_request")) + object.payment_request = message.payment_request; + if (message.timeout_seconds != null && message.hasOwnProperty("timeout_seconds")) + object.timeout_seconds = message.timeout_seconds; + if (message.fee_limit_sat != null && message.hasOwnProperty("fee_limit_sat")) + if (typeof message.fee_limit_sat === "number") + object.fee_limit_sat = options.longs === String ? String(message.fee_limit_sat) : message.fee_limit_sat; + else + object.fee_limit_sat = options.longs === String ? $util.Long.prototype.toString.call(message.fee_limit_sat) : options.longs === Number ? new $util.LongBits(message.fee_limit_sat.low >>> 0, message.fee_limit_sat.high >>> 0).toNumber() : message.fee_limit_sat; + if (message.outgoing_chan_id != null && message.hasOwnProperty("outgoing_chan_id")) + if (typeof message.outgoing_chan_id === "number") + object.outgoing_chan_id = options.longs === String ? String(message.outgoing_chan_id) : message.outgoing_chan_id; + else + object.outgoing_chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_chan_id) : options.longs === Number ? new $util.LongBits(message.outgoing_chan_id.low >>> 0, message.outgoing_chan_id.high >>> 0).toNumber(true) : message.outgoing_chan_id; + if (message.cltv_limit != null && message.hasOwnProperty("cltv_limit")) + object.cltv_limit = message.cltv_limit; + if (message.route_hints && message.route_hints.length) { + object.route_hints = []; + for (let j = 0; j < message.route_hints.length; ++j) + object.route_hints[j] = $root.lnrpc.RouteHint.toObject(message.route_hints[j], options); + } + let keys2; + if (message.dest_custom_records && (keys2 = Object.keys(message.dest_custom_records)).length) { + object.dest_custom_records = {}; + for (let j = 0; j < keys2.length; ++j) + object.dest_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.dest_custom_records[keys2[j]], 0, message.dest_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.dest_custom_records[keys2[j]]) : message.dest_custom_records[keys2[j]]; + } + if (message.amt_msat != null && message.hasOwnProperty("amt_msat")) + if (typeof message.amt_msat === "number") + object.amt_msat = options.longs === String ? String(message.amt_msat) : message.amt_msat; + else + object.amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_msat) : options.longs === Number ? new $util.LongBits(message.amt_msat.low >>> 0, message.amt_msat.high >>> 0).toNumber() : message.amt_msat; + if (message.fee_limit_msat != null && message.hasOwnProperty("fee_limit_msat")) + if (typeof message.fee_limit_msat === "number") + object.fee_limit_msat = options.longs === String ? String(message.fee_limit_msat) : message.fee_limit_msat; + else + object.fee_limit_msat = options.longs === String ? $util.Long.prototype.toString.call(message.fee_limit_msat) : options.longs === Number ? new $util.LongBits(message.fee_limit_msat.low >>> 0, message.fee_limit_msat.high >>> 0).toNumber() : message.fee_limit_msat; + if (message.last_hop_pubkey != null && message.hasOwnProperty("last_hop_pubkey")) + object.last_hop_pubkey = options.bytes === String ? $util.base64.encode(message.last_hop_pubkey, 0, message.last_hop_pubkey.length) : options.bytes === Array ? Array.prototype.slice.call(message.last_hop_pubkey) : message.last_hop_pubkey; + if (message.allow_self_payment != null && message.hasOwnProperty("allow_self_payment")) + object.allow_self_payment = message.allow_self_payment; + if (message.dest_features && message.dest_features.length) { + object.dest_features = []; + for (let j = 0; j < message.dest_features.length; ++j) + object.dest_features[j] = options.enums === String ? $root.lnrpc.FeatureBit[message.dest_features[j]] === undefined ? message.dest_features[j] : $root.lnrpc.FeatureBit[message.dest_features[j]] : message.dest_features[j]; + } + if (message.max_parts != null && message.hasOwnProperty("max_parts")) + object.max_parts = message.max_parts; + if (message.no_inflight_updates != null && message.hasOwnProperty("no_inflight_updates")) + object.no_inflight_updates = message.no_inflight_updates; + if (message.outgoing_chan_ids && message.outgoing_chan_ids.length) { + object.outgoing_chan_ids = []; + for (let j = 0; j < message.outgoing_chan_ids.length; ++j) + if (typeof message.outgoing_chan_ids[j] === "number") + object.outgoing_chan_ids[j] = options.longs === String ? String(message.outgoing_chan_ids[j]) : message.outgoing_chan_ids[j]; + else + object.outgoing_chan_ids[j] = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_chan_ids[j]) : options.longs === Number ? new $util.LongBits(message.outgoing_chan_ids[j].low >>> 0, message.outgoing_chan_ids[j].high >>> 0).toNumber(true) : message.outgoing_chan_ids[j]; + } + if (message.payment_addr != null && message.hasOwnProperty("payment_addr")) + object.payment_addr = options.bytes === String ? $util.base64.encode(message.payment_addr, 0, message.payment_addr.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_addr) : message.payment_addr; + if (message.max_shard_size_msat != null && message.hasOwnProperty("max_shard_size_msat")) + if (typeof message.max_shard_size_msat === "number") + object.max_shard_size_msat = options.longs === String ? String(message.max_shard_size_msat) : message.max_shard_size_msat; + else + object.max_shard_size_msat = options.longs === String ? $util.Long.prototype.toString.call(message.max_shard_size_msat) : options.longs === Number ? new $util.LongBits(message.max_shard_size_msat.low >>> 0, message.max_shard_size_msat.high >>> 0).toNumber(true) : message.max_shard_size_msat; + if (message.amp != null && message.hasOwnProperty("amp")) + object.amp = message.amp; + if (message.time_pref != null && message.hasOwnProperty("time_pref")) + object.time_pref = options.json && !isFinite(message.time_pref) ? String(message.time_pref) : message.time_pref; + if (message.cancelable != null && message.hasOwnProperty("cancelable")) + object.cancelable = message.cancelable; + if (message.first_hop_custom_records && (keys2 = Object.keys(message.first_hop_custom_records)).length) { + object.first_hop_custom_records = {}; + for (let j = 0; j < keys2.length; ++j) + object.first_hop_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.first_hop_custom_records[keys2[j]], 0, message.first_hop_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.first_hop_custom_records[keys2[j]]) : message.first_hop_custom_records[keys2[j]]; + } + return object; + }; + + /** + * Converts this SendPaymentRequest to JSON. + * @function toJSON + * @memberof routerrpc.SendPaymentRequest + * @instance + * @returns {Object.} JSON object + */ + SendPaymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SendPaymentRequest + * @function getTypeUrl + * @memberof routerrpc.SendPaymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SendPaymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/routerrpc.SendPaymentRequest"; + }; + + return SendPaymentRequest; + })(); + + routerrpc.TrackPaymentRequest = (function() { + + /** + * Properties of a TrackPaymentRequest. + * @memberof routerrpc + * @interface ITrackPaymentRequest + * @property {Uint8Array|null} [payment_hash] TrackPaymentRequest payment_hash + * @property {boolean|null} [no_inflight_updates] TrackPaymentRequest no_inflight_updates */ - SendPaymentRequest.prototype.timeout_seconds = 0; /** - * SendPaymentRequest fee_limit_sat. - * @member {Long} fee_limit_sat - * @memberof routerrpc.SendPaymentRequest - * @instance + * Constructs a new TrackPaymentRequest. + * @memberof routerrpc + * @classdesc Represents a TrackPaymentRequest. + * @implements ITrackPaymentRequest + * @constructor + * @param {routerrpc.ITrackPaymentRequest=} [properties] Properties to set */ - SendPaymentRequest.prototype.fee_limit_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + function TrackPaymentRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * SendPaymentRequest outgoing_chan_id. - * @member {Long} outgoing_chan_id - * @memberof routerrpc.SendPaymentRequest + * TrackPaymentRequest payment_hash. + * @member {Uint8Array} payment_hash + * @memberof routerrpc.TrackPaymentRequest * @instance */ - SendPaymentRequest.prototype.outgoing_chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + TrackPaymentRequest.prototype.payment_hash = $util.newBuffer([]); /** - * SendPaymentRequest cltv_limit. - * @member {number} cltv_limit - * @memberof routerrpc.SendPaymentRequest + * TrackPaymentRequest no_inflight_updates. + * @member {boolean} no_inflight_updates + * @memberof routerrpc.TrackPaymentRequest * @instance */ - SendPaymentRequest.prototype.cltv_limit = 0; + TrackPaymentRequest.prototype.no_inflight_updates = false; /** - * SendPaymentRequest route_hints. - * @member {Array.} route_hints - * @memberof routerrpc.SendPaymentRequest - * @instance + * Creates a new TrackPaymentRequest instance using the specified properties. + * @function create + * @memberof routerrpc.TrackPaymentRequest + * @static + * @param {routerrpc.ITrackPaymentRequest=} [properties] Properties to set + * @returns {routerrpc.TrackPaymentRequest} TrackPaymentRequest instance */ - SendPaymentRequest.prototype.route_hints = $util.emptyArray; + TrackPaymentRequest.create = function create(properties) { + return new TrackPaymentRequest(properties); + }; /** - * SendPaymentRequest dest_custom_records. - * @member {Object.} dest_custom_records - * @memberof routerrpc.SendPaymentRequest - * @instance + * Encodes the specified TrackPaymentRequest message. Does not implicitly {@link routerrpc.TrackPaymentRequest.verify|verify} messages. + * @function encode + * @memberof routerrpc.TrackPaymentRequest + * @static + * @param {routerrpc.ITrackPaymentRequest} message TrackPaymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - SendPaymentRequest.prototype.dest_custom_records = $util.emptyObject; + TrackPaymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.payment_hash); + if (message.no_inflight_updates != null && Object.hasOwnProperty.call(message, "no_inflight_updates")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.no_inflight_updates); + return writer; + }; /** - * SendPaymentRequest amt_msat. - * @member {Long} amt_msat - * @memberof routerrpc.SendPaymentRequest - * @instance + * Encodes the specified TrackPaymentRequest message, length delimited. Does not implicitly {@link routerrpc.TrackPaymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof routerrpc.TrackPaymentRequest + * @static + * @param {routerrpc.ITrackPaymentRequest} message TrackPaymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - SendPaymentRequest.prototype.amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + TrackPaymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * SendPaymentRequest fee_limit_msat. - * @member {Long} fee_limit_msat - * @memberof routerrpc.SendPaymentRequest - * @instance + * Decodes a TrackPaymentRequest message from the specified reader or buffer. + * @function decode + * @memberof routerrpc.TrackPaymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {routerrpc.TrackPaymentRequest} TrackPaymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SendPaymentRequest.prototype.fee_limit_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + TrackPaymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.TrackPaymentRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.payment_hash = reader.bytes(); + break; + } + case 2: { + message.no_inflight_updates = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * SendPaymentRequest last_hop_pubkey. - * @member {Uint8Array} last_hop_pubkey - * @memberof routerrpc.SendPaymentRequest - * @instance + * Decodes a TrackPaymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof routerrpc.TrackPaymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {routerrpc.TrackPaymentRequest} TrackPaymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SendPaymentRequest.prototype.last_hop_pubkey = $util.newBuffer([]); + TrackPaymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * SendPaymentRequest allow_self_payment. - * @member {boolean} allow_self_payment - * @memberof routerrpc.SendPaymentRequest - * @instance + * Verifies a TrackPaymentRequest message. + * @function verify + * @memberof routerrpc.TrackPaymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SendPaymentRequest.prototype.allow_self_payment = false; + TrackPaymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + if (!(message.payment_hash && typeof message.payment_hash.length === "number" || $util.isString(message.payment_hash))) + return "payment_hash: buffer expected"; + if (message.no_inflight_updates != null && message.hasOwnProperty("no_inflight_updates")) + if (typeof message.no_inflight_updates !== "boolean") + return "no_inflight_updates: boolean expected"; + return null; + }; /** - * SendPaymentRequest dest_features. - * @member {Array.} dest_features - * @memberof routerrpc.SendPaymentRequest - * @instance + * Creates a TrackPaymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof routerrpc.TrackPaymentRequest + * @static + * @param {Object.} object Plain object + * @returns {routerrpc.TrackPaymentRequest} TrackPaymentRequest */ - SendPaymentRequest.prototype.dest_features = $util.emptyArray; + TrackPaymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.TrackPaymentRequest) + return object; + let message = new $root.routerrpc.TrackPaymentRequest(); + if (object.payment_hash != null) + if (typeof object.payment_hash === "string") + $util.base64.decode(object.payment_hash, message.payment_hash = $util.newBuffer($util.base64.length(object.payment_hash)), 0); + else if (object.payment_hash.length >= 0) + message.payment_hash = object.payment_hash; + if (object.no_inflight_updates != null) + message.no_inflight_updates = Boolean(object.no_inflight_updates); + return message; + }; /** - * SendPaymentRequest max_parts. - * @member {number} max_parts - * @memberof routerrpc.SendPaymentRequest - * @instance + * Creates a plain object from a TrackPaymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof routerrpc.TrackPaymentRequest + * @static + * @param {routerrpc.TrackPaymentRequest} message TrackPaymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - SendPaymentRequest.prototype.max_parts = 0; + TrackPaymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.payment_hash = ""; + else { + object.payment_hash = []; + if (options.bytes !== Array) + object.payment_hash = $util.newBuffer(object.payment_hash); + } + object.no_inflight_updates = false; + } + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + object.payment_hash = options.bytes === String ? $util.base64.encode(message.payment_hash, 0, message.payment_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_hash) : message.payment_hash; + if (message.no_inflight_updates != null && message.hasOwnProperty("no_inflight_updates")) + object.no_inflight_updates = message.no_inflight_updates; + return object; + }; /** - * SendPaymentRequest no_inflight_updates. - * @member {boolean} no_inflight_updates - * @memberof routerrpc.SendPaymentRequest + * Converts this TrackPaymentRequest to JSON. + * @function toJSON + * @memberof routerrpc.TrackPaymentRequest * @instance + * @returns {Object.} JSON object */ - SendPaymentRequest.prototype.no_inflight_updates = false; + TrackPaymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * SendPaymentRequest outgoing_chan_ids. - * @member {Array.} outgoing_chan_ids - * @memberof routerrpc.SendPaymentRequest - * @instance + * Gets the default type url for TrackPaymentRequest + * @function getTypeUrl + * @memberof routerrpc.TrackPaymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - SendPaymentRequest.prototype.outgoing_chan_ids = $util.emptyArray; + TrackPaymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/routerrpc.TrackPaymentRequest"; + }; - /** - * SendPaymentRequest payment_addr. - * @member {Uint8Array} payment_addr - * @memberof routerrpc.SendPaymentRequest - * @instance - */ - SendPaymentRequest.prototype.payment_addr = $util.newBuffer([]); + return TrackPaymentRequest; + })(); + + routerrpc.TrackPaymentsRequest = (function() { /** - * SendPaymentRequest max_shard_size_msat. - * @member {Long} max_shard_size_msat - * @memberof routerrpc.SendPaymentRequest - * @instance + * Properties of a TrackPaymentsRequest. + * @memberof routerrpc + * @interface ITrackPaymentsRequest + * @property {boolean|null} [no_inflight_updates] TrackPaymentsRequest no_inflight_updates */ - SendPaymentRequest.prototype.max_shard_size_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * SendPaymentRequest amp. - * @member {boolean} amp - * @memberof routerrpc.SendPaymentRequest - * @instance + * Constructs a new TrackPaymentsRequest. + * @memberof routerrpc + * @classdesc Represents a TrackPaymentsRequest. + * @implements ITrackPaymentsRequest + * @constructor + * @param {routerrpc.ITrackPaymentsRequest=} [properties] Properties to set */ - SendPaymentRequest.prototype.amp = false; + function TrackPaymentsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * SendPaymentRequest time_pref. - * @member {number} time_pref - * @memberof routerrpc.SendPaymentRequest + * TrackPaymentsRequest no_inflight_updates. + * @member {boolean} no_inflight_updates + * @memberof routerrpc.TrackPaymentsRequest * @instance */ - SendPaymentRequest.prototype.time_pref = 0; + TrackPaymentsRequest.prototype.no_inflight_updates = false; /** - * Creates a new SendPaymentRequest instance using the specified properties. + * Creates a new TrackPaymentsRequest instance using the specified properties. * @function create - * @memberof routerrpc.SendPaymentRequest + * @memberof routerrpc.TrackPaymentsRequest * @static - * @param {routerrpc.ISendPaymentRequest=} [properties] Properties to set - * @returns {routerrpc.SendPaymentRequest} SendPaymentRequest instance + * @param {routerrpc.ITrackPaymentsRequest=} [properties] Properties to set + * @returns {routerrpc.TrackPaymentsRequest} TrackPaymentsRequest instance */ - SendPaymentRequest.create = function create(properties) { - return new SendPaymentRequest(properties); + TrackPaymentsRequest.create = function create(properties) { + return new TrackPaymentsRequest(properties); }; /** - * Encodes the specified SendPaymentRequest message. Does not implicitly {@link routerrpc.SendPaymentRequest.verify|verify} messages. + * Encodes the specified TrackPaymentsRequest message. Does not implicitly {@link routerrpc.TrackPaymentsRequest.verify|verify} messages. * @function encode - * @memberof routerrpc.SendPaymentRequest + * @memberof routerrpc.TrackPaymentsRequest * @static - * @param {routerrpc.ISendPaymentRequest} message SendPaymentRequest message or plain object to encode + * @param {routerrpc.ITrackPaymentsRequest} message TrackPaymentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SendPaymentRequest.encode = function encode(message, writer) { + TrackPaymentsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dest != null && Object.hasOwnProperty.call(message, "dest")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dest); - if (message.amt != null && Object.hasOwnProperty.call(message, "amt")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.amt); - if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.payment_hash); - if (message.final_cltv_delta != null && Object.hasOwnProperty.call(message, "final_cltv_delta")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.final_cltv_delta); - if (message.payment_request != null && Object.hasOwnProperty.call(message, "payment_request")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.payment_request); - if (message.timeout_seconds != null && Object.hasOwnProperty.call(message, "timeout_seconds")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.timeout_seconds); - if (message.fee_limit_sat != null && Object.hasOwnProperty.call(message, "fee_limit_sat")) - writer.uint32(/* id 7, wireType 0 =*/56).int64(message.fee_limit_sat); - if (message.outgoing_chan_id != null && Object.hasOwnProperty.call(message, "outgoing_chan_id")) - writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.outgoing_chan_id); - if (message.cltv_limit != null && Object.hasOwnProperty.call(message, "cltv_limit")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.cltv_limit); - if (message.route_hints != null && message.route_hints.length) - for (let i = 0; i < message.route_hints.length; ++i) - $root.lnrpc.RouteHint.encode(message.route_hints[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.dest_custom_records != null && Object.hasOwnProperty.call(message, "dest_custom_records")) - for (let keys = Object.keys(message.dest_custom_records), i = 0; i < keys.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.dest_custom_records[keys[i]]).ldelim(); - if (message.amt_msat != null && Object.hasOwnProperty.call(message, "amt_msat")) - writer.uint32(/* id 12, wireType 0 =*/96).int64(message.amt_msat); - if (message.fee_limit_msat != null && Object.hasOwnProperty.call(message, "fee_limit_msat")) - writer.uint32(/* id 13, wireType 0 =*/104).int64(message.fee_limit_msat); - if (message.last_hop_pubkey != null && Object.hasOwnProperty.call(message, "last_hop_pubkey")) - writer.uint32(/* id 14, wireType 2 =*/114).bytes(message.last_hop_pubkey); - if (message.allow_self_payment != null && Object.hasOwnProperty.call(message, "allow_self_payment")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.allow_self_payment); - if (message.dest_features != null && message.dest_features.length) { - writer.uint32(/* id 16, wireType 2 =*/130).fork(); - for (let i = 0; i < message.dest_features.length; ++i) - writer.int32(message.dest_features[i]); - writer.ldelim(); - } - if (message.max_parts != null && Object.hasOwnProperty.call(message, "max_parts")) - writer.uint32(/* id 17, wireType 0 =*/136).uint32(message.max_parts); if (message.no_inflight_updates != null && Object.hasOwnProperty.call(message, "no_inflight_updates")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.no_inflight_updates); - if (message.outgoing_chan_ids != null && message.outgoing_chan_ids.length) { - writer.uint32(/* id 19, wireType 2 =*/154).fork(); - for (let i = 0; i < message.outgoing_chan_ids.length; ++i) - writer.uint64(message.outgoing_chan_ids[i]); - writer.ldelim(); - } - if (message.payment_addr != null && Object.hasOwnProperty.call(message, "payment_addr")) - writer.uint32(/* id 20, wireType 2 =*/162).bytes(message.payment_addr); - if (message.max_shard_size_msat != null && Object.hasOwnProperty.call(message, "max_shard_size_msat")) - writer.uint32(/* id 21, wireType 0 =*/168).uint64(message.max_shard_size_msat); - if (message.amp != null && Object.hasOwnProperty.call(message, "amp")) - writer.uint32(/* id 22, wireType 0 =*/176).bool(message.amp); - if (message.time_pref != null && Object.hasOwnProperty.call(message, "time_pref")) - writer.uint32(/* id 23, wireType 1 =*/185).double(message.time_pref); + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.no_inflight_updates); return writer; }; /** - * Encodes the specified SendPaymentRequest message, length delimited. Does not implicitly {@link routerrpc.SendPaymentRequest.verify|verify} messages. + * Encodes the specified TrackPaymentsRequest message, length delimited. Does not implicitly {@link routerrpc.TrackPaymentsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.SendPaymentRequest + * @memberof routerrpc.TrackPaymentsRequest * @static - * @param {routerrpc.ISendPaymentRequest} message SendPaymentRequest message or plain object to encode + * @param {routerrpc.ITrackPaymentsRequest} message TrackPaymentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SendPaymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + TrackPaymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SendPaymentRequest message from the specified reader or buffer. + * Decodes a TrackPaymentsRequest message from the specified reader or buffer. * @function decode - * @memberof routerrpc.SendPaymentRequest + * @memberof routerrpc.TrackPaymentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.SendPaymentRequest} SendPaymentRequest + * @returns {routerrpc.TrackPaymentsRequest} TrackPaymentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SendPaymentRequest.decode = function decode(reader, length) { + TrackPaymentsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SendPaymentRequest(), key, value; + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.TrackPaymentsRequest(); while (reader.pos < end) { - let tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.dest = reader.bytes(); - break; - } - case 2: { - message.amt = reader.int64(); - break; - } - case 3: { - message.payment_hash = reader.bytes(); - break; - } - case 4: { - message.final_cltv_delta = reader.int32(); - break; - } - case 5: { - message.payment_request = reader.string(); - break; - } - case 6: { - message.timeout_seconds = reader.int32(); - break; - } - case 7: { - message.fee_limit_sat = reader.int64(); - break; - } - case 8: { - message.outgoing_chan_id = reader.uint64(); - break; - } - case 9: { - message.cltv_limit = reader.int32(); - break; - } - case 10: { - if (!(message.route_hints && message.route_hints.length)) - message.route_hints = []; - message.route_hints.push($root.lnrpc.RouteHint.decode(reader, reader.uint32())); - break; - } - case 11: { - if (message.dest_custom_records === $util.emptyObject) - message.dest_custom_records = {}; - let end2 = reader.uint32() + reader.pos; - key = 0; - value = []; - while (reader.pos < end2) { - let tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.uint64(); - break; - case 2: - value = reader.bytes(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.dest_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value; - break; - } - case 12: { - message.amt_msat = reader.int64(); - break; - } - case 13: { - message.fee_limit_msat = reader.int64(); - break; - } - case 14: { - message.last_hop_pubkey = reader.bytes(); - break; - } - case 15: { - message.allow_self_payment = reader.bool(); - break; - } - case 16: { - if (!(message.dest_features && message.dest_features.length)) - message.dest_features = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.dest_features.push(reader.int32()); - } else - message.dest_features.push(reader.int32()); - break; - } - case 17: { - message.max_parts = reader.uint32(); - break; - } - case 18: { - message.no_inflight_updates = reader.bool(); - break; - } - case 19: { - if (!(message.outgoing_chan_ids && message.outgoing_chan_ids.length)) - message.outgoing_chan_ids = []; - if ((tag & 7) === 2) { - let end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.outgoing_chan_ids.push(reader.uint64()); - } else - message.outgoing_chan_ids.push(reader.uint64()); - break; - } - case 20: { - message.payment_addr = reader.bytes(); - break; - } - case 21: { - message.max_shard_size_msat = reader.uint64(); - break; - } - case 22: { - message.amp = reader.bool(); - break; - } - case 23: { - message.time_pref = reader.double(); + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.no_inflight_updates = reader.bool(); break; } default: @@ -84987,438 +87746,341 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a SendPaymentRequest message from the specified reader or buffer, length delimited. + * Decodes a TrackPaymentsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.SendPaymentRequest + * @memberof routerrpc.TrackPaymentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.SendPaymentRequest} SendPaymentRequest + * @returns {routerrpc.TrackPaymentsRequest} TrackPaymentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SendPaymentRequest.decodeDelimited = function decodeDelimited(reader) { + TrackPaymentsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SendPaymentRequest message. + * Verifies a TrackPaymentsRequest message. * @function verify - * @memberof routerrpc.SendPaymentRequest + * @memberof routerrpc.TrackPaymentsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SendPaymentRequest.verify = function verify(message) { + TrackPaymentsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dest != null && message.hasOwnProperty("dest")) - if (!(message.dest && typeof message.dest.length === "number" || $util.isString(message.dest))) - return "dest: buffer expected"; - if (message.amt != null && message.hasOwnProperty("amt")) - if (!$util.isInteger(message.amt) && !(message.amt && $util.isInteger(message.amt.low) && $util.isInteger(message.amt.high))) - return "amt: integer|Long expected"; - if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) - if (!(message.payment_hash && typeof message.payment_hash.length === "number" || $util.isString(message.payment_hash))) - return "payment_hash: buffer expected"; - if (message.final_cltv_delta != null && message.hasOwnProperty("final_cltv_delta")) - if (!$util.isInteger(message.final_cltv_delta)) - return "final_cltv_delta: integer expected"; - if (message.payment_request != null && message.hasOwnProperty("payment_request")) - if (!$util.isString(message.payment_request)) - return "payment_request: string expected"; - if (message.timeout_seconds != null && message.hasOwnProperty("timeout_seconds")) - if (!$util.isInteger(message.timeout_seconds)) - return "timeout_seconds: integer expected"; - if (message.fee_limit_sat != null && message.hasOwnProperty("fee_limit_sat")) - if (!$util.isInteger(message.fee_limit_sat) && !(message.fee_limit_sat && $util.isInteger(message.fee_limit_sat.low) && $util.isInteger(message.fee_limit_sat.high))) - return "fee_limit_sat: integer|Long expected"; - if (message.outgoing_chan_id != null && message.hasOwnProperty("outgoing_chan_id")) - if (!$util.isInteger(message.outgoing_chan_id) && !(message.outgoing_chan_id && $util.isInteger(message.outgoing_chan_id.low) && $util.isInteger(message.outgoing_chan_id.high))) - return "outgoing_chan_id: integer|Long expected"; - if (message.cltv_limit != null && message.hasOwnProperty("cltv_limit")) - if (!$util.isInteger(message.cltv_limit)) - return "cltv_limit: integer expected"; - if (message.route_hints != null && message.hasOwnProperty("route_hints")) { - if (!Array.isArray(message.route_hints)) - return "route_hints: array expected"; - for (let i = 0; i < message.route_hints.length; ++i) { - let error = $root.lnrpc.RouteHint.verify(message.route_hints[i]); - if (error) - return "route_hints." + error; - } - } - if (message.dest_custom_records != null && message.hasOwnProperty("dest_custom_records")) { - if (!$util.isObject(message.dest_custom_records)) - return "dest_custom_records: object expected"; - let key = Object.keys(message.dest_custom_records); - for (let i = 0; i < key.length; ++i) { - if (!$util.key64Re.test(key[i])) - return "dest_custom_records: integer|Long key{k:uint64} expected"; - if (!(message.dest_custom_records[key[i]] && typeof message.dest_custom_records[key[i]].length === "number" || $util.isString(message.dest_custom_records[key[i]]))) - return "dest_custom_records: buffer{k:uint64} expected"; - } - } - if (message.amt_msat != null && message.hasOwnProperty("amt_msat")) - if (!$util.isInteger(message.amt_msat) && !(message.amt_msat && $util.isInteger(message.amt_msat.low) && $util.isInteger(message.amt_msat.high))) - return "amt_msat: integer|Long expected"; - if (message.fee_limit_msat != null && message.hasOwnProperty("fee_limit_msat")) - if (!$util.isInteger(message.fee_limit_msat) && !(message.fee_limit_msat && $util.isInteger(message.fee_limit_msat.low) && $util.isInteger(message.fee_limit_msat.high))) - return "fee_limit_msat: integer|Long expected"; - if (message.last_hop_pubkey != null && message.hasOwnProperty("last_hop_pubkey")) - if (!(message.last_hop_pubkey && typeof message.last_hop_pubkey.length === "number" || $util.isString(message.last_hop_pubkey))) - return "last_hop_pubkey: buffer expected"; - if (message.allow_self_payment != null && message.hasOwnProperty("allow_self_payment")) - if (typeof message.allow_self_payment !== "boolean") - return "allow_self_payment: boolean expected"; - if (message.dest_features != null && message.hasOwnProperty("dest_features")) { - if (!Array.isArray(message.dest_features)) - return "dest_features: array expected"; - for (let i = 0; i < message.dest_features.length; ++i) - switch (message.dest_features[i]) { - default: - return "dest_features: enum value[] expected"; - case 0: - case 1: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: - case 24: - case 25: - case 30: - case 31: - break; - } - } - if (message.max_parts != null && message.hasOwnProperty("max_parts")) - if (!$util.isInteger(message.max_parts)) - return "max_parts: integer expected"; if (message.no_inflight_updates != null && message.hasOwnProperty("no_inflight_updates")) if (typeof message.no_inflight_updates !== "boolean") return "no_inflight_updates: boolean expected"; - if (message.outgoing_chan_ids != null && message.hasOwnProperty("outgoing_chan_ids")) { - if (!Array.isArray(message.outgoing_chan_ids)) - return "outgoing_chan_ids: array expected"; - for (let i = 0; i < message.outgoing_chan_ids.length; ++i) - if (!$util.isInteger(message.outgoing_chan_ids[i]) && !(message.outgoing_chan_ids[i] && $util.isInteger(message.outgoing_chan_ids[i].low) && $util.isInteger(message.outgoing_chan_ids[i].high))) - return "outgoing_chan_ids: integer|Long[] expected"; - } - if (message.payment_addr != null && message.hasOwnProperty("payment_addr")) - if (!(message.payment_addr && typeof message.payment_addr.length === "number" || $util.isString(message.payment_addr))) - return "payment_addr: buffer expected"; - if (message.max_shard_size_msat != null && message.hasOwnProperty("max_shard_size_msat")) - if (!$util.isInteger(message.max_shard_size_msat) && !(message.max_shard_size_msat && $util.isInteger(message.max_shard_size_msat.low) && $util.isInteger(message.max_shard_size_msat.high))) - return "max_shard_size_msat: integer|Long expected"; - if (message.amp != null && message.hasOwnProperty("amp")) - if (typeof message.amp !== "boolean") - return "amp: boolean expected"; - if (message.time_pref != null && message.hasOwnProperty("time_pref")) - if (typeof message.time_pref !== "number") - return "time_pref: number expected"; return null; }; /** - * Creates a SendPaymentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TrackPaymentsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.SendPaymentRequest + * @memberof routerrpc.TrackPaymentsRequest * @static * @param {Object.} object Plain object - * @returns {routerrpc.SendPaymentRequest} SendPaymentRequest + * @returns {routerrpc.TrackPaymentsRequest} TrackPaymentsRequest */ - SendPaymentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.SendPaymentRequest) + TrackPaymentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.TrackPaymentsRequest) return object; - let message = new $root.routerrpc.SendPaymentRequest(); - if (object.dest != null) - if (typeof object.dest === "string") - $util.base64.decode(object.dest, message.dest = $util.newBuffer($util.base64.length(object.dest)), 0); - else if (object.dest.length >= 0) - message.dest = object.dest; - if (object.amt != null) - if ($util.Long) - (message.amt = $util.Long.fromValue(object.amt)).unsigned = false; - else if (typeof object.amt === "string") - message.amt = parseInt(object.amt, 10); - else if (typeof object.amt === "number") - message.amt = object.amt; - else if (typeof object.amt === "object") - message.amt = new $util.LongBits(object.amt.low >>> 0, object.amt.high >>> 0).toNumber(); - if (object.payment_hash != null) - if (typeof object.payment_hash === "string") - $util.base64.decode(object.payment_hash, message.payment_hash = $util.newBuffer($util.base64.length(object.payment_hash)), 0); - else if (object.payment_hash.length >= 0) - message.payment_hash = object.payment_hash; - if (object.final_cltv_delta != null) - message.final_cltv_delta = object.final_cltv_delta | 0; - if (object.payment_request != null) - message.payment_request = String(object.payment_request); - if (object.timeout_seconds != null) - message.timeout_seconds = object.timeout_seconds | 0; - if (object.fee_limit_sat != null) - if ($util.Long) - (message.fee_limit_sat = $util.Long.fromValue(object.fee_limit_sat)).unsigned = false; - else if (typeof object.fee_limit_sat === "string") - message.fee_limit_sat = parseInt(object.fee_limit_sat, 10); - else if (typeof object.fee_limit_sat === "number") - message.fee_limit_sat = object.fee_limit_sat; - else if (typeof object.fee_limit_sat === "object") - message.fee_limit_sat = new $util.LongBits(object.fee_limit_sat.low >>> 0, object.fee_limit_sat.high >>> 0).toNumber(); - if (object.outgoing_chan_id != null) - if ($util.Long) - (message.outgoing_chan_id = $util.Long.fromValue(object.outgoing_chan_id)).unsigned = true; - else if (typeof object.outgoing_chan_id === "string") - message.outgoing_chan_id = parseInt(object.outgoing_chan_id, 10); - else if (typeof object.outgoing_chan_id === "number") - message.outgoing_chan_id = object.outgoing_chan_id; - else if (typeof object.outgoing_chan_id === "object") - message.outgoing_chan_id = new $util.LongBits(object.outgoing_chan_id.low >>> 0, object.outgoing_chan_id.high >>> 0).toNumber(true); - if (object.cltv_limit != null) - message.cltv_limit = object.cltv_limit | 0; - if (object.route_hints) { - if (!Array.isArray(object.route_hints)) - throw TypeError(".routerrpc.SendPaymentRequest.route_hints: array expected"); - message.route_hints = []; - for (let i = 0; i < object.route_hints.length; ++i) { - if (typeof object.route_hints[i] !== "object") - throw TypeError(".routerrpc.SendPaymentRequest.route_hints: object expected"); - message.route_hints[i] = $root.lnrpc.RouteHint.fromObject(object.route_hints[i]); - } - } - if (object.dest_custom_records) { - if (typeof object.dest_custom_records !== "object") - throw TypeError(".routerrpc.SendPaymentRequest.dest_custom_records: object expected"); - message.dest_custom_records = {}; - for (let keys = Object.keys(object.dest_custom_records), i = 0; i < keys.length; ++i) - if (typeof object.dest_custom_records[keys[i]] === "string") - $util.base64.decode(object.dest_custom_records[keys[i]], message.dest_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.dest_custom_records[keys[i]])), 0); - else if (object.dest_custom_records[keys[i]].length >= 0) - message.dest_custom_records[keys[i]] = object.dest_custom_records[keys[i]]; + let message = new $root.routerrpc.TrackPaymentsRequest(); + if (object.no_inflight_updates != null) + message.no_inflight_updates = Boolean(object.no_inflight_updates); + return message; + }; + + /** + * Creates a plain object from a TrackPaymentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof routerrpc.TrackPaymentsRequest + * @static + * @param {routerrpc.TrackPaymentsRequest} message TrackPaymentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrackPaymentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.no_inflight_updates = false; + if (message.no_inflight_updates != null && message.hasOwnProperty("no_inflight_updates")) + object.no_inflight_updates = message.no_inflight_updates; + return object; + }; + + /** + * Converts this TrackPaymentsRequest to JSON. + * @function toJSON + * @memberof routerrpc.TrackPaymentsRequest + * @instance + * @returns {Object.} JSON object + */ + TrackPaymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrackPaymentsRequest + * @function getTypeUrl + * @memberof routerrpc.TrackPaymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrackPaymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - if (object.amt_msat != null) - if ($util.Long) - (message.amt_msat = $util.Long.fromValue(object.amt_msat)).unsigned = false; - else if (typeof object.amt_msat === "string") - message.amt_msat = parseInt(object.amt_msat, 10); - else if (typeof object.amt_msat === "number") - message.amt_msat = object.amt_msat; - else if (typeof object.amt_msat === "object") - message.amt_msat = new $util.LongBits(object.amt_msat.low >>> 0, object.amt_msat.high >>> 0).toNumber(); - if (object.fee_limit_msat != null) - if ($util.Long) - (message.fee_limit_msat = $util.Long.fromValue(object.fee_limit_msat)).unsigned = false; - else if (typeof object.fee_limit_msat === "string") - message.fee_limit_msat = parseInt(object.fee_limit_msat, 10); - else if (typeof object.fee_limit_msat === "number") - message.fee_limit_msat = object.fee_limit_msat; - else if (typeof object.fee_limit_msat === "object") - message.fee_limit_msat = new $util.LongBits(object.fee_limit_msat.low >>> 0, object.fee_limit_msat.high >>> 0).toNumber(); - if (object.last_hop_pubkey != null) - if (typeof object.last_hop_pubkey === "string") - $util.base64.decode(object.last_hop_pubkey, message.last_hop_pubkey = $util.newBuffer($util.base64.length(object.last_hop_pubkey)), 0); - else if (object.last_hop_pubkey.length >= 0) - message.last_hop_pubkey = object.last_hop_pubkey; - if (object.allow_self_payment != null) - message.allow_self_payment = Boolean(object.allow_self_payment); - if (object.dest_features) { - if (!Array.isArray(object.dest_features)) - throw TypeError(".routerrpc.SendPaymentRequest.dest_features: array expected"); - message.dest_features = []; - for (let i = 0; i < object.dest_features.length; ++i) - switch (object.dest_features[i]) { - default: - if (typeof object.dest_features[i] === "number") { - message.dest_features[i] = object.dest_features[i]; - break; - } - case "DATALOSS_PROTECT_REQ": - case 0: - message.dest_features[i] = 0; - break; - case "DATALOSS_PROTECT_OPT": - case 1: - message.dest_features[i] = 1; - break; - case "INITIAL_ROUING_SYNC": - case 3: - message.dest_features[i] = 3; - break; - case "UPFRONT_SHUTDOWN_SCRIPT_REQ": - case 4: - message.dest_features[i] = 4; - break; - case "UPFRONT_SHUTDOWN_SCRIPT_OPT": - case 5: - message.dest_features[i] = 5; - break; - case "GOSSIP_QUERIES_REQ": - case 6: - message.dest_features[i] = 6; - break; - case "GOSSIP_QUERIES_OPT": - case 7: - message.dest_features[i] = 7; - break; - case "TLV_ONION_REQ": - case 8: - message.dest_features[i] = 8; - break; - case "TLV_ONION_OPT": - case 9: - message.dest_features[i] = 9; - break; - case "EXT_GOSSIP_QUERIES_REQ": - case 10: - message.dest_features[i] = 10; - break; - case "EXT_GOSSIP_QUERIES_OPT": - case 11: - message.dest_features[i] = 11; - break; - case "STATIC_REMOTE_KEY_REQ": - case 12: - message.dest_features[i] = 12; - break; - case "STATIC_REMOTE_KEY_OPT": - case 13: - message.dest_features[i] = 13; - break; - case "PAYMENT_ADDR_REQ": - case 14: - message.dest_features[i] = 14; - break; - case "PAYMENT_ADDR_OPT": - case 15: - message.dest_features[i] = 15; - break; - case "MPP_REQ": - case 16: - message.dest_features[i] = 16; - break; - case "MPP_OPT": - case 17: - message.dest_features[i] = 17; - break; - case "WUMBO_CHANNELS_REQ": - case 18: - message.dest_features[i] = 18; - break; - case "WUMBO_CHANNELS_OPT": - case 19: - message.dest_features[i] = 19; - break; - case "ANCHORS_REQ": - case 20: - message.dest_features[i] = 20; - break; - case "ANCHORS_OPT": - case 21: - message.dest_features[i] = 21; - break; - case "ANCHORS_ZERO_FEE_HTLC_REQ": - case 22: - message.dest_features[i] = 22; - break; - case "ANCHORS_ZERO_FEE_HTLC_OPT": - case 23: - message.dest_features[i] = 23; - break; - case "ROUTE_BLINDING_REQUIRED": - case 24: - message.dest_features[i] = 24; + return typeUrlPrefix + "/routerrpc.TrackPaymentsRequest"; + }; + + return TrackPaymentsRequest; + })(); + + routerrpc.RouteFeeRequest = (function() { + + /** + * Properties of a RouteFeeRequest. + * @memberof routerrpc + * @interface IRouteFeeRequest + * @property {Uint8Array|null} [dest] RouteFeeRequest dest + * @property {Long|null} [amt_sat] RouteFeeRequest amt_sat + * @property {string|null} [payment_request] RouteFeeRequest payment_request + * @property {number|null} [timeout] RouteFeeRequest timeout + */ + + /** + * Constructs a new RouteFeeRequest. + * @memberof routerrpc + * @classdesc Represents a RouteFeeRequest. + * @implements IRouteFeeRequest + * @constructor + * @param {routerrpc.IRouteFeeRequest=} [properties] Properties to set + */ + function RouteFeeRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteFeeRequest dest. + * @member {Uint8Array} dest + * @memberof routerrpc.RouteFeeRequest + * @instance + */ + RouteFeeRequest.prototype.dest = $util.newBuffer([]); + + /** + * RouteFeeRequest amt_sat. + * @member {Long} amt_sat + * @memberof routerrpc.RouteFeeRequest + * @instance + */ + RouteFeeRequest.prototype.amt_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RouteFeeRequest payment_request. + * @member {string} payment_request + * @memberof routerrpc.RouteFeeRequest + * @instance + */ + RouteFeeRequest.prototype.payment_request = ""; + + /** + * RouteFeeRequest timeout. + * @member {number} timeout + * @memberof routerrpc.RouteFeeRequest + * @instance + */ + RouteFeeRequest.prototype.timeout = 0; + + /** + * Creates a new RouteFeeRequest instance using the specified properties. + * @function create + * @memberof routerrpc.RouteFeeRequest + * @static + * @param {routerrpc.IRouteFeeRequest=} [properties] Properties to set + * @returns {routerrpc.RouteFeeRequest} RouteFeeRequest instance + */ + RouteFeeRequest.create = function create(properties) { + return new RouteFeeRequest(properties); + }; + + /** + * Encodes the specified RouteFeeRequest message. Does not implicitly {@link routerrpc.RouteFeeRequest.verify|verify} messages. + * @function encode + * @memberof routerrpc.RouteFeeRequest + * @static + * @param {routerrpc.IRouteFeeRequest} message RouteFeeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteFeeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dest != null && Object.hasOwnProperty.call(message, "dest")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dest); + if (message.amt_sat != null && Object.hasOwnProperty.call(message, "amt_sat")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.amt_sat); + if (message.payment_request != null && Object.hasOwnProperty.call(message, "payment_request")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.payment_request); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.timeout); + return writer; + }; + + /** + * Encodes the specified RouteFeeRequest message, length delimited. Does not implicitly {@link routerrpc.RouteFeeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof routerrpc.RouteFeeRequest + * @static + * @param {routerrpc.IRouteFeeRequest} message RouteFeeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteFeeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteFeeRequest message from the specified reader or buffer. + * @function decode + * @memberof routerrpc.RouteFeeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {routerrpc.RouteFeeRequest} RouteFeeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteFeeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.RouteFeeRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dest = reader.bytes(); break; - case "ROUTE_BLINDING_OPTIONAL": - case 25: - message.dest_features[i] = 25; + } + case 2: { + message.amt_sat = reader.int64(); break; - case "AMP_REQ": - case 30: - message.dest_features[i] = 30; + } + case 3: { + message.payment_request = reader.string(); break; - case "AMP_OPT": - case 31: - message.dest_features[i] = 31; + } + case 4: { + message.timeout = reader.uint32(); break; } + default: + reader.skipType(tag & 7); + break; + } } - if (object.max_parts != null) - message.max_parts = object.max_parts >>> 0; - if (object.no_inflight_updates != null) - message.no_inflight_updates = Boolean(object.no_inflight_updates); - if (object.outgoing_chan_ids) { - if (!Array.isArray(object.outgoing_chan_ids)) - throw TypeError(".routerrpc.SendPaymentRequest.outgoing_chan_ids: array expected"); - message.outgoing_chan_ids = []; - for (let i = 0; i < object.outgoing_chan_ids.length; ++i) - if ($util.Long) - (message.outgoing_chan_ids[i] = $util.Long.fromValue(object.outgoing_chan_ids[i])).unsigned = true; - else if (typeof object.outgoing_chan_ids[i] === "string") - message.outgoing_chan_ids[i] = parseInt(object.outgoing_chan_ids[i], 10); - else if (typeof object.outgoing_chan_ids[i] === "number") - message.outgoing_chan_ids[i] = object.outgoing_chan_ids[i]; - else if (typeof object.outgoing_chan_ids[i] === "object") - message.outgoing_chan_ids[i] = new $util.LongBits(object.outgoing_chan_ids[i].low >>> 0, object.outgoing_chan_ids[i].high >>> 0).toNumber(true); - } - if (object.payment_addr != null) - if (typeof object.payment_addr === "string") - $util.base64.decode(object.payment_addr, message.payment_addr = $util.newBuffer($util.base64.length(object.payment_addr)), 0); - else if (object.payment_addr.length >= 0) - message.payment_addr = object.payment_addr; - if (object.max_shard_size_msat != null) + return message; + }; + + /** + * Decodes a RouteFeeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof routerrpc.RouteFeeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {routerrpc.RouteFeeRequest} RouteFeeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteFeeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteFeeRequest message. + * @function verify + * @memberof routerrpc.RouteFeeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteFeeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dest != null && message.hasOwnProperty("dest")) + if (!(message.dest && typeof message.dest.length === "number" || $util.isString(message.dest))) + return "dest: buffer expected"; + if (message.amt_sat != null && message.hasOwnProperty("amt_sat")) + if (!$util.isInteger(message.amt_sat) && !(message.amt_sat && $util.isInteger(message.amt_sat.low) && $util.isInteger(message.amt_sat.high))) + return "amt_sat: integer|Long expected"; + if (message.payment_request != null && message.hasOwnProperty("payment_request")) + if (!$util.isString(message.payment_request)) + return "payment_request: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) + if (!$util.isInteger(message.timeout)) + return "timeout: integer expected"; + return null; + }; + + /** + * Creates a RouteFeeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof routerrpc.RouteFeeRequest + * @static + * @param {Object.} object Plain object + * @returns {routerrpc.RouteFeeRequest} RouteFeeRequest + */ + RouteFeeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.RouteFeeRequest) + return object; + let message = new $root.routerrpc.RouteFeeRequest(); + if (object.dest != null) + if (typeof object.dest === "string") + $util.base64.decode(object.dest, message.dest = $util.newBuffer($util.base64.length(object.dest)), 0); + else if (object.dest.length >= 0) + message.dest = object.dest; + if (object.amt_sat != null) if ($util.Long) - (message.max_shard_size_msat = $util.Long.fromValue(object.max_shard_size_msat)).unsigned = true; - else if (typeof object.max_shard_size_msat === "string") - message.max_shard_size_msat = parseInt(object.max_shard_size_msat, 10); - else if (typeof object.max_shard_size_msat === "number") - message.max_shard_size_msat = object.max_shard_size_msat; - else if (typeof object.max_shard_size_msat === "object") - message.max_shard_size_msat = new $util.LongBits(object.max_shard_size_msat.low >>> 0, object.max_shard_size_msat.high >>> 0).toNumber(true); - if (object.amp != null) - message.amp = Boolean(object.amp); - if (object.time_pref != null) - message.time_pref = Number(object.time_pref); + (message.amt_sat = $util.Long.fromValue(object.amt_sat)).unsigned = false; + else if (typeof object.amt_sat === "string") + message.amt_sat = parseInt(object.amt_sat, 10); + else if (typeof object.amt_sat === "number") + message.amt_sat = object.amt_sat; + else if (typeof object.amt_sat === "object") + message.amt_sat = new $util.LongBits(object.amt_sat.low >>> 0, object.amt_sat.high >>> 0).toNumber(); + if (object.payment_request != null) + message.payment_request = String(object.payment_request); + if (object.timeout != null) + message.timeout = object.timeout >>> 0; return message; }; /** - * Creates a plain object from a SendPaymentRequest message. Also converts values to other types if specified. + * Creates a plain object from a RouteFeeRequest message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.SendPaymentRequest + * @memberof routerrpc.RouteFeeRequest * @static - * @param {routerrpc.SendPaymentRequest} message SendPaymentRequest + * @param {routerrpc.RouteFeeRequest} message RouteFeeRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SendPaymentRequest.toObject = function toObject(message, options) { + RouteFeeRequest.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.arrays || options.defaults) { - object.route_hints = []; - object.dest_features = []; - object.outgoing_chan_ids = []; - } - if (options.objects || options.defaults) - object.dest_custom_records = {}; if (options.defaults) { if (options.bytes === String) object.dest = ""; @@ -85429,196 +88091,399 @@ export const routerrpc = $root.routerrpc = (() => { } if ($util.Long) { let long = new $util.Long(0, 0, false); - object.amt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.amt_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.amt = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.payment_hash = ""; - else { - object.payment_hash = []; - if (options.bytes !== Array) - object.payment_hash = $util.newBuffer(object.payment_hash); - } - object.final_cltv_delta = 0; + object.amt_sat = options.longs === String ? "0" : 0; object.payment_request = ""; - object.timeout_seconds = 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.fee_limit_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.fee_limit_sat = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.outgoing_chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.outgoing_chan_id = options.longs === String ? "0" : 0; - object.cltv_limit = 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.amt_msat = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.fee_limit_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.fee_limit_msat = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.last_hop_pubkey = ""; - else { - object.last_hop_pubkey = []; - if (options.bytes !== Array) - object.last_hop_pubkey = $util.newBuffer(object.last_hop_pubkey); + object.timeout = 0; + } + if (message.dest != null && message.hasOwnProperty("dest")) + object.dest = options.bytes === String ? $util.base64.encode(message.dest, 0, message.dest.length) : options.bytes === Array ? Array.prototype.slice.call(message.dest) : message.dest; + if (message.amt_sat != null && message.hasOwnProperty("amt_sat")) + if (typeof message.amt_sat === "number") + object.amt_sat = options.longs === String ? String(message.amt_sat) : message.amt_sat; + else + object.amt_sat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_sat) : options.longs === Number ? new $util.LongBits(message.amt_sat.low >>> 0, message.amt_sat.high >>> 0).toNumber() : message.amt_sat; + if (message.payment_request != null && message.hasOwnProperty("payment_request")) + object.payment_request = message.payment_request; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = message.timeout; + return object; + }; + + /** + * Converts this RouteFeeRequest to JSON. + * @function toJSON + * @memberof routerrpc.RouteFeeRequest + * @instance + * @returns {Object.} JSON object + */ + RouteFeeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteFeeRequest + * @function getTypeUrl + * @memberof routerrpc.RouteFeeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteFeeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/routerrpc.RouteFeeRequest"; + }; + + return RouteFeeRequest; + })(); + + routerrpc.RouteFeeResponse = (function() { + + /** + * Properties of a RouteFeeResponse. + * @memberof routerrpc + * @interface IRouteFeeResponse + * @property {Long|null} [routing_fee_msat] RouteFeeResponse routing_fee_msat + * @property {Long|null} [time_lock_delay] RouteFeeResponse time_lock_delay + * @property {lnrpc.PaymentFailureReason|null} [failure_reason] RouteFeeResponse failure_reason + */ + + /** + * Constructs a new RouteFeeResponse. + * @memberof routerrpc + * @classdesc Represents a RouteFeeResponse. + * @implements IRouteFeeResponse + * @constructor + * @param {routerrpc.IRouteFeeResponse=} [properties] Properties to set + */ + function RouteFeeResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteFeeResponse routing_fee_msat. + * @member {Long} routing_fee_msat + * @memberof routerrpc.RouteFeeResponse + * @instance + */ + RouteFeeResponse.prototype.routing_fee_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RouteFeeResponse time_lock_delay. + * @member {Long} time_lock_delay + * @memberof routerrpc.RouteFeeResponse + * @instance + */ + RouteFeeResponse.prototype.time_lock_delay = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RouteFeeResponse failure_reason. + * @member {lnrpc.PaymentFailureReason} failure_reason + * @memberof routerrpc.RouteFeeResponse + * @instance + */ + RouteFeeResponse.prototype.failure_reason = 0; + + /** + * Creates a new RouteFeeResponse instance using the specified properties. + * @function create + * @memberof routerrpc.RouteFeeResponse + * @static + * @param {routerrpc.IRouteFeeResponse=} [properties] Properties to set + * @returns {routerrpc.RouteFeeResponse} RouteFeeResponse instance + */ + RouteFeeResponse.create = function create(properties) { + return new RouteFeeResponse(properties); + }; + + /** + * Encodes the specified RouteFeeResponse message. Does not implicitly {@link routerrpc.RouteFeeResponse.verify|verify} messages. + * @function encode + * @memberof routerrpc.RouteFeeResponse + * @static + * @param {routerrpc.IRouteFeeResponse} message RouteFeeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteFeeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.routing_fee_msat != null && Object.hasOwnProperty.call(message, "routing_fee_msat")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.routing_fee_msat); + if (message.time_lock_delay != null && Object.hasOwnProperty.call(message, "time_lock_delay")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.time_lock_delay); + if (message.failure_reason != null && Object.hasOwnProperty.call(message, "failure_reason")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.failure_reason); + return writer; + }; + + /** + * Encodes the specified RouteFeeResponse message, length delimited. Does not implicitly {@link routerrpc.RouteFeeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof routerrpc.RouteFeeResponse + * @static + * @param {routerrpc.IRouteFeeResponse} message RouteFeeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteFeeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteFeeResponse message from the specified reader or buffer. + * @function decode + * @memberof routerrpc.RouteFeeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {routerrpc.RouteFeeResponse} RouteFeeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteFeeResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.RouteFeeResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.routing_fee_msat = reader.int64(); + break; + } + case 2: { + message.time_lock_delay = reader.int64(); + break; + } + case 5: { + message.failure_reason = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; } - object.allow_self_payment = false; - object.max_parts = 0; - object.no_inflight_updates = false; - if (options.bytes === String) - object.payment_addr = ""; - else { - object.payment_addr = []; - if (options.bytes !== Array) - object.payment_addr = $util.newBuffer(object.payment_addr); + } + return message; + }; + + /** + * Decodes a RouteFeeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof routerrpc.RouteFeeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {routerrpc.RouteFeeResponse} RouteFeeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteFeeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteFeeResponse message. + * @function verify + * @memberof routerrpc.RouteFeeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteFeeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.routing_fee_msat != null && message.hasOwnProperty("routing_fee_msat")) + if (!$util.isInteger(message.routing_fee_msat) && !(message.routing_fee_msat && $util.isInteger(message.routing_fee_msat.low) && $util.isInteger(message.routing_fee_msat.high))) + return "routing_fee_msat: integer|Long expected"; + if (message.time_lock_delay != null && message.hasOwnProperty("time_lock_delay")) + if (!$util.isInteger(message.time_lock_delay) && !(message.time_lock_delay && $util.isInteger(message.time_lock_delay.low) && $util.isInteger(message.time_lock_delay.high))) + return "time_lock_delay: integer|Long expected"; + if (message.failure_reason != null && message.hasOwnProperty("failure_reason")) + switch (message.failure_reason) { + default: + return "failure_reason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates a RouteFeeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof routerrpc.RouteFeeResponse + * @static + * @param {Object.} object Plain object + * @returns {routerrpc.RouteFeeResponse} RouteFeeResponse + */ + RouteFeeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.RouteFeeResponse) + return object; + let message = new $root.routerrpc.RouteFeeResponse(); + if (object.routing_fee_msat != null) + if ($util.Long) + (message.routing_fee_msat = $util.Long.fromValue(object.routing_fee_msat)).unsigned = false; + else if (typeof object.routing_fee_msat === "string") + message.routing_fee_msat = parseInt(object.routing_fee_msat, 10); + else if (typeof object.routing_fee_msat === "number") + message.routing_fee_msat = object.routing_fee_msat; + else if (typeof object.routing_fee_msat === "object") + message.routing_fee_msat = new $util.LongBits(object.routing_fee_msat.low >>> 0, object.routing_fee_msat.high >>> 0).toNumber(); + if (object.time_lock_delay != null) + if ($util.Long) + (message.time_lock_delay = $util.Long.fromValue(object.time_lock_delay)).unsigned = false; + else if (typeof object.time_lock_delay === "string") + message.time_lock_delay = parseInt(object.time_lock_delay, 10); + else if (typeof object.time_lock_delay === "number") + message.time_lock_delay = object.time_lock_delay; + else if (typeof object.time_lock_delay === "object") + message.time_lock_delay = new $util.LongBits(object.time_lock_delay.low >>> 0, object.time_lock_delay.high >>> 0).toNumber(); + switch (object.failure_reason) { + default: + if (typeof object.failure_reason === "number") { + message.failure_reason = object.failure_reason; + break; } + break; + case "FAILURE_REASON_NONE": + case 0: + message.failure_reason = 0; + break; + case "FAILURE_REASON_TIMEOUT": + case 1: + message.failure_reason = 1; + break; + case "FAILURE_REASON_NO_ROUTE": + case 2: + message.failure_reason = 2; + break; + case "FAILURE_REASON_ERROR": + case 3: + message.failure_reason = 3; + break; + case "FAILURE_REASON_INCORRECT_PAYMENT_DETAILS": + case 4: + message.failure_reason = 4; + break; + case "FAILURE_REASON_INSUFFICIENT_BALANCE": + case 5: + message.failure_reason = 5; + break; + case "FAILURE_REASON_CANCELED": + case 6: + message.failure_reason = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from a RouteFeeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof routerrpc.RouteFeeResponse + * @static + * @param {routerrpc.RouteFeeResponse} message RouteFeeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteFeeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.max_shard_size_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + let long = new $util.Long(0, 0, false); + object.routing_fee_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.max_shard_size_msat = options.longs === String ? "0" : 0; - object.amp = false; - object.time_pref = 0; - } - if (message.dest != null && message.hasOwnProperty("dest")) - object.dest = options.bytes === String ? $util.base64.encode(message.dest, 0, message.dest.length) : options.bytes === Array ? Array.prototype.slice.call(message.dest) : message.dest; - if (message.amt != null && message.hasOwnProperty("amt")) - if (typeof message.amt === "number") - object.amt = options.longs === String ? String(message.amt) : message.amt; - else - object.amt = options.longs === String ? $util.Long.prototype.toString.call(message.amt) : options.longs === Number ? new $util.LongBits(message.amt.low >>> 0, message.amt.high >>> 0).toNumber() : message.amt; - if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) - object.payment_hash = options.bytes === String ? $util.base64.encode(message.payment_hash, 0, message.payment_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_hash) : message.payment_hash; - if (message.final_cltv_delta != null && message.hasOwnProperty("final_cltv_delta")) - object.final_cltv_delta = message.final_cltv_delta; - if (message.payment_request != null && message.hasOwnProperty("payment_request")) - object.payment_request = message.payment_request; - if (message.timeout_seconds != null && message.hasOwnProperty("timeout_seconds")) - object.timeout_seconds = message.timeout_seconds; - if (message.fee_limit_sat != null && message.hasOwnProperty("fee_limit_sat")) - if (typeof message.fee_limit_sat === "number") - object.fee_limit_sat = options.longs === String ? String(message.fee_limit_sat) : message.fee_limit_sat; - else - object.fee_limit_sat = options.longs === String ? $util.Long.prototype.toString.call(message.fee_limit_sat) : options.longs === Number ? new $util.LongBits(message.fee_limit_sat.low >>> 0, message.fee_limit_sat.high >>> 0).toNumber() : message.fee_limit_sat; - if (message.outgoing_chan_id != null && message.hasOwnProperty("outgoing_chan_id")) - if (typeof message.outgoing_chan_id === "number") - object.outgoing_chan_id = options.longs === String ? String(message.outgoing_chan_id) : message.outgoing_chan_id; - else - object.outgoing_chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_chan_id) : options.longs === Number ? new $util.LongBits(message.outgoing_chan_id.low >>> 0, message.outgoing_chan_id.high >>> 0).toNumber(true) : message.outgoing_chan_id; - if (message.cltv_limit != null && message.hasOwnProperty("cltv_limit")) - object.cltv_limit = message.cltv_limit; - if (message.route_hints && message.route_hints.length) { - object.route_hints = []; - for (let j = 0; j < message.route_hints.length; ++j) - object.route_hints[j] = $root.lnrpc.RouteHint.toObject(message.route_hints[j], options); - } - let keys2; - if (message.dest_custom_records && (keys2 = Object.keys(message.dest_custom_records)).length) { - object.dest_custom_records = {}; - for (let j = 0; j < keys2.length; ++j) - object.dest_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.dest_custom_records[keys2[j]], 0, message.dest_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.dest_custom_records[keys2[j]]) : message.dest_custom_records[keys2[j]]; + object.routing_fee_msat = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.time_lock_delay = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.time_lock_delay = options.longs === String ? "0" : 0; + object.failure_reason = options.enums === String ? "FAILURE_REASON_NONE" : 0; } - if (message.amt_msat != null && message.hasOwnProperty("amt_msat")) - if (typeof message.amt_msat === "number") - object.amt_msat = options.longs === String ? String(message.amt_msat) : message.amt_msat; - else - object.amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_msat) : options.longs === Number ? new $util.LongBits(message.amt_msat.low >>> 0, message.amt_msat.high >>> 0).toNumber() : message.amt_msat; - if (message.fee_limit_msat != null && message.hasOwnProperty("fee_limit_msat")) - if (typeof message.fee_limit_msat === "number") - object.fee_limit_msat = options.longs === String ? String(message.fee_limit_msat) : message.fee_limit_msat; + if (message.routing_fee_msat != null && message.hasOwnProperty("routing_fee_msat")) + if (typeof message.routing_fee_msat === "number") + object.routing_fee_msat = options.longs === String ? String(message.routing_fee_msat) : message.routing_fee_msat; else - object.fee_limit_msat = options.longs === String ? $util.Long.prototype.toString.call(message.fee_limit_msat) : options.longs === Number ? new $util.LongBits(message.fee_limit_msat.low >>> 0, message.fee_limit_msat.high >>> 0).toNumber() : message.fee_limit_msat; - if (message.last_hop_pubkey != null && message.hasOwnProperty("last_hop_pubkey")) - object.last_hop_pubkey = options.bytes === String ? $util.base64.encode(message.last_hop_pubkey, 0, message.last_hop_pubkey.length) : options.bytes === Array ? Array.prototype.slice.call(message.last_hop_pubkey) : message.last_hop_pubkey; - if (message.allow_self_payment != null && message.hasOwnProperty("allow_self_payment")) - object.allow_self_payment = message.allow_self_payment; - if (message.dest_features && message.dest_features.length) { - object.dest_features = []; - for (let j = 0; j < message.dest_features.length; ++j) - object.dest_features[j] = options.enums === String ? $root.lnrpc.FeatureBit[message.dest_features[j]] === undefined ? message.dest_features[j] : $root.lnrpc.FeatureBit[message.dest_features[j]] : message.dest_features[j]; - } - if (message.max_parts != null && message.hasOwnProperty("max_parts")) - object.max_parts = message.max_parts; - if (message.no_inflight_updates != null && message.hasOwnProperty("no_inflight_updates")) - object.no_inflight_updates = message.no_inflight_updates; - if (message.outgoing_chan_ids && message.outgoing_chan_ids.length) { - object.outgoing_chan_ids = []; - for (let j = 0; j < message.outgoing_chan_ids.length; ++j) - if (typeof message.outgoing_chan_ids[j] === "number") - object.outgoing_chan_ids[j] = options.longs === String ? String(message.outgoing_chan_ids[j]) : message.outgoing_chan_ids[j]; - else - object.outgoing_chan_ids[j] = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_chan_ids[j]) : options.longs === Number ? new $util.LongBits(message.outgoing_chan_ids[j].low >>> 0, message.outgoing_chan_ids[j].high >>> 0).toNumber(true) : message.outgoing_chan_ids[j]; - } - if (message.payment_addr != null && message.hasOwnProperty("payment_addr")) - object.payment_addr = options.bytes === String ? $util.base64.encode(message.payment_addr, 0, message.payment_addr.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_addr) : message.payment_addr; - if (message.max_shard_size_msat != null && message.hasOwnProperty("max_shard_size_msat")) - if (typeof message.max_shard_size_msat === "number") - object.max_shard_size_msat = options.longs === String ? String(message.max_shard_size_msat) : message.max_shard_size_msat; + object.routing_fee_msat = options.longs === String ? $util.Long.prototype.toString.call(message.routing_fee_msat) : options.longs === Number ? new $util.LongBits(message.routing_fee_msat.low >>> 0, message.routing_fee_msat.high >>> 0).toNumber() : message.routing_fee_msat; + if (message.time_lock_delay != null && message.hasOwnProperty("time_lock_delay")) + if (typeof message.time_lock_delay === "number") + object.time_lock_delay = options.longs === String ? String(message.time_lock_delay) : message.time_lock_delay; else - object.max_shard_size_msat = options.longs === String ? $util.Long.prototype.toString.call(message.max_shard_size_msat) : options.longs === Number ? new $util.LongBits(message.max_shard_size_msat.low >>> 0, message.max_shard_size_msat.high >>> 0).toNumber(true) : message.max_shard_size_msat; - if (message.amp != null && message.hasOwnProperty("amp")) - object.amp = message.amp; - if (message.time_pref != null && message.hasOwnProperty("time_pref")) - object.time_pref = options.json && !isFinite(message.time_pref) ? String(message.time_pref) : message.time_pref; + object.time_lock_delay = options.longs === String ? $util.Long.prototype.toString.call(message.time_lock_delay) : options.longs === Number ? new $util.LongBits(message.time_lock_delay.low >>> 0, message.time_lock_delay.high >>> 0).toNumber() : message.time_lock_delay; + if (message.failure_reason != null && message.hasOwnProperty("failure_reason")) + object.failure_reason = options.enums === String ? $root.lnrpc.PaymentFailureReason[message.failure_reason] === undefined ? message.failure_reason : $root.lnrpc.PaymentFailureReason[message.failure_reason] : message.failure_reason; return object; }; /** - * Converts this SendPaymentRequest to JSON. + * Converts this RouteFeeResponse to JSON. * @function toJSON - * @memberof routerrpc.SendPaymentRequest + * @memberof routerrpc.RouteFeeResponse * @instance * @returns {Object.} JSON object */ - SendPaymentRequest.prototype.toJSON = function toJSON() { + RouteFeeResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SendPaymentRequest + * Gets the default type url for RouteFeeResponse * @function getTypeUrl - * @memberof routerrpc.SendPaymentRequest + * @memberof routerrpc.RouteFeeResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SendPaymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RouteFeeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.SendPaymentRequest"; + return typeUrlPrefix + "/routerrpc.RouteFeeResponse"; }; - return SendPaymentRequest; + return RouteFeeResponse; })(); - routerrpc.TrackPaymentRequest = (function() { + routerrpc.SendToRouteRequest = (function() { /** - * Properties of a TrackPaymentRequest. + * Properties of a SendToRouteRequest. * @memberof routerrpc - * @interface ITrackPaymentRequest - * @property {Uint8Array|null} [payment_hash] TrackPaymentRequest payment_hash - * @property {boolean|null} [no_inflight_updates] TrackPaymentRequest no_inflight_updates + * @interface ISendToRouteRequest + * @property {Uint8Array|null} [payment_hash] SendToRouteRequest payment_hash + * @property {lnrpc.IRoute|null} [route] SendToRouteRequest route + * @property {boolean|null} [skip_temp_err] SendToRouteRequest skip_temp_err + * @property {Object.|null} [first_hop_custom_records] SendToRouteRequest first_hop_custom_records */ /** - * Constructs a new TrackPaymentRequest. + * Constructs a new SendToRouteRequest. * @memberof routerrpc - * @classdesc Represents a TrackPaymentRequest. - * @implements ITrackPaymentRequest + * @classdesc Represents a SendToRouteRequest. + * @implements ISendToRouteRequest * @constructor - * @param {routerrpc.ITrackPaymentRequest=} [properties] Properties to set + * @param {routerrpc.ISendToRouteRequest=} [properties] Properties to set */ - function TrackPaymentRequest(properties) { + function SendToRouteRequest(properties) { + this.first_hop_custom_records = {}; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -85626,80 +88491,101 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * TrackPaymentRequest payment_hash. + * SendToRouteRequest payment_hash. * @member {Uint8Array} payment_hash - * @memberof routerrpc.TrackPaymentRequest + * @memberof routerrpc.SendToRouteRequest * @instance */ - TrackPaymentRequest.prototype.payment_hash = $util.newBuffer([]); + SendToRouteRequest.prototype.payment_hash = $util.newBuffer([]); /** - * TrackPaymentRequest no_inflight_updates. - * @member {boolean} no_inflight_updates - * @memberof routerrpc.TrackPaymentRequest + * SendToRouteRequest route. + * @member {lnrpc.IRoute|null|undefined} route + * @memberof routerrpc.SendToRouteRequest * @instance */ - TrackPaymentRequest.prototype.no_inflight_updates = false; + SendToRouteRequest.prototype.route = null; /** - * Creates a new TrackPaymentRequest instance using the specified properties. + * SendToRouteRequest skip_temp_err. + * @member {boolean} skip_temp_err + * @memberof routerrpc.SendToRouteRequest + * @instance + */ + SendToRouteRequest.prototype.skip_temp_err = false; + + /** + * SendToRouteRequest first_hop_custom_records. + * @member {Object.} first_hop_custom_records + * @memberof routerrpc.SendToRouteRequest + * @instance + */ + SendToRouteRequest.prototype.first_hop_custom_records = $util.emptyObject; + + /** + * Creates a new SendToRouteRequest instance using the specified properties. * @function create - * @memberof routerrpc.TrackPaymentRequest + * @memberof routerrpc.SendToRouteRequest * @static - * @param {routerrpc.ITrackPaymentRequest=} [properties] Properties to set - * @returns {routerrpc.TrackPaymentRequest} TrackPaymentRequest instance + * @param {routerrpc.ISendToRouteRequest=} [properties] Properties to set + * @returns {routerrpc.SendToRouteRequest} SendToRouteRequest instance */ - TrackPaymentRequest.create = function create(properties) { - return new TrackPaymentRequest(properties); + SendToRouteRequest.create = function create(properties) { + return new SendToRouteRequest(properties); }; /** - * Encodes the specified TrackPaymentRequest message. Does not implicitly {@link routerrpc.TrackPaymentRequest.verify|verify} messages. + * Encodes the specified SendToRouteRequest message. Does not implicitly {@link routerrpc.SendToRouteRequest.verify|verify} messages. * @function encode - * @memberof routerrpc.TrackPaymentRequest + * @memberof routerrpc.SendToRouteRequest * @static - * @param {routerrpc.ITrackPaymentRequest} message TrackPaymentRequest message or plain object to encode + * @param {routerrpc.ISendToRouteRequest} message SendToRouteRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TrackPaymentRequest.encode = function encode(message, writer) { + SendToRouteRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.payment_hash); - if (message.no_inflight_updates != null && Object.hasOwnProperty.call(message, "no_inflight_updates")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.no_inflight_updates); + if (message.route != null && Object.hasOwnProperty.call(message, "route")) + $root.lnrpc.Route.encode(message.route, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.skip_temp_err != null && Object.hasOwnProperty.call(message, "skip_temp_err")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.skip_temp_err); + if (message.first_hop_custom_records != null && Object.hasOwnProperty.call(message, "first_hop_custom_records")) + for (let keys = Object.keys(message.first_hop_custom_records), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.first_hop_custom_records[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified TrackPaymentRequest message, length delimited. Does not implicitly {@link routerrpc.TrackPaymentRequest.verify|verify} messages. + * Encodes the specified SendToRouteRequest message, length delimited. Does not implicitly {@link routerrpc.SendToRouteRequest.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.TrackPaymentRequest + * @memberof routerrpc.SendToRouteRequest * @static - * @param {routerrpc.ITrackPaymentRequest} message TrackPaymentRequest message or plain object to encode + * @param {routerrpc.ISendToRouteRequest} message SendToRouteRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TrackPaymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + SendToRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TrackPaymentRequest message from the specified reader or buffer. + * Decodes a SendToRouteRequest message from the specified reader or buffer. * @function decode - * @memberof routerrpc.TrackPaymentRequest + * @memberof routerrpc.SendToRouteRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.TrackPaymentRequest} TrackPaymentRequest + * @returns {routerrpc.SendToRouteRequest} SendToRouteRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TrackPaymentRequest.decode = function decode(reader, length) { + SendToRouteRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.TrackPaymentRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SendToRouteRequest(), key, value; while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { @@ -85708,7 +88594,34 @@ export const routerrpc = $root.routerrpc = (() => { break; } case 2: { - message.no_inflight_updates = reader.bool(); + message.route = $root.lnrpc.Route.decode(reader, reader.uint32()); + break; + } + case 3: { + message.skip_temp_err = reader.bool(); + break; + } + case 4: { + if (message.first_hop_custom_records === $util.emptyObject) + message.first_hop_custom_records = {}; + let end2 = reader.uint32() + reader.pos; + key = 0; + value = []; + while (reader.pos < end2) { + let tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint64(); + break; + case 2: + value = reader.bytes(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.first_hop_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value; break; } default: @@ -85720,76 +88633,109 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a TrackPaymentRequest message from the specified reader or buffer, length delimited. + * Decodes a SendToRouteRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.TrackPaymentRequest + * @memberof routerrpc.SendToRouteRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.TrackPaymentRequest} TrackPaymentRequest + * @returns {routerrpc.SendToRouteRequest} SendToRouteRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TrackPaymentRequest.decodeDelimited = function decodeDelimited(reader) { + SendToRouteRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TrackPaymentRequest message. + * Verifies a SendToRouteRequest message. * @function verify - * @memberof routerrpc.TrackPaymentRequest + * @memberof routerrpc.SendToRouteRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TrackPaymentRequest.verify = function verify(message) { + SendToRouteRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) if (!(message.payment_hash && typeof message.payment_hash.length === "number" || $util.isString(message.payment_hash))) return "payment_hash: buffer expected"; - if (message.no_inflight_updates != null && message.hasOwnProperty("no_inflight_updates")) - if (typeof message.no_inflight_updates !== "boolean") - return "no_inflight_updates: boolean expected"; + if (message.route != null && message.hasOwnProperty("route")) { + let error = $root.lnrpc.Route.verify(message.route); + if (error) + return "route." + error; + } + if (message.skip_temp_err != null && message.hasOwnProperty("skip_temp_err")) + if (typeof message.skip_temp_err !== "boolean") + return "skip_temp_err: boolean expected"; + if (message.first_hop_custom_records != null && message.hasOwnProperty("first_hop_custom_records")) { + if (!$util.isObject(message.first_hop_custom_records)) + return "first_hop_custom_records: object expected"; + let key = Object.keys(message.first_hop_custom_records); + for (let i = 0; i < key.length; ++i) { + if (!$util.key64Re.test(key[i])) + return "first_hop_custom_records: integer|Long key{k:uint64} expected"; + if (!(message.first_hop_custom_records[key[i]] && typeof message.first_hop_custom_records[key[i]].length === "number" || $util.isString(message.first_hop_custom_records[key[i]]))) + return "first_hop_custom_records: buffer{k:uint64} expected"; + } + } return null; }; /** - * Creates a TrackPaymentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SendToRouteRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.TrackPaymentRequest + * @memberof routerrpc.SendToRouteRequest * @static * @param {Object.} object Plain object - * @returns {routerrpc.TrackPaymentRequest} TrackPaymentRequest + * @returns {routerrpc.SendToRouteRequest} SendToRouteRequest */ - TrackPaymentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.TrackPaymentRequest) + SendToRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.SendToRouteRequest) return object; - let message = new $root.routerrpc.TrackPaymentRequest(); + let message = new $root.routerrpc.SendToRouteRequest(); if (object.payment_hash != null) if (typeof object.payment_hash === "string") $util.base64.decode(object.payment_hash, message.payment_hash = $util.newBuffer($util.base64.length(object.payment_hash)), 0); else if (object.payment_hash.length >= 0) message.payment_hash = object.payment_hash; - if (object.no_inflight_updates != null) - message.no_inflight_updates = Boolean(object.no_inflight_updates); + if (object.route != null) { + if (typeof object.route !== "object") + throw TypeError(".routerrpc.SendToRouteRequest.route: object expected"); + message.route = $root.lnrpc.Route.fromObject(object.route); + } + if (object.skip_temp_err != null) + message.skip_temp_err = Boolean(object.skip_temp_err); + if (object.first_hop_custom_records) { + if (typeof object.first_hop_custom_records !== "object") + throw TypeError(".routerrpc.SendToRouteRequest.first_hop_custom_records: object expected"); + message.first_hop_custom_records = {}; + for (let keys = Object.keys(object.first_hop_custom_records), i = 0; i < keys.length; ++i) + if (typeof object.first_hop_custom_records[keys[i]] === "string") + $util.base64.decode(object.first_hop_custom_records[keys[i]], message.first_hop_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.first_hop_custom_records[keys[i]])), 0); + else if (object.first_hop_custom_records[keys[i]].length >= 0) + message.first_hop_custom_records[keys[i]] = object.first_hop_custom_records[keys[i]]; + } return message; }; /** - * Creates a plain object from a TrackPaymentRequest message. Also converts values to other types if specified. + * Creates a plain object from a SendToRouteRequest message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.TrackPaymentRequest + * @memberof routerrpc.SendToRouteRequest * @static - * @param {routerrpc.TrackPaymentRequest} message TrackPaymentRequest + * @param {routerrpc.SendToRouteRequest} message SendToRouteRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TrackPaymentRequest.toObject = function toObject(message, options) { + SendToRouteRequest.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; + if (options.objects || options.defaults) + object.first_hop_custom_records = {}; if (options.defaults) { if (options.bytes === String) object.payment_hash = ""; @@ -85798,62 +88744,72 @@ export const routerrpc = $root.routerrpc = (() => { if (options.bytes !== Array) object.payment_hash = $util.newBuffer(object.payment_hash); } - object.no_inflight_updates = false; + object.route = null; + object.skip_temp_err = false; } if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) object.payment_hash = options.bytes === String ? $util.base64.encode(message.payment_hash, 0, message.payment_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_hash) : message.payment_hash; - if (message.no_inflight_updates != null && message.hasOwnProperty("no_inflight_updates")) - object.no_inflight_updates = message.no_inflight_updates; + if (message.route != null && message.hasOwnProperty("route")) + object.route = $root.lnrpc.Route.toObject(message.route, options); + if (message.skip_temp_err != null && message.hasOwnProperty("skip_temp_err")) + object.skip_temp_err = message.skip_temp_err; + let keys2; + if (message.first_hop_custom_records && (keys2 = Object.keys(message.first_hop_custom_records)).length) { + object.first_hop_custom_records = {}; + for (let j = 0; j < keys2.length; ++j) + object.first_hop_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.first_hop_custom_records[keys2[j]], 0, message.first_hop_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.first_hop_custom_records[keys2[j]]) : message.first_hop_custom_records[keys2[j]]; + } return object; }; /** - * Converts this TrackPaymentRequest to JSON. + * Converts this SendToRouteRequest to JSON. * @function toJSON - * @memberof routerrpc.TrackPaymentRequest + * @memberof routerrpc.SendToRouteRequest * @instance * @returns {Object.} JSON object */ - TrackPaymentRequest.prototype.toJSON = function toJSON() { + SendToRouteRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TrackPaymentRequest + * Gets the default type url for SendToRouteRequest * @function getTypeUrl - * @memberof routerrpc.TrackPaymentRequest + * @memberof routerrpc.SendToRouteRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TrackPaymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SendToRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.TrackPaymentRequest"; + return typeUrlPrefix + "/routerrpc.SendToRouteRequest"; }; - return TrackPaymentRequest; + return SendToRouteRequest; })(); - routerrpc.TrackPaymentsRequest = (function() { + routerrpc.SendToRouteResponse = (function() { /** - * Properties of a TrackPaymentsRequest. + * Properties of a SendToRouteResponse. * @memberof routerrpc - * @interface ITrackPaymentsRequest - * @property {boolean|null} [no_inflight_updates] TrackPaymentsRequest no_inflight_updates + * @interface ISendToRouteResponse + * @property {Uint8Array|null} [preimage] SendToRouteResponse preimage + * @property {lnrpc.IFailure|null} [failure] SendToRouteResponse failure */ /** - * Constructs a new TrackPaymentsRequest. + * Constructs a new SendToRouteResponse. * @memberof routerrpc - * @classdesc Represents a TrackPaymentsRequest. - * @implements ITrackPaymentsRequest + * @classdesc Represents a SendToRouteResponse. + * @implements ISendToRouteResponse * @constructor - * @param {routerrpc.ITrackPaymentsRequest=} [properties] Properties to set + * @param {routerrpc.ISendToRouteResponse=} [properties] Properties to set */ - function TrackPaymentsRequest(properties) { + function SendToRouteResponse(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -85861,75 +88817,89 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * TrackPaymentsRequest no_inflight_updates. - * @member {boolean} no_inflight_updates - * @memberof routerrpc.TrackPaymentsRequest + * SendToRouteResponse preimage. + * @member {Uint8Array} preimage + * @memberof routerrpc.SendToRouteResponse * @instance */ - TrackPaymentsRequest.prototype.no_inflight_updates = false; + SendToRouteResponse.prototype.preimage = $util.newBuffer([]); /** - * Creates a new TrackPaymentsRequest instance using the specified properties. + * SendToRouteResponse failure. + * @member {lnrpc.IFailure|null|undefined} failure + * @memberof routerrpc.SendToRouteResponse + * @instance + */ + SendToRouteResponse.prototype.failure = null; + + /** + * Creates a new SendToRouteResponse instance using the specified properties. * @function create - * @memberof routerrpc.TrackPaymentsRequest + * @memberof routerrpc.SendToRouteResponse * @static - * @param {routerrpc.ITrackPaymentsRequest=} [properties] Properties to set - * @returns {routerrpc.TrackPaymentsRequest} TrackPaymentsRequest instance + * @param {routerrpc.ISendToRouteResponse=} [properties] Properties to set + * @returns {routerrpc.SendToRouteResponse} SendToRouteResponse instance */ - TrackPaymentsRequest.create = function create(properties) { - return new TrackPaymentsRequest(properties); + SendToRouteResponse.create = function create(properties) { + return new SendToRouteResponse(properties); }; /** - * Encodes the specified TrackPaymentsRequest message. Does not implicitly {@link routerrpc.TrackPaymentsRequest.verify|verify} messages. + * Encodes the specified SendToRouteResponse message. Does not implicitly {@link routerrpc.SendToRouteResponse.verify|verify} messages. * @function encode - * @memberof routerrpc.TrackPaymentsRequest + * @memberof routerrpc.SendToRouteResponse * @static - * @param {routerrpc.ITrackPaymentsRequest} message TrackPaymentsRequest message or plain object to encode + * @param {routerrpc.ISendToRouteResponse} message SendToRouteResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TrackPaymentsRequest.encode = function encode(message, writer) { + SendToRouteResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.no_inflight_updates != null && Object.hasOwnProperty.call(message, "no_inflight_updates")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.no_inflight_updates); + if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.preimage); + if (message.failure != null && Object.hasOwnProperty.call(message, "failure")) + $root.lnrpc.Failure.encode(message.failure, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified TrackPaymentsRequest message, length delimited. Does not implicitly {@link routerrpc.TrackPaymentsRequest.verify|verify} messages. + * Encodes the specified SendToRouteResponse message, length delimited. Does not implicitly {@link routerrpc.SendToRouteResponse.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.TrackPaymentsRequest + * @memberof routerrpc.SendToRouteResponse * @static - * @param {routerrpc.ITrackPaymentsRequest} message TrackPaymentsRequest message or plain object to encode + * @param {routerrpc.ISendToRouteResponse} message SendToRouteResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TrackPaymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + SendToRouteResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TrackPaymentsRequest message from the specified reader or buffer. + * Decodes a SendToRouteResponse message from the specified reader or buffer. * @function decode - * @memberof routerrpc.TrackPaymentsRequest + * @memberof routerrpc.SendToRouteResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.TrackPaymentsRequest} TrackPaymentsRequest + * @returns {routerrpc.SendToRouteResponse} SendToRouteResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TrackPaymentsRequest.decode = function decode(reader, length) { + SendToRouteResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.TrackPaymentsRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SendToRouteResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.no_inflight_updates = reader.bool(); + message.preimage = reader.bytes(); + break; + } + case 2: { + message.failure = $root.lnrpc.Failure.decode(reader, reader.uint32()); break; } default: @@ -85941,125 +88911,144 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a TrackPaymentsRequest message from the specified reader or buffer, length delimited. + * Decodes a SendToRouteResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.TrackPaymentsRequest + * @memberof routerrpc.SendToRouteResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.TrackPaymentsRequest} TrackPaymentsRequest + * @returns {routerrpc.SendToRouteResponse} SendToRouteResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TrackPaymentsRequest.decodeDelimited = function decodeDelimited(reader) { + SendToRouteResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TrackPaymentsRequest message. + * Verifies a SendToRouteResponse message. * @function verify - * @memberof routerrpc.TrackPaymentsRequest + * @memberof routerrpc.SendToRouteResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TrackPaymentsRequest.verify = function verify(message) { + SendToRouteResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.no_inflight_updates != null && message.hasOwnProperty("no_inflight_updates")) - if (typeof message.no_inflight_updates !== "boolean") - return "no_inflight_updates: boolean expected"; + if (message.preimage != null && message.hasOwnProperty("preimage")) + if (!(message.preimage && typeof message.preimage.length === "number" || $util.isString(message.preimage))) + return "preimage: buffer expected"; + if (message.failure != null && message.hasOwnProperty("failure")) { + let error = $root.lnrpc.Failure.verify(message.failure); + if (error) + return "failure." + error; + } return null; }; /** - * Creates a TrackPaymentsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SendToRouteResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.TrackPaymentsRequest + * @memberof routerrpc.SendToRouteResponse * @static * @param {Object.} object Plain object - * @returns {routerrpc.TrackPaymentsRequest} TrackPaymentsRequest + * @returns {routerrpc.SendToRouteResponse} SendToRouteResponse */ - TrackPaymentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.TrackPaymentsRequest) + SendToRouteResponse.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.SendToRouteResponse) return object; - let message = new $root.routerrpc.TrackPaymentsRequest(); - if (object.no_inflight_updates != null) - message.no_inflight_updates = Boolean(object.no_inflight_updates); + let message = new $root.routerrpc.SendToRouteResponse(); + if (object.preimage != null) + if (typeof object.preimage === "string") + $util.base64.decode(object.preimage, message.preimage = $util.newBuffer($util.base64.length(object.preimage)), 0); + else if (object.preimage.length >= 0) + message.preimage = object.preimage; + if (object.failure != null) { + if (typeof object.failure !== "object") + throw TypeError(".routerrpc.SendToRouteResponse.failure: object expected"); + message.failure = $root.lnrpc.Failure.fromObject(object.failure); + } return message; }; /** - * Creates a plain object from a TrackPaymentsRequest message. Also converts values to other types if specified. + * Creates a plain object from a SendToRouteResponse message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.TrackPaymentsRequest + * @memberof routerrpc.SendToRouteResponse * @static - * @param {routerrpc.TrackPaymentsRequest} message TrackPaymentsRequest + * @param {routerrpc.SendToRouteResponse} message SendToRouteResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TrackPaymentsRequest.toObject = function toObject(message, options) { + SendToRouteResponse.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.defaults) - object.no_inflight_updates = false; - if (message.no_inflight_updates != null && message.hasOwnProperty("no_inflight_updates")) - object.no_inflight_updates = message.no_inflight_updates; + if (options.defaults) { + if (options.bytes === String) + object.preimage = ""; + else { + object.preimage = []; + if (options.bytes !== Array) + object.preimage = $util.newBuffer(object.preimage); + } + object.failure = null; + } + if (message.preimage != null && message.hasOwnProperty("preimage")) + object.preimage = options.bytes === String ? $util.base64.encode(message.preimage, 0, message.preimage.length) : options.bytes === Array ? Array.prototype.slice.call(message.preimage) : message.preimage; + if (message.failure != null && message.hasOwnProperty("failure")) + object.failure = $root.lnrpc.Failure.toObject(message.failure, options); return object; }; /** - * Converts this TrackPaymentsRequest to JSON. + * Converts this SendToRouteResponse to JSON. * @function toJSON - * @memberof routerrpc.TrackPaymentsRequest + * @memberof routerrpc.SendToRouteResponse * @instance * @returns {Object.} JSON object */ - TrackPaymentsRequest.prototype.toJSON = function toJSON() { + SendToRouteResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TrackPaymentsRequest + * Gets the default type url for SendToRouteResponse * @function getTypeUrl - * @memberof routerrpc.TrackPaymentsRequest + * @memberof routerrpc.SendToRouteResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TrackPaymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SendToRouteResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.TrackPaymentsRequest"; + return typeUrlPrefix + "/routerrpc.SendToRouteResponse"; }; - return TrackPaymentsRequest; + return SendToRouteResponse; })(); - routerrpc.RouteFeeRequest = (function() { + routerrpc.ResetMissionControlRequest = (function() { /** - * Properties of a RouteFeeRequest. - * @memberof routerrpc - * @interface IRouteFeeRequest - * @property {Uint8Array|null} [dest] RouteFeeRequest dest - * @property {Long|null} [amt_sat] RouteFeeRequest amt_sat - * @property {string|null} [payment_request] RouteFeeRequest payment_request - * @property {number|null} [timeout] RouteFeeRequest timeout + * Properties of a ResetMissionControlRequest. + * @memberof routerrpc + * @interface IResetMissionControlRequest */ /** - * Constructs a new RouteFeeRequest. + * Constructs a new ResetMissionControlRequest. * @memberof routerrpc - * @classdesc Represents a RouteFeeRequest. - * @implements IRouteFeeRequest + * @classdesc Represents a ResetMissionControlRequest. + * @implements IResetMissionControlRequest * @constructor - * @param {routerrpc.IRouteFeeRequest=} [properties] Properties to set + * @param {routerrpc.IResetMissionControlRequest=} [properties] Properties to set */ - function RouteFeeRequest(properties) { + function ResetMissionControlRequest(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -86067,119 +89056,63 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * RouteFeeRequest dest. - * @member {Uint8Array} dest - * @memberof routerrpc.RouteFeeRequest - * @instance - */ - RouteFeeRequest.prototype.dest = $util.newBuffer([]); - - /** - * RouteFeeRequest amt_sat. - * @member {Long} amt_sat - * @memberof routerrpc.RouteFeeRequest - * @instance - */ - RouteFeeRequest.prototype.amt_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * RouteFeeRequest payment_request. - * @member {string} payment_request - * @memberof routerrpc.RouteFeeRequest - * @instance - */ - RouteFeeRequest.prototype.payment_request = ""; - - /** - * RouteFeeRequest timeout. - * @member {number} timeout - * @memberof routerrpc.RouteFeeRequest - * @instance - */ - RouteFeeRequest.prototype.timeout = 0; - - /** - * Creates a new RouteFeeRequest instance using the specified properties. + * Creates a new ResetMissionControlRequest instance using the specified properties. * @function create - * @memberof routerrpc.RouteFeeRequest + * @memberof routerrpc.ResetMissionControlRequest * @static - * @param {routerrpc.IRouteFeeRequest=} [properties] Properties to set - * @returns {routerrpc.RouteFeeRequest} RouteFeeRequest instance + * @param {routerrpc.IResetMissionControlRequest=} [properties] Properties to set + * @returns {routerrpc.ResetMissionControlRequest} ResetMissionControlRequest instance */ - RouteFeeRequest.create = function create(properties) { - return new RouteFeeRequest(properties); + ResetMissionControlRequest.create = function create(properties) { + return new ResetMissionControlRequest(properties); }; /** - * Encodes the specified RouteFeeRequest message. Does not implicitly {@link routerrpc.RouteFeeRequest.verify|verify} messages. + * Encodes the specified ResetMissionControlRequest message. Does not implicitly {@link routerrpc.ResetMissionControlRequest.verify|verify} messages. * @function encode - * @memberof routerrpc.RouteFeeRequest + * @memberof routerrpc.ResetMissionControlRequest * @static - * @param {routerrpc.IRouteFeeRequest} message RouteFeeRequest message or plain object to encode + * @param {routerrpc.IResetMissionControlRequest} message ResetMissionControlRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RouteFeeRequest.encode = function encode(message, writer) { + ResetMissionControlRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dest != null && Object.hasOwnProperty.call(message, "dest")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dest); - if (message.amt_sat != null && Object.hasOwnProperty.call(message, "amt_sat")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.amt_sat); - if (message.payment_request != null && Object.hasOwnProperty.call(message, "payment_request")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.payment_request); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.timeout); return writer; }; /** - * Encodes the specified RouteFeeRequest message, length delimited. Does not implicitly {@link routerrpc.RouteFeeRequest.verify|verify} messages. + * Encodes the specified ResetMissionControlRequest message, length delimited. Does not implicitly {@link routerrpc.ResetMissionControlRequest.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.RouteFeeRequest + * @memberof routerrpc.ResetMissionControlRequest * @static - * @param {routerrpc.IRouteFeeRequest} message RouteFeeRequest message or plain object to encode + * @param {routerrpc.IResetMissionControlRequest} message ResetMissionControlRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RouteFeeRequest.encodeDelimited = function encodeDelimited(message, writer) { + ResetMissionControlRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RouteFeeRequest message from the specified reader or buffer. + * Decodes a ResetMissionControlRequest message from the specified reader or buffer. * @function decode - * @memberof routerrpc.RouteFeeRequest + * @memberof routerrpc.ResetMissionControlRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.RouteFeeRequest} RouteFeeRequest + * @returns {routerrpc.ResetMissionControlRequest} ResetMissionControlRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RouteFeeRequest.decode = function decode(reader, length) { + ResetMissionControlRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.RouteFeeRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.ResetMissionControlRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.dest = reader.bytes(); - break; - } - case 2: { - message.amt_sat = reader.int64(); - break; - } - case 3: { - message.payment_request = reader.string(); - break; - } - case 4: { - message.timeout = reader.uint32(); - break; - } default: reader.skipType(tag & 7); break; @@ -86189,172 +89122,108 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a RouteFeeRequest message from the specified reader or buffer, length delimited. + * Decodes a ResetMissionControlRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.RouteFeeRequest + * @memberof routerrpc.ResetMissionControlRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.RouteFeeRequest} RouteFeeRequest + * @returns {routerrpc.ResetMissionControlRequest} ResetMissionControlRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RouteFeeRequest.decodeDelimited = function decodeDelimited(reader) { + ResetMissionControlRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RouteFeeRequest message. + * Verifies a ResetMissionControlRequest message. * @function verify - * @memberof routerrpc.RouteFeeRequest + * @memberof routerrpc.ResetMissionControlRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RouteFeeRequest.verify = function verify(message) { + ResetMissionControlRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dest != null && message.hasOwnProperty("dest")) - if (!(message.dest && typeof message.dest.length === "number" || $util.isString(message.dest))) - return "dest: buffer expected"; - if (message.amt_sat != null && message.hasOwnProperty("amt_sat")) - if (!$util.isInteger(message.amt_sat) && !(message.amt_sat && $util.isInteger(message.amt_sat.low) && $util.isInteger(message.amt_sat.high))) - return "amt_sat: integer|Long expected"; - if (message.payment_request != null && message.hasOwnProperty("payment_request")) - if (!$util.isString(message.payment_request)) - return "payment_request: string expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) - if (!$util.isInteger(message.timeout)) - return "timeout: integer expected"; return null; }; /** - * Creates a RouteFeeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ResetMissionControlRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.RouteFeeRequest + * @memberof routerrpc.ResetMissionControlRequest * @static * @param {Object.} object Plain object - * @returns {routerrpc.RouteFeeRequest} RouteFeeRequest + * @returns {routerrpc.ResetMissionControlRequest} ResetMissionControlRequest */ - RouteFeeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.RouteFeeRequest) + ResetMissionControlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.ResetMissionControlRequest) return object; - let message = new $root.routerrpc.RouteFeeRequest(); - if (object.dest != null) - if (typeof object.dest === "string") - $util.base64.decode(object.dest, message.dest = $util.newBuffer($util.base64.length(object.dest)), 0); - else if (object.dest.length >= 0) - message.dest = object.dest; - if (object.amt_sat != null) - if ($util.Long) - (message.amt_sat = $util.Long.fromValue(object.amt_sat)).unsigned = false; - else if (typeof object.amt_sat === "string") - message.amt_sat = parseInt(object.amt_sat, 10); - else if (typeof object.amt_sat === "number") - message.amt_sat = object.amt_sat; - else if (typeof object.amt_sat === "object") - message.amt_sat = new $util.LongBits(object.amt_sat.low >>> 0, object.amt_sat.high >>> 0).toNumber(); - if (object.payment_request != null) - message.payment_request = String(object.payment_request); - if (object.timeout != null) - message.timeout = object.timeout >>> 0; - return message; + return new $root.routerrpc.ResetMissionControlRequest(); }; /** - * Creates a plain object from a RouteFeeRequest message. Also converts values to other types if specified. + * Creates a plain object from a ResetMissionControlRequest message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.RouteFeeRequest + * @memberof routerrpc.ResetMissionControlRequest * @static - * @param {routerrpc.RouteFeeRequest} message RouteFeeRequest + * @param {routerrpc.ResetMissionControlRequest} message ResetMissionControlRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RouteFeeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.dest = ""; - else { - object.dest = []; - if (options.bytes !== Array) - object.dest = $util.newBuffer(object.dest); - } - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.amt_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.amt_sat = options.longs === String ? "0" : 0; - object.payment_request = ""; - object.timeout = 0; - } - if (message.dest != null && message.hasOwnProperty("dest")) - object.dest = options.bytes === String ? $util.base64.encode(message.dest, 0, message.dest.length) : options.bytes === Array ? Array.prototype.slice.call(message.dest) : message.dest; - if (message.amt_sat != null && message.hasOwnProperty("amt_sat")) - if (typeof message.amt_sat === "number") - object.amt_sat = options.longs === String ? String(message.amt_sat) : message.amt_sat; - else - object.amt_sat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_sat) : options.longs === Number ? new $util.LongBits(message.amt_sat.low >>> 0, message.amt_sat.high >>> 0).toNumber() : message.amt_sat; - if (message.payment_request != null && message.hasOwnProperty("payment_request")) - object.payment_request = message.payment_request; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = message.timeout; - return object; + ResetMissionControlRequest.toObject = function toObject() { + return {}; }; /** - * Converts this RouteFeeRequest to JSON. + * Converts this ResetMissionControlRequest to JSON. * @function toJSON - * @memberof routerrpc.RouteFeeRequest + * @memberof routerrpc.ResetMissionControlRequest * @instance * @returns {Object.} JSON object */ - RouteFeeRequest.prototype.toJSON = function toJSON() { + ResetMissionControlRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RouteFeeRequest + * Gets the default type url for ResetMissionControlRequest * @function getTypeUrl - * @memberof routerrpc.RouteFeeRequest + * @memberof routerrpc.ResetMissionControlRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RouteFeeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ResetMissionControlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.RouteFeeRequest"; + return typeUrlPrefix + "/routerrpc.ResetMissionControlRequest"; }; - return RouteFeeRequest; + return ResetMissionControlRequest; })(); - routerrpc.RouteFeeResponse = (function() { + routerrpc.ResetMissionControlResponse = (function() { /** - * Properties of a RouteFeeResponse. + * Properties of a ResetMissionControlResponse. * @memberof routerrpc - * @interface IRouteFeeResponse - * @property {Long|null} [routing_fee_msat] RouteFeeResponse routing_fee_msat - * @property {Long|null} [time_lock_delay] RouteFeeResponse time_lock_delay - * @property {lnrpc.PaymentFailureReason|null} [failure_reason] RouteFeeResponse failure_reason + * @interface IResetMissionControlResponse */ /** - * Constructs a new RouteFeeResponse. + * Constructs a new ResetMissionControlResponse. * @memberof routerrpc - * @classdesc Represents a RouteFeeResponse. - * @implements IRouteFeeResponse + * @classdesc Represents a ResetMissionControlResponse. + * @implements IResetMissionControlResponse * @constructor - * @param {routerrpc.IRouteFeeResponse=} [properties] Properties to set + * @param {routerrpc.IResetMissionControlResponse=} [properties] Properties to set */ - function RouteFeeResponse(properties) { + function ResetMissionControlResponse(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -86362,105 +89231,63 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * RouteFeeResponse routing_fee_msat. - * @member {Long} routing_fee_msat - * @memberof routerrpc.RouteFeeResponse - * @instance - */ - RouteFeeResponse.prototype.routing_fee_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * RouteFeeResponse time_lock_delay. - * @member {Long} time_lock_delay - * @memberof routerrpc.RouteFeeResponse - * @instance - */ - RouteFeeResponse.prototype.time_lock_delay = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * RouteFeeResponse failure_reason. - * @member {lnrpc.PaymentFailureReason} failure_reason - * @memberof routerrpc.RouteFeeResponse - * @instance - */ - RouteFeeResponse.prototype.failure_reason = 0; - - /** - * Creates a new RouteFeeResponse instance using the specified properties. + * Creates a new ResetMissionControlResponse instance using the specified properties. * @function create - * @memberof routerrpc.RouteFeeResponse + * @memberof routerrpc.ResetMissionControlResponse * @static - * @param {routerrpc.IRouteFeeResponse=} [properties] Properties to set - * @returns {routerrpc.RouteFeeResponse} RouteFeeResponse instance + * @param {routerrpc.IResetMissionControlResponse=} [properties] Properties to set + * @returns {routerrpc.ResetMissionControlResponse} ResetMissionControlResponse instance */ - RouteFeeResponse.create = function create(properties) { - return new RouteFeeResponse(properties); + ResetMissionControlResponse.create = function create(properties) { + return new ResetMissionControlResponse(properties); }; /** - * Encodes the specified RouteFeeResponse message. Does not implicitly {@link routerrpc.RouteFeeResponse.verify|verify} messages. + * Encodes the specified ResetMissionControlResponse message. Does not implicitly {@link routerrpc.ResetMissionControlResponse.verify|verify} messages. * @function encode - * @memberof routerrpc.RouteFeeResponse + * @memberof routerrpc.ResetMissionControlResponse * @static - * @param {routerrpc.IRouteFeeResponse} message RouteFeeResponse message or plain object to encode + * @param {routerrpc.IResetMissionControlResponse} message ResetMissionControlResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RouteFeeResponse.encode = function encode(message, writer) { + ResetMissionControlResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.routing_fee_msat != null && Object.hasOwnProperty.call(message, "routing_fee_msat")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.routing_fee_msat); - if (message.time_lock_delay != null && Object.hasOwnProperty.call(message, "time_lock_delay")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.time_lock_delay); - if (message.failure_reason != null && Object.hasOwnProperty.call(message, "failure_reason")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.failure_reason); return writer; }; /** - * Encodes the specified RouteFeeResponse message, length delimited. Does not implicitly {@link routerrpc.RouteFeeResponse.verify|verify} messages. + * Encodes the specified ResetMissionControlResponse message, length delimited. Does not implicitly {@link routerrpc.ResetMissionControlResponse.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.RouteFeeResponse + * @memberof routerrpc.ResetMissionControlResponse * @static - * @param {routerrpc.IRouteFeeResponse} message RouteFeeResponse message or plain object to encode + * @param {routerrpc.IResetMissionControlResponse} message ResetMissionControlResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RouteFeeResponse.encodeDelimited = function encodeDelimited(message, writer) { + ResetMissionControlResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RouteFeeResponse message from the specified reader or buffer. + * Decodes a ResetMissionControlResponse message from the specified reader or buffer. * @function decode - * @memberof routerrpc.RouteFeeResponse + * @memberof routerrpc.ResetMissionControlResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.RouteFeeResponse} RouteFeeResponse + * @returns {routerrpc.ResetMissionControlResponse} ResetMissionControlResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RouteFeeResponse.decode = function decode(reader, length) { + ResetMissionControlResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.RouteFeeResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.ResetMissionControlResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.routing_fee_msat = reader.int64(); - break; - } - case 2: { - message.time_lock_delay = reader.int64(); - break; - } - case 5: { - message.failure_reason = reader.int32(); - break; - } default: reader.skipType(tag & 7); break; @@ -86470,319 +89297,172 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a RouteFeeResponse message from the specified reader or buffer, length delimited. + * Decodes a ResetMissionControlResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.RouteFeeResponse + * @memberof routerrpc.ResetMissionControlResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.RouteFeeResponse} RouteFeeResponse + * @returns {routerrpc.ResetMissionControlResponse} ResetMissionControlResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RouteFeeResponse.decodeDelimited = function decodeDelimited(reader) { + ResetMissionControlResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RouteFeeResponse message. + * Verifies a ResetMissionControlResponse message. * @function verify - * @memberof routerrpc.RouteFeeResponse + * @memberof routerrpc.ResetMissionControlResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RouteFeeResponse.verify = function verify(message) { + ResetMissionControlResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.routing_fee_msat != null && message.hasOwnProperty("routing_fee_msat")) - if (!$util.isInteger(message.routing_fee_msat) && !(message.routing_fee_msat && $util.isInteger(message.routing_fee_msat.low) && $util.isInteger(message.routing_fee_msat.high))) - return "routing_fee_msat: integer|Long expected"; - if (message.time_lock_delay != null && message.hasOwnProperty("time_lock_delay")) - if (!$util.isInteger(message.time_lock_delay) && !(message.time_lock_delay && $util.isInteger(message.time_lock_delay.low) && $util.isInteger(message.time_lock_delay.high))) - return "time_lock_delay: integer|Long expected"; - if (message.failure_reason != null && message.hasOwnProperty("failure_reason")) - switch (message.failure_reason) { - default: - return "failure_reason: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } return null; }; /** - * Creates a RouteFeeResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ResetMissionControlResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.RouteFeeResponse + * @memberof routerrpc.ResetMissionControlResponse * @static * @param {Object.} object Plain object - * @returns {routerrpc.RouteFeeResponse} RouteFeeResponse + * @returns {routerrpc.ResetMissionControlResponse} ResetMissionControlResponse */ - RouteFeeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.RouteFeeResponse) + ResetMissionControlResponse.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.ResetMissionControlResponse) return object; - let message = new $root.routerrpc.RouteFeeResponse(); - if (object.routing_fee_msat != null) - if ($util.Long) - (message.routing_fee_msat = $util.Long.fromValue(object.routing_fee_msat)).unsigned = false; - else if (typeof object.routing_fee_msat === "string") - message.routing_fee_msat = parseInt(object.routing_fee_msat, 10); - else if (typeof object.routing_fee_msat === "number") - message.routing_fee_msat = object.routing_fee_msat; - else if (typeof object.routing_fee_msat === "object") - message.routing_fee_msat = new $util.LongBits(object.routing_fee_msat.low >>> 0, object.routing_fee_msat.high >>> 0).toNumber(); - if (object.time_lock_delay != null) - if ($util.Long) - (message.time_lock_delay = $util.Long.fromValue(object.time_lock_delay)).unsigned = false; - else if (typeof object.time_lock_delay === "string") - message.time_lock_delay = parseInt(object.time_lock_delay, 10); - else if (typeof object.time_lock_delay === "number") - message.time_lock_delay = object.time_lock_delay; - else if (typeof object.time_lock_delay === "object") - message.time_lock_delay = new $util.LongBits(object.time_lock_delay.low >>> 0, object.time_lock_delay.high >>> 0).toNumber(); - switch (object.failure_reason) { - default: - if (typeof object.failure_reason === "number") { - message.failure_reason = object.failure_reason; - break; - } - break; - case "FAILURE_REASON_NONE": - case 0: - message.failure_reason = 0; - break; - case "FAILURE_REASON_TIMEOUT": - case 1: - message.failure_reason = 1; - break; - case "FAILURE_REASON_NO_ROUTE": - case 2: - message.failure_reason = 2; - break; - case "FAILURE_REASON_ERROR": - case 3: - message.failure_reason = 3; - break; - case "FAILURE_REASON_INCORRECT_PAYMENT_DETAILS": - case 4: - message.failure_reason = 4; - break; - case "FAILURE_REASON_INSUFFICIENT_BALANCE": - case 5: - message.failure_reason = 5; - break; - case "FAILURE_REASON_CANCELED": - case 6: - message.failure_reason = 6; - break; - } - return message; + return new $root.routerrpc.ResetMissionControlResponse(); }; /** - * Creates a plain object from a RouteFeeResponse message. Also converts values to other types if specified. + * Creates a plain object from a ResetMissionControlResponse message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.RouteFeeResponse + * @memberof routerrpc.ResetMissionControlResponse * @static - * @param {routerrpc.RouteFeeResponse} message RouteFeeResponse + * @param {routerrpc.ResetMissionControlResponse} message ResetMissionControlResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RouteFeeResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.routing_fee_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.routing_fee_msat = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.time_lock_delay = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.time_lock_delay = options.longs === String ? "0" : 0; - object.failure_reason = options.enums === String ? "FAILURE_REASON_NONE" : 0; - } - if (message.routing_fee_msat != null && message.hasOwnProperty("routing_fee_msat")) - if (typeof message.routing_fee_msat === "number") - object.routing_fee_msat = options.longs === String ? String(message.routing_fee_msat) : message.routing_fee_msat; - else - object.routing_fee_msat = options.longs === String ? $util.Long.prototype.toString.call(message.routing_fee_msat) : options.longs === Number ? new $util.LongBits(message.routing_fee_msat.low >>> 0, message.routing_fee_msat.high >>> 0).toNumber() : message.routing_fee_msat; - if (message.time_lock_delay != null && message.hasOwnProperty("time_lock_delay")) - if (typeof message.time_lock_delay === "number") - object.time_lock_delay = options.longs === String ? String(message.time_lock_delay) : message.time_lock_delay; - else - object.time_lock_delay = options.longs === String ? $util.Long.prototype.toString.call(message.time_lock_delay) : options.longs === Number ? new $util.LongBits(message.time_lock_delay.low >>> 0, message.time_lock_delay.high >>> 0).toNumber() : message.time_lock_delay; - if (message.failure_reason != null && message.hasOwnProperty("failure_reason")) - object.failure_reason = options.enums === String ? $root.lnrpc.PaymentFailureReason[message.failure_reason] === undefined ? message.failure_reason : $root.lnrpc.PaymentFailureReason[message.failure_reason] : message.failure_reason; - return object; + ResetMissionControlResponse.toObject = function toObject() { + return {}; }; /** - * Converts this RouteFeeResponse to JSON. + * Converts this ResetMissionControlResponse to JSON. * @function toJSON - * @memberof routerrpc.RouteFeeResponse + * @memberof routerrpc.ResetMissionControlResponse * @instance * @returns {Object.} JSON object */ - RouteFeeResponse.prototype.toJSON = function toJSON() { + ResetMissionControlResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RouteFeeResponse + * Gets the default type url for ResetMissionControlResponse * @function getTypeUrl - * @memberof routerrpc.RouteFeeResponse + * @memberof routerrpc.ResetMissionControlResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RouteFeeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ResetMissionControlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.RouteFeeResponse"; + return typeUrlPrefix + "/routerrpc.ResetMissionControlResponse"; }; - return RouteFeeResponse; + return ResetMissionControlResponse; })(); - routerrpc.SendToRouteRequest = (function() { - - /** - * Properties of a SendToRouteRequest. - * @memberof routerrpc - * @interface ISendToRouteRequest - * @property {Uint8Array|null} [payment_hash] SendToRouteRequest payment_hash - * @property {lnrpc.IRoute|null} [route] SendToRouteRequest route - * @property {boolean|null} [skip_temp_err] SendToRouteRequest skip_temp_err - */ + routerrpc.QueryMissionControlRequest = (function() { /** - * Constructs a new SendToRouteRequest. + * Properties of a QueryMissionControlRequest. * @memberof routerrpc - * @classdesc Represents a SendToRouteRequest. - * @implements ISendToRouteRequest - * @constructor - * @param {routerrpc.ISendToRouteRequest=} [properties] Properties to set - */ - function SendToRouteRequest(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SendToRouteRequest payment_hash. - * @member {Uint8Array} payment_hash - * @memberof routerrpc.SendToRouteRequest - * @instance - */ - SendToRouteRequest.prototype.payment_hash = $util.newBuffer([]); - - /** - * SendToRouteRequest route. - * @member {lnrpc.IRoute|null|undefined} route - * @memberof routerrpc.SendToRouteRequest - * @instance + * @interface IQueryMissionControlRequest */ - SendToRouteRequest.prototype.route = null; /** - * SendToRouteRequest skip_temp_err. - * @member {boolean} skip_temp_err - * @memberof routerrpc.SendToRouteRequest - * @instance + * Constructs a new QueryMissionControlRequest. + * @memberof routerrpc + * @classdesc Represents a QueryMissionControlRequest. + * @implements IQueryMissionControlRequest + * @constructor + * @param {routerrpc.IQueryMissionControlRequest=} [properties] Properties to set */ - SendToRouteRequest.prototype.skip_temp_err = false; + function QueryMissionControlRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Creates a new SendToRouteRequest instance using the specified properties. + * Creates a new QueryMissionControlRequest instance using the specified properties. * @function create - * @memberof routerrpc.SendToRouteRequest + * @memberof routerrpc.QueryMissionControlRequest * @static - * @param {routerrpc.ISendToRouteRequest=} [properties] Properties to set - * @returns {routerrpc.SendToRouteRequest} SendToRouteRequest instance + * @param {routerrpc.IQueryMissionControlRequest=} [properties] Properties to set + * @returns {routerrpc.QueryMissionControlRequest} QueryMissionControlRequest instance */ - SendToRouteRequest.create = function create(properties) { - return new SendToRouteRequest(properties); + QueryMissionControlRequest.create = function create(properties) { + return new QueryMissionControlRequest(properties); }; /** - * Encodes the specified SendToRouteRequest message. Does not implicitly {@link routerrpc.SendToRouteRequest.verify|verify} messages. + * Encodes the specified QueryMissionControlRequest message. Does not implicitly {@link routerrpc.QueryMissionControlRequest.verify|verify} messages. * @function encode - * @memberof routerrpc.SendToRouteRequest + * @memberof routerrpc.QueryMissionControlRequest * @static - * @param {routerrpc.ISendToRouteRequest} message SendToRouteRequest message or plain object to encode + * @param {routerrpc.IQueryMissionControlRequest} message QueryMissionControlRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SendToRouteRequest.encode = function encode(message, writer) { + QueryMissionControlRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.payment_hash); - if (message.route != null && Object.hasOwnProperty.call(message, "route")) - $root.lnrpc.Route.encode(message.route, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.skip_temp_err != null && Object.hasOwnProperty.call(message, "skip_temp_err")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.skip_temp_err); return writer; }; /** - * Encodes the specified SendToRouteRequest message, length delimited. Does not implicitly {@link routerrpc.SendToRouteRequest.verify|verify} messages. + * Encodes the specified QueryMissionControlRequest message, length delimited. Does not implicitly {@link routerrpc.QueryMissionControlRequest.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.SendToRouteRequest + * @memberof routerrpc.QueryMissionControlRequest * @static - * @param {routerrpc.ISendToRouteRequest} message SendToRouteRequest message or plain object to encode + * @param {routerrpc.IQueryMissionControlRequest} message QueryMissionControlRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SendToRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + QueryMissionControlRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SendToRouteRequest message from the specified reader or buffer. + * Decodes a QueryMissionControlRequest message from the specified reader or buffer. * @function decode - * @memberof routerrpc.SendToRouteRequest + * @memberof routerrpc.QueryMissionControlRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.SendToRouteRequest} SendToRouteRequest + * @returns {routerrpc.QueryMissionControlRequest} QueryMissionControlRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SendToRouteRequest.decode = function decode(reader, length) { + QueryMissionControlRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SendToRouteRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.QueryMissionControlRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.payment_hash = reader.bytes(); - break; - } - case 2: { - message.route = $root.lnrpc.Route.decode(reader, reader.uint32()); - break; - } - case 3: { - message.skip_temp_err = reader.bool(); - break; - } default: reader.skipType(tag & 7); break; @@ -86792,154 +89472,110 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a SendToRouteRequest message from the specified reader or buffer, length delimited. + * Decodes a QueryMissionControlRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.SendToRouteRequest + * @memberof routerrpc.QueryMissionControlRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.SendToRouteRequest} SendToRouteRequest + * @returns {routerrpc.QueryMissionControlRequest} QueryMissionControlRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SendToRouteRequest.decodeDelimited = function decodeDelimited(reader) { + QueryMissionControlRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SendToRouteRequest message. + * Verifies a QueryMissionControlRequest message. * @function verify - * @memberof routerrpc.SendToRouteRequest + * @memberof routerrpc.QueryMissionControlRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SendToRouteRequest.verify = function verify(message) { + QueryMissionControlRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) - if (!(message.payment_hash && typeof message.payment_hash.length === "number" || $util.isString(message.payment_hash))) - return "payment_hash: buffer expected"; - if (message.route != null && message.hasOwnProperty("route")) { - let error = $root.lnrpc.Route.verify(message.route); - if (error) - return "route." + error; - } - if (message.skip_temp_err != null && message.hasOwnProperty("skip_temp_err")) - if (typeof message.skip_temp_err !== "boolean") - return "skip_temp_err: boolean expected"; return null; }; /** - * Creates a SendToRouteRequest message from a plain object. Also converts values to their respective internal types. + * Creates a QueryMissionControlRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.SendToRouteRequest + * @memberof routerrpc.QueryMissionControlRequest * @static * @param {Object.} object Plain object - * @returns {routerrpc.SendToRouteRequest} SendToRouteRequest + * @returns {routerrpc.QueryMissionControlRequest} QueryMissionControlRequest */ - SendToRouteRequest.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.SendToRouteRequest) + QueryMissionControlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.QueryMissionControlRequest) return object; - let message = new $root.routerrpc.SendToRouteRequest(); - if (object.payment_hash != null) - if (typeof object.payment_hash === "string") - $util.base64.decode(object.payment_hash, message.payment_hash = $util.newBuffer($util.base64.length(object.payment_hash)), 0); - else if (object.payment_hash.length >= 0) - message.payment_hash = object.payment_hash; - if (object.route != null) { - if (typeof object.route !== "object") - throw TypeError(".routerrpc.SendToRouteRequest.route: object expected"); - message.route = $root.lnrpc.Route.fromObject(object.route); - } - if (object.skip_temp_err != null) - message.skip_temp_err = Boolean(object.skip_temp_err); - return message; + return new $root.routerrpc.QueryMissionControlRequest(); }; /** - * Creates a plain object from a SendToRouteRequest message. Also converts values to other types if specified. + * Creates a plain object from a QueryMissionControlRequest message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.SendToRouteRequest + * @memberof routerrpc.QueryMissionControlRequest * @static - * @param {routerrpc.SendToRouteRequest} message SendToRouteRequest + * @param {routerrpc.QueryMissionControlRequest} message QueryMissionControlRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SendToRouteRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.payment_hash = ""; - else { - object.payment_hash = []; - if (options.bytes !== Array) - object.payment_hash = $util.newBuffer(object.payment_hash); - } - object.route = null; - object.skip_temp_err = false; - } - if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) - object.payment_hash = options.bytes === String ? $util.base64.encode(message.payment_hash, 0, message.payment_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_hash) : message.payment_hash; - if (message.route != null && message.hasOwnProperty("route")) - object.route = $root.lnrpc.Route.toObject(message.route, options); - if (message.skip_temp_err != null && message.hasOwnProperty("skip_temp_err")) - object.skip_temp_err = message.skip_temp_err; - return object; + QueryMissionControlRequest.toObject = function toObject() { + return {}; }; /** - * Converts this SendToRouteRequest to JSON. + * Converts this QueryMissionControlRequest to JSON. * @function toJSON - * @memberof routerrpc.SendToRouteRequest + * @memberof routerrpc.QueryMissionControlRequest * @instance * @returns {Object.} JSON object */ - SendToRouteRequest.prototype.toJSON = function toJSON() { + QueryMissionControlRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SendToRouteRequest + * Gets the default type url for QueryMissionControlRequest * @function getTypeUrl - * @memberof routerrpc.SendToRouteRequest + * @memberof routerrpc.QueryMissionControlRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SendToRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + QueryMissionControlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.SendToRouteRequest"; + return typeUrlPrefix + "/routerrpc.QueryMissionControlRequest"; }; - return SendToRouteRequest; + return QueryMissionControlRequest; })(); - routerrpc.SendToRouteResponse = (function() { + routerrpc.QueryMissionControlResponse = (function() { /** - * Properties of a SendToRouteResponse. + * Properties of a QueryMissionControlResponse. * @memberof routerrpc - * @interface ISendToRouteResponse - * @property {Uint8Array|null} [preimage] SendToRouteResponse preimage - * @property {lnrpc.IFailure|null} [failure] SendToRouteResponse failure + * @interface IQueryMissionControlResponse + * @property {Array.|null} [pairs] QueryMissionControlResponse pairs */ /** - * Constructs a new SendToRouteResponse. + * Constructs a new QueryMissionControlResponse. * @memberof routerrpc - * @classdesc Represents a SendToRouteResponse. - * @implements ISendToRouteResponse + * @classdesc Represents a QueryMissionControlResponse. + * @implements IQueryMissionControlResponse * @constructor - * @param {routerrpc.ISendToRouteResponse=} [properties] Properties to set + * @param {routerrpc.IQueryMissionControlResponse=} [properties] Properties to set */ - function SendToRouteResponse(properties) { + function QueryMissionControlResponse(properties) { + this.pairs = []; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -86947,89 +89583,78 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * SendToRouteResponse preimage. - * @member {Uint8Array} preimage - * @memberof routerrpc.SendToRouteResponse - * @instance - */ - SendToRouteResponse.prototype.preimage = $util.newBuffer([]); - - /** - * SendToRouteResponse failure. - * @member {lnrpc.IFailure|null|undefined} failure - * @memberof routerrpc.SendToRouteResponse + * QueryMissionControlResponse pairs. + * @member {Array.} pairs + * @memberof routerrpc.QueryMissionControlResponse * @instance */ - SendToRouteResponse.prototype.failure = null; + QueryMissionControlResponse.prototype.pairs = $util.emptyArray; /** - * Creates a new SendToRouteResponse instance using the specified properties. + * Creates a new QueryMissionControlResponse instance using the specified properties. * @function create - * @memberof routerrpc.SendToRouteResponse + * @memberof routerrpc.QueryMissionControlResponse * @static - * @param {routerrpc.ISendToRouteResponse=} [properties] Properties to set - * @returns {routerrpc.SendToRouteResponse} SendToRouteResponse instance + * @param {routerrpc.IQueryMissionControlResponse=} [properties] Properties to set + * @returns {routerrpc.QueryMissionControlResponse} QueryMissionControlResponse instance */ - SendToRouteResponse.create = function create(properties) { - return new SendToRouteResponse(properties); + QueryMissionControlResponse.create = function create(properties) { + return new QueryMissionControlResponse(properties); }; /** - * Encodes the specified SendToRouteResponse message. Does not implicitly {@link routerrpc.SendToRouteResponse.verify|verify} messages. + * Encodes the specified QueryMissionControlResponse message. Does not implicitly {@link routerrpc.QueryMissionControlResponse.verify|verify} messages. * @function encode - * @memberof routerrpc.SendToRouteResponse + * @memberof routerrpc.QueryMissionControlResponse * @static - * @param {routerrpc.ISendToRouteResponse} message SendToRouteResponse message or plain object to encode + * @param {routerrpc.IQueryMissionControlResponse} message QueryMissionControlResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SendToRouteResponse.encode = function encode(message, writer) { + QueryMissionControlResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.preimage); - if (message.failure != null && Object.hasOwnProperty.call(message, "failure")) - $root.lnrpc.Failure.encode(message.failure, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.pairs != null && message.pairs.length) + for (let i = 0; i < message.pairs.length; ++i) + $root.routerrpc.PairHistory.encode(message.pairs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified SendToRouteResponse message, length delimited. Does not implicitly {@link routerrpc.SendToRouteResponse.verify|verify} messages. + * Encodes the specified QueryMissionControlResponse message, length delimited. Does not implicitly {@link routerrpc.QueryMissionControlResponse.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.SendToRouteResponse + * @memberof routerrpc.QueryMissionControlResponse * @static - * @param {routerrpc.ISendToRouteResponse} message SendToRouteResponse message or plain object to encode + * @param {routerrpc.IQueryMissionControlResponse} message QueryMissionControlResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SendToRouteResponse.encodeDelimited = function encodeDelimited(message, writer) { + QueryMissionControlResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SendToRouteResponse message from the specified reader or buffer. + * Decodes a QueryMissionControlResponse message from the specified reader or buffer. * @function decode - * @memberof routerrpc.SendToRouteResponse + * @memberof routerrpc.QueryMissionControlResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.SendToRouteResponse} SendToRouteResponse + * @returns {routerrpc.QueryMissionControlResponse} QueryMissionControlResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SendToRouteResponse.decode = function decode(reader, length) { + QueryMissionControlResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SendToRouteResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.QueryMissionControlResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.preimage = reader.bytes(); - break; - } case 2: { - message.failure = $root.lnrpc.Failure.decode(reader, reader.uint32()); + if (!(message.pairs && message.pairs.length)) + message.pairs = []; + message.pairs.push($root.routerrpc.PairHistory.decode(reader, reader.uint32())); break; } default: @@ -87041,144 +89666,141 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a SendToRouteResponse message from the specified reader or buffer, length delimited. + * Decodes a QueryMissionControlResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.SendToRouteResponse + * @memberof routerrpc.QueryMissionControlResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.SendToRouteResponse} SendToRouteResponse + * @returns {routerrpc.QueryMissionControlResponse} QueryMissionControlResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SendToRouteResponse.decodeDelimited = function decodeDelimited(reader) { + QueryMissionControlResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SendToRouteResponse message. + * Verifies a QueryMissionControlResponse message. * @function verify - * @memberof routerrpc.SendToRouteResponse + * @memberof routerrpc.QueryMissionControlResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SendToRouteResponse.verify = function verify(message) { + QueryMissionControlResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.preimage != null && message.hasOwnProperty("preimage")) - if (!(message.preimage && typeof message.preimage.length === "number" || $util.isString(message.preimage))) - return "preimage: buffer expected"; - if (message.failure != null && message.hasOwnProperty("failure")) { - let error = $root.lnrpc.Failure.verify(message.failure); - if (error) - return "failure." + error; + if (message.pairs != null && message.hasOwnProperty("pairs")) { + if (!Array.isArray(message.pairs)) + return "pairs: array expected"; + for (let i = 0; i < message.pairs.length; ++i) { + let error = $root.routerrpc.PairHistory.verify(message.pairs[i]); + if (error) + return "pairs." + error; + } } return null; }; /** - * Creates a SendToRouteResponse message from a plain object. Also converts values to their respective internal types. + * Creates a QueryMissionControlResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.SendToRouteResponse + * @memberof routerrpc.QueryMissionControlResponse * @static * @param {Object.} object Plain object - * @returns {routerrpc.SendToRouteResponse} SendToRouteResponse + * @returns {routerrpc.QueryMissionControlResponse} QueryMissionControlResponse */ - SendToRouteResponse.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.SendToRouteResponse) + QueryMissionControlResponse.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.QueryMissionControlResponse) return object; - let message = new $root.routerrpc.SendToRouteResponse(); - if (object.preimage != null) - if (typeof object.preimage === "string") - $util.base64.decode(object.preimage, message.preimage = $util.newBuffer($util.base64.length(object.preimage)), 0); - else if (object.preimage.length >= 0) - message.preimage = object.preimage; - if (object.failure != null) { - if (typeof object.failure !== "object") - throw TypeError(".routerrpc.SendToRouteResponse.failure: object expected"); - message.failure = $root.lnrpc.Failure.fromObject(object.failure); + let message = new $root.routerrpc.QueryMissionControlResponse(); + if (object.pairs) { + if (!Array.isArray(object.pairs)) + throw TypeError(".routerrpc.QueryMissionControlResponse.pairs: array expected"); + message.pairs = []; + for (let i = 0; i < object.pairs.length; ++i) { + if (typeof object.pairs[i] !== "object") + throw TypeError(".routerrpc.QueryMissionControlResponse.pairs: object expected"); + message.pairs[i] = $root.routerrpc.PairHistory.fromObject(object.pairs[i]); + } } return message; }; /** - * Creates a plain object from a SendToRouteResponse message. Also converts values to other types if specified. + * Creates a plain object from a QueryMissionControlResponse message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.SendToRouteResponse + * @memberof routerrpc.QueryMissionControlResponse * @static - * @param {routerrpc.SendToRouteResponse} message SendToRouteResponse + * @param {routerrpc.QueryMissionControlResponse} message QueryMissionControlResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SendToRouteResponse.toObject = function toObject(message, options) { + QueryMissionControlResponse.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.preimage = ""; - else { - object.preimage = []; - if (options.bytes !== Array) - object.preimage = $util.newBuffer(object.preimage); - } - object.failure = null; + if (options.arrays || options.defaults) + object.pairs = []; + if (message.pairs && message.pairs.length) { + object.pairs = []; + for (let j = 0; j < message.pairs.length; ++j) + object.pairs[j] = $root.routerrpc.PairHistory.toObject(message.pairs[j], options); } - if (message.preimage != null && message.hasOwnProperty("preimage")) - object.preimage = options.bytes === String ? $util.base64.encode(message.preimage, 0, message.preimage.length) : options.bytes === Array ? Array.prototype.slice.call(message.preimage) : message.preimage; - if (message.failure != null && message.hasOwnProperty("failure")) - object.failure = $root.lnrpc.Failure.toObject(message.failure, options); return object; }; /** - * Converts this SendToRouteResponse to JSON. + * Converts this QueryMissionControlResponse to JSON. * @function toJSON - * @memberof routerrpc.SendToRouteResponse + * @memberof routerrpc.QueryMissionControlResponse * @instance * @returns {Object.} JSON object */ - SendToRouteResponse.prototype.toJSON = function toJSON() { + QueryMissionControlResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SendToRouteResponse + * Gets the default type url for QueryMissionControlResponse * @function getTypeUrl - * @memberof routerrpc.SendToRouteResponse + * @memberof routerrpc.QueryMissionControlResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SendToRouteResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + QueryMissionControlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.SendToRouteResponse"; + return typeUrlPrefix + "/routerrpc.QueryMissionControlResponse"; }; - return SendToRouteResponse; + return QueryMissionControlResponse; })(); - routerrpc.ResetMissionControlRequest = (function() { + routerrpc.XImportMissionControlRequest = (function() { /** - * Properties of a ResetMissionControlRequest. + * Properties of a XImportMissionControlRequest. * @memberof routerrpc - * @interface IResetMissionControlRequest + * @interface IXImportMissionControlRequest + * @property {Array.|null} [pairs] XImportMissionControlRequest pairs + * @property {boolean|null} [force] XImportMissionControlRequest force */ /** - * Constructs a new ResetMissionControlRequest. + * Constructs a new XImportMissionControlRequest. * @memberof routerrpc - * @classdesc Represents a ResetMissionControlRequest. - * @implements IResetMissionControlRequest + * @classdesc Represents a XImportMissionControlRequest. + * @implements IXImportMissionControlRequest * @constructor - * @param {routerrpc.IResetMissionControlRequest=} [properties] Properties to set + * @param {routerrpc.IXImportMissionControlRequest=} [properties] Properties to set */ - function ResetMissionControlRequest(properties) { + function XImportMissionControlRequest(properties) { + this.pairs = []; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -87186,63 +89808,94 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * Creates a new ResetMissionControlRequest instance using the specified properties. + * XImportMissionControlRequest pairs. + * @member {Array.} pairs + * @memberof routerrpc.XImportMissionControlRequest + * @instance + */ + XImportMissionControlRequest.prototype.pairs = $util.emptyArray; + + /** + * XImportMissionControlRequest force. + * @member {boolean} force + * @memberof routerrpc.XImportMissionControlRequest + * @instance + */ + XImportMissionControlRequest.prototype.force = false; + + /** + * Creates a new XImportMissionControlRequest instance using the specified properties. * @function create - * @memberof routerrpc.ResetMissionControlRequest + * @memberof routerrpc.XImportMissionControlRequest * @static - * @param {routerrpc.IResetMissionControlRequest=} [properties] Properties to set - * @returns {routerrpc.ResetMissionControlRequest} ResetMissionControlRequest instance + * @param {routerrpc.IXImportMissionControlRequest=} [properties] Properties to set + * @returns {routerrpc.XImportMissionControlRequest} XImportMissionControlRequest instance */ - ResetMissionControlRequest.create = function create(properties) { - return new ResetMissionControlRequest(properties); + XImportMissionControlRequest.create = function create(properties) { + return new XImportMissionControlRequest(properties); }; /** - * Encodes the specified ResetMissionControlRequest message. Does not implicitly {@link routerrpc.ResetMissionControlRequest.verify|verify} messages. + * Encodes the specified XImportMissionControlRequest message. Does not implicitly {@link routerrpc.XImportMissionControlRequest.verify|verify} messages. * @function encode - * @memberof routerrpc.ResetMissionControlRequest + * @memberof routerrpc.XImportMissionControlRequest * @static - * @param {routerrpc.IResetMissionControlRequest} message ResetMissionControlRequest message or plain object to encode + * @param {routerrpc.IXImportMissionControlRequest} message XImportMissionControlRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResetMissionControlRequest.encode = function encode(message, writer) { + XImportMissionControlRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.pairs != null && message.pairs.length) + for (let i = 0; i < message.pairs.length; ++i) + $root.routerrpc.PairHistory.encode(message.pairs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); return writer; }; /** - * Encodes the specified ResetMissionControlRequest message, length delimited. Does not implicitly {@link routerrpc.ResetMissionControlRequest.verify|verify} messages. + * Encodes the specified XImportMissionControlRequest message, length delimited. Does not implicitly {@link routerrpc.XImportMissionControlRequest.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.ResetMissionControlRequest + * @memberof routerrpc.XImportMissionControlRequest * @static - * @param {routerrpc.IResetMissionControlRequest} message ResetMissionControlRequest message or plain object to encode + * @param {routerrpc.IXImportMissionControlRequest} message XImportMissionControlRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResetMissionControlRequest.encodeDelimited = function encodeDelimited(message, writer) { + XImportMissionControlRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResetMissionControlRequest message from the specified reader or buffer. + * Decodes a XImportMissionControlRequest message from the specified reader or buffer. * @function decode - * @memberof routerrpc.ResetMissionControlRequest + * @memberof routerrpc.XImportMissionControlRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.ResetMissionControlRequest} ResetMissionControlRequest + * @returns {routerrpc.XImportMissionControlRequest} XImportMissionControlRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResetMissionControlRequest.decode = function decode(reader, length) { + XImportMissionControlRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.ResetMissionControlRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.XImportMissionControlRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + if (!(message.pairs && message.pairs.length)) + message.pairs = []; + message.pairs.push($root.routerrpc.PairHistory.decode(reader, reader.uint32())); + break; + } + case 2: { + message.force = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -87252,108 +89905,147 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a ResetMissionControlRequest message from the specified reader or buffer, length delimited. + * Decodes a XImportMissionControlRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.ResetMissionControlRequest + * @memberof routerrpc.XImportMissionControlRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.ResetMissionControlRequest} ResetMissionControlRequest + * @returns {routerrpc.XImportMissionControlRequest} XImportMissionControlRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResetMissionControlRequest.decodeDelimited = function decodeDelimited(reader) { + XImportMissionControlRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResetMissionControlRequest message. + * Verifies a XImportMissionControlRequest message. * @function verify - * @memberof routerrpc.ResetMissionControlRequest + * @memberof routerrpc.XImportMissionControlRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResetMissionControlRequest.verify = function verify(message) { + XImportMissionControlRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.pairs != null && message.hasOwnProperty("pairs")) { + if (!Array.isArray(message.pairs)) + return "pairs: array expected"; + for (let i = 0; i < message.pairs.length; ++i) { + let error = $root.routerrpc.PairHistory.verify(message.pairs[i]); + if (error) + return "pairs." + error; + } + } + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; /** - * Creates a ResetMissionControlRequest message from a plain object. Also converts values to their respective internal types. + * Creates a XImportMissionControlRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.ResetMissionControlRequest + * @memberof routerrpc.XImportMissionControlRequest * @static * @param {Object.} object Plain object - * @returns {routerrpc.ResetMissionControlRequest} ResetMissionControlRequest + * @returns {routerrpc.XImportMissionControlRequest} XImportMissionControlRequest */ - ResetMissionControlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.ResetMissionControlRequest) + XImportMissionControlRequest.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.XImportMissionControlRequest) return object; - return new $root.routerrpc.ResetMissionControlRequest(); + let message = new $root.routerrpc.XImportMissionControlRequest(); + if (object.pairs) { + if (!Array.isArray(object.pairs)) + throw TypeError(".routerrpc.XImportMissionControlRequest.pairs: array expected"); + message.pairs = []; + for (let i = 0; i < object.pairs.length; ++i) { + if (typeof object.pairs[i] !== "object") + throw TypeError(".routerrpc.XImportMissionControlRequest.pairs: object expected"); + message.pairs[i] = $root.routerrpc.PairHistory.fromObject(object.pairs[i]); + } + } + if (object.force != null) + message.force = Boolean(object.force); + return message; }; /** - * Creates a plain object from a ResetMissionControlRequest message. Also converts values to other types if specified. + * Creates a plain object from a XImportMissionControlRequest message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.ResetMissionControlRequest + * @memberof routerrpc.XImportMissionControlRequest * @static - * @param {routerrpc.ResetMissionControlRequest} message ResetMissionControlRequest + * @param {routerrpc.XImportMissionControlRequest} message XImportMissionControlRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResetMissionControlRequest.toObject = function toObject() { - return {}; + XImportMissionControlRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.pairs = []; + if (options.defaults) + object.force = false; + if (message.pairs && message.pairs.length) { + object.pairs = []; + for (let j = 0; j < message.pairs.length; ++j) + object.pairs[j] = $root.routerrpc.PairHistory.toObject(message.pairs[j], options); + } + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; }; /** - * Converts this ResetMissionControlRequest to JSON. + * Converts this XImportMissionControlRequest to JSON. * @function toJSON - * @memberof routerrpc.ResetMissionControlRequest + * @memberof routerrpc.XImportMissionControlRequest * @instance * @returns {Object.} JSON object */ - ResetMissionControlRequest.prototype.toJSON = function toJSON() { + XImportMissionControlRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ResetMissionControlRequest + * Gets the default type url for XImportMissionControlRequest * @function getTypeUrl - * @memberof routerrpc.ResetMissionControlRequest + * @memberof routerrpc.XImportMissionControlRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ResetMissionControlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + XImportMissionControlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.ResetMissionControlRequest"; + return typeUrlPrefix + "/routerrpc.XImportMissionControlRequest"; }; - return ResetMissionControlRequest; + return XImportMissionControlRequest; })(); - routerrpc.ResetMissionControlResponse = (function() { + routerrpc.XImportMissionControlResponse = (function() { /** - * Properties of a ResetMissionControlResponse. + * Properties of a XImportMissionControlResponse. * @memberof routerrpc - * @interface IResetMissionControlResponse + * @interface IXImportMissionControlResponse */ /** - * Constructs a new ResetMissionControlResponse. + * Constructs a new XImportMissionControlResponse. * @memberof routerrpc - * @classdesc Represents a ResetMissionControlResponse. - * @implements IResetMissionControlResponse + * @classdesc Represents a XImportMissionControlResponse. + * @implements IXImportMissionControlResponse * @constructor - * @param {routerrpc.IResetMissionControlResponse=} [properties] Properties to set + * @param {routerrpc.IXImportMissionControlResponse=} [properties] Properties to set */ - function ResetMissionControlResponse(properties) { + function XImportMissionControlResponse(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -87361,60 +90053,60 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * Creates a new ResetMissionControlResponse instance using the specified properties. + * Creates a new XImportMissionControlResponse instance using the specified properties. * @function create - * @memberof routerrpc.ResetMissionControlResponse + * @memberof routerrpc.XImportMissionControlResponse * @static - * @param {routerrpc.IResetMissionControlResponse=} [properties] Properties to set - * @returns {routerrpc.ResetMissionControlResponse} ResetMissionControlResponse instance + * @param {routerrpc.IXImportMissionControlResponse=} [properties] Properties to set + * @returns {routerrpc.XImportMissionControlResponse} XImportMissionControlResponse instance */ - ResetMissionControlResponse.create = function create(properties) { - return new ResetMissionControlResponse(properties); + XImportMissionControlResponse.create = function create(properties) { + return new XImportMissionControlResponse(properties); }; /** - * Encodes the specified ResetMissionControlResponse message. Does not implicitly {@link routerrpc.ResetMissionControlResponse.verify|verify} messages. + * Encodes the specified XImportMissionControlResponse message. Does not implicitly {@link routerrpc.XImportMissionControlResponse.verify|verify} messages. * @function encode - * @memberof routerrpc.ResetMissionControlResponse + * @memberof routerrpc.XImportMissionControlResponse * @static - * @param {routerrpc.IResetMissionControlResponse} message ResetMissionControlResponse message or plain object to encode + * @param {routerrpc.IXImportMissionControlResponse} message XImportMissionControlResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResetMissionControlResponse.encode = function encode(message, writer) { + XImportMissionControlResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** - * Encodes the specified ResetMissionControlResponse message, length delimited. Does not implicitly {@link routerrpc.ResetMissionControlResponse.verify|verify} messages. + * Encodes the specified XImportMissionControlResponse message, length delimited. Does not implicitly {@link routerrpc.XImportMissionControlResponse.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.ResetMissionControlResponse + * @memberof routerrpc.XImportMissionControlResponse * @static - * @param {routerrpc.IResetMissionControlResponse} message ResetMissionControlResponse message or plain object to encode + * @param {routerrpc.IXImportMissionControlResponse} message XImportMissionControlResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResetMissionControlResponse.encodeDelimited = function encodeDelimited(message, writer) { + XImportMissionControlResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResetMissionControlResponse message from the specified reader or buffer. + * Decodes a XImportMissionControlResponse message from the specified reader or buffer. * @function decode - * @memberof routerrpc.ResetMissionControlResponse + * @memberof routerrpc.XImportMissionControlResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.ResetMissionControlResponse} ResetMissionControlResponse + * @returns {routerrpc.XImportMissionControlResponse} XImportMissionControlResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResetMissionControlResponse.decode = function decode(reader, length) { + XImportMissionControlResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.ResetMissionControlResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.XImportMissionControlResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { @@ -87427,108 +90119,111 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a ResetMissionControlResponse message from the specified reader or buffer, length delimited. + * Decodes a XImportMissionControlResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.ResetMissionControlResponse + * @memberof routerrpc.XImportMissionControlResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.ResetMissionControlResponse} ResetMissionControlResponse + * @returns {routerrpc.XImportMissionControlResponse} XImportMissionControlResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResetMissionControlResponse.decodeDelimited = function decodeDelimited(reader) { + XImportMissionControlResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResetMissionControlResponse message. + * Verifies a XImportMissionControlResponse message. * @function verify - * @memberof routerrpc.ResetMissionControlResponse + * @memberof routerrpc.XImportMissionControlResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResetMissionControlResponse.verify = function verify(message) { + XImportMissionControlResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** - * Creates a ResetMissionControlResponse message from a plain object. Also converts values to their respective internal types. + * Creates a XImportMissionControlResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.ResetMissionControlResponse + * @memberof routerrpc.XImportMissionControlResponse * @static * @param {Object.} object Plain object - * @returns {routerrpc.ResetMissionControlResponse} ResetMissionControlResponse + * @returns {routerrpc.XImportMissionControlResponse} XImportMissionControlResponse */ - ResetMissionControlResponse.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.ResetMissionControlResponse) + XImportMissionControlResponse.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.XImportMissionControlResponse) return object; - return new $root.routerrpc.ResetMissionControlResponse(); + return new $root.routerrpc.XImportMissionControlResponse(); }; /** - * Creates a plain object from a ResetMissionControlResponse message. Also converts values to other types if specified. + * Creates a plain object from a XImportMissionControlResponse message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.ResetMissionControlResponse + * @memberof routerrpc.XImportMissionControlResponse * @static - * @param {routerrpc.ResetMissionControlResponse} message ResetMissionControlResponse + * @param {routerrpc.XImportMissionControlResponse} message XImportMissionControlResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResetMissionControlResponse.toObject = function toObject() { + XImportMissionControlResponse.toObject = function toObject() { return {}; }; /** - * Converts this ResetMissionControlResponse to JSON. + * Converts this XImportMissionControlResponse to JSON. * @function toJSON - * @memberof routerrpc.ResetMissionControlResponse + * @memberof routerrpc.XImportMissionControlResponse * @instance * @returns {Object.} JSON object */ - ResetMissionControlResponse.prototype.toJSON = function toJSON() { + XImportMissionControlResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ResetMissionControlResponse + * Gets the default type url for XImportMissionControlResponse * @function getTypeUrl - * @memberof routerrpc.ResetMissionControlResponse + * @memberof routerrpc.XImportMissionControlResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ResetMissionControlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + XImportMissionControlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.ResetMissionControlResponse"; + return typeUrlPrefix + "/routerrpc.XImportMissionControlResponse"; }; - return ResetMissionControlResponse; + return XImportMissionControlResponse; })(); - routerrpc.QueryMissionControlRequest = (function() { + routerrpc.PairHistory = (function() { /** - * Properties of a QueryMissionControlRequest. + * Properties of a PairHistory. * @memberof routerrpc - * @interface IQueryMissionControlRequest + * @interface IPairHistory + * @property {Uint8Array|null} [node_from] PairHistory node_from + * @property {Uint8Array|null} [node_to] PairHistory node_to + * @property {routerrpc.IPairData|null} [history] PairHistory history */ /** - * Constructs a new QueryMissionControlRequest. + * Constructs a new PairHistory. * @memberof routerrpc - * @classdesc Represents a QueryMissionControlRequest. - * @implements IQueryMissionControlRequest + * @classdesc Represents a PairHistory. + * @implements IPairHistory * @constructor - * @param {routerrpc.IQueryMissionControlRequest=} [properties] Properties to set + * @param {routerrpc.IPairHistory=} [properties] Properties to set */ - function QueryMissionControlRequest(properties) { + function PairHistory(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -87536,63 +90231,105 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * Creates a new QueryMissionControlRequest instance using the specified properties. + * PairHistory node_from. + * @member {Uint8Array} node_from + * @memberof routerrpc.PairHistory + * @instance + */ + PairHistory.prototype.node_from = $util.newBuffer([]); + + /** + * PairHistory node_to. + * @member {Uint8Array} node_to + * @memberof routerrpc.PairHistory + * @instance + */ + PairHistory.prototype.node_to = $util.newBuffer([]); + + /** + * PairHistory history. + * @member {routerrpc.IPairData|null|undefined} history + * @memberof routerrpc.PairHistory + * @instance + */ + PairHistory.prototype.history = null; + + /** + * Creates a new PairHistory instance using the specified properties. * @function create - * @memberof routerrpc.QueryMissionControlRequest + * @memberof routerrpc.PairHistory * @static - * @param {routerrpc.IQueryMissionControlRequest=} [properties] Properties to set - * @returns {routerrpc.QueryMissionControlRequest} QueryMissionControlRequest instance + * @param {routerrpc.IPairHistory=} [properties] Properties to set + * @returns {routerrpc.PairHistory} PairHistory instance */ - QueryMissionControlRequest.create = function create(properties) { - return new QueryMissionControlRequest(properties); + PairHistory.create = function create(properties) { + return new PairHistory(properties); }; /** - * Encodes the specified QueryMissionControlRequest message. Does not implicitly {@link routerrpc.QueryMissionControlRequest.verify|verify} messages. + * Encodes the specified PairHistory message. Does not implicitly {@link routerrpc.PairHistory.verify|verify} messages. * @function encode - * @memberof routerrpc.QueryMissionControlRequest + * @memberof routerrpc.PairHistory * @static - * @param {routerrpc.IQueryMissionControlRequest} message QueryMissionControlRequest message or plain object to encode + * @param {routerrpc.IPairHistory} message PairHistory message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryMissionControlRequest.encode = function encode(message, writer) { + PairHistory.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.node_from != null && Object.hasOwnProperty.call(message, "node_from")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.node_from); + if (message.node_to != null && Object.hasOwnProperty.call(message, "node_to")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.node_to); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + $root.routerrpc.PairData.encode(message.history, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; /** - * Encodes the specified QueryMissionControlRequest message, length delimited. Does not implicitly {@link routerrpc.QueryMissionControlRequest.verify|verify} messages. + * Encodes the specified PairHistory message, length delimited. Does not implicitly {@link routerrpc.PairHistory.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.QueryMissionControlRequest + * @memberof routerrpc.PairHistory * @static - * @param {routerrpc.IQueryMissionControlRequest} message QueryMissionControlRequest message or plain object to encode + * @param {routerrpc.IPairHistory} message PairHistory message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryMissionControlRequest.encodeDelimited = function encodeDelimited(message, writer) { + PairHistory.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a QueryMissionControlRequest message from the specified reader or buffer. + * Decodes a PairHistory message from the specified reader or buffer. * @function decode - * @memberof routerrpc.QueryMissionControlRequest + * @memberof routerrpc.PairHistory * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.QueryMissionControlRequest} QueryMissionControlRequest + * @returns {routerrpc.PairHistory} PairHistory * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryMissionControlRequest.decode = function decode(reader, length) { + PairHistory.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.QueryMissionControlRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.PairHistory(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.node_from = reader.bytes(); + break; + } + case 2: { + message.node_to = reader.bytes(); + break; + } + case 7: { + message.history = $root.routerrpc.PairData.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -87602,110 +90339,167 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a QueryMissionControlRequest message from the specified reader or buffer, length delimited. + * Decodes a PairHistory message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.QueryMissionControlRequest + * @memberof routerrpc.PairHistory * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.QueryMissionControlRequest} QueryMissionControlRequest + * @returns {routerrpc.PairHistory} PairHistory * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryMissionControlRequest.decodeDelimited = function decodeDelimited(reader) { + PairHistory.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a QueryMissionControlRequest message. + * Verifies a PairHistory message. * @function verify - * @memberof routerrpc.QueryMissionControlRequest + * @memberof routerrpc.PairHistory * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - QueryMissionControlRequest.verify = function verify(message) { + PairHistory.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.node_from != null && message.hasOwnProperty("node_from")) + if (!(message.node_from && typeof message.node_from.length === "number" || $util.isString(message.node_from))) + return "node_from: buffer expected"; + if (message.node_to != null && message.hasOwnProperty("node_to")) + if (!(message.node_to && typeof message.node_to.length === "number" || $util.isString(message.node_to))) + return "node_to: buffer expected"; + if (message.history != null && message.hasOwnProperty("history")) { + let error = $root.routerrpc.PairData.verify(message.history); + if (error) + return "history." + error; + } return null; }; /** - * Creates a QueryMissionControlRequest message from a plain object. Also converts values to their respective internal types. + * Creates a PairHistory message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.QueryMissionControlRequest + * @memberof routerrpc.PairHistory * @static * @param {Object.} object Plain object - * @returns {routerrpc.QueryMissionControlRequest} QueryMissionControlRequest + * @returns {routerrpc.PairHistory} PairHistory */ - QueryMissionControlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.QueryMissionControlRequest) + PairHistory.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.PairHistory) return object; - return new $root.routerrpc.QueryMissionControlRequest(); + let message = new $root.routerrpc.PairHistory(); + if (object.node_from != null) + if (typeof object.node_from === "string") + $util.base64.decode(object.node_from, message.node_from = $util.newBuffer($util.base64.length(object.node_from)), 0); + else if (object.node_from.length >= 0) + message.node_from = object.node_from; + if (object.node_to != null) + if (typeof object.node_to === "string") + $util.base64.decode(object.node_to, message.node_to = $util.newBuffer($util.base64.length(object.node_to)), 0); + else if (object.node_to.length >= 0) + message.node_to = object.node_to; + if (object.history != null) { + if (typeof object.history !== "object") + throw TypeError(".routerrpc.PairHistory.history: object expected"); + message.history = $root.routerrpc.PairData.fromObject(object.history); + } + return message; }; /** - * Creates a plain object from a QueryMissionControlRequest message. Also converts values to other types if specified. + * Creates a plain object from a PairHistory message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.QueryMissionControlRequest + * @memberof routerrpc.PairHistory * @static - * @param {routerrpc.QueryMissionControlRequest} message QueryMissionControlRequest + * @param {routerrpc.PairHistory} message PairHistory * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryMissionControlRequest.toObject = function toObject() { - return {}; + PairHistory.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.node_from = ""; + else { + object.node_from = []; + if (options.bytes !== Array) + object.node_from = $util.newBuffer(object.node_from); + } + if (options.bytes === String) + object.node_to = ""; + else { + object.node_to = []; + if (options.bytes !== Array) + object.node_to = $util.newBuffer(object.node_to); + } + object.history = null; + } + if (message.node_from != null && message.hasOwnProperty("node_from")) + object.node_from = options.bytes === String ? $util.base64.encode(message.node_from, 0, message.node_from.length) : options.bytes === Array ? Array.prototype.slice.call(message.node_from) : message.node_from; + if (message.node_to != null && message.hasOwnProperty("node_to")) + object.node_to = options.bytes === String ? $util.base64.encode(message.node_to, 0, message.node_to.length) : options.bytes === Array ? Array.prototype.slice.call(message.node_to) : message.node_to; + if (message.history != null && message.hasOwnProperty("history")) + object.history = $root.routerrpc.PairData.toObject(message.history, options); + return object; }; /** - * Converts this QueryMissionControlRequest to JSON. + * Converts this PairHistory to JSON. * @function toJSON - * @memberof routerrpc.QueryMissionControlRequest + * @memberof routerrpc.PairHistory * @instance * @returns {Object.} JSON object */ - QueryMissionControlRequest.prototype.toJSON = function toJSON() { + PairHistory.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for QueryMissionControlRequest + * Gets the default type url for PairHistory * @function getTypeUrl - * @memberof routerrpc.QueryMissionControlRequest + * @memberof routerrpc.PairHistory * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - QueryMissionControlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PairHistory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.QueryMissionControlRequest"; + return typeUrlPrefix + "/routerrpc.PairHistory"; }; - return QueryMissionControlRequest; + return PairHistory; })(); - routerrpc.QueryMissionControlResponse = (function() { + routerrpc.PairData = (function() { /** - * Properties of a QueryMissionControlResponse. + * Properties of a PairData. * @memberof routerrpc - * @interface IQueryMissionControlResponse - * @property {Array.|null} [pairs] QueryMissionControlResponse pairs + * @interface IPairData + * @property {Long|null} [fail_time] PairData fail_time + * @property {Long|null} [fail_amt_sat] PairData fail_amt_sat + * @property {Long|null} [fail_amt_msat] PairData fail_amt_msat + * @property {Long|null} [success_time] PairData success_time + * @property {Long|null} [success_amt_sat] PairData success_amt_sat + * @property {Long|null} [success_amt_msat] PairData success_amt_msat */ /** - * Constructs a new QueryMissionControlResponse. + * Constructs a new PairData. * @memberof routerrpc - * @classdesc Represents a QueryMissionControlResponse. - * @implements IQueryMissionControlResponse + * @classdesc Represents a PairData. + * @implements IPairData * @constructor - * @param {routerrpc.IQueryMissionControlResponse=} [properties] Properties to set + * @param {routerrpc.IPairData=} [properties] Properties to set */ - function QueryMissionControlResponse(properties) { - this.pairs = []; + function PairData(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -87713,78 +90507,145 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * QueryMissionControlResponse pairs. - * @member {Array.} pairs - * @memberof routerrpc.QueryMissionControlResponse + * PairData fail_time. + * @member {Long} fail_time + * @memberof routerrpc.PairData * @instance */ - QueryMissionControlResponse.prototype.pairs = $util.emptyArray; + PairData.prototype.fail_time = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new QueryMissionControlResponse instance using the specified properties. + * PairData fail_amt_sat. + * @member {Long} fail_amt_sat + * @memberof routerrpc.PairData + * @instance + */ + PairData.prototype.fail_amt_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PairData fail_amt_msat. + * @member {Long} fail_amt_msat + * @memberof routerrpc.PairData + * @instance + */ + PairData.prototype.fail_amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PairData success_time. + * @member {Long} success_time + * @memberof routerrpc.PairData + * @instance + */ + PairData.prototype.success_time = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PairData success_amt_sat. + * @member {Long} success_amt_sat + * @memberof routerrpc.PairData + * @instance + */ + PairData.prototype.success_amt_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PairData success_amt_msat. + * @member {Long} success_amt_msat + * @memberof routerrpc.PairData + * @instance + */ + PairData.prototype.success_amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PairData instance using the specified properties. * @function create - * @memberof routerrpc.QueryMissionControlResponse + * @memberof routerrpc.PairData * @static - * @param {routerrpc.IQueryMissionControlResponse=} [properties] Properties to set - * @returns {routerrpc.QueryMissionControlResponse} QueryMissionControlResponse instance + * @param {routerrpc.IPairData=} [properties] Properties to set + * @returns {routerrpc.PairData} PairData instance */ - QueryMissionControlResponse.create = function create(properties) { - return new QueryMissionControlResponse(properties); + PairData.create = function create(properties) { + return new PairData(properties); }; /** - * Encodes the specified QueryMissionControlResponse message. Does not implicitly {@link routerrpc.QueryMissionControlResponse.verify|verify} messages. + * Encodes the specified PairData message. Does not implicitly {@link routerrpc.PairData.verify|verify} messages. * @function encode - * @memberof routerrpc.QueryMissionControlResponse + * @memberof routerrpc.PairData * @static - * @param {routerrpc.IQueryMissionControlResponse} message QueryMissionControlResponse message or plain object to encode + * @param {routerrpc.IPairData} message PairData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryMissionControlResponse.encode = function encode(message, writer) { + PairData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pairs != null && message.pairs.length) - for (let i = 0; i < message.pairs.length; ++i) - $root.routerrpc.PairHistory.encode(message.pairs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fail_time != null && Object.hasOwnProperty.call(message, "fail_time")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.fail_time); + if (message.fail_amt_sat != null && Object.hasOwnProperty.call(message, "fail_amt_sat")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.fail_amt_sat); + if (message.fail_amt_msat != null && Object.hasOwnProperty.call(message, "fail_amt_msat")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.fail_amt_msat); + if (message.success_time != null && Object.hasOwnProperty.call(message, "success_time")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.success_time); + if (message.success_amt_sat != null && Object.hasOwnProperty.call(message, "success_amt_sat")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.success_amt_sat); + if (message.success_amt_msat != null && Object.hasOwnProperty.call(message, "success_amt_msat")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.success_amt_msat); return writer; }; /** - * Encodes the specified QueryMissionControlResponse message, length delimited. Does not implicitly {@link routerrpc.QueryMissionControlResponse.verify|verify} messages. + * Encodes the specified PairData message, length delimited. Does not implicitly {@link routerrpc.PairData.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.QueryMissionControlResponse + * @memberof routerrpc.PairData * @static - * @param {routerrpc.IQueryMissionControlResponse} message QueryMissionControlResponse message or plain object to encode + * @param {routerrpc.IPairData} message PairData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryMissionControlResponse.encodeDelimited = function encodeDelimited(message, writer) { + PairData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a QueryMissionControlResponse message from the specified reader or buffer. + * Decodes a PairData message from the specified reader or buffer. * @function decode - * @memberof routerrpc.QueryMissionControlResponse + * @memberof routerrpc.PairData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.QueryMissionControlResponse} QueryMissionControlResponse + * @returns {routerrpc.PairData} PairData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryMissionControlResponse.decode = function decode(reader, length) { + PairData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.QueryMissionControlResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.PairData(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.fail_time = reader.int64(); + break; + } case 2: { - if (!(message.pairs && message.pairs.length)) - message.pairs = []; - message.pairs.push($root.routerrpc.PairHistory.decode(reader, reader.uint32())); + message.fail_amt_sat = reader.int64(); + break; + } + case 4: { + message.fail_amt_msat = reader.int64(); + break; + } + case 5: { + message.success_time = reader.int64(); + break; + } + case 6: { + message.success_amt_sat = reader.int64(); + break; + } + case 7: { + message.success_amt_msat = reader.int64(); break; } default: @@ -87796,141 +90657,246 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a QueryMissionControlResponse message from the specified reader or buffer, length delimited. + * Decodes a PairData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.QueryMissionControlResponse + * @memberof routerrpc.PairData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.QueryMissionControlResponse} QueryMissionControlResponse + * @returns {routerrpc.PairData} PairData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryMissionControlResponse.decodeDelimited = function decodeDelimited(reader) { + PairData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a QueryMissionControlResponse message. + * Verifies a PairData message. * @function verify - * @memberof routerrpc.QueryMissionControlResponse + * @memberof routerrpc.PairData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - QueryMissionControlResponse.verify = function verify(message) { + PairData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.pairs != null && message.hasOwnProperty("pairs")) { - if (!Array.isArray(message.pairs)) - return "pairs: array expected"; - for (let i = 0; i < message.pairs.length; ++i) { - let error = $root.routerrpc.PairHistory.verify(message.pairs[i]); - if (error) - return "pairs." + error; - } - } + if (message.fail_time != null && message.hasOwnProperty("fail_time")) + if (!$util.isInteger(message.fail_time) && !(message.fail_time && $util.isInteger(message.fail_time.low) && $util.isInteger(message.fail_time.high))) + return "fail_time: integer|Long expected"; + if (message.fail_amt_sat != null && message.hasOwnProperty("fail_amt_sat")) + if (!$util.isInteger(message.fail_amt_sat) && !(message.fail_amt_sat && $util.isInteger(message.fail_amt_sat.low) && $util.isInteger(message.fail_amt_sat.high))) + return "fail_amt_sat: integer|Long expected"; + if (message.fail_amt_msat != null && message.hasOwnProperty("fail_amt_msat")) + if (!$util.isInteger(message.fail_amt_msat) && !(message.fail_amt_msat && $util.isInteger(message.fail_amt_msat.low) && $util.isInteger(message.fail_amt_msat.high))) + return "fail_amt_msat: integer|Long expected"; + if (message.success_time != null && message.hasOwnProperty("success_time")) + if (!$util.isInteger(message.success_time) && !(message.success_time && $util.isInteger(message.success_time.low) && $util.isInteger(message.success_time.high))) + return "success_time: integer|Long expected"; + if (message.success_amt_sat != null && message.hasOwnProperty("success_amt_sat")) + if (!$util.isInteger(message.success_amt_sat) && !(message.success_amt_sat && $util.isInteger(message.success_amt_sat.low) && $util.isInteger(message.success_amt_sat.high))) + return "success_amt_sat: integer|Long expected"; + if (message.success_amt_msat != null && message.hasOwnProperty("success_amt_msat")) + if (!$util.isInteger(message.success_amt_msat) && !(message.success_amt_msat && $util.isInteger(message.success_amt_msat.low) && $util.isInteger(message.success_amt_msat.high))) + return "success_amt_msat: integer|Long expected"; return null; }; /** - * Creates a QueryMissionControlResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PairData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.QueryMissionControlResponse + * @memberof routerrpc.PairData * @static * @param {Object.} object Plain object - * @returns {routerrpc.QueryMissionControlResponse} QueryMissionControlResponse + * @returns {routerrpc.PairData} PairData */ - QueryMissionControlResponse.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.QueryMissionControlResponse) + PairData.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.PairData) return object; - let message = new $root.routerrpc.QueryMissionControlResponse(); - if (object.pairs) { - if (!Array.isArray(object.pairs)) - throw TypeError(".routerrpc.QueryMissionControlResponse.pairs: array expected"); - message.pairs = []; - for (let i = 0; i < object.pairs.length; ++i) { - if (typeof object.pairs[i] !== "object") - throw TypeError(".routerrpc.QueryMissionControlResponse.pairs: object expected"); - message.pairs[i] = $root.routerrpc.PairHistory.fromObject(object.pairs[i]); - } - } + let message = new $root.routerrpc.PairData(); + if (object.fail_time != null) + if ($util.Long) + (message.fail_time = $util.Long.fromValue(object.fail_time)).unsigned = false; + else if (typeof object.fail_time === "string") + message.fail_time = parseInt(object.fail_time, 10); + else if (typeof object.fail_time === "number") + message.fail_time = object.fail_time; + else if (typeof object.fail_time === "object") + message.fail_time = new $util.LongBits(object.fail_time.low >>> 0, object.fail_time.high >>> 0).toNumber(); + if (object.fail_amt_sat != null) + if ($util.Long) + (message.fail_amt_sat = $util.Long.fromValue(object.fail_amt_sat)).unsigned = false; + else if (typeof object.fail_amt_sat === "string") + message.fail_amt_sat = parseInt(object.fail_amt_sat, 10); + else if (typeof object.fail_amt_sat === "number") + message.fail_amt_sat = object.fail_amt_sat; + else if (typeof object.fail_amt_sat === "object") + message.fail_amt_sat = new $util.LongBits(object.fail_amt_sat.low >>> 0, object.fail_amt_sat.high >>> 0).toNumber(); + if (object.fail_amt_msat != null) + if ($util.Long) + (message.fail_amt_msat = $util.Long.fromValue(object.fail_amt_msat)).unsigned = false; + else if (typeof object.fail_amt_msat === "string") + message.fail_amt_msat = parseInt(object.fail_amt_msat, 10); + else if (typeof object.fail_amt_msat === "number") + message.fail_amt_msat = object.fail_amt_msat; + else if (typeof object.fail_amt_msat === "object") + message.fail_amt_msat = new $util.LongBits(object.fail_amt_msat.low >>> 0, object.fail_amt_msat.high >>> 0).toNumber(); + if (object.success_time != null) + if ($util.Long) + (message.success_time = $util.Long.fromValue(object.success_time)).unsigned = false; + else if (typeof object.success_time === "string") + message.success_time = parseInt(object.success_time, 10); + else if (typeof object.success_time === "number") + message.success_time = object.success_time; + else if (typeof object.success_time === "object") + message.success_time = new $util.LongBits(object.success_time.low >>> 0, object.success_time.high >>> 0).toNumber(); + if (object.success_amt_sat != null) + if ($util.Long) + (message.success_amt_sat = $util.Long.fromValue(object.success_amt_sat)).unsigned = false; + else if (typeof object.success_amt_sat === "string") + message.success_amt_sat = parseInt(object.success_amt_sat, 10); + else if (typeof object.success_amt_sat === "number") + message.success_amt_sat = object.success_amt_sat; + else if (typeof object.success_amt_sat === "object") + message.success_amt_sat = new $util.LongBits(object.success_amt_sat.low >>> 0, object.success_amt_sat.high >>> 0).toNumber(); + if (object.success_amt_msat != null) + if ($util.Long) + (message.success_amt_msat = $util.Long.fromValue(object.success_amt_msat)).unsigned = false; + else if (typeof object.success_amt_msat === "string") + message.success_amt_msat = parseInt(object.success_amt_msat, 10); + else if (typeof object.success_amt_msat === "number") + message.success_amt_msat = object.success_amt_msat; + else if (typeof object.success_amt_msat === "object") + message.success_amt_msat = new $util.LongBits(object.success_amt_msat.low >>> 0, object.success_amt_msat.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a QueryMissionControlResponse message. Also converts values to other types if specified. + * Creates a plain object from a PairData message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.QueryMissionControlResponse + * @memberof routerrpc.PairData * @static - * @param {routerrpc.QueryMissionControlResponse} message QueryMissionControlResponse + * @param {routerrpc.PairData} message PairData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryMissionControlResponse.toObject = function toObject(message, options) { + PairData.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.arrays || options.defaults) - object.pairs = []; - if (message.pairs && message.pairs.length) { - object.pairs = []; - for (let j = 0; j < message.pairs.length; ++j) - object.pairs[j] = $root.routerrpc.PairHistory.toObject(message.pairs[j], options); + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.fail_time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fail_time = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.fail_amt_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fail_amt_sat = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.fail_amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fail_amt_msat = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.success_time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.success_time = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.success_amt_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.success_amt_sat = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.success_amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.success_amt_msat = options.longs === String ? "0" : 0; } + if (message.fail_time != null && message.hasOwnProperty("fail_time")) + if (typeof message.fail_time === "number") + object.fail_time = options.longs === String ? String(message.fail_time) : message.fail_time; + else + object.fail_time = options.longs === String ? $util.Long.prototype.toString.call(message.fail_time) : options.longs === Number ? new $util.LongBits(message.fail_time.low >>> 0, message.fail_time.high >>> 0).toNumber() : message.fail_time; + if (message.fail_amt_sat != null && message.hasOwnProperty("fail_amt_sat")) + if (typeof message.fail_amt_sat === "number") + object.fail_amt_sat = options.longs === String ? String(message.fail_amt_sat) : message.fail_amt_sat; + else + object.fail_amt_sat = options.longs === String ? $util.Long.prototype.toString.call(message.fail_amt_sat) : options.longs === Number ? new $util.LongBits(message.fail_amt_sat.low >>> 0, message.fail_amt_sat.high >>> 0).toNumber() : message.fail_amt_sat; + if (message.fail_amt_msat != null && message.hasOwnProperty("fail_amt_msat")) + if (typeof message.fail_amt_msat === "number") + object.fail_amt_msat = options.longs === String ? String(message.fail_amt_msat) : message.fail_amt_msat; + else + object.fail_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.fail_amt_msat) : options.longs === Number ? new $util.LongBits(message.fail_amt_msat.low >>> 0, message.fail_amt_msat.high >>> 0).toNumber() : message.fail_amt_msat; + if (message.success_time != null && message.hasOwnProperty("success_time")) + if (typeof message.success_time === "number") + object.success_time = options.longs === String ? String(message.success_time) : message.success_time; + else + object.success_time = options.longs === String ? $util.Long.prototype.toString.call(message.success_time) : options.longs === Number ? new $util.LongBits(message.success_time.low >>> 0, message.success_time.high >>> 0).toNumber() : message.success_time; + if (message.success_amt_sat != null && message.hasOwnProperty("success_amt_sat")) + if (typeof message.success_amt_sat === "number") + object.success_amt_sat = options.longs === String ? String(message.success_amt_sat) : message.success_amt_sat; + else + object.success_amt_sat = options.longs === String ? $util.Long.prototype.toString.call(message.success_amt_sat) : options.longs === Number ? new $util.LongBits(message.success_amt_sat.low >>> 0, message.success_amt_sat.high >>> 0).toNumber() : message.success_amt_sat; + if (message.success_amt_msat != null && message.hasOwnProperty("success_amt_msat")) + if (typeof message.success_amt_msat === "number") + object.success_amt_msat = options.longs === String ? String(message.success_amt_msat) : message.success_amt_msat; + else + object.success_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.success_amt_msat) : options.longs === Number ? new $util.LongBits(message.success_amt_msat.low >>> 0, message.success_amt_msat.high >>> 0).toNumber() : message.success_amt_msat; return object; }; /** - * Converts this QueryMissionControlResponse to JSON. + * Converts this PairData to JSON. * @function toJSON - * @memberof routerrpc.QueryMissionControlResponse + * @memberof routerrpc.PairData * @instance * @returns {Object.} JSON object */ - QueryMissionControlResponse.prototype.toJSON = function toJSON() { + PairData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for QueryMissionControlResponse + * Gets the default type url for PairData * @function getTypeUrl - * @memberof routerrpc.QueryMissionControlResponse + * @memberof routerrpc.PairData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - QueryMissionControlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PairData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.QueryMissionControlResponse"; + return typeUrlPrefix + "/routerrpc.PairData"; }; - return QueryMissionControlResponse; + return PairData; })(); - routerrpc.XImportMissionControlRequest = (function() { + routerrpc.GetMissionControlConfigRequest = (function() { /** - * Properties of a XImportMissionControlRequest. + * Properties of a GetMissionControlConfigRequest. * @memberof routerrpc - * @interface IXImportMissionControlRequest - * @property {Array.|null} [pairs] XImportMissionControlRequest pairs - * @property {boolean|null} [force] XImportMissionControlRequest force + * @interface IGetMissionControlConfigRequest */ /** - * Constructs a new XImportMissionControlRequest. + * Constructs a new GetMissionControlConfigRequest. * @memberof routerrpc - * @classdesc Represents a XImportMissionControlRequest. - * @implements IXImportMissionControlRequest + * @classdesc Represents a GetMissionControlConfigRequest. + * @implements IGetMissionControlConfigRequest * @constructor - * @param {routerrpc.IXImportMissionControlRequest=} [properties] Properties to set + * @param {routerrpc.IGetMissionControlConfigRequest=} [properties] Properties to set */ - function XImportMissionControlRequest(properties) { - this.pairs = []; + function GetMissionControlConfigRequest(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -87938,94 +90904,63 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * XImportMissionControlRequest pairs. - * @member {Array.} pairs - * @memberof routerrpc.XImportMissionControlRequest - * @instance - */ - XImportMissionControlRequest.prototype.pairs = $util.emptyArray; - - /** - * XImportMissionControlRequest force. - * @member {boolean} force - * @memberof routerrpc.XImportMissionControlRequest - * @instance - */ - XImportMissionControlRequest.prototype.force = false; - - /** - * Creates a new XImportMissionControlRequest instance using the specified properties. + * Creates a new GetMissionControlConfigRequest instance using the specified properties. * @function create - * @memberof routerrpc.XImportMissionControlRequest + * @memberof routerrpc.GetMissionControlConfigRequest * @static - * @param {routerrpc.IXImportMissionControlRequest=} [properties] Properties to set - * @returns {routerrpc.XImportMissionControlRequest} XImportMissionControlRequest instance + * @param {routerrpc.IGetMissionControlConfigRequest=} [properties] Properties to set + * @returns {routerrpc.GetMissionControlConfigRequest} GetMissionControlConfigRequest instance */ - XImportMissionControlRequest.create = function create(properties) { - return new XImportMissionControlRequest(properties); + GetMissionControlConfigRequest.create = function create(properties) { + return new GetMissionControlConfigRequest(properties); }; /** - * Encodes the specified XImportMissionControlRequest message. Does not implicitly {@link routerrpc.XImportMissionControlRequest.verify|verify} messages. + * Encodes the specified GetMissionControlConfigRequest message. Does not implicitly {@link routerrpc.GetMissionControlConfigRequest.verify|verify} messages. * @function encode - * @memberof routerrpc.XImportMissionControlRequest + * @memberof routerrpc.GetMissionControlConfigRequest * @static - * @param {routerrpc.IXImportMissionControlRequest} message XImportMissionControlRequest message or plain object to encode + * @param {routerrpc.IGetMissionControlConfigRequest} message GetMissionControlConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - XImportMissionControlRequest.encode = function encode(message, writer) { + GetMissionControlConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pairs != null && message.pairs.length) - for (let i = 0; i < message.pairs.length; ++i) - $root.routerrpc.PairHistory.encode(message.pairs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); return writer; }; /** - * Encodes the specified XImportMissionControlRequest message, length delimited. Does not implicitly {@link routerrpc.XImportMissionControlRequest.verify|verify} messages. + * Encodes the specified GetMissionControlConfigRequest message, length delimited. Does not implicitly {@link routerrpc.GetMissionControlConfigRequest.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.XImportMissionControlRequest + * @memberof routerrpc.GetMissionControlConfigRequest * @static - * @param {routerrpc.IXImportMissionControlRequest} message XImportMissionControlRequest message or plain object to encode + * @param {routerrpc.IGetMissionControlConfigRequest} message GetMissionControlConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - XImportMissionControlRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetMissionControlConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a XImportMissionControlRequest message from the specified reader or buffer. + * Decodes a GetMissionControlConfigRequest message from the specified reader or buffer. * @function decode - * @memberof routerrpc.XImportMissionControlRequest + * @memberof routerrpc.GetMissionControlConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.XImportMissionControlRequest} XImportMissionControlRequest + * @returns {routerrpc.GetMissionControlConfigRequest} GetMissionControlConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - XImportMissionControlRequest.decode = function decode(reader, length) { + GetMissionControlConfigRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.XImportMissionControlRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.GetMissionControlConfigRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - if (!(message.pairs && message.pairs.length)) - message.pairs = []; - message.pairs.push($root.routerrpc.PairHistory.decode(reader, reader.uint32())); - break; - } - case 2: { - message.force = reader.bool(); - break; - } default: reader.skipType(tag & 7); break; @@ -88035,147 +90970,109 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a XImportMissionControlRequest message from the specified reader or buffer, length delimited. + * Decodes a GetMissionControlConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.XImportMissionControlRequest + * @memberof routerrpc.GetMissionControlConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.XImportMissionControlRequest} XImportMissionControlRequest + * @returns {routerrpc.GetMissionControlConfigRequest} GetMissionControlConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - XImportMissionControlRequest.decodeDelimited = function decodeDelimited(reader) { + GetMissionControlConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a XImportMissionControlRequest message. + * Verifies a GetMissionControlConfigRequest message. * @function verify - * @memberof routerrpc.XImportMissionControlRequest + * @memberof routerrpc.GetMissionControlConfigRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - XImportMissionControlRequest.verify = function verify(message) { + GetMissionControlConfigRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.pairs != null && message.hasOwnProperty("pairs")) { - if (!Array.isArray(message.pairs)) - return "pairs: array expected"; - for (let i = 0; i < message.pairs.length; ++i) { - let error = $root.routerrpc.PairHistory.verify(message.pairs[i]); - if (error) - return "pairs." + error; - } - } - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; return null; }; /** - * Creates a XImportMissionControlRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetMissionControlConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.XImportMissionControlRequest + * @memberof routerrpc.GetMissionControlConfigRequest * @static * @param {Object.} object Plain object - * @returns {routerrpc.XImportMissionControlRequest} XImportMissionControlRequest + * @returns {routerrpc.GetMissionControlConfigRequest} GetMissionControlConfigRequest */ - XImportMissionControlRequest.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.XImportMissionControlRequest) + GetMissionControlConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.GetMissionControlConfigRequest) return object; - let message = new $root.routerrpc.XImportMissionControlRequest(); - if (object.pairs) { - if (!Array.isArray(object.pairs)) - throw TypeError(".routerrpc.XImportMissionControlRequest.pairs: array expected"); - message.pairs = []; - for (let i = 0; i < object.pairs.length; ++i) { - if (typeof object.pairs[i] !== "object") - throw TypeError(".routerrpc.XImportMissionControlRequest.pairs: object expected"); - message.pairs[i] = $root.routerrpc.PairHistory.fromObject(object.pairs[i]); - } - } - if (object.force != null) - message.force = Boolean(object.force); - return message; + return new $root.routerrpc.GetMissionControlConfigRequest(); }; /** - * Creates a plain object from a XImportMissionControlRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetMissionControlConfigRequest message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.XImportMissionControlRequest + * @memberof routerrpc.GetMissionControlConfigRequest * @static - * @param {routerrpc.XImportMissionControlRequest} message XImportMissionControlRequest + * @param {routerrpc.GetMissionControlConfigRequest} message GetMissionControlConfigRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - XImportMissionControlRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.arrays || options.defaults) - object.pairs = []; - if (options.defaults) - object.force = false; - if (message.pairs && message.pairs.length) { - object.pairs = []; - for (let j = 0; j < message.pairs.length; ++j) - object.pairs[j] = $root.routerrpc.PairHistory.toObject(message.pairs[j], options); - } - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - return object; + GetMissionControlConfigRequest.toObject = function toObject() { + return {}; }; /** - * Converts this XImportMissionControlRequest to JSON. + * Converts this GetMissionControlConfigRequest to JSON. * @function toJSON - * @memberof routerrpc.XImportMissionControlRequest + * @memberof routerrpc.GetMissionControlConfigRequest * @instance * @returns {Object.} JSON object */ - XImportMissionControlRequest.prototype.toJSON = function toJSON() { + GetMissionControlConfigRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for XImportMissionControlRequest + * Gets the default type url for GetMissionControlConfigRequest * @function getTypeUrl - * @memberof routerrpc.XImportMissionControlRequest + * @memberof routerrpc.GetMissionControlConfigRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - XImportMissionControlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetMissionControlConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.XImportMissionControlRequest"; + return typeUrlPrefix + "/routerrpc.GetMissionControlConfigRequest"; }; - return XImportMissionControlRequest; + return GetMissionControlConfigRequest; })(); - routerrpc.XImportMissionControlResponse = (function() { + routerrpc.GetMissionControlConfigResponse = (function() { /** - * Properties of a XImportMissionControlResponse. + * Properties of a GetMissionControlConfigResponse. * @memberof routerrpc - * @interface IXImportMissionControlResponse + * @interface IGetMissionControlConfigResponse + * @property {routerrpc.IMissionControlConfig|null} [config] GetMissionControlConfigResponse config */ /** - * Constructs a new XImportMissionControlResponse. + * Constructs a new GetMissionControlConfigResponse. * @memberof routerrpc - * @classdesc Represents a XImportMissionControlResponse. - * @implements IXImportMissionControlResponse + * @classdesc Represents a GetMissionControlConfigResponse. + * @implements IGetMissionControlConfigResponse * @constructor - * @param {routerrpc.IXImportMissionControlResponse=} [properties] Properties to set + * @param {routerrpc.IGetMissionControlConfigResponse=} [properties] Properties to set */ - function XImportMissionControlResponse(properties) { + function GetMissionControlConfigResponse(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -88183,63 +91080,77 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * Creates a new XImportMissionControlResponse instance using the specified properties. + * GetMissionControlConfigResponse config. + * @member {routerrpc.IMissionControlConfig|null|undefined} config + * @memberof routerrpc.GetMissionControlConfigResponse + * @instance + */ + GetMissionControlConfigResponse.prototype.config = null; + + /** + * Creates a new GetMissionControlConfigResponse instance using the specified properties. * @function create - * @memberof routerrpc.XImportMissionControlResponse + * @memberof routerrpc.GetMissionControlConfigResponse * @static - * @param {routerrpc.IXImportMissionControlResponse=} [properties] Properties to set - * @returns {routerrpc.XImportMissionControlResponse} XImportMissionControlResponse instance + * @param {routerrpc.IGetMissionControlConfigResponse=} [properties] Properties to set + * @returns {routerrpc.GetMissionControlConfigResponse} GetMissionControlConfigResponse instance */ - XImportMissionControlResponse.create = function create(properties) { - return new XImportMissionControlResponse(properties); + GetMissionControlConfigResponse.create = function create(properties) { + return new GetMissionControlConfigResponse(properties); }; /** - * Encodes the specified XImportMissionControlResponse message. Does not implicitly {@link routerrpc.XImportMissionControlResponse.verify|verify} messages. + * Encodes the specified GetMissionControlConfigResponse message. Does not implicitly {@link routerrpc.GetMissionControlConfigResponse.verify|verify} messages. * @function encode - * @memberof routerrpc.XImportMissionControlResponse + * @memberof routerrpc.GetMissionControlConfigResponse * @static - * @param {routerrpc.IXImportMissionControlResponse} message XImportMissionControlResponse message or plain object to encode + * @param {routerrpc.IGetMissionControlConfigResponse} message GetMissionControlConfigResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - XImportMissionControlResponse.encode = function encode(message, writer) { + GetMissionControlConfigResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.routerrpc.MissionControlConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified XImportMissionControlResponse message, length delimited. Does not implicitly {@link routerrpc.XImportMissionControlResponse.verify|verify} messages. + * Encodes the specified GetMissionControlConfigResponse message, length delimited. Does not implicitly {@link routerrpc.GetMissionControlConfigResponse.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.XImportMissionControlResponse + * @memberof routerrpc.GetMissionControlConfigResponse * @static - * @param {routerrpc.IXImportMissionControlResponse} message XImportMissionControlResponse message or plain object to encode + * @param {routerrpc.IGetMissionControlConfigResponse} message GetMissionControlConfigResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - XImportMissionControlResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetMissionControlConfigResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a XImportMissionControlResponse message from the specified reader or buffer. + * Decodes a GetMissionControlConfigResponse message from the specified reader or buffer. * @function decode - * @memberof routerrpc.XImportMissionControlResponse + * @memberof routerrpc.GetMissionControlConfigResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.XImportMissionControlResponse} XImportMissionControlResponse + * @returns {routerrpc.GetMissionControlConfigResponse} GetMissionControlConfigResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - XImportMissionControlResponse.decode = function decode(reader, length) { + GetMissionControlConfigResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.XImportMissionControlResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.GetMissionControlConfigResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.config = $root.routerrpc.MissionControlConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -88249,111 +91160,127 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a XImportMissionControlResponse message from the specified reader or buffer, length delimited. + * Decodes a GetMissionControlConfigResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.XImportMissionControlResponse + * @memberof routerrpc.GetMissionControlConfigResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.XImportMissionControlResponse} XImportMissionControlResponse + * @returns {routerrpc.GetMissionControlConfigResponse} GetMissionControlConfigResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - XImportMissionControlResponse.decodeDelimited = function decodeDelimited(reader) { + GetMissionControlConfigResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a XImportMissionControlResponse message. + * Verifies a GetMissionControlConfigResponse message. * @function verify - * @memberof routerrpc.XImportMissionControlResponse + * @memberof routerrpc.GetMissionControlConfigResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - XImportMissionControlResponse.verify = function verify(message) { + GetMissionControlConfigResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + let error = $root.routerrpc.MissionControlConfig.verify(message.config); + if (error) + return "config." + error; + } return null; }; /** - * Creates a XImportMissionControlResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetMissionControlConfigResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.XImportMissionControlResponse + * @memberof routerrpc.GetMissionControlConfigResponse * @static * @param {Object.} object Plain object - * @returns {routerrpc.XImportMissionControlResponse} XImportMissionControlResponse + * @returns {routerrpc.GetMissionControlConfigResponse} GetMissionControlConfigResponse */ - XImportMissionControlResponse.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.XImportMissionControlResponse) + GetMissionControlConfigResponse.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.GetMissionControlConfigResponse) return object; - return new $root.routerrpc.XImportMissionControlResponse(); + let message = new $root.routerrpc.GetMissionControlConfigResponse(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".routerrpc.GetMissionControlConfigResponse.config: object expected"); + message.config = $root.routerrpc.MissionControlConfig.fromObject(object.config); + } + return message; }; /** - * Creates a plain object from a XImportMissionControlResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetMissionControlConfigResponse message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.XImportMissionControlResponse + * @memberof routerrpc.GetMissionControlConfigResponse * @static - * @param {routerrpc.XImportMissionControlResponse} message XImportMissionControlResponse + * @param {routerrpc.GetMissionControlConfigResponse} message GetMissionControlConfigResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - XImportMissionControlResponse.toObject = function toObject() { - return {}; + GetMissionControlConfigResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.config = null; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.routerrpc.MissionControlConfig.toObject(message.config, options); + return object; }; /** - * Converts this XImportMissionControlResponse to JSON. + * Converts this GetMissionControlConfigResponse to JSON. * @function toJSON - * @memberof routerrpc.XImportMissionControlResponse + * @memberof routerrpc.GetMissionControlConfigResponse * @instance * @returns {Object.} JSON object */ - XImportMissionControlResponse.prototype.toJSON = function toJSON() { + GetMissionControlConfigResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for XImportMissionControlResponse + * Gets the default type url for GetMissionControlConfigResponse * @function getTypeUrl - * @memberof routerrpc.XImportMissionControlResponse + * @memberof routerrpc.GetMissionControlConfigResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - XImportMissionControlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetMissionControlConfigResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.XImportMissionControlResponse"; + return typeUrlPrefix + "/routerrpc.GetMissionControlConfigResponse"; }; - return XImportMissionControlResponse; + return GetMissionControlConfigResponse; })(); - routerrpc.PairHistory = (function() { + routerrpc.SetMissionControlConfigRequest = (function() { /** - * Properties of a PairHistory. + * Properties of a SetMissionControlConfigRequest. * @memberof routerrpc - * @interface IPairHistory - * @property {Uint8Array|null} [node_from] PairHistory node_from - * @property {Uint8Array|null} [node_to] PairHistory node_to - * @property {routerrpc.IPairData|null} [history] PairHistory history + * @interface ISetMissionControlConfigRequest + * @property {routerrpc.IMissionControlConfig|null} [config] SetMissionControlConfigRequest config */ /** - * Constructs a new PairHistory. + * Constructs a new SetMissionControlConfigRequest. * @memberof routerrpc - * @classdesc Represents a PairHistory. - * @implements IPairHistory + * @classdesc Represents a SetMissionControlConfigRequest. + * @implements ISetMissionControlConfigRequest * @constructor - * @param {routerrpc.IPairHistory=} [properties] Properties to set + * @param {routerrpc.ISetMissionControlConfigRequest=} [properties] Properties to set */ - function PairHistory(properties) { + function SetMissionControlConfigRequest(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -88361,103 +91288,75 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * PairHistory node_from. - * @member {Uint8Array} node_from - * @memberof routerrpc.PairHistory - * @instance - */ - PairHistory.prototype.node_from = $util.newBuffer([]); - - /** - * PairHistory node_to. - * @member {Uint8Array} node_to - * @memberof routerrpc.PairHistory - * @instance - */ - PairHistory.prototype.node_to = $util.newBuffer([]); - - /** - * PairHistory history. - * @member {routerrpc.IPairData|null|undefined} history - * @memberof routerrpc.PairHistory + * SetMissionControlConfigRequest config. + * @member {routerrpc.IMissionControlConfig|null|undefined} config + * @memberof routerrpc.SetMissionControlConfigRequest * @instance */ - PairHistory.prototype.history = null; + SetMissionControlConfigRequest.prototype.config = null; /** - * Creates a new PairHistory instance using the specified properties. + * Creates a new SetMissionControlConfigRequest instance using the specified properties. * @function create - * @memberof routerrpc.PairHistory + * @memberof routerrpc.SetMissionControlConfigRequest * @static - * @param {routerrpc.IPairHistory=} [properties] Properties to set - * @returns {routerrpc.PairHistory} PairHistory instance + * @param {routerrpc.ISetMissionControlConfigRequest=} [properties] Properties to set + * @returns {routerrpc.SetMissionControlConfigRequest} SetMissionControlConfigRequest instance */ - PairHistory.create = function create(properties) { - return new PairHistory(properties); + SetMissionControlConfigRequest.create = function create(properties) { + return new SetMissionControlConfigRequest(properties); }; /** - * Encodes the specified PairHistory message. Does not implicitly {@link routerrpc.PairHistory.verify|verify} messages. + * Encodes the specified SetMissionControlConfigRequest message. Does not implicitly {@link routerrpc.SetMissionControlConfigRequest.verify|verify} messages. * @function encode - * @memberof routerrpc.PairHistory + * @memberof routerrpc.SetMissionControlConfigRequest * @static - * @param {routerrpc.IPairHistory} message PairHistory message or plain object to encode + * @param {routerrpc.ISetMissionControlConfigRequest} message SetMissionControlConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PairHistory.encode = function encode(message, writer) { + SetMissionControlConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.node_from != null && Object.hasOwnProperty.call(message, "node_from")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.node_from); - if (message.node_to != null && Object.hasOwnProperty.call(message, "node_to")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.node_to); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - $root.routerrpc.PairData.encode(message.history, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.routerrpc.MissionControlConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified PairHistory message, length delimited. Does not implicitly {@link routerrpc.PairHistory.verify|verify} messages. + * Encodes the specified SetMissionControlConfigRequest message, length delimited. Does not implicitly {@link routerrpc.SetMissionControlConfigRequest.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.PairHistory + * @memberof routerrpc.SetMissionControlConfigRequest * @static - * @param {routerrpc.IPairHistory} message PairHistory message or plain object to encode + * @param {routerrpc.ISetMissionControlConfigRequest} message SetMissionControlConfigRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PairHistory.encodeDelimited = function encodeDelimited(message, writer) { + SetMissionControlConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PairHistory message from the specified reader or buffer. + * Decodes a SetMissionControlConfigRequest message from the specified reader or buffer. * @function decode - * @memberof routerrpc.PairHistory + * @memberof routerrpc.SetMissionControlConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.PairHistory} PairHistory + * @returns {routerrpc.SetMissionControlConfigRequest} SetMissionControlConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PairHistory.decode = function decode(reader, length) { + SetMissionControlConfigRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.PairHistory(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SetMissionControlConfigRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.node_from = reader.bytes(); - break; - } - case 2: { - message.node_to = reader.bytes(); - break; - } - case 7: { - message.history = $root.routerrpc.PairData.decode(reader, reader.uint32()); + message.config = $root.routerrpc.MissionControlConfig.decode(reader, reader.uint32()); break; } default: @@ -88469,167 +91368,126 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a PairHistory message from the specified reader or buffer, length delimited. + * Decodes a SetMissionControlConfigRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.PairHistory + * @memberof routerrpc.SetMissionControlConfigRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.PairHistory} PairHistory + * @returns {routerrpc.SetMissionControlConfigRequest} SetMissionControlConfigRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PairHistory.decodeDelimited = function decodeDelimited(reader) { + SetMissionControlConfigRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PairHistory message. + * Verifies a SetMissionControlConfigRequest message. * @function verify - * @memberof routerrpc.PairHistory + * @memberof routerrpc.SetMissionControlConfigRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PairHistory.verify = function verify(message) { + SetMissionControlConfigRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.node_from != null && message.hasOwnProperty("node_from")) - if (!(message.node_from && typeof message.node_from.length === "number" || $util.isString(message.node_from))) - return "node_from: buffer expected"; - if (message.node_to != null && message.hasOwnProperty("node_to")) - if (!(message.node_to && typeof message.node_to.length === "number" || $util.isString(message.node_to))) - return "node_to: buffer expected"; - if (message.history != null && message.hasOwnProperty("history")) { - let error = $root.routerrpc.PairData.verify(message.history); + if (message.config != null && message.hasOwnProperty("config")) { + let error = $root.routerrpc.MissionControlConfig.verify(message.config); if (error) - return "history." + error; + return "config." + error; } return null; }; /** - * Creates a PairHistory message from a plain object. Also converts values to their respective internal types. + * Creates a SetMissionControlConfigRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.PairHistory + * @memberof routerrpc.SetMissionControlConfigRequest * @static * @param {Object.} object Plain object - * @returns {routerrpc.PairHistory} PairHistory + * @returns {routerrpc.SetMissionControlConfigRequest} SetMissionControlConfigRequest */ - PairHistory.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.PairHistory) + SetMissionControlConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.SetMissionControlConfigRequest) return object; - let message = new $root.routerrpc.PairHistory(); - if (object.node_from != null) - if (typeof object.node_from === "string") - $util.base64.decode(object.node_from, message.node_from = $util.newBuffer($util.base64.length(object.node_from)), 0); - else if (object.node_from.length >= 0) - message.node_from = object.node_from; - if (object.node_to != null) - if (typeof object.node_to === "string") - $util.base64.decode(object.node_to, message.node_to = $util.newBuffer($util.base64.length(object.node_to)), 0); - else if (object.node_to.length >= 0) - message.node_to = object.node_to; - if (object.history != null) { - if (typeof object.history !== "object") - throw TypeError(".routerrpc.PairHistory.history: object expected"); - message.history = $root.routerrpc.PairData.fromObject(object.history); + let message = new $root.routerrpc.SetMissionControlConfigRequest(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".routerrpc.SetMissionControlConfigRequest.config: object expected"); + message.config = $root.routerrpc.MissionControlConfig.fromObject(object.config); } return message; }; /** - * Creates a plain object from a PairHistory message. Also converts values to other types if specified. + * Creates a plain object from a SetMissionControlConfigRequest message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.PairHistory + * @memberof routerrpc.SetMissionControlConfigRequest * @static - * @param {routerrpc.PairHistory} message PairHistory + * @param {routerrpc.SetMissionControlConfigRequest} message SetMissionControlConfigRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PairHistory.toObject = function toObject(message, options) { + SetMissionControlConfigRequest.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.node_from = ""; - else { - object.node_from = []; - if (options.bytes !== Array) - object.node_from = $util.newBuffer(object.node_from); - } - if (options.bytes === String) - object.node_to = ""; - else { - object.node_to = []; - if (options.bytes !== Array) - object.node_to = $util.newBuffer(object.node_to); - } - object.history = null; - } - if (message.node_from != null && message.hasOwnProperty("node_from")) - object.node_from = options.bytes === String ? $util.base64.encode(message.node_from, 0, message.node_from.length) : options.bytes === Array ? Array.prototype.slice.call(message.node_from) : message.node_from; - if (message.node_to != null && message.hasOwnProperty("node_to")) - object.node_to = options.bytes === String ? $util.base64.encode(message.node_to, 0, message.node_to.length) : options.bytes === Array ? Array.prototype.slice.call(message.node_to) : message.node_to; - if (message.history != null && message.hasOwnProperty("history")) - object.history = $root.routerrpc.PairData.toObject(message.history, options); + if (options.defaults) + object.config = null; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.routerrpc.MissionControlConfig.toObject(message.config, options); return object; }; /** - * Converts this PairHistory to JSON. + * Converts this SetMissionControlConfigRequest to JSON. * @function toJSON - * @memberof routerrpc.PairHistory + * @memberof routerrpc.SetMissionControlConfigRequest * @instance * @returns {Object.} JSON object */ - PairHistory.prototype.toJSON = function toJSON() { + SetMissionControlConfigRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PairHistory + * Gets the default type url for SetMissionControlConfigRequest * @function getTypeUrl - * @memberof routerrpc.PairHistory + * @memberof routerrpc.SetMissionControlConfigRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PairHistory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SetMissionControlConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.PairHistory"; + return typeUrlPrefix + "/routerrpc.SetMissionControlConfigRequest"; }; - return PairHistory; + return SetMissionControlConfigRequest; })(); - routerrpc.PairData = (function() { + routerrpc.SetMissionControlConfigResponse = (function() { /** - * Properties of a PairData. + * Properties of a SetMissionControlConfigResponse. * @memberof routerrpc - * @interface IPairData - * @property {Long|null} [fail_time] PairData fail_time - * @property {Long|null} [fail_amt_sat] PairData fail_amt_sat - * @property {Long|null} [fail_amt_msat] PairData fail_amt_msat - * @property {Long|null} [success_time] PairData success_time - * @property {Long|null} [success_amt_sat] PairData success_amt_sat - * @property {Long|null} [success_amt_msat] PairData success_amt_msat + * @interface ISetMissionControlConfigResponse */ /** - * Constructs a new PairData. + * Constructs a new SetMissionControlConfigResponse. * @memberof routerrpc - * @classdesc Represents a PairData. - * @implements IPairData + * @classdesc Represents a SetMissionControlConfigResponse. + * @implements ISetMissionControlConfigResponse * @constructor - * @param {routerrpc.IPairData=} [properties] Properties to set + * @param {routerrpc.ISetMissionControlConfigResponse=} [properties] Properties to set */ - function PairData(properties) { + function SetMissionControlConfigResponse(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -88637,147 +91495,63 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * PairData fail_time. - * @member {Long} fail_time - * @memberof routerrpc.PairData - * @instance - */ - PairData.prototype.fail_time = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * PairData fail_amt_sat. - * @member {Long} fail_amt_sat - * @memberof routerrpc.PairData - * @instance - */ - PairData.prototype.fail_amt_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * PairData fail_amt_msat. - * @member {Long} fail_amt_msat - * @memberof routerrpc.PairData - * @instance - */ - PairData.prototype.fail_amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * PairData success_time. - * @member {Long} success_time - * @memberof routerrpc.PairData - * @instance - */ - PairData.prototype.success_time = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * PairData success_amt_sat. - * @member {Long} success_amt_sat - * @memberof routerrpc.PairData - * @instance - */ - PairData.prototype.success_amt_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * PairData success_amt_msat. - * @member {Long} success_amt_msat - * @memberof routerrpc.PairData - * @instance - */ - PairData.prototype.success_amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new PairData instance using the specified properties. + * Creates a new SetMissionControlConfigResponse instance using the specified properties. * @function create - * @memberof routerrpc.PairData + * @memberof routerrpc.SetMissionControlConfigResponse * @static - * @param {routerrpc.IPairData=} [properties] Properties to set - * @returns {routerrpc.PairData} PairData instance + * @param {routerrpc.ISetMissionControlConfigResponse=} [properties] Properties to set + * @returns {routerrpc.SetMissionControlConfigResponse} SetMissionControlConfigResponse instance */ - PairData.create = function create(properties) { - return new PairData(properties); + SetMissionControlConfigResponse.create = function create(properties) { + return new SetMissionControlConfigResponse(properties); }; /** - * Encodes the specified PairData message. Does not implicitly {@link routerrpc.PairData.verify|verify} messages. + * Encodes the specified SetMissionControlConfigResponse message. Does not implicitly {@link routerrpc.SetMissionControlConfigResponse.verify|verify} messages. * @function encode - * @memberof routerrpc.PairData + * @memberof routerrpc.SetMissionControlConfigResponse * @static - * @param {routerrpc.IPairData} message PairData message or plain object to encode + * @param {routerrpc.ISetMissionControlConfigResponse} message SetMissionControlConfigResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PairData.encode = function encode(message, writer) { + SetMissionControlConfigResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.fail_time != null && Object.hasOwnProperty.call(message, "fail_time")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.fail_time); - if (message.fail_amt_sat != null && Object.hasOwnProperty.call(message, "fail_amt_sat")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.fail_amt_sat); - if (message.fail_amt_msat != null && Object.hasOwnProperty.call(message, "fail_amt_msat")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.fail_amt_msat); - if (message.success_time != null && Object.hasOwnProperty.call(message, "success_time")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.success_time); - if (message.success_amt_sat != null && Object.hasOwnProperty.call(message, "success_amt_sat")) - writer.uint32(/* id 6, wireType 0 =*/48).int64(message.success_amt_sat); - if (message.success_amt_msat != null && Object.hasOwnProperty.call(message, "success_amt_msat")) - writer.uint32(/* id 7, wireType 0 =*/56).int64(message.success_amt_msat); return writer; }; /** - * Encodes the specified PairData message, length delimited. Does not implicitly {@link routerrpc.PairData.verify|verify} messages. + * Encodes the specified SetMissionControlConfigResponse message, length delimited. Does not implicitly {@link routerrpc.SetMissionControlConfigResponse.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.PairData + * @memberof routerrpc.SetMissionControlConfigResponse * @static - * @param {routerrpc.IPairData} message PairData message or plain object to encode + * @param {routerrpc.ISetMissionControlConfigResponse} message SetMissionControlConfigResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PairData.encodeDelimited = function encodeDelimited(message, writer) { + SetMissionControlConfigResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PairData message from the specified reader or buffer. + * Decodes a SetMissionControlConfigResponse message from the specified reader or buffer. * @function decode - * @memberof routerrpc.PairData + * @memberof routerrpc.SetMissionControlConfigResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.PairData} PairData + * @returns {routerrpc.SetMissionControlConfigResponse} SetMissionControlConfigResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PairData.decode = function decode(reader, length) { + SetMissionControlConfigResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.PairData(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SetMissionControlConfigResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.fail_time = reader.int64(); - break; - } - case 2: { - message.fail_amt_sat = reader.int64(); - break; - } - case 4: { - message.fail_amt_msat = reader.int64(); - break; - } - case 5: { - message.success_time = reader.int64(); - break; - } - case 6: { - message.success_amt_sat = reader.int64(); - break; - } - case 7: { - message.success_amt_msat = reader.int64(); - break; - } default: reader.skipType(tag & 7); break; @@ -88787,246 +91561,116 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a PairData message from the specified reader or buffer, length delimited. + * Decodes a SetMissionControlConfigResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.PairData + * @memberof routerrpc.SetMissionControlConfigResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.PairData} PairData + * @returns {routerrpc.SetMissionControlConfigResponse} SetMissionControlConfigResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PairData.decodeDelimited = function decodeDelimited(reader) { + SetMissionControlConfigResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PairData message. + * Verifies a SetMissionControlConfigResponse message. * @function verify - * @memberof routerrpc.PairData + * @memberof routerrpc.SetMissionControlConfigResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PairData.verify = function verify(message) { + SetMissionControlConfigResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.fail_time != null && message.hasOwnProperty("fail_time")) - if (!$util.isInteger(message.fail_time) && !(message.fail_time && $util.isInteger(message.fail_time.low) && $util.isInteger(message.fail_time.high))) - return "fail_time: integer|Long expected"; - if (message.fail_amt_sat != null && message.hasOwnProperty("fail_amt_sat")) - if (!$util.isInteger(message.fail_amt_sat) && !(message.fail_amt_sat && $util.isInteger(message.fail_amt_sat.low) && $util.isInteger(message.fail_amt_sat.high))) - return "fail_amt_sat: integer|Long expected"; - if (message.fail_amt_msat != null && message.hasOwnProperty("fail_amt_msat")) - if (!$util.isInteger(message.fail_amt_msat) && !(message.fail_amt_msat && $util.isInteger(message.fail_amt_msat.low) && $util.isInteger(message.fail_amt_msat.high))) - return "fail_amt_msat: integer|Long expected"; - if (message.success_time != null && message.hasOwnProperty("success_time")) - if (!$util.isInteger(message.success_time) && !(message.success_time && $util.isInteger(message.success_time.low) && $util.isInteger(message.success_time.high))) - return "success_time: integer|Long expected"; - if (message.success_amt_sat != null && message.hasOwnProperty("success_amt_sat")) - if (!$util.isInteger(message.success_amt_sat) && !(message.success_amt_sat && $util.isInteger(message.success_amt_sat.low) && $util.isInteger(message.success_amt_sat.high))) - return "success_amt_sat: integer|Long expected"; - if (message.success_amt_msat != null && message.hasOwnProperty("success_amt_msat")) - if (!$util.isInteger(message.success_amt_msat) && !(message.success_amt_msat && $util.isInteger(message.success_amt_msat.low) && $util.isInteger(message.success_amt_msat.high))) - return "success_amt_msat: integer|Long expected"; return null; }; /** - * Creates a PairData message from a plain object. Also converts values to their respective internal types. + * Creates a SetMissionControlConfigResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.PairData + * @memberof routerrpc.SetMissionControlConfigResponse * @static * @param {Object.} object Plain object - * @returns {routerrpc.PairData} PairData - */ - PairData.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.PairData) - return object; - let message = new $root.routerrpc.PairData(); - if (object.fail_time != null) - if ($util.Long) - (message.fail_time = $util.Long.fromValue(object.fail_time)).unsigned = false; - else if (typeof object.fail_time === "string") - message.fail_time = parseInt(object.fail_time, 10); - else if (typeof object.fail_time === "number") - message.fail_time = object.fail_time; - else if (typeof object.fail_time === "object") - message.fail_time = new $util.LongBits(object.fail_time.low >>> 0, object.fail_time.high >>> 0).toNumber(); - if (object.fail_amt_sat != null) - if ($util.Long) - (message.fail_amt_sat = $util.Long.fromValue(object.fail_amt_sat)).unsigned = false; - else if (typeof object.fail_amt_sat === "string") - message.fail_amt_sat = parseInt(object.fail_amt_sat, 10); - else if (typeof object.fail_amt_sat === "number") - message.fail_amt_sat = object.fail_amt_sat; - else if (typeof object.fail_amt_sat === "object") - message.fail_amt_sat = new $util.LongBits(object.fail_amt_sat.low >>> 0, object.fail_amt_sat.high >>> 0).toNumber(); - if (object.fail_amt_msat != null) - if ($util.Long) - (message.fail_amt_msat = $util.Long.fromValue(object.fail_amt_msat)).unsigned = false; - else if (typeof object.fail_amt_msat === "string") - message.fail_amt_msat = parseInt(object.fail_amt_msat, 10); - else if (typeof object.fail_amt_msat === "number") - message.fail_amt_msat = object.fail_amt_msat; - else if (typeof object.fail_amt_msat === "object") - message.fail_amt_msat = new $util.LongBits(object.fail_amt_msat.low >>> 0, object.fail_amt_msat.high >>> 0).toNumber(); - if (object.success_time != null) - if ($util.Long) - (message.success_time = $util.Long.fromValue(object.success_time)).unsigned = false; - else if (typeof object.success_time === "string") - message.success_time = parseInt(object.success_time, 10); - else if (typeof object.success_time === "number") - message.success_time = object.success_time; - else if (typeof object.success_time === "object") - message.success_time = new $util.LongBits(object.success_time.low >>> 0, object.success_time.high >>> 0).toNumber(); - if (object.success_amt_sat != null) - if ($util.Long) - (message.success_amt_sat = $util.Long.fromValue(object.success_amt_sat)).unsigned = false; - else if (typeof object.success_amt_sat === "string") - message.success_amt_sat = parseInt(object.success_amt_sat, 10); - else if (typeof object.success_amt_sat === "number") - message.success_amt_sat = object.success_amt_sat; - else if (typeof object.success_amt_sat === "object") - message.success_amt_sat = new $util.LongBits(object.success_amt_sat.low >>> 0, object.success_amt_sat.high >>> 0).toNumber(); - if (object.success_amt_msat != null) - if ($util.Long) - (message.success_amt_msat = $util.Long.fromValue(object.success_amt_msat)).unsigned = false; - else if (typeof object.success_amt_msat === "string") - message.success_amt_msat = parseInt(object.success_amt_msat, 10); - else if (typeof object.success_amt_msat === "number") - message.success_amt_msat = object.success_amt_msat; - else if (typeof object.success_amt_msat === "object") - message.success_amt_msat = new $util.LongBits(object.success_amt_msat.low >>> 0, object.success_amt_msat.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a PairData message. Also converts values to other types if specified. - * @function toObject - * @memberof routerrpc.PairData - * @static - * @param {routerrpc.PairData} message PairData - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PairData.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.fail_time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.fail_time = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.fail_amt_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.fail_amt_sat = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.fail_amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.fail_amt_msat = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.success_time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.success_time = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.success_amt_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.success_amt_sat = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.success_amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.success_amt_msat = options.longs === String ? "0" : 0; - } - if (message.fail_time != null && message.hasOwnProperty("fail_time")) - if (typeof message.fail_time === "number") - object.fail_time = options.longs === String ? String(message.fail_time) : message.fail_time; - else - object.fail_time = options.longs === String ? $util.Long.prototype.toString.call(message.fail_time) : options.longs === Number ? new $util.LongBits(message.fail_time.low >>> 0, message.fail_time.high >>> 0).toNumber() : message.fail_time; - if (message.fail_amt_sat != null && message.hasOwnProperty("fail_amt_sat")) - if (typeof message.fail_amt_sat === "number") - object.fail_amt_sat = options.longs === String ? String(message.fail_amt_sat) : message.fail_amt_sat; - else - object.fail_amt_sat = options.longs === String ? $util.Long.prototype.toString.call(message.fail_amt_sat) : options.longs === Number ? new $util.LongBits(message.fail_amt_sat.low >>> 0, message.fail_amt_sat.high >>> 0).toNumber() : message.fail_amt_sat; - if (message.fail_amt_msat != null && message.hasOwnProperty("fail_amt_msat")) - if (typeof message.fail_amt_msat === "number") - object.fail_amt_msat = options.longs === String ? String(message.fail_amt_msat) : message.fail_amt_msat; - else - object.fail_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.fail_amt_msat) : options.longs === Number ? new $util.LongBits(message.fail_amt_msat.low >>> 0, message.fail_amt_msat.high >>> 0).toNumber() : message.fail_amt_msat; - if (message.success_time != null && message.hasOwnProperty("success_time")) - if (typeof message.success_time === "number") - object.success_time = options.longs === String ? String(message.success_time) : message.success_time; - else - object.success_time = options.longs === String ? $util.Long.prototype.toString.call(message.success_time) : options.longs === Number ? new $util.LongBits(message.success_time.low >>> 0, message.success_time.high >>> 0).toNumber() : message.success_time; - if (message.success_amt_sat != null && message.hasOwnProperty("success_amt_sat")) - if (typeof message.success_amt_sat === "number") - object.success_amt_sat = options.longs === String ? String(message.success_amt_sat) : message.success_amt_sat; - else - object.success_amt_sat = options.longs === String ? $util.Long.prototype.toString.call(message.success_amt_sat) : options.longs === Number ? new $util.LongBits(message.success_amt_sat.low >>> 0, message.success_amt_sat.high >>> 0).toNumber() : message.success_amt_sat; - if (message.success_amt_msat != null && message.hasOwnProperty("success_amt_msat")) - if (typeof message.success_amt_msat === "number") - object.success_amt_msat = options.longs === String ? String(message.success_amt_msat) : message.success_amt_msat; - else - object.success_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.success_amt_msat) : options.longs === Number ? new $util.LongBits(message.success_amt_msat.low >>> 0, message.success_amt_msat.high >>> 0).toNumber() : message.success_amt_msat; - return object; + * @returns {routerrpc.SetMissionControlConfigResponse} SetMissionControlConfigResponse + */ + SetMissionControlConfigResponse.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.SetMissionControlConfigResponse) + return object; + return new $root.routerrpc.SetMissionControlConfigResponse(); }; /** - * Converts this PairData to JSON. + * Creates a plain object from a SetMissionControlConfigResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof routerrpc.SetMissionControlConfigResponse + * @static + * @param {routerrpc.SetMissionControlConfigResponse} message SetMissionControlConfigResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetMissionControlConfigResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this SetMissionControlConfigResponse to JSON. * @function toJSON - * @memberof routerrpc.PairData + * @memberof routerrpc.SetMissionControlConfigResponse * @instance * @returns {Object.} JSON object */ - PairData.prototype.toJSON = function toJSON() { + SetMissionControlConfigResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PairData + * Gets the default type url for SetMissionControlConfigResponse * @function getTypeUrl - * @memberof routerrpc.PairData + * @memberof routerrpc.SetMissionControlConfigResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PairData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SetMissionControlConfigResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.PairData"; + return typeUrlPrefix + "/routerrpc.SetMissionControlConfigResponse"; }; - return PairData; + return SetMissionControlConfigResponse; })(); - routerrpc.GetMissionControlConfigRequest = (function() { + routerrpc.MissionControlConfig = (function() { /** - * Properties of a GetMissionControlConfigRequest. + * Properties of a MissionControlConfig. * @memberof routerrpc - * @interface IGetMissionControlConfigRequest + * @interface IMissionControlConfig + * @property {Long|null} [half_life_seconds] MissionControlConfig half_life_seconds + * @property {number|null} [hop_probability] MissionControlConfig hop_probability + * @property {number|null} [weight] MissionControlConfig weight + * @property {number|null} [maximum_payment_results] MissionControlConfig maximum_payment_results + * @property {Long|null} [minimum_failure_relax_interval] MissionControlConfig minimum_failure_relax_interval + * @property {routerrpc.MissionControlConfig.ProbabilityModel|null} [model] MissionControlConfig model + * @property {routerrpc.IAprioriParameters|null} [apriori] MissionControlConfig apriori + * @property {routerrpc.IBimodalParameters|null} [bimodal] MissionControlConfig bimodal */ /** - * Constructs a new GetMissionControlConfigRequest. + * Constructs a new MissionControlConfig. * @memberof routerrpc - * @classdesc Represents a GetMissionControlConfigRequest. - * @implements IGetMissionControlConfigRequest + * @classdesc Represents a MissionControlConfig. + * @implements IMissionControlConfig * @constructor - * @param {routerrpc.IGetMissionControlConfigRequest=} [properties] Properties to set + * @param {routerrpc.IMissionControlConfig=} [properties] Properties to set */ - function GetMissionControlConfigRequest(properties) { + function MissionControlConfig(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -89034,63 +91678,189 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * Creates a new GetMissionControlConfigRequest instance using the specified properties. + * MissionControlConfig half_life_seconds. + * @member {Long} half_life_seconds + * @memberof routerrpc.MissionControlConfig + * @instance + */ + MissionControlConfig.prototype.half_life_seconds = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * MissionControlConfig hop_probability. + * @member {number} hop_probability + * @memberof routerrpc.MissionControlConfig + * @instance + */ + MissionControlConfig.prototype.hop_probability = 0; + + /** + * MissionControlConfig weight. + * @member {number} weight + * @memberof routerrpc.MissionControlConfig + * @instance + */ + MissionControlConfig.prototype.weight = 0; + + /** + * MissionControlConfig maximum_payment_results. + * @member {number} maximum_payment_results + * @memberof routerrpc.MissionControlConfig + * @instance + */ + MissionControlConfig.prototype.maximum_payment_results = 0; + + /** + * MissionControlConfig minimum_failure_relax_interval. + * @member {Long} minimum_failure_relax_interval + * @memberof routerrpc.MissionControlConfig + * @instance + */ + MissionControlConfig.prototype.minimum_failure_relax_interval = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * MissionControlConfig model. + * @member {routerrpc.MissionControlConfig.ProbabilityModel} model + * @memberof routerrpc.MissionControlConfig + * @instance + */ + MissionControlConfig.prototype.model = 0; + + /** + * MissionControlConfig apriori. + * @member {routerrpc.IAprioriParameters|null|undefined} apriori + * @memberof routerrpc.MissionControlConfig + * @instance + */ + MissionControlConfig.prototype.apriori = null; + + /** + * MissionControlConfig bimodal. + * @member {routerrpc.IBimodalParameters|null|undefined} bimodal + * @memberof routerrpc.MissionControlConfig + * @instance + */ + MissionControlConfig.prototype.bimodal = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * MissionControlConfig EstimatorConfig. + * @member {"apriori"|"bimodal"|undefined} EstimatorConfig + * @memberof routerrpc.MissionControlConfig + * @instance + */ + Object.defineProperty(MissionControlConfig.prototype, "EstimatorConfig", { + get: $util.oneOfGetter($oneOfFields = ["apriori", "bimodal"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MissionControlConfig instance using the specified properties. * @function create - * @memberof routerrpc.GetMissionControlConfigRequest + * @memberof routerrpc.MissionControlConfig * @static - * @param {routerrpc.IGetMissionControlConfigRequest=} [properties] Properties to set - * @returns {routerrpc.GetMissionControlConfigRequest} GetMissionControlConfigRequest instance + * @param {routerrpc.IMissionControlConfig=} [properties] Properties to set + * @returns {routerrpc.MissionControlConfig} MissionControlConfig instance */ - GetMissionControlConfigRequest.create = function create(properties) { - return new GetMissionControlConfigRequest(properties); + MissionControlConfig.create = function create(properties) { + return new MissionControlConfig(properties); }; /** - * Encodes the specified GetMissionControlConfigRequest message. Does not implicitly {@link routerrpc.GetMissionControlConfigRequest.verify|verify} messages. + * Encodes the specified MissionControlConfig message. Does not implicitly {@link routerrpc.MissionControlConfig.verify|verify} messages. * @function encode - * @memberof routerrpc.GetMissionControlConfigRequest + * @memberof routerrpc.MissionControlConfig * @static - * @param {routerrpc.IGetMissionControlConfigRequest} message GetMissionControlConfigRequest message or plain object to encode + * @param {routerrpc.IMissionControlConfig} message MissionControlConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetMissionControlConfigRequest.encode = function encode(message, writer) { + MissionControlConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.half_life_seconds != null && Object.hasOwnProperty.call(message, "half_life_seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.half_life_seconds); + if (message.hop_probability != null && Object.hasOwnProperty.call(message, "hop_probability")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.hop_probability); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.weight); + if (message.maximum_payment_results != null && Object.hasOwnProperty.call(message, "maximum_payment_results")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.maximum_payment_results); + if (message.minimum_failure_relax_interval != null && Object.hasOwnProperty.call(message, "minimum_failure_relax_interval")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.minimum_failure_relax_interval); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.model); + if (message.apriori != null && Object.hasOwnProperty.call(message, "apriori")) + $root.routerrpc.AprioriParameters.encode(message.apriori, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.bimodal != null && Object.hasOwnProperty.call(message, "bimodal")) + $root.routerrpc.BimodalParameters.encode(message.bimodal, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetMissionControlConfigRequest message, length delimited. Does not implicitly {@link routerrpc.GetMissionControlConfigRequest.verify|verify} messages. + * Encodes the specified MissionControlConfig message, length delimited. Does not implicitly {@link routerrpc.MissionControlConfig.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.GetMissionControlConfigRequest + * @memberof routerrpc.MissionControlConfig * @static - * @param {routerrpc.IGetMissionControlConfigRequest} message GetMissionControlConfigRequest message or plain object to encode + * @param {routerrpc.IMissionControlConfig} message MissionControlConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetMissionControlConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + MissionControlConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetMissionControlConfigRequest message from the specified reader or buffer. + * Decodes a MissionControlConfig message from the specified reader or buffer. * @function decode - * @memberof routerrpc.GetMissionControlConfigRequest + * @memberof routerrpc.MissionControlConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.GetMissionControlConfigRequest} GetMissionControlConfigRequest + * @returns {routerrpc.MissionControlConfig} MissionControlConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetMissionControlConfigRequest.decode = function decode(reader, length) { + MissionControlConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.GetMissionControlConfigRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.MissionControlConfig(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.half_life_seconds = reader.uint64(); + break; + } + case 2: { + message.hop_probability = reader.float(); + break; + } + case 3: { + message.weight = reader.float(); + break; + } + case 4: { + message.maximum_payment_results = reader.uint32(); + break; + } + case 5: { + message.minimum_failure_relax_interval = reader.uint64(); + break; + } + case 6: { + message.model = reader.int32(); + break; + } + case 7: { + message.apriori = $root.routerrpc.AprioriParameters.decode(reader, reader.uint32()); + break; + } + case 8: { + message.bimodal = $root.routerrpc.BimodalParameters.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -89100,109 +91870,265 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a GetMissionControlConfigRequest message from the specified reader or buffer, length delimited. + * Decodes a MissionControlConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.GetMissionControlConfigRequest + * @memberof routerrpc.MissionControlConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.GetMissionControlConfigRequest} GetMissionControlConfigRequest + * @returns {routerrpc.MissionControlConfig} MissionControlConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetMissionControlConfigRequest.decodeDelimited = function decodeDelimited(reader) { + MissionControlConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetMissionControlConfigRequest message. + * Verifies a MissionControlConfig message. * @function verify - * @memberof routerrpc.GetMissionControlConfigRequest + * @memberof routerrpc.MissionControlConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetMissionControlConfigRequest.verify = function verify(message) { + MissionControlConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + let properties = {}; + if (message.half_life_seconds != null && message.hasOwnProperty("half_life_seconds")) + if (!$util.isInteger(message.half_life_seconds) && !(message.half_life_seconds && $util.isInteger(message.half_life_seconds.low) && $util.isInteger(message.half_life_seconds.high))) + return "half_life_seconds: integer|Long expected"; + if (message.hop_probability != null && message.hasOwnProperty("hop_probability")) + if (typeof message.hop_probability !== "number") + return "hop_probability: number expected"; + if (message.weight != null && message.hasOwnProperty("weight")) + if (typeof message.weight !== "number") + return "weight: number expected"; + if (message.maximum_payment_results != null && message.hasOwnProperty("maximum_payment_results")) + if (!$util.isInteger(message.maximum_payment_results)) + return "maximum_payment_results: integer expected"; + if (message.minimum_failure_relax_interval != null && message.hasOwnProperty("minimum_failure_relax_interval")) + if (!$util.isInteger(message.minimum_failure_relax_interval) && !(message.minimum_failure_relax_interval && $util.isInteger(message.minimum_failure_relax_interval.low) && $util.isInteger(message.minimum_failure_relax_interval.high))) + return "minimum_failure_relax_interval: integer|Long expected"; + if (message.model != null && message.hasOwnProperty("model")) + switch (message.model) { + default: + return "model: enum value expected"; + case 0: + case 1: + break; + } + if (message.apriori != null && message.hasOwnProperty("apriori")) { + properties.EstimatorConfig = 1; + { + let error = $root.routerrpc.AprioriParameters.verify(message.apriori); + if (error) + return "apriori." + error; + } + } + if (message.bimodal != null && message.hasOwnProperty("bimodal")) { + if (properties.EstimatorConfig === 1) + return "EstimatorConfig: multiple values"; + properties.EstimatorConfig = 1; + { + let error = $root.routerrpc.BimodalParameters.verify(message.bimodal); + if (error) + return "bimodal." + error; + } + } return null; }; /** - * Creates a GetMissionControlConfigRequest message from a plain object. Also converts values to their respective internal types. + * Creates a MissionControlConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.GetMissionControlConfigRequest + * @memberof routerrpc.MissionControlConfig * @static * @param {Object.} object Plain object - * @returns {routerrpc.GetMissionControlConfigRequest} GetMissionControlConfigRequest + * @returns {routerrpc.MissionControlConfig} MissionControlConfig */ - GetMissionControlConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.GetMissionControlConfigRequest) + MissionControlConfig.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.MissionControlConfig) return object; - return new $root.routerrpc.GetMissionControlConfigRequest(); + let message = new $root.routerrpc.MissionControlConfig(); + if (object.half_life_seconds != null) + if ($util.Long) + (message.half_life_seconds = $util.Long.fromValue(object.half_life_seconds)).unsigned = true; + else if (typeof object.half_life_seconds === "string") + message.half_life_seconds = parseInt(object.half_life_seconds, 10); + else if (typeof object.half_life_seconds === "number") + message.half_life_seconds = object.half_life_seconds; + else if (typeof object.half_life_seconds === "object") + message.half_life_seconds = new $util.LongBits(object.half_life_seconds.low >>> 0, object.half_life_seconds.high >>> 0).toNumber(true); + if (object.hop_probability != null) + message.hop_probability = Number(object.hop_probability); + if (object.weight != null) + message.weight = Number(object.weight); + if (object.maximum_payment_results != null) + message.maximum_payment_results = object.maximum_payment_results >>> 0; + if (object.minimum_failure_relax_interval != null) + if ($util.Long) + (message.minimum_failure_relax_interval = $util.Long.fromValue(object.minimum_failure_relax_interval)).unsigned = true; + else if (typeof object.minimum_failure_relax_interval === "string") + message.minimum_failure_relax_interval = parseInt(object.minimum_failure_relax_interval, 10); + else if (typeof object.minimum_failure_relax_interval === "number") + message.minimum_failure_relax_interval = object.minimum_failure_relax_interval; + else if (typeof object.minimum_failure_relax_interval === "object") + message.minimum_failure_relax_interval = new $util.LongBits(object.minimum_failure_relax_interval.low >>> 0, object.minimum_failure_relax_interval.high >>> 0).toNumber(true); + switch (object.model) { + default: + if (typeof object.model === "number") { + message.model = object.model; + break; + } + break; + case "APRIORI": + case 0: + message.model = 0; + break; + case "BIMODAL": + case 1: + message.model = 1; + break; + } + if (object.apriori != null) { + if (typeof object.apriori !== "object") + throw TypeError(".routerrpc.MissionControlConfig.apriori: object expected"); + message.apriori = $root.routerrpc.AprioriParameters.fromObject(object.apriori); + } + if (object.bimodal != null) { + if (typeof object.bimodal !== "object") + throw TypeError(".routerrpc.MissionControlConfig.bimodal: object expected"); + message.bimodal = $root.routerrpc.BimodalParameters.fromObject(object.bimodal); + } + return message; }; /** - * Creates a plain object from a GetMissionControlConfigRequest message. Also converts values to other types if specified. + * Creates a plain object from a MissionControlConfig message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.GetMissionControlConfigRequest + * @memberof routerrpc.MissionControlConfig * @static - * @param {routerrpc.GetMissionControlConfigRequest} message GetMissionControlConfigRequest + * @param {routerrpc.MissionControlConfig} message MissionControlConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetMissionControlConfigRequest.toObject = function toObject() { - return {}; + MissionControlConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.half_life_seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.half_life_seconds = options.longs === String ? "0" : 0; + object.hop_probability = 0; + object.weight = 0; + object.maximum_payment_results = 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.minimum_failure_relax_interval = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.minimum_failure_relax_interval = options.longs === String ? "0" : 0; + object.model = options.enums === String ? "APRIORI" : 0; + } + if (message.half_life_seconds != null && message.hasOwnProperty("half_life_seconds")) + if (typeof message.half_life_seconds === "number") + object.half_life_seconds = options.longs === String ? String(message.half_life_seconds) : message.half_life_seconds; + else + object.half_life_seconds = options.longs === String ? $util.Long.prototype.toString.call(message.half_life_seconds) : options.longs === Number ? new $util.LongBits(message.half_life_seconds.low >>> 0, message.half_life_seconds.high >>> 0).toNumber(true) : message.half_life_seconds; + if (message.hop_probability != null && message.hasOwnProperty("hop_probability")) + object.hop_probability = options.json && !isFinite(message.hop_probability) ? String(message.hop_probability) : message.hop_probability; + if (message.weight != null && message.hasOwnProperty("weight")) + object.weight = options.json && !isFinite(message.weight) ? String(message.weight) : message.weight; + if (message.maximum_payment_results != null && message.hasOwnProperty("maximum_payment_results")) + object.maximum_payment_results = message.maximum_payment_results; + if (message.minimum_failure_relax_interval != null && message.hasOwnProperty("minimum_failure_relax_interval")) + if (typeof message.minimum_failure_relax_interval === "number") + object.minimum_failure_relax_interval = options.longs === String ? String(message.minimum_failure_relax_interval) : message.minimum_failure_relax_interval; + else + object.minimum_failure_relax_interval = options.longs === String ? $util.Long.prototype.toString.call(message.minimum_failure_relax_interval) : options.longs === Number ? new $util.LongBits(message.minimum_failure_relax_interval.low >>> 0, message.minimum_failure_relax_interval.high >>> 0).toNumber(true) : message.minimum_failure_relax_interval; + if (message.model != null && message.hasOwnProperty("model")) + object.model = options.enums === String ? $root.routerrpc.MissionControlConfig.ProbabilityModel[message.model] === undefined ? message.model : $root.routerrpc.MissionControlConfig.ProbabilityModel[message.model] : message.model; + if (message.apriori != null && message.hasOwnProperty("apriori")) { + object.apriori = $root.routerrpc.AprioriParameters.toObject(message.apriori, options); + if (options.oneofs) + object.EstimatorConfig = "apriori"; + } + if (message.bimodal != null && message.hasOwnProperty("bimodal")) { + object.bimodal = $root.routerrpc.BimodalParameters.toObject(message.bimodal, options); + if (options.oneofs) + object.EstimatorConfig = "bimodal"; + } + return object; }; /** - * Converts this GetMissionControlConfigRequest to JSON. + * Converts this MissionControlConfig to JSON. * @function toJSON - * @memberof routerrpc.GetMissionControlConfigRequest + * @memberof routerrpc.MissionControlConfig * @instance * @returns {Object.} JSON object */ - GetMissionControlConfigRequest.prototype.toJSON = function toJSON() { + MissionControlConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetMissionControlConfigRequest + * Gets the default type url for MissionControlConfig * @function getTypeUrl - * @memberof routerrpc.GetMissionControlConfigRequest + * @memberof routerrpc.MissionControlConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetMissionControlConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MissionControlConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.GetMissionControlConfigRequest"; + return typeUrlPrefix + "/routerrpc.MissionControlConfig"; }; - return GetMissionControlConfigRequest; + /** + * ProbabilityModel enum. + * @name routerrpc.MissionControlConfig.ProbabilityModel + * @enum {number} + * @property {number} APRIORI=0 APRIORI value + * @property {number} BIMODAL=1 BIMODAL value + */ + MissionControlConfig.ProbabilityModel = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "APRIORI"] = 0; + values[valuesById[1] = "BIMODAL"] = 1; + return values; + })(); + + return MissionControlConfig; })(); - routerrpc.GetMissionControlConfigResponse = (function() { + routerrpc.BimodalParameters = (function() { /** - * Properties of a GetMissionControlConfigResponse. + * Properties of a BimodalParameters. * @memberof routerrpc - * @interface IGetMissionControlConfigResponse - * @property {routerrpc.IMissionControlConfig|null} [config] GetMissionControlConfigResponse config + * @interface IBimodalParameters + * @property {number|null} [node_weight] BimodalParameters node_weight + * @property {Long|null} [scale_msat] BimodalParameters scale_msat + * @property {Long|null} [decay_time] BimodalParameters decay_time */ /** - * Constructs a new GetMissionControlConfigResponse. + * Constructs a new BimodalParameters. * @memberof routerrpc - * @classdesc Represents a GetMissionControlConfigResponse. - * @implements IGetMissionControlConfigResponse + * @classdesc Represents a BimodalParameters. + * @implements IBimodalParameters * @constructor - * @param {routerrpc.IGetMissionControlConfigResponse=} [properties] Properties to set + * @param {routerrpc.IBimodalParameters=} [properties] Properties to set */ - function GetMissionControlConfigResponse(properties) { + function BimodalParameters(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -89210,75 +92136,103 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * GetMissionControlConfigResponse config. - * @member {routerrpc.IMissionControlConfig|null|undefined} config - * @memberof routerrpc.GetMissionControlConfigResponse + * BimodalParameters node_weight. + * @member {number} node_weight + * @memberof routerrpc.BimodalParameters * @instance */ - GetMissionControlConfigResponse.prototype.config = null; + BimodalParameters.prototype.node_weight = 0; /** - * Creates a new GetMissionControlConfigResponse instance using the specified properties. + * BimodalParameters scale_msat. + * @member {Long} scale_msat + * @memberof routerrpc.BimodalParameters + * @instance + */ + BimodalParameters.prototype.scale_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * BimodalParameters decay_time. + * @member {Long} decay_time + * @memberof routerrpc.BimodalParameters + * @instance + */ + BimodalParameters.prototype.decay_time = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new BimodalParameters instance using the specified properties. * @function create - * @memberof routerrpc.GetMissionControlConfigResponse + * @memberof routerrpc.BimodalParameters * @static - * @param {routerrpc.IGetMissionControlConfigResponse=} [properties] Properties to set - * @returns {routerrpc.GetMissionControlConfigResponse} GetMissionControlConfigResponse instance + * @param {routerrpc.IBimodalParameters=} [properties] Properties to set + * @returns {routerrpc.BimodalParameters} BimodalParameters instance */ - GetMissionControlConfigResponse.create = function create(properties) { - return new GetMissionControlConfigResponse(properties); + BimodalParameters.create = function create(properties) { + return new BimodalParameters(properties); }; /** - * Encodes the specified GetMissionControlConfigResponse message. Does not implicitly {@link routerrpc.GetMissionControlConfigResponse.verify|verify} messages. + * Encodes the specified BimodalParameters message. Does not implicitly {@link routerrpc.BimodalParameters.verify|verify} messages. * @function encode - * @memberof routerrpc.GetMissionControlConfigResponse + * @memberof routerrpc.BimodalParameters * @static - * @param {routerrpc.IGetMissionControlConfigResponse} message GetMissionControlConfigResponse message or plain object to encode + * @param {routerrpc.IBimodalParameters} message BimodalParameters message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetMissionControlConfigResponse.encode = function encode(message, writer) { + BimodalParameters.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - $root.routerrpc.MissionControlConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.node_weight != null && Object.hasOwnProperty.call(message, "node_weight")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.node_weight); + if (message.scale_msat != null && Object.hasOwnProperty.call(message, "scale_msat")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.scale_msat); + if (message.decay_time != null && Object.hasOwnProperty.call(message, "decay_time")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.decay_time); return writer; }; /** - * Encodes the specified GetMissionControlConfigResponse message, length delimited. Does not implicitly {@link routerrpc.GetMissionControlConfigResponse.verify|verify} messages. + * Encodes the specified BimodalParameters message, length delimited. Does not implicitly {@link routerrpc.BimodalParameters.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.GetMissionControlConfigResponse + * @memberof routerrpc.BimodalParameters * @static - * @param {routerrpc.IGetMissionControlConfigResponse} message GetMissionControlConfigResponse message or plain object to encode + * @param {routerrpc.IBimodalParameters} message BimodalParameters message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetMissionControlConfigResponse.encodeDelimited = function encodeDelimited(message, writer) { + BimodalParameters.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetMissionControlConfigResponse message from the specified reader or buffer. + * Decodes a BimodalParameters message from the specified reader or buffer. * @function decode - * @memberof routerrpc.GetMissionControlConfigResponse + * @memberof routerrpc.BimodalParameters * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.GetMissionControlConfigResponse} GetMissionControlConfigResponse + * @returns {routerrpc.BimodalParameters} BimodalParameters * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetMissionControlConfigResponse.decode = function decode(reader, length) { + BimodalParameters.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.GetMissionControlConfigResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.BimodalParameters(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.config = $root.routerrpc.MissionControlConfig.decode(reader, reader.uint32()); + message.node_weight = reader.double(); + break; + } + case 2: { + message.scale_msat = reader.uint64(); + break; + } + case 3: { + message.decay_time = reader.uint64(); break; } default: @@ -89290,127 +92244,170 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a GetMissionControlConfigResponse message from the specified reader or buffer, length delimited. + * Decodes a BimodalParameters message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.GetMissionControlConfigResponse + * @memberof routerrpc.BimodalParameters * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.GetMissionControlConfigResponse} GetMissionControlConfigResponse + * @returns {routerrpc.BimodalParameters} BimodalParameters * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetMissionControlConfigResponse.decodeDelimited = function decodeDelimited(reader) { + BimodalParameters.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetMissionControlConfigResponse message. + * Verifies a BimodalParameters message. * @function verify - * @memberof routerrpc.GetMissionControlConfigResponse + * @memberof routerrpc.BimodalParameters * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetMissionControlConfigResponse.verify = function verify(message) { + BimodalParameters.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.config != null && message.hasOwnProperty("config")) { - let error = $root.routerrpc.MissionControlConfig.verify(message.config); - if (error) - return "config." + error; - } + if (message.node_weight != null && message.hasOwnProperty("node_weight")) + if (typeof message.node_weight !== "number") + return "node_weight: number expected"; + if (message.scale_msat != null && message.hasOwnProperty("scale_msat")) + if (!$util.isInteger(message.scale_msat) && !(message.scale_msat && $util.isInteger(message.scale_msat.low) && $util.isInteger(message.scale_msat.high))) + return "scale_msat: integer|Long expected"; + if (message.decay_time != null && message.hasOwnProperty("decay_time")) + if (!$util.isInteger(message.decay_time) && !(message.decay_time && $util.isInteger(message.decay_time.low) && $util.isInteger(message.decay_time.high))) + return "decay_time: integer|Long expected"; return null; }; /** - * Creates a GetMissionControlConfigResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BimodalParameters message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.GetMissionControlConfigResponse + * @memberof routerrpc.BimodalParameters * @static * @param {Object.} object Plain object - * @returns {routerrpc.GetMissionControlConfigResponse} GetMissionControlConfigResponse + * @returns {routerrpc.BimodalParameters} BimodalParameters */ - GetMissionControlConfigResponse.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.GetMissionControlConfigResponse) + BimodalParameters.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.BimodalParameters) return object; - let message = new $root.routerrpc.GetMissionControlConfigResponse(); - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".routerrpc.GetMissionControlConfigResponse.config: object expected"); - message.config = $root.routerrpc.MissionControlConfig.fromObject(object.config); - } + let message = new $root.routerrpc.BimodalParameters(); + if (object.node_weight != null) + message.node_weight = Number(object.node_weight); + if (object.scale_msat != null) + if ($util.Long) + (message.scale_msat = $util.Long.fromValue(object.scale_msat)).unsigned = true; + else if (typeof object.scale_msat === "string") + message.scale_msat = parseInt(object.scale_msat, 10); + else if (typeof object.scale_msat === "number") + message.scale_msat = object.scale_msat; + else if (typeof object.scale_msat === "object") + message.scale_msat = new $util.LongBits(object.scale_msat.low >>> 0, object.scale_msat.high >>> 0).toNumber(true); + if (object.decay_time != null) + if ($util.Long) + (message.decay_time = $util.Long.fromValue(object.decay_time)).unsigned = true; + else if (typeof object.decay_time === "string") + message.decay_time = parseInt(object.decay_time, 10); + else if (typeof object.decay_time === "number") + message.decay_time = object.decay_time; + else if (typeof object.decay_time === "object") + message.decay_time = new $util.LongBits(object.decay_time.low >>> 0, object.decay_time.high >>> 0).toNumber(true); return message; }; /** - * Creates a plain object from a GetMissionControlConfigResponse message. Also converts values to other types if specified. + * Creates a plain object from a BimodalParameters message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.GetMissionControlConfigResponse + * @memberof routerrpc.BimodalParameters * @static - * @param {routerrpc.GetMissionControlConfigResponse} message GetMissionControlConfigResponse + * @param {routerrpc.BimodalParameters} message BimodalParameters * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetMissionControlConfigResponse.toObject = function toObject(message, options) { + BimodalParameters.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.defaults) - object.config = null; - if (message.config != null && message.hasOwnProperty("config")) - object.config = $root.routerrpc.MissionControlConfig.toObject(message.config, options); + if (options.defaults) { + object.node_weight = 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.scale_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.scale_msat = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.decay_time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.decay_time = options.longs === String ? "0" : 0; + } + if (message.node_weight != null && message.hasOwnProperty("node_weight")) + object.node_weight = options.json && !isFinite(message.node_weight) ? String(message.node_weight) : message.node_weight; + if (message.scale_msat != null && message.hasOwnProperty("scale_msat")) + if (typeof message.scale_msat === "number") + object.scale_msat = options.longs === String ? String(message.scale_msat) : message.scale_msat; + else + object.scale_msat = options.longs === String ? $util.Long.prototype.toString.call(message.scale_msat) : options.longs === Number ? new $util.LongBits(message.scale_msat.low >>> 0, message.scale_msat.high >>> 0).toNumber(true) : message.scale_msat; + if (message.decay_time != null && message.hasOwnProperty("decay_time")) + if (typeof message.decay_time === "number") + object.decay_time = options.longs === String ? String(message.decay_time) : message.decay_time; + else + object.decay_time = options.longs === String ? $util.Long.prototype.toString.call(message.decay_time) : options.longs === Number ? new $util.LongBits(message.decay_time.low >>> 0, message.decay_time.high >>> 0).toNumber(true) : message.decay_time; return object; }; /** - * Converts this GetMissionControlConfigResponse to JSON. + * Converts this BimodalParameters to JSON. * @function toJSON - * @memberof routerrpc.GetMissionControlConfigResponse + * @memberof routerrpc.BimodalParameters * @instance * @returns {Object.} JSON object */ - GetMissionControlConfigResponse.prototype.toJSON = function toJSON() { + BimodalParameters.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetMissionControlConfigResponse + * Gets the default type url for BimodalParameters * @function getTypeUrl - * @memberof routerrpc.GetMissionControlConfigResponse + * @memberof routerrpc.BimodalParameters * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetMissionControlConfigResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BimodalParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.GetMissionControlConfigResponse"; + return typeUrlPrefix + "/routerrpc.BimodalParameters"; }; - return GetMissionControlConfigResponse; + return BimodalParameters; })(); - routerrpc.SetMissionControlConfigRequest = (function() { + routerrpc.AprioriParameters = (function() { /** - * Properties of a SetMissionControlConfigRequest. + * Properties of an AprioriParameters. * @memberof routerrpc - * @interface ISetMissionControlConfigRequest - * @property {routerrpc.IMissionControlConfig|null} [config] SetMissionControlConfigRequest config + * @interface IAprioriParameters + * @property {Long|null} [half_life_seconds] AprioriParameters half_life_seconds + * @property {number|null} [hop_probability] AprioriParameters hop_probability + * @property {number|null} [weight] AprioriParameters weight + * @property {number|null} [capacity_fraction] AprioriParameters capacity_fraction */ /** - * Constructs a new SetMissionControlConfigRequest. + * Constructs a new AprioriParameters. * @memberof routerrpc - * @classdesc Represents a SetMissionControlConfigRequest. - * @implements ISetMissionControlConfigRequest + * @classdesc Represents an AprioriParameters. + * @implements IAprioriParameters * @constructor - * @param {routerrpc.ISetMissionControlConfigRequest=} [properties] Properties to set + * @param {routerrpc.IAprioriParameters=} [properties] Properties to set */ - function SetMissionControlConfigRequest(properties) { + function AprioriParameters(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -89418,75 +92415,117 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * SetMissionControlConfigRequest config. - * @member {routerrpc.IMissionControlConfig|null|undefined} config - * @memberof routerrpc.SetMissionControlConfigRequest + * AprioriParameters half_life_seconds. + * @member {Long} half_life_seconds + * @memberof routerrpc.AprioriParameters * @instance */ - SetMissionControlConfigRequest.prototype.config = null; + AprioriParameters.prototype.half_life_seconds = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Creates a new SetMissionControlConfigRequest instance using the specified properties. + * AprioriParameters hop_probability. + * @member {number} hop_probability + * @memberof routerrpc.AprioriParameters + * @instance + */ + AprioriParameters.prototype.hop_probability = 0; + + /** + * AprioriParameters weight. + * @member {number} weight + * @memberof routerrpc.AprioriParameters + * @instance + */ + AprioriParameters.prototype.weight = 0; + + /** + * AprioriParameters capacity_fraction. + * @member {number} capacity_fraction + * @memberof routerrpc.AprioriParameters + * @instance + */ + AprioriParameters.prototype.capacity_fraction = 0; + + /** + * Creates a new AprioriParameters instance using the specified properties. * @function create - * @memberof routerrpc.SetMissionControlConfigRequest + * @memberof routerrpc.AprioriParameters * @static - * @param {routerrpc.ISetMissionControlConfigRequest=} [properties] Properties to set - * @returns {routerrpc.SetMissionControlConfigRequest} SetMissionControlConfigRequest instance + * @param {routerrpc.IAprioriParameters=} [properties] Properties to set + * @returns {routerrpc.AprioriParameters} AprioriParameters instance */ - SetMissionControlConfigRequest.create = function create(properties) { - return new SetMissionControlConfigRequest(properties); + AprioriParameters.create = function create(properties) { + return new AprioriParameters(properties); }; /** - * Encodes the specified SetMissionControlConfigRequest message. Does not implicitly {@link routerrpc.SetMissionControlConfigRequest.verify|verify} messages. + * Encodes the specified AprioriParameters message. Does not implicitly {@link routerrpc.AprioriParameters.verify|verify} messages. * @function encode - * @memberof routerrpc.SetMissionControlConfigRequest + * @memberof routerrpc.AprioriParameters * @static - * @param {routerrpc.ISetMissionControlConfigRequest} message SetMissionControlConfigRequest message or plain object to encode + * @param {routerrpc.IAprioriParameters} message AprioriParameters message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetMissionControlConfigRequest.encode = function encode(message, writer) { + AprioriParameters.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - $root.routerrpc.MissionControlConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.half_life_seconds != null && Object.hasOwnProperty.call(message, "half_life_seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.half_life_seconds); + if (message.hop_probability != null && Object.hasOwnProperty.call(message, "hop_probability")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.hop_probability); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.weight); + if (message.capacity_fraction != null && Object.hasOwnProperty.call(message, "capacity_fraction")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.capacity_fraction); return writer; }; /** - * Encodes the specified SetMissionControlConfigRequest message, length delimited. Does not implicitly {@link routerrpc.SetMissionControlConfigRequest.verify|verify} messages. + * Encodes the specified AprioriParameters message, length delimited. Does not implicitly {@link routerrpc.AprioriParameters.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.SetMissionControlConfigRequest + * @memberof routerrpc.AprioriParameters * @static - * @param {routerrpc.ISetMissionControlConfigRequest} message SetMissionControlConfigRequest message or plain object to encode + * @param {routerrpc.IAprioriParameters} message AprioriParameters message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetMissionControlConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + AprioriParameters.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetMissionControlConfigRequest message from the specified reader or buffer. + * Decodes an AprioriParameters message from the specified reader or buffer. * @function decode - * @memberof routerrpc.SetMissionControlConfigRequest + * @memberof routerrpc.AprioriParameters * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.SetMissionControlConfigRequest} SetMissionControlConfigRequest + * @returns {routerrpc.AprioriParameters} AprioriParameters * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetMissionControlConfigRequest.decode = function decode(reader, length) { + AprioriParameters.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SetMissionControlConfigRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.AprioriParameters(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.config = $root.routerrpc.MissionControlConfig.decode(reader, reader.uint32()); + message.half_life_seconds = reader.uint64(); + break; + } + case 2: { + message.hop_probability = reader.double(); + break; + } + case 3: { + message.weight = reader.double(); + break; + } + case 4: { + message.capacity_fraction = reader.double(); break; } default: @@ -89498,126 +92537,163 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a SetMissionControlConfigRequest message from the specified reader or buffer, length delimited. + * Decodes an AprioriParameters message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.SetMissionControlConfigRequest + * @memberof routerrpc.AprioriParameters * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.SetMissionControlConfigRequest} SetMissionControlConfigRequest + * @returns {routerrpc.AprioriParameters} AprioriParameters * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetMissionControlConfigRequest.decodeDelimited = function decodeDelimited(reader) { + AprioriParameters.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetMissionControlConfigRequest message. + * Verifies an AprioriParameters message. * @function verify - * @memberof routerrpc.SetMissionControlConfigRequest + * @memberof routerrpc.AprioriParameters * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetMissionControlConfigRequest.verify = function verify(message) { + AprioriParameters.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.config != null && message.hasOwnProperty("config")) { - let error = $root.routerrpc.MissionControlConfig.verify(message.config); - if (error) - return "config." + error; - } + if (message.half_life_seconds != null && message.hasOwnProperty("half_life_seconds")) + if (!$util.isInteger(message.half_life_seconds) && !(message.half_life_seconds && $util.isInteger(message.half_life_seconds.low) && $util.isInteger(message.half_life_seconds.high))) + return "half_life_seconds: integer|Long expected"; + if (message.hop_probability != null && message.hasOwnProperty("hop_probability")) + if (typeof message.hop_probability !== "number") + return "hop_probability: number expected"; + if (message.weight != null && message.hasOwnProperty("weight")) + if (typeof message.weight !== "number") + return "weight: number expected"; + if (message.capacity_fraction != null && message.hasOwnProperty("capacity_fraction")) + if (typeof message.capacity_fraction !== "number") + return "capacity_fraction: number expected"; return null; }; /** - * Creates a SetMissionControlConfigRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AprioriParameters message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.SetMissionControlConfigRequest + * @memberof routerrpc.AprioriParameters * @static * @param {Object.} object Plain object - * @returns {routerrpc.SetMissionControlConfigRequest} SetMissionControlConfigRequest + * @returns {routerrpc.AprioriParameters} AprioriParameters */ - SetMissionControlConfigRequest.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.SetMissionControlConfigRequest) + AprioriParameters.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.AprioriParameters) return object; - let message = new $root.routerrpc.SetMissionControlConfigRequest(); - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".routerrpc.SetMissionControlConfigRequest.config: object expected"); - message.config = $root.routerrpc.MissionControlConfig.fromObject(object.config); - } + let message = new $root.routerrpc.AprioriParameters(); + if (object.half_life_seconds != null) + if ($util.Long) + (message.half_life_seconds = $util.Long.fromValue(object.half_life_seconds)).unsigned = true; + else if (typeof object.half_life_seconds === "string") + message.half_life_seconds = parseInt(object.half_life_seconds, 10); + else if (typeof object.half_life_seconds === "number") + message.half_life_seconds = object.half_life_seconds; + else if (typeof object.half_life_seconds === "object") + message.half_life_seconds = new $util.LongBits(object.half_life_seconds.low >>> 0, object.half_life_seconds.high >>> 0).toNumber(true); + if (object.hop_probability != null) + message.hop_probability = Number(object.hop_probability); + if (object.weight != null) + message.weight = Number(object.weight); + if (object.capacity_fraction != null) + message.capacity_fraction = Number(object.capacity_fraction); return message; }; /** - * Creates a plain object from a SetMissionControlConfigRequest message. Also converts values to other types if specified. + * Creates a plain object from an AprioriParameters message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.SetMissionControlConfigRequest + * @memberof routerrpc.AprioriParameters * @static - * @param {routerrpc.SetMissionControlConfigRequest} message SetMissionControlConfigRequest + * @param {routerrpc.AprioriParameters} message AprioriParameters * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetMissionControlConfigRequest.toObject = function toObject(message, options) { + AprioriParameters.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.defaults) - object.config = null; - if (message.config != null && message.hasOwnProperty("config")) - object.config = $root.routerrpc.MissionControlConfig.toObject(message.config, options); + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.half_life_seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.half_life_seconds = options.longs === String ? "0" : 0; + object.hop_probability = 0; + object.weight = 0; + object.capacity_fraction = 0; + } + if (message.half_life_seconds != null && message.hasOwnProperty("half_life_seconds")) + if (typeof message.half_life_seconds === "number") + object.half_life_seconds = options.longs === String ? String(message.half_life_seconds) : message.half_life_seconds; + else + object.half_life_seconds = options.longs === String ? $util.Long.prototype.toString.call(message.half_life_seconds) : options.longs === Number ? new $util.LongBits(message.half_life_seconds.low >>> 0, message.half_life_seconds.high >>> 0).toNumber(true) : message.half_life_seconds; + if (message.hop_probability != null && message.hasOwnProperty("hop_probability")) + object.hop_probability = options.json && !isFinite(message.hop_probability) ? String(message.hop_probability) : message.hop_probability; + if (message.weight != null && message.hasOwnProperty("weight")) + object.weight = options.json && !isFinite(message.weight) ? String(message.weight) : message.weight; + if (message.capacity_fraction != null && message.hasOwnProperty("capacity_fraction")) + object.capacity_fraction = options.json && !isFinite(message.capacity_fraction) ? String(message.capacity_fraction) : message.capacity_fraction; return object; }; /** - * Converts this SetMissionControlConfigRequest to JSON. + * Converts this AprioriParameters to JSON. * @function toJSON - * @memberof routerrpc.SetMissionControlConfigRequest + * @memberof routerrpc.AprioriParameters * @instance * @returns {Object.} JSON object */ - SetMissionControlConfigRequest.prototype.toJSON = function toJSON() { + AprioriParameters.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SetMissionControlConfigRequest + * Gets the default type url for AprioriParameters * @function getTypeUrl - * @memberof routerrpc.SetMissionControlConfigRequest + * @memberof routerrpc.AprioriParameters * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SetMissionControlConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AprioriParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.SetMissionControlConfigRequest"; + return typeUrlPrefix + "/routerrpc.AprioriParameters"; }; - return SetMissionControlConfigRequest; + return AprioriParameters; })(); - routerrpc.SetMissionControlConfigResponse = (function() { + routerrpc.QueryProbabilityRequest = (function() { /** - * Properties of a SetMissionControlConfigResponse. + * Properties of a QueryProbabilityRequest. * @memberof routerrpc - * @interface ISetMissionControlConfigResponse + * @interface IQueryProbabilityRequest + * @property {Uint8Array|null} [from_node] QueryProbabilityRequest from_node + * @property {Uint8Array|null} [to_node] QueryProbabilityRequest to_node + * @property {Long|null} [amt_msat] QueryProbabilityRequest amt_msat */ /** - * Constructs a new SetMissionControlConfigResponse. + * Constructs a new QueryProbabilityRequest. * @memberof routerrpc - * @classdesc Represents a SetMissionControlConfigResponse. - * @implements ISetMissionControlConfigResponse + * @classdesc Represents a QueryProbabilityRequest. + * @implements IQueryProbabilityRequest * @constructor - * @param {routerrpc.ISetMissionControlConfigResponse=} [properties] Properties to set + * @param {routerrpc.IQueryProbabilityRequest=} [properties] Properties to set */ - function SetMissionControlConfigResponse(properties) { + function QueryProbabilityRequest(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -89625,63 +92701,105 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * Creates a new SetMissionControlConfigResponse instance using the specified properties. + * QueryProbabilityRequest from_node. + * @member {Uint8Array} from_node + * @memberof routerrpc.QueryProbabilityRequest + * @instance + */ + QueryProbabilityRequest.prototype.from_node = $util.newBuffer([]); + + /** + * QueryProbabilityRequest to_node. + * @member {Uint8Array} to_node + * @memberof routerrpc.QueryProbabilityRequest + * @instance + */ + QueryProbabilityRequest.prototype.to_node = $util.newBuffer([]); + + /** + * QueryProbabilityRequest amt_msat. + * @member {Long} amt_msat + * @memberof routerrpc.QueryProbabilityRequest + * @instance + */ + QueryProbabilityRequest.prototype.amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new QueryProbabilityRequest instance using the specified properties. * @function create - * @memberof routerrpc.SetMissionControlConfigResponse + * @memberof routerrpc.QueryProbabilityRequest * @static - * @param {routerrpc.ISetMissionControlConfigResponse=} [properties] Properties to set - * @returns {routerrpc.SetMissionControlConfigResponse} SetMissionControlConfigResponse instance + * @param {routerrpc.IQueryProbabilityRequest=} [properties] Properties to set + * @returns {routerrpc.QueryProbabilityRequest} QueryProbabilityRequest instance */ - SetMissionControlConfigResponse.create = function create(properties) { - return new SetMissionControlConfigResponse(properties); + QueryProbabilityRequest.create = function create(properties) { + return new QueryProbabilityRequest(properties); }; /** - * Encodes the specified SetMissionControlConfigResponse message. Does not implicitly {@link routerrpc.SetMissionControlConfigResponse.verify|verify} messages. + * Encodes the specified QueryProbabilityRequest message. Does not implicitly {@link routerrpc.QueryProbabilityRequest.verify|verify} messages. * @function encode - * @memberof routerrpc.SetMissionControlConfigResponse + * @memberof routerrpc.QueryProbabilityRequest * @static - * @param {routerrpc.ISetMissionControlConfigResponse} message SetMissionControlConfigResponse message or plain object to encode + * @param {routerrpc.IQueryProbabilityRequest} message QueryProbabilityRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetMissionControlConfigResponse.encode = function encode(message, writer) { + QueryProbabilityRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.from_node != null && Object.hasOwnProperty.call(message, "from_node")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.from_node); + if (message.to_node != null && Object.hasOwnProperty.call(message, "to_node")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.to_node); + if (message.amt_msat != null && Object.hasOwnProperty.call(message, "amt_msat")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.amt_msat); return writer; }; /** - * Encodes the specified SetMissionControlConfigResponse message, length delimited. Does not implicitly {@link routerrpc.SetMissionControlConfigResponse.verify|verify} messages. + * Encodes the specified QueryProbabilityRequest message, length delimited. Does not implicitly {@link routerrpc.QueryProbabilityRequest.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.SetMissionControlConfigResponse + * @memberof routerrpc.QueryProbabilityRequest * @static - * @param {routerrpc.ISetMissionControlConfigResponse} message SetMissionControlConfigResponse message or plain object to encode + * @param {routerrpc.IQueryProbabilityRequest} message QueryProbabilityRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetMissionControlConfigResponse.encodeDelimited = function encodeDelimited(message, writer) { + QueryProbabilityRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetMissionControlConfigResponse message from the specified reader or buffer. + * Decodes a QueryProbabilityRequest message from the specified reader or buffer. * @function decode - * @memberof routerrpc.SetMissionControlConfigResponse + * @memberof routerrpc.QueryProbabilityRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.SetMissionControlConfigResponse} SetMissionControlConfigResponse + * @returns {routerrpc.QueryProbabilityRequest} QueryProbabilityRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetMissionControlConfigResponse.decode = function decode(reader, length) { + QueryProbabilityRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SetMissionControlConfigResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.QueryProbabilityRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.from_node = reader.bytes(); + break; + } + case 2: { + message.to_node = reader.bytes(); + break; + } + case 3: { + message.amt_msat = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -89691,116 +92809,172 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a SetMissionControlConfigResponse message from the specified reader or buffer, length delimited. + * Decodes a QueryProbabilityRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.SetMissionControlConfigResponse + * @memberof routerrpc.QueryProbabilityRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.SetMissionControlConfigResponse} SetMissionControlConfigResponse + * @returns {routerrpc.QueryProbabilityRequest} QueryProbabilityRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetMissionControlConfigResponse.decodeDelimited = function decodeDelimited(reader) { + QueryProbabilityRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetMissionControlConfigResponse message. + * Verifies a QueryProbabilityRequest message. * @function verify - * @memberof routerrpc.SetMissionControlConfigResponse + * @memberof routerrpc.QueryProbabilityRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetMissionControlConfigResponse.verify = function verify(message) { + QueryProbabilityRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.from_node != null && message.hasOwnProperty("from_node")) + if (!(message.from_node && typeof message.from_node.length === "number" || $util.isString(message.from_node))) + return "from_node: buffer expected"; + if (message.to_node != null && message.hasOwnProperty("to_node")) + if (!(message.to_node && typeof message.to_node.length === "number" || $util.isString(message.to_node))) + return "to_node: buffer expected"; + if (message.amt_msat != null && message.hasOwnProperty("amt_msat")) + if (!$util.isInteger(message.amt_msat) && !(message.amt_msat && $util.isInteger(message.amt_msat.low) && $util.isInteger(message.amt_msat.high))) + return "amt_msat: integer|Long expected"; return null; }; /** - * Creates a SetMissionControlConfigResponse message from a plain object. Also converts values to their respective internal types. + * Creates a QueryProbabilityRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.SetMissionControlConfigResponse + * @memberof routerrpc.QueryProbabilityRequest * @static * @param {Object.} object Plain object - * @returns {routerrpc.SetMissionControlConfigResponse} SetMissionControlConfigResponse + * @returns {routerrpc.QueryProbabilityRequest} QueryProbabilityRequest */ - SetMissionControlConfigResponse.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.SetMissionControlConfigResponse) + QueryProbabilityRequest.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.QueryProbabilityRequest) return object; - return new $root.routerrpc.SetMissionControlConfigResponse(); + let message = new $root.routerrpc.QueryProbabilityRequest(); + if (object.from_node != null) + if (typeof object.from_node === "string") + $util.base64.decode(object.from_node, message.from_node = $util.newBuffer($util.base64.length(object.from_node)), 0); + else if (object.from_node.length >= 0) + message.from_node = object.from_node; + if (object.to_node != null) + if (typeof object.to_node === "string") + $util.base64.decode(object.to_node, message.to_node = $util.newBuffer($util.base64.length(object.to_node)), 0); + else if (object.to_node.length >= 0) + message.to_node = object.to_node; + if (object.amt_msat != null) + if ($util.Long) + (message.amt_msat = $util.Long.fromValue(object.amt_msat)).unsigned = false; + else if (typeof object.amt_msat === "string") + message.amt_msat = parseInt(object.amt_msat, 10); + else if (typeof object.amt_msat === "number") + message.amt_msat = object.amt_msat; + else if (typeof object.amt_msat === "object") + message.amt_msat = new $util.LongBits(object.amt_msat.low >>> 0, object.amt_msat.high >>> 0).toNumber(); + return message; }; /** - * Creates a plain object from a SetMissionControlConfigResponse message. Also converts values to other types if specified. + * Creates a plain object from a QueryProbabilityRequest message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.SetMissionControlConfigResponse + * @memberof routerrpc.QueryProbabilityRequest * @static - * @param {routerrpc.SetMissionControlConfigResponse} message SetMissionControlConfigResponse + * @param {routerrpc.QueryProbabilityRequest} message QueryProbabilityRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetMissionControlConfigResponse.toObject = function toObject() { - return {}; + QueryProbabilityRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.from_node = ""; + else { + object.from_node = []; + if (options.bytes !== Array) + object.from_node = $util.newBuffer(object.from_node); + } + if (options.bytes === String) + object.to_node = ""; + else { + object.to_node = []; + if (options.bytes !== Array) + object.to_node = $util.newBuffer(object.to_node); + } + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amt_msat = options.longs === String ? "0" : 0; + } + if (message.from_node != null && message.hasOwnProperty("from_node")) + object.from_node = options.bytes === String ? $util.base64.encode(message.from_node, 0, message.from_node.length) : options.bytes === Array ? Array.prototype.slice.call(message.from_node) : message.from_node; + if (message.to_node != null && message.hasOwnProperty("to_node")) + object.to_node = options.bytes === String ? $util.base64.encode(message.to_node, 0, message.to_node.length) : options.bytes === Array ? Array.prototype.slice.call(message.to_node) : message.to_node; + if (message.amt_msat != null && message.hasOwnProperty("amt_msat")) + if (typeof message.amt_msat === "number") + object.amt_msat = options.longs === String ? String(message.amt_msat) : message.amt_msat; + else + object.amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_msat) : options.longs === Number ? new $util.LongBits(message.amt_msat.low >>> 0, message.amt_msat.high >>> 0).toNumber() : message.amt_msat; + return object; }; /** - * Converts this SetMissionControlConfigResponse to JSON. + * Converts this QueryProbabilityRequest to JSON. * @function toJSON - * @memberof routerrpc.SetMissionControlConfigResponse + * @memberof routerrpc.QueryProbabilityRequest * @instance * @returns {Object.} JSON object */ - SetMissionControlConfigResponse.prototype.toJSON = function toJSON() { + QueryProbabilityRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SetMissionControlConfigResponse + * Gets the default type url for QueryProbabilityRequest * @function getTypeUrl - * @memberof routerrpc.SetMissionControlConfigResponse + * @memberof routerrpc.QueryProbabilityRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SetMissionControlConfigResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + QueryProbabilityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.SetMissionControlConfigResponse"; + return typeUrlPrefix + "/routerrpc.QueryProbabilityRequest"; }; - return SetMissionControlConfigResponse; + return QueryProbabilityRequest; })(); - routerrpc.MissionControlConfig = (function() { + routerrpc.QueryProbabilityResponse = (function() { /** - * Properties of a MissionControlConfig. + * Properties of a QueryProbabilityResponse. * @memberof routerrpc - * @interface IMissionControlConfig - * @property {Long|null} [half_life_seconds] MissionControlConfig half_life_seconds - * @property {number|null} [hop_probability] MissionControlConfig hop_probability - * @property {number|null} [weight] MissionControlConfig weight - * @property {number|null} [maximum_payment_results] MissionControlConfig maximum_payment_results - * @property {Long|null} [minimum_failure_relax_interval] MissionControlConfig minimum_failure_relax_interval - * @property {routerrpc.MissionControlConfig.ProbabilityModel|null} [model] MissionControlConfig model - * @property {routerrpc.IAprioriParameters|null} [apriori] MissionControlConfig apriori - * @property {routerrpc.IBimodalParameters|null} [bimodal] MissionControlConfig bimodal + * @interface IQueryProbabilityResponse + * @property {number|null} [probability] QueryProbabilityResponse probability + * @property {routerrpc.IPairData|null} [history] QueryProbabilityResponse history */ /** - * Constructs a new MissionControlConfig. + * Constructs a new QueryProbabilityResponse. * @memberof routerrpc - * @classdesc Represents a MissionControlConfig. - * @implements IMissionControlConfig + * @classdesc Represents a QueryProbabilityResponse. + * @implements IQueryProbabilityResponse * @constructor - * @param {routerrpc.IMissionControlConfig=} [properties] Properties to set + * @param {routerrpc.IQueryProbabilityResponse=} [properties] Properties to set */ - function MissionControlConfig(properties) { + function QueryProbabilityResponse(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -89808,187 +92982,89 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * MissionControlConfig half_life_seconds. - * @member {Long} half_life_seconds - * @memberof routerrpc.MissionControlConfig - * @instance - */ - MissionControlConfig.prototype.half_life_seconds = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MissionControlConfig hop_probability. - * @member {number} hop_probability - * @memberof routerrpc.MissionControlConfig - * @instance - */ - MissionControlConfig.prototype.hop_probability = 0; - - /** - * MissionControlConfig weight. - * @member {number} weight - * @memberof routerrpc.MissionControlConfig - * @instance - */ - MissionControlConfig.prototype.weight = 0; - - /** - * MissionControlConfig maximum_payment_results. - * @member {number} maximum_payment_results - * @memberof routerrpc.MissionControlConfig - * @instance - */ - MissionControlConfig.prototype.maximum_payment_results = 0; - - /** - * MissionControlConfig minimum_failure_relax_interval. - * @member {Long} minimum_failure_relax_interval - * @memberof routerrpc.MissionControlConfig - * @instance - */ - MissionControlConfig.prototype.minimum_failure_relax_interval = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * MissionControlConfig model. - * @member {routerrpc.MissionControlConfig.ProbabilityModel} model - * @memberof routerrpc.MissionControlConfig - * @instance - */ - MissionControlConfig.prototype.model = 0; - - /** - * MissionControlConfig apriori. - * @member {routerrpc.IAprioriParameters|null|undefined} apriori - * @memberof routerrpc.MissionControlConfig - * @instance - */ - MissionControlConfig.prototype.apriori = null; - - /** - * MissionControlConfig bimodal. - * @member {routerrpc.IBimodalParameters|null|undefined} bimodal - * @memberof routerrpc.MissionControlConfig + * QueryProbabilityResponse probability. + * @member {number} probability + * @memberof routerrpc.QueryProbabilityResponse * @instance */ - MissionControlConfig.prototype.bimodal = null; - - // OneOf field names bound to virtual getters and setters - let $oneOfFields; + QueryProbabilityResponse.prototype.probability = 0; /** - * MissionControlConfig EstimatorConfig. - * @member {"apriori"|"bimodal"|undefined} EstimatorConfig - * @memberof routerrpc.MissionControlConfig + * QueryProbabilityResponse history. + * @member {routerrpc.IPairData|null|undefined} history + * @memberof routerrpc.QueryProbabilityResponse * @instance */ - Object.defineProperty(MissionControlConfig.prototype, "EstimatorConfig", { - get: $util.oneOfGetter($oneOfFields = ["apriori", "bimodal"]), - set: $util.oneOfSetter($oneOfFields) - }); + QueryProbabilityResponse.prototype.history = null; /** - * Creates a new MissionControlConfig instance using the specified properties. + * Creates a new QueryProbabilityResponse instance using the specified properties. * @function create - * @memberof routerrpc.MissionControlConfig + * @memberof routerrpc.QueryProbabilityResponse * @static - * @param {routerrpc.IMissionControlConfig=} [properties] Properties to set - * @returns {routerrpc.MissionControlConfig} MissionControlConfig instance + * @param {routerrpc.IQueryProbabilityResponse=} [properties] Properties to set + * @returns {routerrpc.QueryProbabilityResponse} QueryProbabilityResponse instance */ - MissionControlConfig.create = function create(properties) { - return new MissionControlConfig(properties); + QueryProbabilityResponse.create = function create(properties) { + return new QueryProbabilityResponse(properties); }; /** - * Encodes the specified MissionControlConfig message. Does not implicitly {@link routerrpc.MissionControlConfig.verify|verify} messages. + * Encodes the specified QueryProbabilityResponse message. Does not implicitly {@link routerrpc.QueryProbabilityResponse.verify|verify} messages. * @function encode - * @memberof routerrpc.MissionControlConfig + * @memberof routerrpc.QueryProbabilityResponse * @static - * @param {routerrpc.IMissionControlConfig} message MissionControlConfig message or plain object to encode + * @param {routerrpc.IQueryProbabilityResponse} message QueryProbabilityResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MissionControlConfig.encode = function encode(message, writer) { + QueryProbabilityResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.half_life_seconds != null && Object.hasOwnProperty.call(message, "half_life_seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.half_life_seconds); - if (message.hop_probability != null && Object.hasOwnProperty.call(message, "hop_probability")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.hop_probability); - if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.weight); - if (message.maximum_payment_results != null && Object.hasOwnProperty.call(message, "maximum_payment_results")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.maximum_payment_results); - if (message.minimum_failure_relax_interval != null && Object.hasOwnProperty.call(message, "minimum_failure_relax_interval")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.minimum_failure_relax_interval); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.model); - if (message.apriori != null && Object.hasOwnProperty.call(message, "apriori")) - $root.routerrpc.AprioriParameters.encode(message.apriori, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.bimodal != null && Object.hasOwnProperty.call(message, "bimodal")) - $root.routerrpc.BimodalParameters.encode(message.bimodal, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.probability != null && Object.hasOwnProperty.call(message, "probability")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.probability); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + $root.routerrpc.PairData.encode(message.history, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified MissionControlConfig message, length delimited. Does not implicitly {@link routerrpc.MissionControlConfig.verify|verify} messages. + * Encodes the specified QueryProbabilityResponse message, length delimited. Does not implicitly {@link routerrpc.QueryProbabilityResponse.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.MissionControlConfig + * @memberof routerrpc.QueryProbabilityResponse * @static - * @param {routerrpc.IMissionControlConfig} message MissionControlConfig message or plain object to encode + * @param {routerrpc.IQueryProbabilityResponse} message QueryProbabilityResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MissionControlConfig.encodeDelimited = function encodeDelimited(message, writer) { + QueryProbabilityResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MissionControlConfig message from the specified reader or buffer. + * Decodes a QueryProbabilityResponse message from the specified reader or buffer. * @function decode - * @memberof routerrpc.MissionControlConfig + * @memberof routerrpc.QueryProbabilityResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.MissionControlConfig} MissionControlConfig + * @returns {routerrpc.QueryProbabilityResponse} QueryProbabilityResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MissionControlConfig.decode = function decode(reader, length) { + QueryProbabilityResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.MissionControlConfig(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.QueryProbabilityResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.half_life_seconds = reader.uint64(); + message.probability = reader.double(); break; } case 2: { - message.hop_probability = reader.float(); - break; - } - case 3: { - message.weight = reader.float(); - break; - } - case 4: { - message.maximum_payment_results = reader.uint32(); - break; - } - case 5: { - message.minimum_failure_relax_interval = reader.uint64(); - break; - } - case 6: { - message.model = reader.int32(); - break; - } - case 7: { - message.apriori = $root.routerrpc.AprioriParameters.decode(reader, reader.uint32()); - break; - } - case 8: { - message.bimodal = $root.routerrpc.BimodalParameters.decode(reader, reader.uint32()); + message.history = $root.routerrpc.PairData.decode(reader, reader.uint32()); break; } default: @@ -90000,265 +93076,143 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a MissionControlConfig message from the specified reader or buffer, length delimited. + * Decodes a QueryProbabilityResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.MissionControlConfig + * @memberof routerrpc.QueryProbabilityResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.MissionControlConfig} MissionControlConfig + * @returns {routerrpc.QueryProbabilityResponse} QueryProbabilityResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MissionControlConfig.decodeDelimited = function decodeDelimited(reader) { + QueryProbabilityResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MissionControlConfig message. + * Verifies a QueryProbabilityResponse message. * @function verify - * @memberof routerrpc.MissionControlConfig + * @memberof routerrpc.QueryProbabilityResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MissionControlConfig.verify = function verify(message) { + QueryProbabilityResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - let properties = {}; - if (message.half_life_seconds != null && message.hasOwnProperty("half_life_seconds")) - if (!$util.isInteger(message.half_life_seconds) && !(message.half_life_seconds && $util.isInteger(message.half_life_seconds.low) && $util.isInteger(message.half_life_seconds.high))) - return "half_life_seconds: integer|Long expected"; - if (message.hop_probability != null && message.hasOwnProperty("hop_probability")) - if (typeof message.hop_probability !== "number") - return "hop_probability: number expected"; - if (message.weight != null && message.hasOwnProperty("weight")) - if (typeof message.weight !== "number") - return "weight: number expected"; - if (message.maximum_payment_results != null && message.hasOwnProperty("maximum_payment_results")) - if (!$util.isInteger(message.maximum_payment_results)) - return "maximum_payment_results: integer expected"; - if (message.minimum_failure_relax_interval != null && message.hasOwnProperty("minimum_failure_relax_interval")) - if (!$util.isInteger(message.minimum_failure_relax_interval) && !(message.minimum_failure_relax_interval && $util.isInteger(message.minimum_failure_relax_interval.low) && $util.isInteger(message.minimum_failure_relax_interval.high))) - return "minimum_failure_relax_interval: integer|Long expected"; - if (message.model != null && message.hasOwnProperty("model")) - switch (message.model) { - default: - return "model: enum value expected"; - case 0: - case 1: - break; - } - if (message.apriori != null && message.hasOwnProperty("apriori")) { - properties.EstimatorConfig = 1; - { - let error = $root.routerrpc.AprioriParameters.verify(message.apriori); - if (error) - return "apriori." + error; - } - } - if (message.bimodal != null && message.hasOwnProperty("bimodal")) { - if (properties.EstimatorConfig === 1) - return "EstimatorConfig: multiple values"; - properties.EstimatorConfig = 1; - { - let error = $root.routerrpc.BimodalParameters.verify(message.bimodal); - if (error) - return "bimodal." + error; - } + if (message.probability != null && message.hasOwnProperty("probability")) + if (typeof message.probability !== "number") + return "probability: number expected"; + if (message.history != null && message.hasOwnProperty("history")) { + let error = $root.routerrpc.PairData.verify(message.history); + if (error) + return "history." + error; } return null; }; /** - * Creates a MissionControlConfig message from a plain object. Also converts values to their respective internal types. + * Creates a QueryProbabilityResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.MissionControlConfig + * @memberof routerrpc.QueryProbabilityResponse * @static * @param {Object.} object Plain object - * @returns {routerrpc.MissionControlConfig} MissionControlConfig + * @returns {routerrpc.QueryProbabilityResponse} QueryProbabilityResponse */ - MissionControlConfig.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.MissionControlConfig) + QueryProbabilityResponse.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.QueryProbabilityResponse) return object; - let message = new $root.routerrpc.MissionControlConfig(); - if (object.half_life_seconds != null) - if ($util.Long) - (message.half_life_seconds = $util.Long.fromValue(object.half_life_seconds)).unsigned = true; - else if (typeof object.half_life_seconds === "string") - message.half_life_seconds = parseInt(object.half_life_seconds, 10); - else if (typeof object.half_life_seconds === "number") - message.half_life_seconds = object.half_life_seconds; - else if (typeof object.half_life_seconds === "object") - message.half_life_seconds = new $util.LongBits(object.half_life_seconds.low >>> 0, object.half_life_seconds.high >>> 0).toNumber(true); - if (object.hop_probability != null) - message.hop_probability = Number(object.hop_probability); - if (object.weight != null) - message.weight = Number(object.weight); - if (object.maximum_payment_results != null) - message.maximum_payment_results = object.maximum_payment_results >>> 0; - if (object.minimum_failure_relax_interval != null) - if ($util.Long) - (message.minimum_failure_relax_interval = $util.Long.fromValue(object.minimum_failure_relax_interval)).unsigned = true; - else if (typeof object.minimum_failure_relax_interval === "string") - message.minimum_failure_relax_interval = parseInt(object.minimum_failure_relax_interval, 10); - else if (typeof object.minimum_failure_relax_interval === "number") - message.minimum_failure_relax_interval = object.minimum_failure_relax_interval; - else if (typeof object.minimum_failure_relax_interval === "object") - message.minimum_failure_relax_interval = new $util.LongBits(object.minimum_failure_relax_interval.low >>> 0, object.minimum_failure_relax_interval.high >>> 0).toNumber(true); - switch (object.model) { - default: - if (typeof object.model === "number") { - message.model = object.model; - break; - } - break; - case "APRIORI": - case 0: - message.model = 0; - break; - case "BIMODAL": - case 1: - message.model = 1; - break; - } - if (object.apriori != null) { - if (typeof object.apriori !== "object") - throw TypeError(".routerrpc.MissionControlConfig.apriori: object expected"); - message.apriori = $root.routerrpc.AprioriParameters.fromObject(object.apriori); - } - if (object.bimodal != null) { - if (typeof object.bimodal !== "object") - throw TypeError(".routerrpc.MissionControlConfig.bimodal: object expected"); - message.bimodal = $root.routerrpc.BimodalParameters.fromObject(object.bimodal); + let message = new $root.routerrpc.QueryProbabilityResponse(); + if (object.probability != null) + message.probability = Number(object.probability); + if (object.history != null) { + if (typeof object.history !== "object") + throw TypeError(".routerrpc.QueryProbabilityResponse.history: object expected"); + message.history = $root.routerrpc.PairData.fromObject(object.history); } return message; }; /** - * Creates a plain object from a MissionControlConfig message. Also converts values to other types if specified. + * Creates a plain object from a QueryProbabilityResponse message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.MissionControlConfig + * @memberof routerrpc.QueryProbabilityResponse * @static - * @param {routerrpc.MissionControlConfig} message MissionControlConfig + * @param {routerrpc.QueryProbabilityResponse} message QueryProbabilityResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MissionControlConfig.toObject = function toObject(message, options) { + QueryProbabilityResponse.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.half_life_seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.half_life_seconds = options.longs === String ? "0" : 0; - object.hop_probability = 0; - object.weight = 0; - object.maximum_payment_results = 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.minimum_failure_relax_interval = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.minimum_failure_relax_interval = options.longs === String ? "0" : 0; - object.model = options.enums === String ? "APRIORI" : 0; - } - if (message.half_life_seconds != null && message.hasOwnProperty("half_life_seconds")) - if (typeof message.half_life_seconds === "number") - object.half_life_seconds = options.longs === String ? String(message.half_life_seconds) : message.half_life_seconds; - else - object.half_life_seconds = options.longs === String ? $util.Long.prototype.toString.call(message.half_life_seconds) : options.longs === Number ? new $util.LongBits(message.half_life_seconds.low >>> 0, message.half_life_seconds.high >>> 0).toNumber(true) : message.half_life_seconds; - if (message.hop_probability != null && message.hasOwnProperty("hop_probability")) - object.hop_probability = options.json && !isFinite(message.hop_probability) ? String(message.hop_probability) : message.hop_probability; - if (message.weight != null && message.hasOwnProperty("weight")) - object.weight = options.json && !isFinite(message.weight) ? String(message.weight) : message.weight; - if (message.maximum_payment_results != null && message.hasOwnProperty("maximum_payment_results")) - object.maximum_payment_results = message.maximum_payment_results; - if (message.minimum_failure_relax_interval != null && message.hasOwnProperty("minimum_failure_relax_interval")) - if (typeof message.minimum_failure_relax_interval === "number") - object.minimum_failure_relax_interval = options.longs === String ? String(message.minimum_failure_relax_interval) : message.minimum_failure_relax_interval; - else - object.minimum_failure_relax_interval = options.longs === String ? $util.Long.prototype.toString.call(message.minimum_failure_relax_interval) : options.longs === Number ? new $util.LongBits(message.minimum_failure_relax_interval.low >>> 0, message.minimum_failure_relax_interval.high >>> 0).toNumber(true) : message.minimum_failure_relax_interval; - if (message.model != null && message.hasOwnProperty("model")) - object.model = options.enums === String ? $root.routerrpc.MissionControlConfig.ProbabilityModel[message.model] === undefined ? message.model : $root.routerrpc.MissionControlConfig.ProbabilityModel[message.model] : message.model; - if (message.apriori != null && message.hasOwnProperty("apriori")) { - object.apriori = $root.routerrpc.AprioriParameters.toObject(message.apriori, options); - if (options.oneofs) - object.EstimatorConfig = "apriori"; - } - if (message.bimodal != null && message.hasOwnProperty("bimodal")) { - object.bimodal = $root.routerrpc.BimodalParameters.toObject(message.bimodal, options); - if (options.oneofs) - object.EstimatorConfig = "bimodal"; + object.probability = 0; + object.history = null; } + if (message.probability != null && message.hasOwnProperty("probability")) + object.probability = options.json && !isFinite(message.probability) ? String(message.probability) : message.probability; + if (message.history != null && message.hasOwnProperty("history")) + object.history = $root.routerrpc.PairData.toObject(message.history, options); return object; }; /** - * Converts this MissionControlConfig to JSON. + * Converts this QueryProbabilityResponse to JSON. * @function toJSON - * @memberof routerrpc.MissionControlConfig + * @memberof routerrpc.QueryProbabilityResponse * @instance * @returns {Object.} JSON object */ - MissionControlConfig.prototype.toJSON = function toJSON() { + QueryProbabilityResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MissionControlConfig + * Gets the default type url for QueryProbabilityResponse * @function getTypeUrl - * @memberof routerrpc.MissionControlConfig + * @memberof routerrpc.QueryProbabilityResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MissionControlConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + QueryProbabilityResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.MissionControlConfig"; + return typeUrlPrefix + "/routerrpc.QueryProbabilityResponse"; }; - /** - * ProbabilityModel enum. - * @name routerrpc.MissionControlConfig.ProbabilityModel - * @enum {number} - * @property {number} APRIORI=0 APRIORI value - * @property {number} BIMODAL=1 BIMODAL value - */ - MissionControlConfig.ProbabilityModel = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "APRIORI"] = 0; - values[valuesById[1] = "BIMODAL"] = 1; - return values; - })(); - - return MissionControlConfig; + return QueryProbabilityResponse; })(); - routerrpc.BimodalParameters = (function() { + routerrpc.BuildRouteRequest = (function() { /** - * Properties of a BimodalParameters. + * Properties of a BuildRouteRequest. * @memberof routerrpc - * @interface IBimodalParameters - * @property {number|null} [node_weight] BimodalParameters node_weight - * @property {Long|null} [scale_msat] BimodalParameters scale_msat - * @property {Long|null} [decay_time] BimodalParameters decay_time + * @interface IBuildRouteRequest + * @property {Long|null} [amt_msat] BuildRouteRequest amt_msat + * @property {number|null} [final_cltv_delta] BuildRouteRequest final_cltv_delta + * @property {Long|null} [outgoing_chan_id] BuildRouteRequest outgoing_chan_id + * @property {Array.|null} [hop_pubkeys] BuildRouteRequest hop_pubkeys + * @property {Uint8Array|null} [payment_addr] BuildRouteRequest payment_addr + * @property {Object.|null} [first_hop_custom_records] BuildRouteRequest first_hop_custom_records */ /** - * Constructs a new BimodalParameters. + * Constructs a new BuildRouteRequest. * @memberof routerrpc - * @classdesc Represents a BimodalParameters. - * @implements IBimodalParameters + * @classdesc Represents a BuildRouteRequest. + * @implements IBuildRouteRequest * @constructor - * @param {routerrpc.IBimodalParameters=} [properties] Properties to set + * @param {routerrpc.IBuildRouteRequest=} [properties] Properties to set */ - function BimodalParameters(properties) { + function BuildRouteRequest(properties) { + this.hop_pubkeys = []; + this.first_hop_custom_records = {}; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -90266,103 +93220,168 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * BimodalParameters node_weight. - * @member {number} node_weight - * @memberof routerrpc.BimodalParameters + * BuildRouteRequest amt_msat. + * @member {Long} amt_msat + * @memberof routerrpc.BuildRouteRequest + * @instance + */ + BuildRouteRequest.prototype.amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BuildRouteRequest final_cltv_delta. + * @member {number} final_cltv_delta + * @memberof routerrpc.BuildRouteRequest + * @instance + */ + BuildRouteRequest.prototype.final_cltv_delta = 0; + + /** + * BuildRouteRequest outgoing_chan_id. + * @member {Long} outgoing_chan_id + * @memberof routerrpc.BuildRouteRequest + * @instance + */ + BuildRouteRequest.prototype.outgoing_chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * BuildRouteRequest hop_pubkeys. + * @member {Array.} hop_pubkeys + * @memberof routerrpc.BuildRouteRequest * @instance */ - BimodalParameters.prototype.node_weight = 0; + BuildRouteRequest.prototype.hop_pubkeys = $util.emptyArray; /** - * BimodalParameters scale_msat. - * @member {Long} scale_msat - * @memberof routerrpc.BimodalParameters + * BuildRouteRequest payment_addr. + * @member {Uint8Array} payment_addr + * @memberof routerrpc.BuildRouteRequest * @instance */ - BimodalParameters.prototype.scale_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + BuildRouteRequest.prototype.payment_addr = $util.newBuffer([]); /** - * BimodalParameters decay_time. - * @member {Long} decay_time - * @memberof routerrpc.BimodalParameters + * BuildRouteRequest first_hop_custom_records. + * @member {Object.} first_hop_custom_records + * @memberof routerrpc.BuildRouteRequest * @instance */ - BimodalParameters.prototype.decay_time = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + BuildRouteRequest.prototype.first_hop_custom_records = $util.emptyObject; /** - * Creates a new BimodalParameters instance using the specified properties. + * Creates a new BuildRouteRequest instance using the specified properties. * @function create - * @memberof routerrpc.BimodalParameters + * @memberof routerrpc.BuildRouteRequest * @static - * @param {routerrpc.IBimodalParameters=} [properties] Properties to set - * @returns {routerrpc.BimodalParameters} BimodalParameters instance + * @param {routerrpc.IBuildRouteRequest=} [properties] Properties to set + * @returns {routerrpc.BuildRouteRequest} BuildRouteRequest instance */ - BimodalParameters.create = function create(properties) { - return new BimodalParameters(properties); + BuildRouteRequest.create = function create(properties) { + return new BuildRouteRequest(properties); }; /** - * Encodes the specified BimodalParameters message. Does not implicitly {@link routerrpc.BimodalParameters.verify|verify} messages. + * Encodes the specified BuildRouteRequest message. Does not implicitly {@link routerrpc.BuildRouteRequest.verify|verify} messages. * @function encode - * @memberof routerrpc.BimodalParameters + * @memberof routerrpc.BuildRouteRequest * @static - * @param {routerrpc.IBimodalParameters} message BimodalParameters message or plain object to encode + * @param {routerrpc.IBuildRouteRequest} message BuildRouteRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BimodalParameters.encode = function encode(message, writer) { + BuildRouteRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.node_weight != null && Object.hasOwnProperty.call(message, "node_weight")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.node_weight); - if (message.scale_msat != null && Object.hasOwnProperty.call(message, "scale_msat")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.scale_msat); - if (message.decay_time != null && Object.hasOwnProperty.call(message, "decay_time")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.decay_time); + if (message.amt_msat != null && Object.hasOwnProperty.call(message, "amt_msat")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.amt_msat); + if (message.final_cltv_delta != null && Object.hasOwnProperty.call(message, "final_cltv_delta")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.final_cltv_delta); + if (message.outgoing_chan_id != null && Object.hasOwnProperty.call(message, "outgoing_chan_id")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.outgoing_chan_id); + if (message.hop_pubkeys != null && message.hop_pubkeys.length) + for (let i = 0; i < message.hop_pubkeys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.hop_pubkeys[i]); + if (message.payment_addr != null && Object.hasOwnProperty.call(message, "payment_addr")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.payment_addr); + if (message.first_hop_custom_records != null && Object.hasOwnProperty.call(message, "first_hop_custom_records")) + for (let keys = Object.keys(message.first_hop_custom_records), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.first_hop_custom_records[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified BimodalParameters message, length delimited. Does not implicitly {@link routerrpc.BimodalParameters.verify|verify} messages. + * Encodes the specified BuildRouteRequest message, length delimited. Does not implicitly {@link routerrpc.BuildRouteRequest.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.BimodalParameters + * @memberof routerrpc.BuildRouteRequest * @static - * @param {routerrpc.IBimodalParameters} message BimodalParameters message or plain object to encode + * @param {routerrpc.IBuildRouteRequest} message BuildRouteRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BimodalParameters.encodeDelimited = function encodeDelimited(message, writer) { + BuildRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BimodalParameters message from the specified reader or buffer. + * Decodes a BuildRouteRequest message from the specified reader or buffer. * @function decode - * @memberof routerrpc.BimodalParameters + * @memberof routerrpc.BuildRouteRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.BimodalParameters} BimodalParameters + * @returns {routerrpc.BuildRouteRequest} BuildRouteRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BimodalParameters.decode = function decode(reader, length) { + BuildRouteRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.BimodalParameters(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.BuildRouteRequest(), key, value; while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.node_weight = reader.double(); + message.amt_msat = reader.int64(); break; } case 2: { - message.scale_msat = reader.uint64(); + message.final_cltv_delta = reader.int32(); break; } case 3: { - message.decay_time = reader.uint64(); + message.outgoing_chan_id = reader.uint64(); + break; + } + case 4: { + if (!(message.hop_pubkeys && message.hop_pubkeys.length)) + message.hop_pubkeys = []; + message.hop_pubkeys.push(reader.bytes()); + break; + } + case 5: { + message.payment_addr = reader.bytes(); + break; + } + case 6: { + if (message.first_hop_custom_records === $util.emptyObject) + message.first_hop_custom_records = {}; + let end2 = reader.uint32() + reader.pos; + key = 0; + value = []; + while (reader.pos < end2) { + let tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint64(); + break; + case 2: + value = reader.bytes(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.first_hop_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value; break; } default: @@ -90374,170 +93393,237 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a BimodalParameters message from the specified reader or buffer, length delimited. + * Decodes a BuildRouteRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.BimodalParameters + * @memberof routerrpc.BuildRouteRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.BimodalParameters} BimodalParameters + * @returns {routerrpc.BuildRouteRequest} BuildRouteRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BimodalParameters.decodeDelimited = function decodeDelimited(reader) { + BuildRouteRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BimodalParameters message. + * Verifies a BuildRouteRequest message. * @function verify - * @memberof routerrpc.BimodalParameters + * @memberof routerrpc.BuildRouteRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BimodalParameters.verify = function verify(message) { + BuildRouteRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.node_weight != null && message.hasOwnProperty("node_weight")) - if (typeof message.node_weight !== "number") - return "node_weight: number expected"; - if (message.scale_msat != null && message.hasOwnProperty("scale_msat")) - if (!$util.isInteger(message.scale_msat) && !(message.scale_msat && $util.isInteger(message.scale_msat.low) && $util.isInteger(message.scale_msat.high))) - return "scale_msat: integer|Long expected"; - if (message.decay_time != null && message.hasOwnProperty("decay_time")) - if (!$util.isInteger(message.decay_time) && !(message.decay_time && $util.isInteger(message.decay_time.low) && $util.isInteger(message.decay_time.high))) - return "decay_time: integer|Long expected"; + if (message.amt_msat != null && message.hasOwnProperty("amt_msat")) + if (!$util.isInteger(message.amt_msat) && !(message.amt_msat && $util.isInteger(message.amt_msat.low) && $util.isInteger(message.amt_msat.high))) + return "amt_msat: integer|Long expected"; + if (message.final_cltv_delta != null && message.hasOwnProperty("final_cltv_delta")) + if (!$util.isInteger(message.final_cltv_delta)) + return "final_cltv_delta: integer expected"; + if (message.outgoing_chan_id != null && message.hasOwnProperty("outgoing_chan_id")) + if (!$util.isInteger(message.outgoing_chan_id) && !(message.outgoing_chan_id && $util.isInteger(message.outgoing_chan_id.low) && $util.isInteger(message.outgoing_chan_id.high))) + return "outgoing_chan_id: integer|Long expected"; + if (message.hop_pubkeys != null && message.hasOwnProperty("hop_pubkeys")) { + if (!Array.isArray(message.hop_pubkeys)) + return "hop_pubkeys: array expected"; + for (let i = 0; i < message.hop_pubkeys.length; ++i) + if (!(message.hop_pubkeys[i] && typeof message.hop_pubkeys[i].length === "number" || $util.isString(message.hop_pubkeys[i]))) + return "hop_pubkeys: buffer[] expected"; + } + if (message.payment_addr != null && message.hasOwnProperty("payment_addr")) + if (!(message.payment_addr && typeof message.payment_addr.length === "number" || $util.isString(message.payment_addr))) + return "payment_addr: buffer expected"; + if (message.first_hop_custom_records != null && message.hasOwnProperty("first_hop_custom_records")) { + if (!$util.isObject(message.first_hop_custom_records)) + return "first_hop_custom_records: object expected"; + let key = Object.keys(message.first_hop_custom_records); + for (let i = 0; i < key.length; ++i) { + if (!$util.key64Re.test(key[i])) + return "first_hop_custom_records: integer|Long key{k:uint64} expected"; + if (!(message.first_hop_custom_records[key[i]] && typeof message.first_hop_custom_records[key[i]].length === "number" || $util.isString(message.first_hop_custom_records[key[i]]))) + return "first_hop_custom_records: buffer{k:uint64} expected"; + } + } return null; }; /** - * Creates a BimodalParameters message from a plain object. Also converts values to their respective internal types. + * Creates a BuildRouteRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.BimodalParameters + * @memberof routerrpc.BuildRouteRequest * @static * @param {Object.} object Plain object - * @returns {routerrpc.BimodalParameters} BimodalParameters + * @returns {routerrpc.BuildRouteRequest} BuildRouteRequest */ - BimodalParameters.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.BimodalParameters) + BuildRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.BuildRouteRequest) return object; - let message = new $root.routerrpc.BimodalParameters(); - if (object.node_weight != null) - message.node_weight = Number(object.node_weight); - if (object.scale_msat != null) + let message = new $root.routerrpc.BuildRouteRequest(); + if (object.amt_msat != null) if ($util.Long) - (message.scale_msat = $util.Long.fromValue(object.scale_msat)).unsigned = true; - else if (typeof object.scale_msat === "string") - message.scale_msat = parseInt(object.scale_msat, 10); - else if (typeof object.scale_msat === "number") - message.scale_msat = object.scale_msat; - else if (typeof object.scale_msat === "object") - message.scale_msat = new $util.LongBits(object.scale_msat.low >>> 0, object.scale_msat.high >>> 0).toNumber(true); - if (object.decay_time != null) + (message.amt_msat = $util.Long.fromValue(object.amt_msat)).unsigned = false; + else if (typeof object.amt_msat === "string") + message.amt_msat = parseInt(object.amt_msat, 10); + else if (typeof object.amt_msat === "number") + message.amt_msat = object.amt_msat; + else if (typeof object.amt_msat === "object") + message.amt_msat = new $util.LongBits(object.amt_msat.low >>> 0, object.amt_msat.high >>> 0).toNumber(); + if (object.final_cltv_delta != null) + message.final_cltv_delta = object.final_cltv_delta | 0; + if (object.outgoing_chan_id != null) if ($util.Long) - (message.decay_time = $util.Long.fromValue(object.decay_time)).unsigned = true; - else if (typeof object.decay_time === "string") - message.decay_time = parseInt(object.decay_time, 10); - else if (typeof object.decay_time === "number") - message.decay_time = object.decay_time; - else if (typeof object.decay_time === "object") - message.decay_time = new $util.LongBits(object.decay_time.low >>> 0, object.decay_time.high >>> 0).toNumber(true); + (message.outgoing_chan_id = $util.Long.fromValue(object.outgoing_chan_id)).unsigned = true; + else if (typeof object.outgoing_chan_id === "string") + message.outgoing_chan_id = parseInt(object.outgoing_chan_id, 10); + else if (typeof object.outgoing_chan_id === "number") + message.outgoing_chan_id = object.outgoing_chan_id; + else if (typeof object.outgoing_chan_id === "object") + message.outgoing_chan_id = new $util.LongBits(object.outgoing_chan_id.low >>> 0, object.outgoing_chan_id.high >>> 0).toNumber(true); + if (object.hop_pubkeys) { + if (!Array.isArray(object.hop_pubkeys)) + throw TypeError(".routerrpc.BuildRouteRequest.hop_pubkeys: array expected"); + message.hop_pubkeys = []; + for (let i = 0; i < object.hop_pubkeys.length; ++i) + if (typeof object.hop_pubkeys[i] === "string") + $util.base64.decode(object.hop_pubkeys[i], message.hop_pubkeys[i] = $util.newBuffer($util.base64.length(object.hop_pubkeys[i])), 0); + else if (object.hop_pubkeys[i].length >= 0) + message.hop_pubkeys[i] = object.hop_pubkeys[i]; + } + if (object.payment_addr != null) + if (typeof object.payment_addr === "string") + $util.base64.decode(object.payment_addr, message.payment_addr = $util.newBuffer($util.base64.length(object.payment_addr)), 0); + else if (object.payment_addr.length >= 0) + message.payment_addr = object.payment_addr; + if (object.first_hop_custom_records) { + if (typeof object.first_hop_custom_records !== "object") + throw TypeError(".routerrpc.BuildRouteRequest.first_hop_custom_records: object expected"); + message.first_hop_custom_records = {}; + for (let keys = Object.keys(object.first_hop_custom_records), i = 0; i < keys.length; ++i) + if (typeof object.first_hop_custom_records[keys[i]] === "string") + $util.base64.decode(object.first_hop_custom_records[keys[i]], message.first_hop_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.first_hop_custom_records[keys[i]])), 0); + else if (object.first_hop_custom_records[keys[i]].length >= 0) + message.first_hop_custom_records[keys[i]] = object.first_hop_custom_records[keys[i]]; + } return message; }; /** - * Creates a plain object from a BimodalParameters message. Also converts values to other types if specified. + * Creates a plain object from a BuildRouteRequest message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.BimodalParameters + * @memberof routerrpc.BuildRouteRequest * @static - * @param {routerrpc.BimodalParameters} message BimodalParameters + * @param {routerrpc.BuildRouteRequest} message BuildRouteRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BimodalParameters.toObject = function toObject(message, options) { + BuildRouteRequest.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; + if (options.arrays || options.defaults) + object.hop_pubkeys = []; + if (options.objects || options.defaults) + object.first_hop_custom_records = {}; if (options.defaults) { - object.node_weight = 0; if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.scale_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + let long = new $util.Long(0, 0, false); + object.amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.scale_msat = options.longs === String ? "0" : 0; + object.amt_msat = options.longs === String ? "0" : 0; + object.final_cltv_delta = 0; if ($util.Long) { let long = new $util.Long(0, 0, true); - object.decay_time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.outgoing_chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.decay_time = options.longs === String ? "0" : 0; + object.outgoing_chan_id = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.payment_addr = ""; + else { + object.payment_addr = []; + if (options.bytes !== Array) + object.payment_addr = $util.newBuffer(object.payment_addr); + } } - if (message.node_weight != null && message.hasOwnProperty("node_weight")) - object.node_weight = options.json && !isFinite(message.node_weight) ? String(message.node_weight) : message.node_weight; - if (message.scale_msat != null && message.hasOwnProperty("scale_msat")) - if (typeof message.scale_msat === "number") - object.scale_msat = options.longs === String ? String(message.scale_msat) : message.scale_msat; + if (message.amt_msat != null && message.hasOwnProperty("amt_msat")) + if (typeof message.amt_msat === "number") + object.amt_msat = options.longs === String ? String(message.amt_msat) : message.amt_msat; else - object.scale_msat = options.longs === String ? $util.Long.prototype.toString.call(message.scale_msat) : options.longs === Number ? new $util.LongBits(message.scale_msat.low >>> 0, message.scale_msat.high >>> 0).toNumber(true) : message.scale_msat; - if (message.decay_time != null && message.hasOwnProperty("decay_time")) - if (typeof message.decay_time === "number") - object.decay_time = options.longs === String ? String(message.decay_time) : message.decay_time; + object.amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_msat) : options.longs === Number ? new $util.LongBits(message.amt_msat.low >>> 0, message.amt_msat.high >>> 0).toNumber() : message.amt_msat; + if (message.final_cltv_delta != null && message.hasOwnProperty("final_cltv_delta")) + object.final_cltv_delta = message.final_cltv_delta; + if (message.outgoing_chan_id != null && message.hasOwnProperty("outgoing_chan_id")) + if (typeof message.outgoing_chan_id === "number") + object.outgoing_chan_id = options.longs === String ? String(message.outgoing_chan_id) : message.outgoing_chan_id; else - object.decay_time = options.longs === String ? $util.Long.prototype.toString.call(message.decay_time) : options.longs === Number ? new $util.LongBits(message.decay_time.low >>> 0, message.decay_time.high >>> 0).toNumber(true) : message.decay_time; + object.outgoing_chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_chan_id) : options.longs === Number ? new $util.LongBits(message.outgoing_chan_id.low >>> 0, message.outgoing_chan_id.high >>> 0).toNumber(true) : message.outgoing_chan_id; + if (message.hop_pubkeys && message.hop_pubkeys.length) { + object.hop_pubkeys = []; + for (let j = 0; j < message.hop_pubkeys.length; ++j) + object.hop_pubkeys[j] = options.bytes === String ? $util.base64.encode(message.hop_pubkeys[j], 0, message.hop_pubkeys[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.hop_pubkeys[j]) : message.hop_pubkeys[j]; + } + if (message.payment_addr != null && message.hasOwnProperty("payment_addr")) + object.payment_addr = options.bytes === String ? $util.base64.encode(message.payment_addr, 0, message.payment_addr.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_addr) : message.payment_addr; + let keys2; + if (message.first_hop_custom_records && (keys2 = Object.keys(message.first_hop_custom_records)).length) { + object.first_hop_custom_records = {}; + for (let j = 0; j < keys2.length; ++j) + object.first_hop_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.first_hop_custom_records[keys2[j]], 0, message.first_hop_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.first_hop_custom_records[keys2[j]]) : message.first_hop_custom_records[keys2[j]]; + } return object; }; /** - * Converts this BimodalParameters to JSON. + * Converts this BuildRouteRequest to JSON. * @function toJSON - * @memberof routerrpc.BimodalParameters + * @memberof routerrpc.BuildRouteRequest * @instance * @returns {Object.} JSON object */ - BimodalParameters.prototype.toJSON = function toJSON() { + BuildRouteRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BimodalParameters + * Gets the default type url for BuildRouteRequest * @function getTypeUrl - * @memberof routerrpc.BimodalParameters + * @memberof routerrpc.BuildRouteRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BimodalParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BuildRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.BimodalParameters"; + return typeUrlPrefix + "/routerrpc.BuildRouteRequest"; }; - return BimodalParameters; + return BuildRouteRequest; })(); - routerrpc.AprioriParameters = (function() { + routerrpc.BuildRouteResponse = (function() { /** - * Properties of an AprioriParameters. + * Properties of a BuildRouteResponse. * @memberof routerrpc - * @interface IAprioriParameters - * @property {Long|null} [half_life_seconds] AprioriParameters half_life_seconds - * @property {number|null} [hop_probability] AprioriParameters hop_probability - * @property {number|null} [weight] AprioriParameters weight - * @property {number|null} [capacity_fraction] AprioriParameters capacity_fraction + * @interface IBuildRouteResponse + * @property {lnrpc.IRoute|null} [route] BuildRouteResponse route */ /** - * Constructs a new AprioriParameters. + * Constructs a new BuildRouteResponse. * @memberof routerrpc - * @classdesc Represents an AprioriParameters. - * @implements IAprioriParameters + * @classdesc Represents a BuildRouteResponse. + * @implements IBuildRouteResponse * @constructor - * @param {routerrpc.IAprioriParameters=} [properties] Properties to set + * @param {routerrpc.IBuildRouteResponse=} [properties] Properties to set */ - function AprioriParameters(properties) { + function BuildRouteResponse(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -90545,117 +93631,75 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * AprioriParameters half_life_seconds. - * @member {Long} half_life_seconds - * @memberof routerrpc.AprioriParameters - * @instance - */ - AprioriParameters.prototype.half_life_seconds = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * AprioriParameters hop_probability. - * @member {number} hop_probability - * @memberof routerrpc.AprioriParameters - * @instance - */ - AprioriParameters.prototype.hop_probability = 0; - - /** - * AprioriParameters weight. - * @member {number} weight - * @memberof routerrpc.AprioriParameters - * @instance - */ - AprioriParameters.prototype.weight = 0; - - /** - * AprioriParameters capacity_fraction. - * @member {number} capacity_fraction - * @memberof routerrpc.AprioriParameters + * BuildRouteResponse route. + * @member {lnrpc.IRoute|null|undefined} route + * @memberof routerrpc.BuildRouteResponse * @instance */ - AprioriParameters.prototype.capacity_fraction = 0; + BuildRouteResponse.prototype.route = null; /** - * Creates a new AprioriParameters instance using the specified properties. + * Creates a new BuildRouteResponse instance using the specified properties. * @function create - * @memberof routerrpc.AprioriParameters + * @memberof routerrpc.BuildRouteResponse * @static - * @param {routerrpc.IAprioriParameters=} [properties] Properties to set - * @returns {routerrpc.AprioriParameters} AprioriParameters instance + * @param {routerrpc.IBuildRouteResponse=} [properties] Properties to set + * @returns {routerrpc.BuildRouteResponse} BuildRouteResponse instance */ - AprioriParameters.create = function create(properties) { - return new AprioriParameters(properties); + BuildRouteResponse.create = function create(properties) { + return new BuildRouteResponse(properties); }; /** - * Encodes the specified AprioriParameters message. Does not implicitly {@link routerrpc.AprioriParameters.verify|verify} messages. + * Encodes the specified BuildRouteResponse message. Does not implicitly {@link routerrpc.BuildRouteResponse.verify|verify} messages. * @function encode - * @memberof routerrpc.AprioriParameters + * @memberof routerrpc.BuildRouteResponse * @static - * @param {routerrpc.IAprioriParameters} message AprioriParameters message or plain object to encode + * @param {routerrpc.IBuildRouteResponse} message BuildRouteResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AprioriParameters.encode = function encode(message, writer) { + BuildRouteResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.half_life_seconds != null && Object.hasOwnProperty.call(message, "half_life_seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.half_life_seconds); - if (message.hop_probability != null && Object.hasOwnProperty.call(message, "hop_probability")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.hop_probability); - if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.weight); - if (message.capacity_fraction != null && Object.hasOwnProperty.call(message, "capacity_fraction")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.capacity_fraction); + if (message.route != null && Object.hasOwnProperty.call(message, "route")) + $root.lnrpc.Route.encode(message.route, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified AprioriParameters message, length delimited. Does not implicitly {@link routerrpc.AprioriParameters.verify|verify} messages. + * Encodes the specified BuildRouteResponse message, length delimited. Does not implicitly {@link routerrpc.BuildRouteResponse.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.AprioriParameters + * @memberof routerrpc.BuildRouteResponse * @static - * @param {routerrpc.IAprioriParameters} message AprioriParameters message or plain object to encode + * @param {routerrpc.IBuildRouteResponse} message BuildRouteResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AprioriParameters.encodeDelimited = function encodeDelimited(message, writer) { + BuildRouteResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AprioriParameters message from the specified reader or buffer. + * Decodes a BuildRouteResponse message from the specified reader or buffer. * @function decode - * @memberof routerrpc.AprioriParameters + * @memberof routerrpc.BuildRouteResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.AprioriParameters} AprioriParameters + * @returns {routerrpc.BuildRouteResponse} BuildRouteResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AprioriParameters.decode = function decode(reader, length) { + BuildRouteResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.AprioriParameters(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.BuildRouteResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.half_life_seconds = reader.uint64(); - break; - } - case 2: { - message.hop_probability = reader.double(); - break; - } - case 3: { - message.weight = reader.double(); - break; - } - case 4: { - message.capacity_fraction = reader.double(); + message.route = $root.lnrpc.Route.decode(reader, reader.uint32()); break; } default: @@ -90667,163 +93711,126 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes an AprioriParameters message from the specified reader or buffer, length delimited. + * Decodes a BuildRouteResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.AprioriParameters + * @memberof routerrpc.BuildRouteResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.AprioriParameters} AprioriParameters + * @returns {routerrpc.BuildRouteResponse} BuildRouteResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AprioriParameters.decodeDelimited = function decodeDelimited(reader) { + BuildRouteResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AprioriParameters message. + * Verifies a BuildRouteResponse message. * @function verify - * @memberof routerrpc.AprioriParameters + * @memberof routerrpc.BuildRouteResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AprioriParameters.verify = function verify(message) { + BuildRouteResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.half_life_seconds != null && message.hasOwnProperty("half_life_seconds")) - if (!$util.isInteger(message.half_life_seconds) && !(message.half_life_seconds && $util.isInteger(message.half_life_seconds.low) && $util.isInteger(message.half_life_seconds.high))) - return "half_life_seconds: integer|Long expected"; - if (message.hop_probability != null && message.hasOwnProperty("hop_probability")) - if (typeof message.hop_probability !== "number") - return "hop_probability: number expected"; - if (message.weight != null && message.hasOwnProperty("weight")) - if (typeof message.weight !== "number") - return "weight: number expected"; - if (message.capacity_fraction != null && message.hasOwnProperty("capacity_fraction")) - if (typeof message.capacity_fraction !== "number") - return "capacity_fraction: number expected"; + if (message.route != null && message.hasOwnProperty("route")) { + let error = $root.lnrpc.Route.verify(message.route); + if (error) + return "route." + error; + } return null; }; /** - * Creates an AprioriParameters message from a plain object. Also converts values to their respective internal types. + * Creates a BuildRouteResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.AprioriParameters + * @memberof routerrpc.BuildRouteResponse * @static * @param {Object.} object Plain object - * @returns {routerrpc.AprioriParameters} AprioriParameters + * @returns {routerrpc.BuildRouteResponse} BuildRouteResponse */ - AprioriParameters.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.AprioriParameters) + BuildRouteResponse.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.BuildRouteResponse) return object; - let message = new $root.routerrpc.AprioriParameters(); - if (object.half_life_seconds != null) - if ($util.Long) - (message.half_life_seconds = $util.Long.fromValue(object.half_life_seconds)).unsigned = true; - else if (typeof object.half_life_seconds === "string") - message.half_life_seconds = parseInt(object.half_life_seconds, 10); - else if (typeof object.half_life_seconds === "number") - message.half_life_seconds = object.half_life_seconds; - else if (typeof object.half_life_seconds === "object") - message.half_life_seconds = new $util.LongBits(object.half_life_seconds.low >>> 0, object.half_life_seconds.high >>> 0).toNumber(true); - if (object.hop_probability != null) - message.hop_probability = Number(object.hop_probability); - if (object.weight != null) - message.weight = Number(object.weight); - if (object.capacity_fraction != null) - message.capacity_fraction = Number(object.capacity_fraction); - return message; - }; - - /** - * Creates a plain object from an AprioriParameters message. Also converts values to other types if specified. - * @function toObject - * @memberof routerrpc.AprioriParameters - * @static - * @param {routerrpc.AprioriParameters} message AprioriParameters - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AprioriParameters.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.half_life_seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.half_life_seconds = options.longs === String ? "0" : 0; - object.hop_probability = 0; - object.weight = 0; - object.capacity_fraction = 0; - } - if (message.half_life_seconds != null && message.hasOwnProperty("half_life_seconds")) - if (typeof message.half_life_seconds === "number") - object.half_life_seconds = options.longs === String ? String(message.half_life_seconds) : message.half_life_seconds; - else - object.half_life_seconds = options.longs === String ? $util.Long.prototype.toString.call(message.half_life_seconds) : options.longs === Number ? new $util.LongBits(message.half_life_seconds.low >>> 0, message.half_life_seconds.high >>> 0).toNumber(true) : message.half_life_seconds; - if (message.hop_probability != null && message.hasOwnProperty("hop_probability")) - object.hop_probability = options.json && !isFinite(message.hop_probability) ? String(message.hop_probability) : message.hop_probability; - if (message.weight != null && message.hasOwnProperty("weight")) - object.weight = options.json && !isFinite(message.weight) ? String(message.weight) : message.weight; - if (message.capacity_fraction != null && message.hasOwnProperty("capacity_fraction")) - object.capacity_fraction = options.json && !isFinite(message.capacity_fraction) ? String(message.capacity_fraction) : message.capacity_fraction; + let message = new $root.routerrpc.BuildRouteResponse(); + if (object.route != null) { + if (typeof object.route !== "object") + throw TypeError(".routerrpc.BuildRouteResponse.route: object expected"); + message.route = $root.lnrpc.Route.fromObject(object.route); + } + return message; + }; + + /** + * Creates a plain object from a BuildRouteResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof routerrpc.BuildRouteResponse + * @static + * @param {routerrpc.BuildRouteResponse} message BuildRouteResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BuildRouteResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.route = null; + if (message.route != null && message.hasOwnProperty("route")) + object.route = $root.lnrpc.Route.toObject(message.route, options); return object; }; /** - * Converts this AprioriParameters to JSON. + * Converts this BuildRouteResponse to JSON. * @function toJSON - * @memberof routerrpc.AprioriParameters + * @memberof routerrpc.BuildRouteResponse * @instance * @returns {Object.} JSON object */ - AprioriParameters.prototype.toJSON = function toJSON() { + BuildRouteResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AprioriParameters + * Gets the default type url for BuildRouteResponse * @function getTypeUrl - * @memberof routerrpc.AprioriParameters + * @memberof routerrpc.BuildRouteResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AprioriParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BuildRouteResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.AprioriParameters"; + return typeUrlPrefix + "/routerrpc.BuildRouteResponse"; }; - return AprioriParameters; + return BuildRouteResponse; })(); - routerrpc.QueryProbabilityRequest = (function() { + routerrpc.SubscribeHtlcEventsRequest = (function() { /** - * Properties of a QueryProbabilityRequest. + * Properties of a SubscribeHtlcEventsRequest. * @memberof routerrpc - * @interface IQueryProbabilityRequest - * @property {Uint8Array|null} [from_node] QueryProbabilityRequest from_node - * @property {Uint8Array|null} [to_node] QueryProbabilityRequest to_node - * @property {Long|null} [amt_msat] QueryProbabilityRequest amt_msat + * @interface ISubscribeHtlcEventsRequest */ /** - * Constructs a new QueryProbabilityRequest. + * Constructs a new SubscribeHtlcEventsRequest. * @memberof routerrpc - * @classdesc Represents a QueryProbabilityRequest. - * @implements IQueryProbabilityRequest + * @classdesc Represents a SubscribeHtlcEventsRequest. + * @implements ISubscribeHtlcEventsRequest * @constructor - * @param {routerrpc.IQueryProbabilityRequest=} [properties] Properties to set + * @param {routerrpc.ISubscribeHtlcEventsRequest=} [properties] Properties to set */ - function QueryProbabilityRequest(properties) { + function SubscribeHtlcEventsRequest(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -90831,105 +93838,63 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * QueryProbabilityRequest from_node. - * @member {Uint8Array} from_node - * @memberof routerrpc.QueryProbabilityRequest - * @instance - */ - QueryProbabilityRequest.prototype.from_node = $util.newBuffer([]); - - /** - * QueryProbabilityRequest to_node. - * @member {Uint8Array} to_node - * @memberof routerrpc.QueryProbabilityRequest - * @instance - */ - QueryProbabilityRequest.prototype.to_node = $util.newBuffer([]); - - /** - * QueryProbabilityRequest amt_msat. - * @member {Long} amt_msat - * @memberof routerrpc.QueryProbabilityRequest - * @instance - */ - QueryProbabilityRequest.prototype.amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new QueryProbabilityRequest instance using the specified properties. + * Creates a new SubscribeHtlcEventsRequest instance using the specified properties. * @function create - * @memberof routerrpc.QueryProbabilityRequest + * @memberof routerrpc.SubscribeHtlcEventsRequest * @static - * @param {routerrpc.IQueryProbabilityRequest=} [properties] Properties to set - * @returns {routerrpc.QueryProbabilityRequest} QueryProbabilityRequest instance + * @param {routerrpc.ISubscribeHtlcEventsRequest=} [properties] Properties to set + * @returns {routerrpc.SubscribeHtlcEventsRequest} SubscribeHtlcEventsRequest instance */ - QueryProbabilityRequest.create = function create(properties) { - return new QueryProbabilityRequest(properties); + SubscribeHtlcEventsRequest.create = function create(properties) { + return new SubscribeHtlcEventsRequest(properties); }; /** - * Encodes the specified QueryProbabilityRequest message. Does not implicitly {@link routerrpc.QueryProbabilityRequest.verify|verify} messages. + * Encodes the specified SubscribeHtlcEventsRequest message. Does not implicitly {@link routerrpc.SubscribeHtlcEventsRequest.verify|verify} messages. * @function encode - * @memberof routerrpc.QueryProbabilityRequest + * @memberof routerrpc.SubscribeHtlcEventsRequest * @static - * @param {routerrpc.IQueryProbabilityRequest} message QueryProbabilityRequest message or plain object to encode + * @param {routerrpc.ISubscribeHtlcEventsRequest} message SubscribeHtlcEventsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryProbabilityRequest.encode = function encode(message, writer) { + SubscribeHtlcEventsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.from_node != null && Object.hasOwnProperty.call(message, "from_node")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.from_node); - if (message.to_node != null && Object.hasOwnProperty.call(message, "to_node")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.to_node); - if (message.amt_msat != null && Object.hasOwnProperty.call(message, "amt_msat")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.amt_msat); return writer; }; /** - * Encodes the specified QueryProbabilityRequest message, length delimited. Does not implicitly {@link routerrpc.QueryProbabilityRequest.verify|verify} messages. + * Encodes the specified SubscribeHtlcEventsRequest message, length delimited. Does not implicitly {@link routerrpc.SubscribeHtlcEventsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.QueryProbabilityRequest + * @memberof routerrpc.SubscribeHtlcEventsRequest * @static - * @param {routerrpc.IQueryProbabilityRequest} message QueryProbabilityRequest message or plain object to encode + * @param {routerrpc.ISubscribeHtlcEventsRequest} message SubscribeHtlcEventsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryProbabilityRequest.encodeDelimited = function encodeDelimited(message, writer) { + SubscribeHtlcEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a QueryProbabilityRequest message from the specified reader or buffer. + * Decodes a SubscribeHtlcEventsRequest message from the specified reader or buffer. * @function decode - * @memberof routerrpc.QueryProbabilityRequest + * @memberof routerrpc.SubscribeHtlcEventsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.QueryProbabilityRequest} QueryProbabilityRequest + * @returns {routerrpc.SubscribeHtlcEventsRequest} SubscribeHtlcEventsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryProbabilityRequest.decode = function decode(reader, length) { + SubscribeHtlcEventsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.QueryProbabilityRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SubscribeHtlcEventsRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.from_node = reader.bytes(); - break; - } - case 2: { - message.to_node = reader.bytes(); - break; - } - case 3: { - message.amt_msat = reader.int64(); - break; - } default: reader.skipType(tag & 7); break; @@ -90939,172 +93904,120 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a QueryProbabilityRequest message from the specified reader or buffer, length delimited. + * Decodes a SubscribeHtlcEventsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.QueryProbabilityRequest + * @memberof routerrpc.SubscribeHtlcEventsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.QueryProbabilityRequest} QueryProbabilityRequest + * @returns {routerrpc.SubscribeHtlcEventsRequest} SubscribeHtlcEventsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryProbabilityRequest.decodeDelimited = function decodeDelimited(reader) { + SubscribeHtlcEventsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a QueryProbabilityRequest message. + * Verifies a SubscribeHtlcEventsRequest message. * @function verify - * @memberof routerrpc.QueryProbabilityRequest + * @memberof routerrpc.SubscribeHtlcEventsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - QueryProbabilityRequest.verify = function verify(message) { + SubscribeHtlcEventsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.from_node != null && message.hasOwnProperty("from_node")) - if (!(message.from_node && typeof message.from_node.length === "number" || $util.isString(message.from_node))) - return "from_node: buffer expected"; - if (message.to_node != null && message.hasOwnProperty("to_node")) - if (!(message.to_node && typeof message.to_node.length === "number" || $util.isString(message.to_node))) - return "to_node: buffer expected"; - if (message.amt_msat != null && message.hasOwnProperty("amt_msat")) - if (!$util.isInteger(message.amt_msat) && !(message.amt_msat && $util.isInteger(message.amt_msat.low) && $util.isInteger(message.amt_msat.high))) - return "amt_msat: integer|Long expected"; return null; }; /** - * Creates a QueryProbabilityRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SubscribeHtlcEventsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.QueryProbabilityRequest + * @memberof routerrpc.SubscribeHtlcEventsRequest * @static * @param {Object.} object Plain object - * @returns {routerrpc.QueryProbabilityRequest} QueryProbabilityRequest + * @returns {routerrpc.SubscribeHtlcEventsRequest} SubscribeHtlcEventsRequest */ - QueryProbabilityRequest.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.QueryProbabilityRequest) + SubscribeHtlcEventsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.SubscribeHtlcEventsRequest) return object; - let message = new $root.routerrpc.QueryProbabilityRequest(); - if (object.from_node != null) - if (typeof object.from_node === "string") - $util.base64.decode(object.from_node, message.from_node = $util.newBuffer($util.base64.length(object.from_node)), 0); - else if (object.from_node.length >= 0) - message.from_node = object.from_node; - if (object.to_node != null) - if (typeof object.to_node === "string") - $util.base64.decode(object.to_node, message.to_node = $util.newBuffer($util.base64.length(object.to_node)), 0); - else if (object.to_node.length >= 0) - message.to_node = object.to_node; - if (object.amt_msat != null) - if ($util.Long) - (message.amt_msat = $util.Long.fromValue(object.amt_msat)).unsigned = false; - else if (typeof object.amt_msat === "string") - message.amt_msat = parseInt(object.amt_msat, 10); - else if (typeof object.amt_msat === "number") - message.amt_msat = object.amt_msat; - else if (typeof object.amt_msat === "object") - message.amt_msat = new $util.LongBits(object.amt_msat.low >>> 0, object.amt_msat.high >>> 0).toNumber(); - return message; + return new $root.routerrpc.SubscribeHtlcEventsRequest(); }; /** - * Creates a plain object from a QueryProbabilityRequest message. Also converts values to other types if specified. + * Creates a plain object from a SubscribeHtlcEventsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.QueryProbabilityRequest + * @memberof routerrpc.SubscribeHtlcEventsRequest * @static - * @param {routerrpc.QueryProbabilityRequest} message QueryProbabilityRequest + * @param {routerrpc.SubscribeHtlcEventsRequest} message SubscribeHtlcEventsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryProbabilityRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if (options.bytes === String) - object.from_node = ""; - else { - object.from_node = []; - if (options.bytes !== Array) - object.from_node = $util.newBuffer(object.from_node); - } - if (options.bytes === String) - object.to_node = ""; - else { - object.to_node = []; - if (options.bytes !== Array) - object.to_node = $util.newBuffer(object.to_node); - } - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.amt_msat = options.longs === String ? "0" : 0; - } - if (message.from_node != null && message.hasOwnProperty("from_node")) - object.from_node = options.bytes === String ? $util.base64.encode(message.from_node, 0, message.from_node.length) : options.bytes === Array ? Array.prototype.slice.call(message.from_node) : message.from_node; - if (message.to_node != null && message.hasOwnProperty("to_node")) - object.to_node = options.bytes === String ? $util.base64.encode(message.to_node, 0, message.to_node.length) : options.bytes === Array ? Array.prototype.slice.call(message.to_node) : message.to_node; - if (message.amt_msat != null && message.hasOwnProperty("amt_msat")) - if (typeof message.amt_msat === "number") - object.amt_msat = options.longs === String ? String(message.amt_msat) : message.amt_msat; - else - object.amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_msat) : options.longs === Number ? new $util.LongBits(message.amt_msat.low >>> 0, message.amt_msat.high >>> 0).toNumber() : message.amt_msat; - return object; + SubscribeHtlcEventsRequest.toObject = function toObject() { + return {}; }; /** - * Converts this QueryProbabilityRequest to JSON. + * Converts this SubscribeHtlcEventsRequest to JSON. * @function toJSON - * @memberof routerrpc.QueryProbabilityRequest + * @memberof routerrpc.SubscribeHtlcEventsRequest * @instance * @returns {Object.} JSON object */ - QueryProbabilityRequest.prototype.toJSON = function toJSON() { + SubscribeHtlcEventsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for QueryProbabilityRequest + * Gets the default type url for SubscribeHtlcEventsRequest * @function getTypeUrl - * @memberof routerrpc.QueryProbabilityRequest + * @memberof routerrpc.SubscribeHtlcEventsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - QueryProbabilityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SubscribeHtlcEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.QueryProbabilityRequest"; + return typeUrlPrefix + "/routerrpc.SubscribeHtlcEventsRequest"; }; - return QueryProbabilityRequest; + return SubscribeHtlcEventsRequest; })(); - routerrpc.QueryProbabilityResponse = (function() { + routerrpc.HtlcEvent = (function() { /** - * Properties of a QueryProbabilityResponse. + * Properties of a HtlcEvent. * @memberof routerrpc - * @interface IQueryProbabilityResponse - * @property {number|null} [probability] QueryProbabilityResponse probability - * @property {routerrpc.IPairData|null} [history] QueryProbabilityResponse history + * @interface IHtlcEvent + * @property {Long|null} [incoming_channel_id] HtlcEvent incoming_channel_id + * @property {Long|null} [outgoing_channel_id] HtlcEvent outgoing_channel_id + * @property {Long|null} [incoming_htlc_id] HtlcEvent incoming_htlc_id + * @property {Long|null} [outgoing_htlc_id] HtlcEvent outgoing_htlc_id + * @property {Long|null} [timestamp_ns] HtlcEvent timestamp_ns + * @property {routerrpc.HtlcEvent.EventType|null} [event_type] HtlcEvent event_type + * @property {routerrpc.IForwardEvent|null} [forward_event] HtlcEvent forward_event + * @property {routerrpc.IForwardFailEvent|null} [forward_fail_event] HtlcEvent forward_fail_event + * @property {routerrpc.ISettleEvent|null} [settle_event] HtlcEvent settle_event + * @property {routerrpc.ILinkFailEvent|null} [link_fail_event] HtlcEvent link_fail_event + * @property {routerrpc.ISubscribedEvent|null} [subscribed_event] HtlcEvent subscribed_event + * @property {routerrpc.IFinalHtlcEvent|null} [final_htlc_event] HtlcEvent final_htlc_event */ /** - * Constructs a new QueryProbabilityResponse. + * Constructs a new HtlcEvent. * @memberof routerrpc - * @classdesc Represents a QueryProbabilityResponse. - * @implements IQueryProbabilityResponse + * @classdesc Represents a HtlcEvent. + * @implements IHtlcEvent * @constructor - * @param {routerrpc.IQueryProbabilityResponse=} [properties] Properties to set + * @param {routerrpc.IHtlcEvent=} [properties] Properties to set */ - function QueryProbabilityResponse(properties) { + function HtlcEvent(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -91112,89 +94025,243 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * QueryProbabilityResponse probability. - * @member {number} probability - * @memberof routerrpc.QueryProbabilityResponse + * HtlcEvent incoming_channel_id. + * @member {Long} incoming_channel_id + * @memberof routerrpc.HtlcEvent * @instance */ - QueryProbabilityResponse.prototype.probability = 0; + HtlcEvent.prototype.incoming_channel_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * QueryProbabilityResponse history. - * @member {routerrpc.IPairData|null|undefined} history - * @memberof routerrpc.QueryProbabilityResponse + * HtlcEvent outgoing_channel_id. + * @member {Long} outgoing_channel_id + * @memberof routerrpc.HtlcEvent * @instance */ - QueryProbabilityResponse.prototype.history = null; + HtlcEvent.prototype.outgoing_channel_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Creates a new QueryProbabilityResponse instance using the specified properties. + * HtlcEvent incoming_htlc_id. + * @member {Long} incoming_htlc_id + * @memberof routerrpc.HtlcEvent + * @instance + */ + HtlcEvent.prototype.incoming_htlc_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * HtlcEvent outgoing_htlc_id. + * @member {Long} outgoing_htlc_id + * @memberof routerrpc.HtlcEvent + * @instance + */ + HtlcEvent.prototype.outgoing_htlc_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * HtlcEvent timestamp_ns. + * @member {Long} timestamp_ns + * @memberof routerrpc.HtlcEvent + * @instance + */ + HtlcEvent.prototype.timestamp_ns = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * HtlcEvent event_type. + * @member {routerrpc.HtlcEvent.EventType} event_type + * @memberof routerrpc.HtlcEvent + * @instance + */ + HtlcEvent.prototype.event_type = 0; + + /** + * HtlcEvent forward_event. + * @member {routerrpc.IForwardEvent|null|undefined} forward_event + * @memberof routerrpc.HtlcEvent + * @instance + */ + HtlcEvent.prototype.forward_event = null; + + /** + * HtlcEvent forward_fail_event. + * @member {routerrpc.IForwardFailEvent|null|undefined} forward_fail_event + * @memberof routerrpc.HtlcEvent + * @instance + */ + HtlcEvent.prototype.forward_fail_event = null; + + /** + * HtlcEvent settle_event. + * @member {routerrpc.ISettleEvent|null|undefined} settle_event + * @memberof routerrpc.HtlcEvent + * @instance + */ + HtlcEvent.prototype.settle_event = null; + + /** + * HtlcEvent link_fail_event. + * @member {routerrpc.ILinkFailEvent|null|undefined} link_fail_event + * @memberof routerrpc.HtlcEvent + * @instance + */ + HtlcEvent.prototype.link_fail_event = null; + + /** + * HtlcEvent subscribed_event. + * @member {routerrpc.ISubscribedEvent|null|undefined} subscribed_event + * @memberof routerrpc.HtlcEvent + * @instance + */ + HtlcEvent.prototype.subscribed_event = null; + + /** + * HtlcEvent final_htlc_event. + * @member {routerrpc.IFinalHtlcEvent|null|undefined} final_htlc_event + * @memberof routerrpc.HtlcEvent + * @instance + */ + HtlcEvent.prototype.final_htlc_event = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * HtlcEvent event. + * @member {"forward_event"|"forward_fail_event"|"settle_event"|"link_fail_event"|"subscribed_event"|"final_htlc_event"|undefined} event + * @memberof routerrpc.HtlcEvent + * @instance + */ + Object.defineProperty(HtlcEvent.prototype, "event", { + get: $util.oneOfGetter($oneOfFields = ["forward_event", "forward_fail_event", "settle_event", "link_fail_event", "subscribed_event", "final_htlc_event"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HtlcEvent instance using the specified properties. * @function create - * @memberof routerrpc.QueryProbabilityResponse + * @memberof routerrpc.HtlcEvent * @static - * @param {routerrpc.IQueryProbabilityResponse=} [properties] Properties to set - * @returns {routerrpc.QueryProbabilityResponse} QueryProbabilityResponse instance + * @param {routerrpc.IHtlcEvent=} [properties] Properties to set + * @returns {routerrpc.HtlcEvent} HtlcEvent instance */ - QueryProbabilityResponse.create = function create(properties) { - return new QueryProbabilityResponse(properties); + HtlcEvent.create = function create(properties) { + return new HtlcEvent(properties); }; /** - * Encodes the specified QueryProbabilityResponse message. Does not implicitly {@link routerrpc.QueryProbabilityResponse.verify|verify} messages. + * Encodes the specified HtlcEvent message. Does not implicitly {@link routerrpc.HtlcEvent.verify|verify} messages. * @function encode - * @memberof routerrpc.QueryProbabilityResponse + * @memberof routerrpc.HtlcEvent * @static - * @param {routerrpc.IQueryProbabilityResponse} message QueryProbabilityResponse message or plain object to encode + * @param {routerrpc.IHtlcEvent} message HtlcEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryProbabilityResponse.encode = function encode(message, writer) { + HtlcEvent.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.probability != null && Object.hasOwnProperty.call(message, "probability")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.probability); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - $root.routerrpc.PairData.encode(message.history, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.incoming_channel_id != null && Object.hasOwnProperty.call(message, "incoming_channel_id")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.incoming_channel_id); + if (message.outgoing_channel_id != null && Object.hasOwnProperty.call(message, "outgoing_channel_id")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.outgoing_channel_id); + if (message.incoming_htlc_id != null && Object.hasOwnProperty.call(message, "incoming_htlc_id")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.incoming_htlc_id); + if (message.outgoing_htlc_id != null && Object.hasOwnProperty.call(message, "outgoing_htlc_id")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.outgoing_htlc_id); + if (message.timestamp_ns != null && Object.hasOwnProperty.call(message, "timestamp_ns")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.timestamp_ns); + if (message.event_type != null && Object.hasOwnProperty.call(message, "event_type")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.event_type); + if (message.forward_event != null && Object.hasOwnProperty.call(message, "forward_event")) + $root.routerrpc.ForwardEvent.encode(message.forward_event, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.forward_fail_event != null && Object.hasOwnProperty.call(message, "forward_fail_event")) + $root.routerrpc.ForwardFailEvent.encode(message.forward_fail_event, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.settle_event != null && Object.hasOwnProperty.call(message, "settle_event")) + $root.routerrpc.SettleEvent.encode(message.settle_event, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.link_fail_event != null && Object.hasOwnProperty.call(message, "link_fail_event")) + $root.routerrpc.LinkFailEvent.encode(message.link_fail_event, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.subscribed_event != null && Object.hasOwnProperty.call(message, "subscribed_event")) + $root.routerrpc.SubscribedEvent.encode(message.subscribed_event, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.final_htlc_event != null && Object.hasOwnProperty.call(message, "final_htlc_event")) + $root.routerrpc.FinalHtlcEvent.encode(message.final_htlc_event, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; /** - * Encodes the specified QueryProbabilityResponse message, length delimited. Does not implicitly {@link routerrpc.QueryProbabilityResponse.verify|verify} messages. + * Encodes the specified HtlcEvent message, length delimited. Does not implicitly {@link routerrpc.HtlcEvent.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.QueryProbabilityResponse + * @memberof routerrpc.HtlcEvent * @static - * @param {routerrpc.IQueryProbabilityResponse} message QueryProbabilityResponse message or plain object to encode + * @param {routerrpc.IHtlcEvent} message HtlcEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryProbabilityResponse.encodeDelimited = function encodeDelimited(message, writer) { + HtlcEvent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a QueryProbabilityResponse message from the specified reader or buffer. + * Decodes a HtlcEvent message from the specified reader or buffer. * @function decode - * @memberof routerrpc.QueryProbabilityResponse + * @memberof routerrpc.HtlcEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.QueryProbabilityResponse} QueryProbabilityResponse + * @returns {routerrpc.HtlcEvent} HtlcEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryProbabilityResponse.decode = function decode(reader, length) { + HtlcEvent.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.QueryProbabilityResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.HtlcEvent(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.probability = reader.double(); + message.incoming_channel_id = reader.uint64(); break; } case 2: { - message.history = $root.routerrpc.PairData.decode(reader, reader.uint32()); + message.outgoing_channel_id = reader.uint64(); + break; + } + case 3: { + message.incoming_htlc_id = reader.uint64(); + break; + } + case 4: { + message.outgoing_htlc_id = reader.uint64(); + break; + } + case 5: { + message.timestamp_ns = reader.uint64(); + break; + } + case 6: { + message.event_type = reader.int32(); + break; + } + case 7: { + message.forward_event = $root.routerrpc.ForwardEvent.decode(reader, reader.uint32()); + break; + } + case 8: { + message.forward_fail_event = $root.routerrpc.ForwardFailEvent.decode(reader, reader.uint32()); + break; + } + case 9: { + message.settle_event = $root.routerrpc.SettleEvent.decode(reader, reader.uint32()); + break; + } + case 10: { + message.link_fail_event = $root.routerrpc.LinkFailEvent.decode(reader, reader.uint32()); + break; + } + case 11: { + message.subscribed_event = $root.routerrpc.SubscribedEvent.decode(reader, reader.uint32()); + break; + } + case 12: { + message.final_htlc_event = $root.routerrpc.FinalHtlcEvent.decode(reader, reader.uint32()); break; } default: @@ -91206,141 +94273,402 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a QueryProbabilityResponse message from the specified reader or buffer, length delimited. + * Decodes a HtlcEvent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.QueryProbabilityResponse + * @memberof routerrpc.HtlcEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.QueryProbabilityResponse} QueryProbabilityResponse + * @returns {routerrpc.HtlcEvent} HtlcEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryProbabilityResponse.decodeDelimited = function decodeDelimited(reader) { + HtlcEvent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a QueryProbabilityResponse message. + * Verifies a HtlcEvent message. * @function verify - * @memberof routerrpc.QueryProbabilityResponse + * @memberof routerrpc.HtlcEvent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - QueryProbabilityResponse.verify = function verify(message) { + HtlcEvent.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.probability != null && message.hasOwnProperty("probability")) - if (typeof message.probability !== "number") - return "probability: number expected"; - if (message.history != null && message.hasOwnProperty("history")) { - let error = $root.routerrpc.PairData.verify(message.history); - if (error) - return "history." + error; + let properties = {}; + if (message.incoming_channel_id != null && message.hasOwnProperty("incoming_channel_id")) + if (!$util.isInteger(message.incoming_channel_id) && !(message.incoming_channel_id && $util.isInteger(message.incoming_channel_id.low) && $util.isInteger(message.incoming_channel_id.high))) + return "incoming_channel_id: integer|Long expected"; + if (message.outgoing_channel_id != null && message.hasOwnProperty("outgoing_channel_id")) + if (!$util.isInteger(message.outgoing_channel_id) && !(message.outgoing_channel_id && $util.isInteger(message.outgoing_channel_id.low) && $util.isInteger(message.outgoing_channel_id.high))) + return "outgoing_channel_id: integer|Long expected"; + if (message.incoming_htlc_id != null && message.hasOwnProperty("incoming_htlc_id")) + if (!$util.isInteger(message.incoming_htlc_id) && !(message.incoming_htlc_id && $util.isInteger(message.incoming_htlc_id.low) && $util.isInteger(message.incoming_htlc_id.high))) + return "incoming_htlc_id: integer|Long expected"; + if (message.outgoing_htlc_id != null && message.hasOwnProperty("outgoing_htlc_id")) + if (!$util.isInteger(message.outgoing_htlc_id) && !(message.outgoing_htlc_id && $util.isInteger(message.outgoing_htlc_id.low) && $util.isInteger(message.outgoing_htlc_id.high))) + return "outgoing_htlc_id: integer|Long expected"; + if (message.timestamp_ns != null && message.hasOwnProperty("timestamp_ns")) + if (!$util.isInteger(message.timestamp_ns) && !(message.timestamp_ns && $util.isInteger(message.timestamp_ns.low) && $util.isInteger(message.timestamp_ns.high))) + return "timestamp_ns: integer|Long expected"; + if (message.event_type != null && message.hasOwnProperty("event_type")) + switch (message.event_type) { + default: + return "event_type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.forward_event != null && message.hasOwnProperty("forward_event")) { + properties.event = 1; + { + let error = $root.routerrpc.ForwardEvent.verify(message.forward_event); + if (error) + return "forward_event." + error; + } + } + if (message.forward_fail_event != null && message.hasOwnProperty("forward_fail_event")) { + if (properties.event === 1) + return "event: multiple values"; + properties.event = 1; + { + let error = $root.routerrpc.ForwardFailEvent.verify(message.forward_fail_event); + if (error) + return "forward_fail_event." + error; + } + } + if (message.settle_event != null && message.hasOwnProperty("settle_event")) { + if (properties.event === 1) + return "event: multiple values"; + properties.event = 1; + { + let error = $root.routerrpc.SettleEvent.verify(message.settle_event); + if (error) + return "settle_event." + error; + } + } + if (message.link_fail_event != null && message.hasOwnProperty("link_fail_event")) { + if (properties.event === 1) + return "event: multiple values"; + properties.event = 1; + { + let error = $root.routerrpc.LinkFailEvent.verify(message.link_fail_event); + if (error) + return "link_fail_event." + error; + } + } + if (message.subscribed_event != null && message.hasOwnProperty("subscribed_event")) { + if (properties.event === 1) + return "event: multiple values"; + properties.event = 1; + { + let error = $root.routerrpc.SubscribedEvent.verify(message.subscribed_event); + if (error) + return "subscribed_event." + error; + } + } + if (message.final_htlc_event != null && message.hasOwnProperty("final_htlc_event")) { + if (properties.event === 1) + return "event: multiple values"; + properties.event = 1; + { + let error = $root.routerrpc.FinalHtlcEvent.verify(message.final_htlc_event); + if (error) + return "final_htlc_event." + error; + } } return null; }; /** - * Creates a QueryProbabilityResponse message from a plain object. Also converts values to their respective internal types. + * Creates a HtlcEvent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.QueryProbabilityResponse + * @memberof routerrpc.HtlcEvent * @static * @param {Object.} object Plain object - * @returns {routerrpc.QueryProbabilityResponse} QueryProbabilityResponse + * @returns {routerrpc.HtlcEvent} HtlcEvent */ - QueryProbabilityResponse.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.QueryProbabilityResponse) + HtlcEvent.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.HtlcEvent) return object; - let message = new $root.routerrpc.QueryProbabilityResponse(); - if (object.probability != null) - message.probability = Number(object.probability); - if (object.history != null) { - if (typeof object.history !== "object") - throw TypeError(".routerrpc.QueryProbabilityResponse.history: object expected"); - message.history = $root.routerrpc.PairData.fromObject(object.history); + let message = new $root.routerrpc.HtlcEvent(); + if (object.incoming_channel_id != null) + if ($util.Long) + (message.incoming_channel_id = $util.Long.fromValue(object.incoming_channel_id)).unsigned = true; + else if (typeof object.incoming_channel_id === "string") + message.incoming_channel_id = parseInt(object.incoming_channel_id, 10); + else if (typeof object.incoming_channel_id === "number") + message.incoming_channel_id = object.incoming_channel_id; + else if (typeof object.incoming_channel_id === "object") + message.incoming_channel_id = new $util.LongBits(object.incoming_channel_id.low >>> 0, object.incoming_channel_id.high >>> 0).toNumber(true); + if (object.outgoing_channel_id != null) + if ($util.Long) + (message.outgoing_channel_id = $util.Long.fromValue(object.outgoing_channel_id)).unsigned = true; + else if (typeof object.outgoing_channel_id === "string") + message.outgoing_channel_id = parseInt(object.outgoing_channel_id, 10); + else if (typeof object.outgoing_channel_id === "number") + message.outgoing_channel_id = object.outgoing_channel_id; + else if (typeof object.outgoing_channel_id === "object") + message.outgoing_channel_id = new $util.LongBits(object.outgoing_channel_id.low >>> 0, object.outgoing_channel_id.high >>> 0).toNumber(true); + if (object.incoming_htlc_id != null) + if ($util.Long) + (message.incoming_htlc_id = $util.Long.fromValue(object.incoming_htlc_id)).unsigned = true; + else if (typeof object.incoming_htlc_id === "string") + message.incoming_htlc_id = parseInt(object.incoming_htlc_id, 10); + else if (typeof object.incoming_htlc_id === "number") + message.incoming_htlc_id = object.incoming_htlc_id; + else if (typeof object.incoming_htlc_id === "object") + message.incoming_htlc_id = new $util.LongBits(object.incoming_htlc_id.low >>> 0, object.incoming_htlc_id.high >>> 0).toNumber(true); + if (object.outgoing_htlc_id != null) + if ($util.Long) + (message.outgoing_htlc_id = $util.Long.fromValue(object.outgoing_htlc_id)).unsigned = true; + else if (typeof object.outgoing_htlc_id === "string") + message.outgoing_htlc_id = parseInt(object.outgoing_htlc_id, 10); + else if (typeof object.outgoing_htlc_id === "number") + message.outgoing_htlc_id = object.outgoing_htlc_id; + else if (typeof object.outgoing_htlc_id === "object") + message.outgoing_htlc_id = new $util.LongBits(object.outgoing_htlc_id.low >>> 0, object.outgoing_htlc_id.high >>> 0).toNumber(true); + if (object.timestamp_ns != null) + if ($util.Long) + (message.timestamp_ns = $util.Long.fromValue(object.timestamp_ns)).unsigned = true; + else if (typeof object.timestamp_ns === "string") + message.timestamp_ns = parseInt(object.timestamp_ns, 10); + else if (typeof object.timestamp_ns === "number") + message.timestamp_ns = object.timestamp_ns; + else if (typeof object.timestamp_ns === "object") + message.timestamp_ns = new $util.LongBits(object.timestamp_ns.low >>> 0, object.timestamp_ns.high >>> 0).toNumber(true); + switch (object.event_type) { + default: + if (typeof object.event_type === "number") { + message.event_type = object.event_type; + break; + } + break; + case "UNKNOWN": + case 0: + message.event_type = 0; + break; + case "SEND": + case 1: + message.event_type = 1; + break; + case "RECEIVE": + case 2: + message.event_type = 2; + break; + case "FORWARD": + case 3: + message.event_type = 3; + break; + } + if (object.forward_event != null) { + if (typeof object.forward_event !== "object") + throw TypeError(".routerrpc.HtlcEvent.forward_event: object expected"); + message.forward_event = $root.routerrpc.ForwardEvent.fromObject(object.forward_event); + } + if (object.forward_fail_event != null) { + if (typeof object.forward_fail_event !== "object") + throw TypeError(".routerrpc.HtlcEvent.forward_fail_event: object expected"); + message.forward_fail_event = $root.routerrpc.ForwardFailEvent.fromObject(object.forward_fail_event); + } + if (object.settle_event != null) { + if (typeof object.settle_event !== "object") + throw TypeError(".routerrpc.HtlcEvent.settle_event: object expected"); + message.settle_event = $root.routerrpc.SettleEvent.fromObject(object.settle_event); + } + if (object.link_fail_event != null) { + if (typeof object.link_fail_event !== "object") + throw TypeError(".routerrpc.HtlcEvent.link_fail_event: object expected"); + message.link_fail_event = $root.routerrpc.LinkFailEvent.fromObject(object.link_fail_event); + } + if (object.subscribed_event != null) { + if (typeof object.subscribed_event !== "object") + throw TypeError(".routerrpc.HtlcEvent.subscribed_event: object expected"); + message.subscribed_event = $root.routerrpc.SubscribedEvent.fromObject(object.subscribed_event); + } + if (object.final_htlc_event != null) { + if (typeof object.final_htlc_event !== "object") + throw TypeError(".routerrpc.HtlcEvent.final_htlc_event: object expected"); + message.final_htlc_event = $root.routerrpc.FinalHtlcEvent.fromObject(object.final_htlc_event); } return message; }; /** - * Creates a plain object from a QueryProbabilityResponse message. Also converts values to other types if specified. + * Creates a plain object from a HtlcEvent message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.QueryProbabilityResponse + * @memberof routerrpc.HtlcEvent * @static - * @param {routerrpc.QueryProbabilityResponse} message QueryProbabilityResponse + * @param {routerrpc.HtlcEvent} message HtlcEvent * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryProbabilityResponse.toObject = function toObject(message, options) { + HtlcEvent.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; if (options.defaults) { - object.probability = 0; - object.history = null; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.incoming_channel_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.incoming_channel_id = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.outgoing_channel_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.outgoing_channel_id = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.incoming_htlc_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.incoming_htlc_id = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.outgoing_htlc_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.outgoing_htlc_id = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.timestamp_ns = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp_ns = options.longs === String ? "0" : 0; + object.event_type = options.enums === String ? "UNKNOWN" : 0; + } + if (message.incoming_channel_id != null && message.hasOwnProperty("incoming_channel_id")) + if (typeof message.incoming_channel_id === "number") + object.incoming_channel_id = options.longs === String ? String(message.incoming_channel_id) : message.incoming_channel_id; + else + object.incoming_channel_id = options.longs === String ? $util.Long.prototype.toString.call(message.incoming_channel_id) : options.longs === Number ? new $util.LongBits(message.incoming_channel_id.low >>> 0, message.incoming_channel_id.high >>> 0).toNumber(true) : message.incoming_channel_id; + if (message.outgoing_channel_id != null && message.hasOwnProperty("outgoing_channel_id")) + if (typeof message.outgoing_channel_id === "number") + object.outgoing_channel_id = options.longs === String ? String(message.outgoing_channel_id) : message.outgoing_channel_id; + else + object.outgoing_channel_id = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_channel_id) : options.longs === Number ? new $util.LongBits(message.outgoing_channel_id.low >>> 0, message.outgoing_channel_id.high >>> 0).toNumber(true) : message.outgoing_channel_id; + if (message.incoming_htlc_id != null && message.hasOwnProperty("incoming_htlc_id")) + if (typeof message.incoming_htlc_id === "number") + object.incoming_htlc_id = options.longs === String ? String(message.incoming_htlc_id) : message.incoming_htlc_id; + else + object.incoming_htlc_id = options.longs === String ? $util.Long.prototype.toString.call(message.incoming_htlc_id) : options.longs === Number ? new $util.LongBits(message.incoming_htlc_id.low >>> 0, message.incoming_htlc_id.high >>> 0).toNumber(true) : message.incoming_htlc_id; + if (message.outgoing_htlc_id != null && message.hasOwnProperty("outgoing_htlc_id")) + if (typeof message.outgoing_htlc_id === "number") + object.outgoing_htlc_id = options.longs === String ? String(message.outgoing_htlc_id) : message.outgoing_htlc_id; + else + object.outgoing_htlc_id = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_htlc_id) : options.longs === Number ? new $util.LongBits(message.outgoing_htlc_id.low >>> 0, message.outgoing_htlc_id.high >>> 0).toNumber(true) : message.outgoing_htlc_id; + if (message.timestamp_ns != null && message.hasOwnProperty("timestamp_ns")) + if (typeof message.timestamp_ns === "number") + object.timestamp_ns = options.longs === String ? String(message.timestamp_ns) : message.timestamp_ns; + else + object.timestamp_ns = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp_ns) : options.longs === Number ? new $util.LongBits(message.timestamp_ns.low >>> 0, message.timestamp_ns.high >>> 0).toNumber(true) : message.timestamp_ns; + if (message.event_type != null && message.hasOwnProperty("event_type")) + object.event_type = options.enums === String ? $root.routerrpc.HtlcEvent.EventType[message.event_type] === undefined ? message.event_type : $root.routerrpc.HtlcEvent.EventType[message.event_type] : message.event_type; + if (message.forward_event != null && message.hasOwnProperty("forward_event")) { + object.forward_event = $root.routerrpc.ForwardEvent.toObject(message.forward_event, options); + if (options.oneofs) + object.event = "forward_event"; + } + if (message.forward_fail_event != null && message.hasOwnProperty("forward_fail_event")) { + object.forward_fail_event = $root.routerrpc.ForwardFailEvent.toObject(message.forward_fail_event, options); + if (options.oneofs) + object.event = "forward_fail_event"; + } + if (message.settle_event != null && message.hasOwnProperty("settle_event")) { + object.settle_event = $root.routerrpc.SettleEvent.toObject(message.settle_event, options); + if (options.oneofs) + object.event = "settle_event"; + } + if (message.link_fail_event != null && message.hasOwnProperty("link_fail_event")) { + object.link_fail_event = $root.routerrpc.LinkFailEvent.toObject(message.link_fail_event, options); + if (options.oneofs) + object.event = "link_fail_event"; + } + if (message.subscribed_event != null && message.hasOwnProperty("subscribed_event")) { + object.subscribed_event = $root.routerrpc.SubscribedEvent.toObject(message.subscribed_event, options); + if (options.oneofs) + object.event = "subscribed_event"; + } + if (message.final_htlc_event != null && message.hasOwnProperty("final_htlc_event")) { + object.final_htlc_event = $root.routerrpc.FinalHtlcEvent.toObject(message.final_htlc_event, options); + if (options.oneofs) + object.event = "final_htlc_event"; } - if (message.probability != null && message.hasOwnProperty("probability")) - object.probability = options.json && !isFinite(message.probability) ? String(message.probability) : message.probability; - if (message.history != null && message.hasOwnProperty("history")) - object.history = $root.routerrpc.PairData.toObject(message.history, options); return object; }; /** - * Converts this QueryProbabilityResponse to JSON. + * Converts this HtlcEvent to JSON. * @function toJSON - * @memberof routerrpc.QueryProbabilityResponse + * @memberof routerrpc.HtlcEvent * @instance * @returns {Object.} JSON object */ - QueryProbabilityResponse.prototype.toJSON = function toJSON() { + HtlcEvent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for QueryProbabilityResponse + * Gets the default type url for HtlcEvent * @function getTypeUrl - * @memberof routerrpc.QueryProbabilityResponse + * @memberof routerrpc.HtlcEvent * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - QueryProbabilityResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + HtlcEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.QueryProbabilityResponse"; + return typeUrlPrefix + "/routerrpc.HtlcEvent"; }; - return QueryProbabilityResponse; + /** + * EventType enum. + * @name routerrpc.HtlcEvent.EventType + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} SEND=1 SEND value + * @property {number} RECEIVE=2 RECEIVE value + * @property {number} FORWARD=3 FORWARD value + */ + HtlcEvent.EventType = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "SEND"] = 1; + values[valuesById[2] = "RECEIVE"] = 2; + values[valuesById[3] = "FORWARD"] = 3; + return values; + })(); + + return HtlcEvent; })(); - routerrpc.BuildRouteRequest = (function() { + routerrpc.HtlcInfo = (function() { /** - * Properties of a BuildRouteRequest. + * Properties of a HtlcInfo. * @memberof routerrpc - * @interface IBuildRouteRequest - * @property {Long|null} [amt_msat] BuildRouteRequest amt_msat - * @property {number|null} [final_cltv_delta] BuildRouteRequest final_cltv_delta - * @property {Long|null} [outgoing_chan_id] BuildRouteRequest outgoing_chan_id - * @property {Array.|null} [hop_pubkeys] BuildRouteRequest hop_pubkeys - * @property {Uint8Array|null} [payment_addr] BuildRouteRequest payment_addr + * @interface IHtlcInfo + * @property {number|null} [incoming_timelock] HtlcInfo incoming_timelock + * @property {number|null} [outgoing_timelock] HtlcInfo outgoing_timelock + * @property {Long|null} [incoming_amt_msat] HtlcInfo incoming_amt_msat + * @property {Long|null} [outgoing_amt_msat] HtlcInfo outgoing_amt_msat */ /** - * Constructs a new BuildRouteRequest. + * Constructs a new HtlcInfo. * @memberof routerrpc - * @classdesc Represents a BuildRouteRequest. - * @implements IBuildRouteRequest + * @classdesc Represents a HtlcInfo. + * @implements IHtlcInfo * @constructor - * @param {routerrpc.IBuildRouteRequest=} [properties] Properties to set + * @param {routerrpc.IHtlcInfo=} [properties] Properties to set */ - function BuildRouteRequest(properties) { - this.hop_pubkeys = []; + function HtlcInfo(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -91348,134 +94676,117 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * BuildRouteRequest amt_msat. - * @member {Long} amt_msat - * @memberof routerrpc.BuildRouteRequest - * @instance - */ - BuildRouteRequest.prototype.amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * BuildRouteRequest final_cltv_delta. - * @member {number} final_cltv_delta - * @memberof routerrpc.BuildRouteRequest + * HtlcInfo incoming_timelock. + * @member {number} incoming_timelock + * @memberof routerrpc.HtlcInfo * @instance */ - BuildRouteRequest.prototype.final_cltv_delta = 0; + HtlcInfo.prototype.incoming_timelock = 0; /** - * BuildRouteRequest outgoing_chan_id. - * @member {Long} outgoing_chan_id - * @memberof routerrpc.BuildRouteRequest + * HtlcInfo outgoing_timelock. + * @member {number} outgoing_timelock + * @memberof routerrpc.HtlcInfo * @instance */ - BuildRouteRequest.prototype.outgoing_chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + HtlcInfo.prototype.outgoing_timelock = 0; /** - * BuildRouteRequest hop_pubkeys. - * @member {Array.} hop_pubkeys - * @memberof routerrpc.BuildRouteRequest + * HtlcInfo incoming_amt_msat. + * @member {Long} incoming_amt_msat + * @memberof routerrpc.HtlcInfo * @instance */ - BuildRouteRequest.prototype.hop_pubkeys = $util.emptyArray; + HtlcInfo.prototype.incoming_amt_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * BuildRouteRequest payment_addr. - * @member {Uint8Array} payment_addr - * @memberof routerrpc.BuildRouteRequest + * HtlcInfo outgoing_amt_msat. + * @member {Long} outgoing_amt_msat + * @memberof routerrpc.HtlcInfo * @instance */ - BuildRouteRequest.prototype.payment_addr = $util.newBuffer([]); + HtlcInfo.prototype.outgoing_amt_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Creates a new BuildRouteRequest instance using the specified properties. + * Creates a new HtlcInfo instance using the specified properties. * @function create - * @memberof routerrpc.BuildRouteRequest + * @memberof routerrpc.HtlcInfo * @static - * @param {routerrpc.IBuildRouteRequest=} [properties] Properties to set - * @returns {routerrpc.BuildRouteRequest} BuildRouteRequest instance + * @param {routerrpc.IHtlcInfo=} [properties] Properties to set + * @returns {routerrpc.HtlcInfo} HtlcInfo instance */ - BuildRouteRequest.create = function create(properties) { - return new BuildRouteRequest(properties); + HtlcInfo.create = function create(properties) { + return new HtlcInfo(properties); }; /** - * Encodes the specified BuildRouteRequest message. Does not implicitly {@link routerrpc.BuildRouteRequest.verify|verify} messages. + * Encodes the specified HtlcInfo message. Does not implicitly {@link routerrpc.HtlcInfo.verify|verify} messages. * @function encode - * @memberof routerrpc.BuildRouteRequest + * @memberof routerrpc.HtlcInfo * @static - * @param {routerrpc.IBuildRouteRequest} message BuildRouteRequest message or plain object to encode + * @param {routerrpc.IHtlcInfo} message HtlcInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BuildRouteRequest.encode = function encode(message, writer) { + HtlcInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.amt_msat != null && Object.hasOwnProperty.call(message, "amt_msat")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.amt_msat); - if (message.final_cltv_delta != null && Object.hasOwnProperty.call(message, "final_cltv_delta")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.final_cltv_delta); - if (message.outgoing_chan_id != null && Object.hasOwnProperty.call(message, "outgoing_chan_id")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.outgoing_chan_id); - if (message.hop_pubkeys != null && message.hop_pubkeys.length) - for (let i = 0; i < message.hop_pubkeys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.hop_pubkeys[i]); - if (message.payment_addr != null && Object.hasOwnProperty.call(message, "payment_addr")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.payment_addr); + if (message.incoming_timelock != null && Object.hasOwnProperty.call(message, "incoming_timelock")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.incoming_timelock); + if (message.outgoing_timelock != null && Object.hasOwnProperty.call(message, "outgoing_timelock")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.outgoing_timelock); + if (message.incoming_amt_msat != null && Object.hasOwnProperty.call(message, "incoming_amt_msat")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.incoming_amt_msat); + if (message.outgoing_amt_msat != null && Object.hasOwnProperty.call(message, "outgoing_amt_msat")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.outgoing_amt_msat); return writer; }; /** - * Encodes the specified BuildRouteRequest message, length delimited. Does not implicitly {@link routerrpc.BuildRouteRequest.verify|verify} messages. + * Encodes the specified HtlcInfo message, length delimited. Does not implicitly {@link routerrpc.HtlcInfo.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.BuildRouteRequest + * @memberof routerrpc.HtlcInfo * @static - * @param {routerrpc.IBuildRouteRequest} message BuildRouteRequest message or plain object to encode + * @param {routerrpc.IHtlcInfo} message HtlcInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BuildRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + HtlcInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BuildRouteRequest message from the specified reader or buffer. + * Decodes a HtlcInfo message from the specified reader or buffer. * @function decode - * @memberof routerrpc.BuildRouteRequest + * @memberof routerrpc.HtlcInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.BuildRouteRequest} BuildRouteRequest + * @returns {routerrpc.HtlcInfo} HtlcInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BuildRouteRequest.decode = function decode(reader, length) { + HtlcInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.BuildRouteRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.HtlcInfo(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.amt_msat = reader.int64(); + message.incoming_timelock = reader.uint32(); break; } case 2: { - message.final_cltv_delta = reader.int32(); + message.outgoing_timelock = reader.uint32(); break; } case 3: { - message.outgoing_chan_id = reader.uint64(); + message.incoming_amt_msat = reader.uint64(); break; } case 4: { - if (!(message.hop_pubkeys && message.hop_pubkeys.length)) - message.hop_pubkeys = []; - message.hop_pubkeys.push(reader.bytes()); - break; - } - case 5: { - message.payment_addr = reader.bytes(); + message.outgoing_amt_msat = reader.uint64(); break; } default: @@ -91487,208 +94798,175 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a BuildRouteRequest message from the specified reader or buffer, length delimited. + * Decodes a HtlcInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.BuildRouteRequest + * @memberof routerrpc.HtlcInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.BuildRouteRequest} BuildRouteRequest + * @returns {routerrpc.HtlcInfo} HtlcInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BuildRouteRequest.decodeDelimited = function decodeDelimited(reader) { + HtlcInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BuildRouteRequest message. + * Verifies a HtlcInfo message. * @function verify - * @memberof routerrpc.BuildRouteRequest + * @memberof routerrpc.HtlcInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BuildRouteRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.amt_msat != null && message.hasOwnProperty("amt_msat")) - if (!$util.isInteger(message.amt_msat) && !(message.amt_msat && $util.isInteger(message.amt_msat.low) && $util.isInteger(message.amt_msat.high))) - return "amt_msat: integer|Long expected"; - if (message.final_cltv_delta != null && message.hasOwnProperty("final_cltv_delta")) - if (!$util.isInteger(message.final_cltv_delta)) - return "final_cltv_delta: integer expected"; - if (message.outgoing_chan_id != null && message.hasOwnProperty("outgoing_chan_id")) - if (!$util.isInteger(message.outgoing_chan_id) && !(message.outgoing_chan_id && $util.isInteger(message.outgoing_chan_id.low) && $util.isInteger(message.outgoing_chan_id.high))) - return "outgoing_chan_id: integer|Long expected"; - if (message.hop_pubkeys != null && message.hasOwnProperty("hop_pubkeys")) { - if (!Array.isArray(message.hop_pubkeys)) - return "hop_pubkeys: array expected"; - for (let i = 0; i < message.hop_pubkeys.length; ++i) - if (!(message.hop_pubkeys[i] && typeof message.hop_pubkeys[i].length === "number" || $util.isString(message.hop_pubkeys[i]))) - return "hop_pubkeys: buffer[] expected"; - } - if (message.payment_addr != null && message.hasOwnProperty("payment_addr")) - if (!(message.payment_addr && typeof message.payment_addr.length === "number" || $util.isString(message.payment_addr))) - return "payment_addr: buffer expected"; + HtlcInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.incoming_timelock != null && message.hasOwnProperty("incoming_timelock")) + if (!$util.isInteger(message.incoming_timelock)) + return "incoming_timelock: integer expected"; + if (message.outgoing_timelock != null && message.hasOwnProperty("outgoing_timelock")) + if (!$util.isInteger(message.outgoing_timelock)) + return "outgoing_timelock: integer expected"; + if (message.incoming_amt_msat != null && message.hasOwnProperty("incoming_amt_msat")) + if (!$util.isInteger(message.incoming_amt_msat) && !(message.incoming_amt_msat && $util.isInteger(message.incoming_amt_msat.low) && $util.isInteger(message.incoming_amt_msat.high))) + return "incoming_amt_msat: integer|Long expected"; + if (message.outgoing_amt_msat != null && message.hasOwnProperty("outgoing_amt_msat")) + if (!$util.isInteger(message.outgoing_amt_msat) && !(message.outgoing_amt_msat && $util.isInteger(message.outgoing_amt_msat.low) && $util.isInteger(message.outgoing_amt_msat.high))) + return "outgoing_amt_msat: integer|Long expected"; return null; }; /** - * Creates a BuildRouteRequest message from a plain object. Also converts values to their respective internal types. + * Creates a HtlcInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.BuildRouteRequest + * @memberof routerrpc.HtlcInfo * @static * @param {Object.} object Plain object - * @returns {routerrpc.BuildRouteRequest} BuildRouteRequest + * @returns {routerrpc.HtlcInfo} HtlcInfo */ - BuildRouteRequest.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.BuildRouteRequest) + HtlcInfo.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.HtlcInfo) return object; - let message = new $root.routerrpc.BuildRouteRequest(); - if (object.amt_msat != null) + let message = new $root.routerrpc.HtlcInfo(); + if (object.incoming_timelock != null) + message.incoming_timelock = object.incoming_timelock >>> 0; + if (object.outgoing_timelock != null) + message.outgoing_timelock = object.outgoing_timelock >>> 0; + if (object.incoming_amt_msat != null) if ($util.Long) - (message.amt_msat = $util.Long.fromValue(object.amt_msat)).unsigned = false; - else if (typeof object.amt_msat === "string") - message.amt_msat = parseInt(object.amt_msat, 10); - else if (typeof object.amt_msat === "number") - message.amt_msat = object.amt_msat; - else if (typeof object.amt_msat === "object") - message.amt_msat = new $util.LongBits(object.amt_msat.low >>> 0, object.amt_msat.high >>> 0).toNumber(); - if (object.final_cltv_delta != null) - message.final_cltv_delta = object.final_cltv_delta | 0; - if (object.outgoing_chan_id != null) + (message.incoming_amt_msat = $util.Long.fromValue(object.incoming_amt_msat)).unsigned = true; + else if (typeof object.incoming_amt_msat === "string") + message.incoming_amt_msat = parseInt(object.incoming_amt_msat, 10); + else if (typeof object.incoming_amt_msat === "number") + message.incoming_amt_msat = object.incoming_amt_msat; + else if (typeof object.incoming_amt_msat === "object") + message.incoming_amt_msat = new $util.LongBits(object.incoming_amt_msat.low >>> 0, object.incoming_amt_msat.high >>> 0).toNumber(true); + if (object.outgoing_amt_msat != null) if ($util.Long) - (message.outgoing_chan_id = $util.Long.fromValue(object.outgoing_chan_id)).unsigned = true; - else if (typeof object.outgoing_chan_id === "string") - message.outgoing_chan_id = parseInt(object.outgoing_chan_id, 10); - else if (typeof object.outgoing_chan_id === "number") - message.outgoing_chan_id = object.outgoing_chan_id; - else if (typeof object.outgoing_chan_id === "object") - message.outgoing_chan_id = new $util.LongBits(object.outgoing_chan_id.low >>> 0, object.outgoing_chan_id.high >>> 0).toNumber(true); - if (object.hop_pubkeys) { - if (!Array.isArray(object.hop_pubkeys)) - throw TypeError(".routerrpc.BuildRouteRequest.hop_pubkeys: array expected"); - message.hop_pubkeys = []; - for (let i = 0; i < object.hop_pubkeys.length; ++i) - if (typeof object.hop_pubkeys[i] === "string") - $util.base64.decode(object.hop_pubkeys[i], message.hop_pubkeys[i] = $util.newBuffer($util.base64.length(object.hop_pubkeys[i])), 0); - else if (object.hop_pubkeys[i].length >= 0) - message.hop_pubkeys[i] = object.hop_pubkeys[i]; - } - if (object.payment_addr != null) - if (typeof object.payment_addr === "string") - $util.base64.decode(object.payment_addr, message.payment_addr = $util.newBuffer($util.base64.length(object.payment_addr)), 0); - else if (object.payment_addr.length >= 0) - message.payment_addr = object.payment_addr; + (message.outgoing_amt_msat = $util.Long.fromValue(object.outgoing_amt_msat)).unsigned = true; + else if (typeof object.outgoing_amt_msat === "string") + message.outgoing_amt_msat = parseInt(object.outgoing_amt_msat, 10); + else if (typeof object.outgoing_amt_msat === "number") + message.outgoing_amt_msat = object.outgoing_amt_msat; + else if (typeof object.outgoing_amt_msat === "object") + message.outgoing_amt_msat = new $util.LongBits(object.outgoing_amt_msat.low >>> 0, object.outgoing_amt_msat.high >>> 0).toNumber(true); return message; }; /** - * Creates a plain object from a BuildRouteRequest message. Also converts values to other types if specified. + * Creates a plain object from a HtlcInfo message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.BuildRouteRequest + * @memberof routerrpc.HtlcInfo * @static - * @param {routerrpc.BuildRouteRequest} message BuildRouteRequest + * @param {routerrpc.HtlcInfo} message HtlcInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BuildRouteRequest.toObject = function toObject(message, options) { + HtlcInfo.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.arrays || options.defaults) - object.hop_pubkeys = []; if (options.defaults) { + object.incoming_timelock = 0; + object.outgoing_timelock = 0; if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + let long = new $util.Long(0, 0, true); + object.incoming_amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.amt_msat = options.longs === String ? "0" : 0; - object.final_cltv_delta = 0; + object.incoming_amt_msat = options.longs === String ? "0" : 0; if ($util.Long) { let long = new $util.Long(0, 0, true); - object.outgoing_chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.outgoing_amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.outgoing_chan_id = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.payment_addr = ""; - else { - object.payment_addr = []; - if (options.bytes !== Array) - object.payment_addr = $util.newBuffer(object.payment_addr); - } + object.outgoing_amt_msat = options.longs === String ? "0" : 0; } - if (message.amt_msat != null && message.hasOwnProperty("amt_msat")) - if (typeof message.amt_msat === "number") - object.amt_msat = options.longs === String ? String(message.amt_msat) : message.amt_msat; + if (message.incoming_timelock != null && message.hasOwnProperty("incoming_timelock")) + object.incoming_timelock = message.incoming_timelock; + if (message.outgoing_timelock != null && message.hasOwnProperty("outgoing_timelock")) + object.outgoing_timelock = message.outgoing_timelock; + if (message.incoming_amt_msat != null && message.hasOwnProperty("incoming_amt_msat")) + if (typeof message.incoming_amt_msat === "number") + object.incoming_amt_msat = options.longs === String ? String(message.incoming_amt_msat) : message.incoming_amt_msat; else - object.amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_msat) : options.longs === Number ? new $util.LongBits(message.amt_msat.low >>> 0, message.amt_msat.high >>> 0).toNumber() : message.amt_msat; - if (message.final_cltv_delta != null && message.hasOwnProperty("final_cltv_delta")) - object.final_cltv_delta = message.final_cltv_delta; - if (message.outgoing_chan_id != null && message.hasOwnProperty("outgoing_chan_id")) - if (typeof message.outgoing_chan_id === "number") - object.outgoing_chan_id = options.longs === String ? String(message.outgoing_chan_id) : message.outgoing_chan_id; + object.incoming_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.incoming_amt_msat) : options.longs === Number ? new $util.LongBits(message.incoming_amt_msat.low >>> 0, message.incoming_amt_msat.high >>> 0).toNumber(true) : message.incoming_amt_msat; + if (message.outgoing_amt_msat != null && message.hasOwnProperty("outgoing_amt_msat")) + if (typeof message.outgoing_amt_msat === "number") + object.outgoing_amt_msat = options.longs === String ? String(message.outgoing_amt_msat) : message.outgoing_amt_msat; else - object.outgoing_chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_chan_id) : options.longs === Number ? new $util.LongBits(message.outgoing_chan_id.low >>> 0, message.outgoing_chan_id.high >>> 0).toNumber(true) : message.outgoing_chan_id; - if (message.hop_pubkeys && message.hop_pubkeys.length) { - object.hop_pubkeys = []; - for (let j = 0; j < message.hop_pubkeys.length; ++j) - object.hop_pubkeys[j] = options.bytes === String ? $util.base64.encode(message.hop_pubkeys[j], 0, message.hop_pubkeys[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.hop_pubkeys[j]) : message.hop_pubkeys[j]; - } - if (message.payment_addr != null && message.hasOwnProperty("payment_addr")) - object.payment_addr = options.bytes === String ? $util.base64.encode(message.payment_addr, 0, message.payment_addr.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_addr) : message.payment_addr; + object.outgoing_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_amt_msat) : options.longs === Number ? new $util.LongBits(message.outgoing_amt_msat.low >>> 0, message.outgoing_amt_msat.high >>> 0).toNumber(true) : message.outgoing_amt_msat; return object; }; /** - * Converts this BuildRouteRequest to JSON. + * Converts this HtlcInfo to JSON. * @function toJSON - * @memberof routerrpc.BuildRouteRequest + * @memberof routerrpc.HtlcInfo * @instance * @returns {Object.} JSON object */ - BuildRouteRequest.prototype.toJSON = function toJSON() { + HtlcInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BuildRouteRequest + * Gets the default type url for HtlcInfo * @function getTypeUrl - * @memberof routerrpc.BuildRouteRequest + * @memberof routerrpc.HtlcInfo * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BuildRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + HtlcInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.BuildRouteRequest"; + return typeUrlPrefix + "/routerrpc.HtlcInfo"; }; - return BuildRouteRequest; + return HtlcInfo; })(); - routerrpc.BuildRouteResponse = (function() { + routerrpc.ForwardEvent = (function() { /** - * Properties of a BuildRouteResponse. + * Properties of a ForwardEvent. * @memberof routerrpc - * @interface IBuildRouteResponse - * @property {lnrpc.IRoute|null} [route] BuildRouteResponse route + * @interface IForwardEvent + * @property {routerrpc.IHtlcInfo|null} [info] ForwardEvent info */ /** - * Constructs a new BuildRouteResponse. + * Constructs a new ForwardEvent. * @memberof routerrpc - * @classdesc Represents a BuildRouteResponse. - * @implements IBuildRouteResponse + * @classdesc Represents a ForwardEvent. + * @implements IForwardEvent * @constructor - * @param {routerrpc.IBuildRouteResponse=} [properties] Properties to set + * @param {routerrpc.IForwardEvent=} [properties] Properties to set */ - function BuildRouteResponse(properties) { + function ForwardEvent(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -91696,75 +94974,75 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * BuildRouteResponse route. - * @member {lnrpc.IRoute|null|undefined} route - * @memberof routerrpc.BuildRouteResponse + * ForwardEvent info. + * @member {routerrpc.IHtlcInfo|null|undefined} info + * @memberof routerrpc.ForwardEvent * @instance */ - BuildRouteResponse.prototype.route = null; + ForwardEvent.prototype.info = null; /** - * Creates a new BuildRouteResponse instance using the specified properties. + * Creates a new ForwardEvent instance using the specified properties. * @function create - * @memberof routerrpc.BuildRouteResponse + * @memberof routerrpc.ForwardEvent * @static - * @param {routerrpc.IBuildRouteResponse=} [properties] Properties to set - * @returns {routerrpc.BuildRouteResponse} BuildRouteResponse instance + * @param {routerrpc.IForwardEvent=} [properties] Properties to set + * @returns {routerrpc.ForwardEvent} ForwardEvent instance */ - BuildRouteResponse.create = function create(properties) { - return new BuildRouteResponse(properties); + ForwardEvent.create = function create(properties) { + return new ForwardEvent(properties); }; /** - * Encodes the specified BuildRouteResponse message. Does not implicitly {@link routerrpc.BuildRouteResponse.verify|verify} messages. + * Encodes the specified ForwardEvent message. Does not implicitly {@link routerrpc.ForwardEvent.verify|verify} messages. * @function encode - * @memberof routerrpc.BuildRouteResponse + * @memberof routerrpc.ForwardEvent * @static - * @param {routerrpc.IBuildRouteResponse} message BuildRouteResponse message or plain object to encode + * @param {routerrpc.IForwardEvent} message ForwardEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BuildRouteResponse.encode = function encode(message, writer) { + ForwardEvent.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.route != null && Object.hasOwnProperty.call(message, "route")) - $root.lnrpc.Route.encode(message.route, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + $root.routerrpc.HtlcInfo.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified BuildRouteResponse message, length delimited. Does not implicitly {@link routerrpc.BuildRouteResponse.verify|verify} messages. + * Encodes the specified ForwardEvent message, length delimited. Does not implicitly {@link routerrpc.ForwardEvent.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.BuildRouteResponse + * @memberof routerrpc.ForwardEvent * @static - * @param {routerrpc.IBuildRouteResponse} message BuildRouteResponse message or plain object to encode + * @param {routerrpc.IForwardEvent} message ForwardEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BuildRouteResponse.encodeDelimited = function encodeDelimited(message, writer) { + ForwardEvent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BuildRouteResponse message from the specified reader or buffer. + * Decodes a ForwardEvent message from the specified reader or buffer. * @function decode - * @memberof routerrpc.BuildRouteResponse + * @memberof routerrpc.ForwardEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.BuildRouteResponse} BuildRouteResponse + * @returns {routerrpc.ForwardEvent} ForwardEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BuildRouteResponse.decode = function decode(reader, length) { + ForwardEvent.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.BuildRouteResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.ForwardEvent(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.route = $root.lnrpc.Route.decode(reader, reader.uint32()); + message.info = $root.routerrpc.HtlcInfo.decode(reader, reader.uint32()); break; } default: @@ -91776,126 +95054,126 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a BuildRouteResponse message from the specified reader or buffer, length delimited. + * Decodes a ForwardEvent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.BuildRouteResponse + * @memberof routerrpc.ForwardEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.BuildRouteResponse} BuildRouteResponse + * @returns {routerrpc.ForwardEvent} ForwardEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BuildRouteResponse.decodeDelimited = function decodeDelimited(reader) { + ForwardEvent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BuildRouteResponse message. + * Verifies a ForwardEvent message. * @function verify - * @memberof routerrpc.BuildRouteResponse + * @memberof routerrpc.ForwardEvent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BuildRouteResponse.verify = function verify(message) { + ForwardEvent.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.route != null && message.hasOwnProperty("route")) { - let error = $root.lnrpc.Route.verify(message.route); + if (message.info != null && message.hasOwnProperty("info")) { + let error = $root.routerrpc.HtlcInfo.verify(message.info); if (error) - return "route." + error; + return "info." + error; } return null; }; /** - * Creates a BuildRouteResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ForwardEvent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.BuildRouteResponse + * @memberof routerrpc.ForwardEvent * @static * @param {Object.} object Plain object - * @returns {routerrpc.BuildRouteResponse} BuildRouteResponse + * @returns {routerrpc.ForwardEvent} ForwardEvent */ - BuildRouteResponse.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.BuildRouteResponse) + ForwardEvent.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.ForwardEvent) return object; - let message = new $root.routerrpc.BuildRouteResponse(); - if (object.route != null) { - if (typeof object.route !== "object") - throw TypeError(".routerrpc.BuildRouteResponse.route: object expected"); - message.route = $root.lnrpc.Route.fromObject(object.route); + let message = new $root.routerrpc.ForwardEvent(); + if (object.info != null) { + if (typeof object.info !== "object") + throw TypeError(".routerrpc.ForwardEvent.info: object expected"); + message.info = $root.routerrpc.HtlcInfo.fromObject(object.info); } return message; }; /** - * Creates a plain object from a BuildRouteResponse message. Also converts values to other types if specified. + * Creates a plain object from a ForwardEvent message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.BuildRouteResponse + * @memberof routerrpc.ForwardEvent * @static - * @param {routerrpc.BuildRouteResponse} message BuildRouteResponse + * @param {routerrpc.ForwardEvent} message ForwardEvent * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BuildRouteResponse.toObject = function toObject(message, options) { + ForwardEvent.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; if (options.defaults) - object.route = null; - if (message.route != null && message.hasOwnProperty("route")) - object.route = $root.lnrpc.Route.toObject(message.route, options); + object.info = null; + if (message.info != null && message.hasOwnProperty("info")) + object.info = $root.routerrpc.HtlcInfo.toObject(message.info, options); return object; }; /** - * Converts this BuildRouteResponse to JSON. + * Converts this ForwardEvent to JSON. * @function toJSON - * @memberof routerrpc.BuildRouteResponse + * @memberof routerrpc.ForwardEvent * @instance * @returns {Object.} JSON object */ - BuildRouteResponse.prototype.toJSON = function toJSON() { + ForwardEvent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BuildRouteResponse + * Gets the default type url for ForwardEvent * @function getTypeUrl - * @memberof routerrpc.BuildRouteResponse + * @memberof routerrpc.ForwardEvent * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BuildRouteResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ForwardEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.BuildRouteResponse"; + return typeUrlPrefix + "/routerrpc.ForwardEvent"; }; - return BuildRouteResponse; + return ForwardEvent; })(); - routerrpc.SubscribeHtlcEventsRequest = (function() { + routerrpc.ForwardFailEvent = (function() { /** - * Properties of a SubscribeHtlcEventsRequest. + * Properties of a ForwardFailEvent. * @memberof routerrpc - * @interface ISubscribeHtlcEventsRequest + * @interface IForwardFailEvent */ /** - * Constructs a new SubscribeHtlcEventsRequest. + * Constructs a new ForwardFailEvent. * @memberof routerrpc - * @classdesc Represents a SubscribeHtlcEventsRequest. - * @implements ISubscribeHtlcEventsRequest + * @classdesc Represents a ForwardFailEvent. + * @implements IForwardFailEvent * @constructor - * @param {routerrpc.ISubscribeHtlcEventsRequest=} [properties] Properties to set + * @param {routerrpc.IForwardFailEvent=} [properties] Properties to set */ - function SubscribeHtlcEventsRequest(properties) { + function ForwardFailEvent(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -91903,60 +95181,60 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * Creates a new SubscribeHtlcEventsRequest instance using the specified properties. + * Creates a new ForwardFailEvent instance using the specified properties. * @function create - * @memberof routerrpc.SubscribeHtlcEventsRequest + * @memberof routerrpc.ForwardFailEvent * @static - * @param {routerrpc.ISubscribeHtlcEventsRequest=} [properties] Properties to set - * @returns {routerrpc.SubscribeHtlcEventsRequest} SubscribeHtlcEventsRequest instance + * @param {routerrpc.IForwardFailEvent=} [properties] Properties to set + * @returns {routerrpc.ForwardFailEvent} ForwardFailEvent instance */ - SubscribeHtlcEventsRequest.create = function create(properties) { - return new SubscribeHtlcEventsRequest(properties); + ForwardFailEvent.create = function create(properties) { + return new ForwardFailEvent(properties); }; /** - * Encodes the specified SubscribeHtlcEventsRequest message. Does not implicitly {@link routerrpc.SubscribeHtlcEventsRequest.verify|verify} messages. + * Encodes the specified ForwardFailEvent message. Does not implicitly {@link routerrpc.ForwardFailEvent.verify|verify} messages. * @function encode - * @memberof routerrpc.SubscribeHtlcEventsRequest + * @memberof routerrpc.ForwardFailEvent * @static - * @param {routerrpc.ISubscribeHtlcEventsRequest} message SubscribeHtlcEventsRequest message or plain object to encode + * @param {routerrpc.IForwardFailEvent} message ForwardFailEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SubscribeHtlcEventsRequest.encode = function encode(message, writer) { + ForwardFailEvent.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); return writer; }; /** - * Encodes the specified SubscribeHtlcEventsRequest message, length delimited. Does not implicitly {@link routerrpc.SubscribeHtlcEventsRequest.verify|verify} messages. + * Encodes the specified ForwardFailEvent message, length delimited. Does not implicitly {@link routerrpc.ForwardFailEvent.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.SubscribeHtlcEventsRequest + * @memberof routerrpc.ForwardFailEvent * @static - * @param {routerrpc.ISubscribeHtlcEventsRequest} message SubscribeHtlcEventsRequest message or plain object to encode + * @param {routerrpc.IForwardFailEvent} message ForwardFailEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SubscribeHtlcEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ForwardFailEvent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SubscribeHtlcEventsRequest message from the specified reader or buffer. + * Decodes a ForwardFailEvent message from the specified reader or buffer. * @function decode - * @memberof routerrpc.SubscribeHtlcEventsRequest + * @memberof routerrpc.ForwardFailEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.SubscribeHtlcEventsRequest} SubscribeHtlcEventsRequest + * @returns {routerrpc.ForwardFailEvent} ForwardFailEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SubscribeHtlcEventsRequest.decode = function decode(reader, length) { + ForwardFailEvent.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SubscribeHtlcEventsRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.ForwardFailEvent(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { @@ -91969,364 +95247,185 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a SubscribeHtlcEventsRequest message from the specified reader or buffer, length delimited. + * Decodes a ForwardFailEvent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.SubscribeHtlcEventsRequest + * @memberof routerrpc.ForwardFailEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.SubscribeHtlcEventsRequest} SubscribeHtlcEventsRequest + * @returns {routerrpc.ForwardFailEvent} ForwardFailEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SubscribeHtlcEventsRequest.decodeDelimited = function decodeDelimited(reader) { + ForwardFailEvent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SubscribeHtlcEventsRequest message. + * Verifies a ForwardFailEvent message. * @function verify - * @memberof routerrpc.SubscribeHtlcEventsRequest + * @memberof routerrpc.ForwardFailEvent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SubscribeHtlcEventsRequest.verify = function verify(message) { + ForwardFailEvent.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; return null; }; /** - * Creates a SubscribeHtlcEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ForwardFailEvent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.SubscribeHtlcEventsRequest + * @memberof routerrpc.ForwardFailEvent * @static * @param {Object.} object Plain object - * @returns {routerrpc.SubscribeHtlcEventsRequest} SubscribeHtlcEventsRequest + * @returns {routerrpc.ForwardFailEvent} ForwardFailEvent */ - SubscribeHtlcEventsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.SubscribeHtlcEventsRequest) + ForwardFailEvent.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.ForwardFailEvent) return object; - return new $root.routerrpc.SubscribeHtlcEventsRequest(); + return new $root.routerrpc.ForwardFailEvent(); }; /** - * Creates a plain object from a SubscribeHtlcEventsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ForwardFailEvent message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.SubscribeHtlcEventsRequest - * @static - * @param {routerrpc.SubscribeHtlcEventsRequest} message SubscribeHtlcEventsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubscribeHtlcEventsRequest.toObject = function toObject() { - return {}; - }; - - /** - * Converts this SubscribeHtlcEventsRequest to JSON. - * @function toJSON - * @memberof routerrpc.SubscribeHtlcEventsRequest - * @instance - * @returns {Object.} JSON object - */ - SubscribeHtlcEventsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubscribeHtlcEventsRequest - * @function getTypeUrl - * @memberof routerrpc.SubscribeHtlcEventsRequest + * @memberof routerrpc.ForwardFailEvent * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubscribeHtlcEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/routerrpc.SubscribeHtlcEventsRequest"; - }; - - return SubscribeHtlcEventsRequest; - })(); - - routerrpc.HtlcEvent = (function() { - - /** - * Properties of a HtlcEvent. - * @memberof routerrpc - * @interface IHtlcEvent - * @property {Long|null} [incoming_channel_id] HtlcEvent incoming_channel_id - * @property {Long|null} [outgoing_channel_id] HtlcEvent outgoing_channel_id - * @property {Long|null} [incoming_htlc_id] HtlcEvent incoming_htlc_id - * @property {Long|null} [outgoing_htlc_id] HtlcEvent outgoing_htlc_id - * @property {Long|null} [timestamp_ns] HtlcEvent timestamp_ns - * @property {routerrpc.HtlcEvent.EventType|null} [event_type] HtlcEvent event_type - * @property {routerrpc.IForwardEvent|null} [forward_event] HtlcEvent forward_event - * @property {routerrpc.IForwardFailEvent|null} [forward_fail_event] HtlcEvent forward_fail_event - * @property {routerrpc.ISettleEvent|null} [settle_event] HtlcEvent settle_event - * @property {routerrpc.ILinkFailEvent|null} [link_fail_event] HtlcEvent link_fail_event - * @property {routerrpc.ISubscribedEvent|null} [subscribed_event] HtlcEvent subscribed_event - * @property {routerrpc.IFinalHtlcEvent|null} [final_htlc_event] HtlcEvent final_htlc_event - */ - - /** - * Constructs a new HtlcEvent. - * @memberof routerrpc - * @classdesc Represents a HtlcEvent. - * @implements IHtlcEvent - * @constructor - * @param {routerrpc.IHtlcEvent=} [properties] Properties to set - */ - function HtlcEvent(properties) { - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HtlcEvent incoming_channel_id. - * @member {Long} incoming_channel_id - * @memberof routerrpc.HtlcEvent - * @instance - */ - HtlcEvent.prototype.incoming_channel_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * HtlcEvent outgoing_channel_id. - * @member {Long} outgoing_channel_id - * @memberof routerrpc.HtlcEvent - * @instance - */ - HtlcEvent.prototype.outgoing_channel_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * HtlcEvent incoming_htlc_id. - * @member {Long} incoming_htlc_id - * @memberof routerrpc.HtlcEvent - * @instance - */ - HtlcEvent.prototype.incoming_htlc_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * HtlcEvent outgoing_htlc_id. - * @member {Long} outgoing_htlc_id - * @memberof routerrpc.HtlcEvent - * @instance - */ - HtlcEvent.prototype.outgoing_htlc_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * HtlcEvent timestamp_ns. - * @member {Long} timestamp_ns - * @memberof routerrpc.HtlcEvent - * @instance - */ - HtlcEvent.prototype.timestamp_ns = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * HtlcEvent event_type. - * @member {routerrpc.HtlcEvent.EventType} event_type - * @memberof routerrpc.HtlcEvent - * @instance - */ - HtlcEvent.prototype.event_type = 0; - - /** - * HtlcEvent forward_event. - * @member {routerrpc.IForwardEvent|null|undefined} forward_event - * @memberof routerrpc.HtlcEvent - * @instance - */ - HtlcEvent.prototype.forward_event = null; - - /** - * HtlcEvent forward_fail_event. - * @member {routerrpc.IForwardFailEvent|null|undefined} forward_fail_event - * @memberof routerrpc.HtlcEvent - * @instance + * @param {routerrpc.ForwardFailEvent} message ForwardFailEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - HtlcEvent.prototype.forward_fail_event = null; + ForwardFailEvent.toObject = function toObject() { + return {}; + }; /** - * HtlcEvent settle_event. - * @member {routerrpc.ISettleEvent|null|undefined} settle_event - * @memberof routerrpc.HtlcEvent + * Converts this ForwardFailEvent to JSON. + * @function toJSON + * @memberof routerrpc.ForwardFailEvent * @instance + * @returns {Object.} JSON object */ - HtlcEvent.prototype.settle_event = null; + ForwardFailEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * HtlcEvent link_fail_event. - * @member {routerrpc.ILinkFailEvent|null|undefined} link_fail_event - * @memberof routerrpc.HtlcEvent - * @instance + * Gets the default type url for ForwardFailEvent + * @function getTypeUrl + * @memberof routerrpc.ForwardFailEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - HtlcEvent.prototype.link_fail_event = null; + ForwardFailEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/routerrpc.ForwardFailEvent"; + }; + + return ForwardFailEvent; + })(); + + routerrpc.SettleEvent = (function() { /** - * HtlcEvent subscribed_event. - * @member {routerrpc.ISubscribedEvent|null|undefined} subscribed_event - * @memberof routerrpc.HtlcEvent - * @instance + * Properties of a SettleEvent. + * @memberof routerrpc + * @interface ISettleEvent + * @property {Uint8Array|null} [preimage] SettleEvent preimage */ - HtlcEvent.prototype.subscribed_event = null; /** - * HtlcEvent final_htlc_event. - * @member {routerrpc.IFinalHtlcEvent|null|undefined} final_htlc_event - * @memberof routerrpc.HtlcEvent - * @instance + * Constructs a new SettleEvent. + * @memberof routerrpc + * @classdesc Represents a SettleEvent. + * @implements ISettleEvent + * @constructor + * @param {routerrpc.ISettleEvent=} [properties] Properties to set */ - HtlcEvent.prototype.final_htlc_event = null; - - // OneOf field names bound to virtual getters and setters - let $oneOfFields; + function SettleEvent(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * HtlcEvent event. - * @member {"forward_event"|"forward_fail_event"|"settle_event"|"link_fail_event"|"subscribed_event"|"final_htlc_event"|undefined} event - * @memberof routerrpc.HtlcEvent + * SettleEvent preimage. + * @member {Uint8Array} preimage + * @memberof routerrpc.SettleEvent * @instance */ - Object.defineProperty(HtlcEvent.prototype, "event", { - get: $util.oneOfGetter($oneOfFields = ["forward_event", "forward_fail_event", "settle_event", "link_fail_event", "subscribed_event", "final_htlc_event"]), - set: $util.oneOfSetter($oneOfFields) - }); + SettleEvent.prototype.preimage = $util.newBuffer([]); /** - * Creates a new HtlcEvent instance using the specified properties. + * Creates a new SettleEvent instance using the specified properties. * @function create - * @memberof routerrpc.HtlcEvent + * @memberof routerrpc.SettleEvent * @static - * @param {routerrpc.IHtlcEvent=} [properties] Properties to set - * @returns {routerrpc.HtlcEvent} HtlcEvent instance + * @param {routerrpc.ISettleEvent=} [properties] Properties to set + * @returns {routerrpc.SettleEvent} SettleEvent instance */ - HtlcEvent.create = function create(properties) { - return new HtlcEvent(properties); + SettleEvent.create = function create(properties) { + return new SettleEvent(properties); }; /** - * Encodes the specified HtlcEvent message. Does not implicitly {@link routerrpc.HtlcEvent.verify|verify} messages. + * Encodes the specified SettleEvent message. Does not implicitly {@link routerrpc.SettleEvent.verify|verify} messages. * @function encode - * @memberof routerrpc.HtlcEvent + * @memberof routerrpc.SettleEvent * @static - * @param {routerrpc.IHtlcEvent} message HtlcEvent message or plain object to encode + * @param {routerrpc.ISettleEvent} message SettleEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HtlcEvent.encode = function encode(message, writer) { + SettleEvent.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.incoming_channel_id != null && Object.hasOwnProperty.call(message, "incoming_channel_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.incoming_channel_id); - if (message.outgoing_channel_id != null && Object.hasOwnProperty.call(message, "outgoing_channel_id")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.outgoing_channel_id); - if (message.incoming_htlc_id != null && Object.hasOwnProperty.call(message, "incoming_htlc_id")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.incoming_htlc_id); - if (message.outgoing_htlc_id != null && Object.hasOwnProperty.call(message, "outgoing_htlc_id")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.outgoing_htlc_id); - if (message.timestamp_ns != null && Object.hasOwnProperty.call(message, "timestamp_ns")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.timestamp_ns); - if (message.event_type != null && Object.hasOwnProperty.call(message, "event_type")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.event_type); - if (message.forward_event != null && Object.hasOwnProperty.call(message, "forward_event")) - $root.routerrpc.ForwardEvent.encode(message.forward_event, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.forward_fail_event != null && Object.hasOwnProperty.call(message, "forward_fail_event")) - $root.routerrpc.ForwardFailEvent.encode(message.forward_fail_event, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.settle_event != null && Object.hasOwnProperty.call(message, "settle_event")) - $root.routerrpc.SettleEvent.encode(message.settle_event, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.link_fail_event != null && Object.hasOwnProperty.call(message, "link_fail_event")) - $root.routerrpc.LinkFailEvent.encode(message.link_fail_event, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.subscribed_event != null && Object.hasOwnProperty.call(message, "subscribed_event")) - $root.routerrpc.SubscribedEvent.encode(message.subscribed_event, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.final_htlc_event != null && Object.hasOwnProperty.call(message, "final_htlc_event")) - $root.routerrpc.FinalHtlcEvent.encode(message.final_htlc_event, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.preimage); return writer; }; /** - * Encodes the specified HtlcEvent message, length delimited. Does not implicitly {@link routerrpc.HtlcEvent.verify|verify} messages. + * Encodes the specified SettleEvent message, length delimited. Does not implicitly {@link routerrpc.SettleEvent.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.HtlcEvent + * @memberof routerrpc.SettleEvent * @static - * @param {routerrpc.IHtlcEvent} message HtlcEvent message or plain object to encode + * @param {routerrpc.ISettleEvent} message SettleEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HtlcEvent.encodeDelimited = function encodeDelimited(message, writer) { + SettleEvent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HtlcEvent message from the specified reader or buffer. + * Decodes a SettleEvent message from the specified reader or buffer. * @function decode - * @memberof routerrpc.HtlcEvent + * @memberof routerrpc.SettleEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.HtlcEvent} HtlcEvent + * @returns {routerrpc.SettleEvent} SettleEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HtlcEvent.decode = function decode(reader, length) { + SettleEvent.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.HtlcEvent(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SettleEvent(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.incoming_channel_id = reader.uint64(); - break; - } - case 2: { - message.outgoing_channel_id = reader.uint64(); - break; - } - case 3: { - message.incoming_htlc_id = reader.uint64(); - break; - } - case 4: { - message.outgoing_htlc_id = reader.uint64(); - break; - } - case 5: { - message.timestamp_ns = reader.uint64(); - break; - } - case 6: { - message.event_type = reader.int32(); - break; - } - case 7: { - message.forward_event = $root.routerrpc.ForwardEvent.decode(reader, reader.uint32()); - break; - } - case 8: { - message.forward_fail_event = $root.routerrpc.ForwardFailEvent.decode(reader, reader.uint32()); - break; - } - case 9: { - message.settle_event = $root.routerrpc.SettleEvent.decode(reader, reader.uint32()); - break; - } - case 10: { - message.link_fail_event = $root.routerrpc.LinkFailEvent.decode(reader, reader.uint32()); - break; - } - case 11: { - message.subscribed_event = $root.routerrpc.SubscribedEvent.decode(reader, reader.uint32()); - break; - } - case 12: { - message.final_htlc_event = $root.routerrpc.FinalHtlcEvent.decode(reader, reader.uint32()); + message.preimage = reader.bytes(); break; } default: @@ -92338,402 +95437,132 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a HtlcEvent message from the specified reader or buffer, length delimited. + * Decodes a SettleEvent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.HtlcEvent + * @memberof routerrpc.SettleEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.HtlcEvent} HtlcEvent + * @returns {routerrpc.SettleEvent} SettleEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HtlcEvent.decodeDelimited = function decodeDelimited(reader) { + SettleEvent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HtlcEvent message. + * Verifies a SettleEvent message. * @function verify - * @memberof routerrpc.HtlcEvent + * @memberof routerrpc.SettleEvent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HtlcEvent.verify = function verify(message) { + SettleEvent.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - let properties = {}; - if (message.incoming_channel_id != null && message.hasOwnProperty("incoming_channel_id")) - if (!$util.isInteger(message.incoming_channel_id) && !(message.incoming_channel_id && $util.isInteger(message.incoming_channel_id.low) && $util.isInteger(message.incoming_channel_id.high))) - return "incoming_channel_id: integer|Long expected"; - if (message.outgoing_channel_id != null && message.hasOwnProperty("outgoing_channel_id")) - if (!$util.isInteger(message.outgoing_channel_id) && !(message.outgoing_channel_id && $util.isInteger(message.outgoing_channel_id.low) && $util.isInteger(message.outgoing_channel_id.high))) - return "outgoing_channel_id: integer|Long expected"; - if (message.incoming_htlc_id != null && message.hasOwnProperty("incoming_htlc_id")) - if (!$util.isInteger(message.incoming_htlc_id) && !(message.incoming_htlc_id && $util.isInteger(message.incoming_htlc_id.low) && $util.isInteger(message.incoming_htlc_id.high))) - return "incoming_htlc_id: integer|Long expected"; - if (message.outgoing_htlc_id != null && message.hasOwnProperty("outgoing_htlc_id")) - if (!$util.isInteger(message.outgoing_htlc_id) && !(message.outgoing_htlc_id && $util.isInteger(message.outgoing_htlc_id.low) && $util.isInteger(message.outgoing_htlc_id.high))) - return "outgoing_htlc_id: integer|Long expected"; - if (message.timestamp_ns != null && message.hasOwnProperty("timestamp_ns")) - if (!$util.isInteger(message.timestamp_ns) && !(message.timestamp_ns && $util.isInteger(message.timestamp_ns.low) && $util.isInteger(message.timestamp_ns.high))) - return "timestamp_ns: integer|Long expected"; - if (message.event_type != null && message.hasOwnProperty("event_type")) - switch (message.event_type) { - default: - return "event_type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.forward_event != null && message.hasOwnProperty("forward_event")) { - properties.event = 1; - { - let error = $root.routerrpc.ForwardEvent.verify(message.forward_event); - if (error) - return "forward_event." + error; - } - } - if (message.forward_fail_event != null && message.hasOwnProperty("forward_fail_event")) { - if (properties.event === 1) - return "event: multiple values"; - properties.event = 1; - { - let error = $root.routerrpc.ForwardFailEvent.verify(message.forward_fail_event); - if (error) - return "forward_fail_event." + error; - } - } - if (message.settle_event != null && message.hasOwnProperty("settle_event")) { - if (properties.event === 1) - return "event: multiple values"; - properties.event = 1; - { - let error = $root.routerrpc.SettleEvent.verify(message.settle_event); - if (error) - return "settle_event." + error; - } - } - if (message.link_fail_event != null && message.hasOwnProperty("link_fail_event")) { - if (properties.event === 1) - return "event: multiple values"; - properties.event = 1; - { - let error = $root.routerrpc.LinkFailEvent.verify(message.link_fail_event); - if (error) - return "link_fail_event." + error; - } - } - if (message.subscribed_event != null && message.hasOwnProperty("subscribed_event")) { - if (properties.event === 1) - return "event: multiple values"; - properties.event = 1; - { - let error = $root.routerrpc.SubscribedEvent.verify(message.subscribed_event); - if (error) - return "subscribed_event." + error; - } - } - if (message.final_htlc_event != null && message.hasOwnProperty("final_htlc_event")) { - if (properties.event === 1) - return "event: multiple values"; - properties.event = 1; - { - let error = $root.routerrpc.FinalHtlcEvent.verify(message.final_htlc_event); - if (error) - return "final_htlc_event." + error; - } - } + if (message.preimage != null && message.hasOwnProperty("preimage")) + if (!(message.preimage && typeof message.preimage.length === "number" || $util.isString(message.preimage))) + return "preimage: buffer expected"; return null; }; /** - * Creates a HtlcEvent message from a plain object. Also converts values to their respective internal types. + * Creates a SettleEvent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.HtlcEvent + * @memberof routerrpc.SettleEvent * @static * @param {Object.} object Plain object - * @returns {routerrpc.HtlcEvent} HtlcEvent + * @returns {routerrpc.SettleEvent} SettleEvent */ - HtlcEvent.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.HtlcEvent) + SettleEvent.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.SettleEvent) return object; - let message = new $root.routerrpc.HtlcEvent(); - if (object.incoming_channel_id != null) - if ($util.Long) - (message.incoming_channel_id = $util.Long.fromValue(object.incoming_channel_id)).unsigned = true; - else if (typeof object.incoming_channel_id === "string") - message.incoming_channel_id = parseInt(object.incoming_channel_id, 10); - else if (typeof object.incoming_channel_id === "number") - message.incoming_channel_id = object.incoming_channel_id; - else if (typeof object.incoming_channel_id === "object") - message.incoming_channel_id = new $util.LongBits(object.incoming_channel_id.low >>> 0, object.incoming_channel_id.high >>> 0).toNumber(true); - if (object.outgoing_channel_id != null) - if ($util.Long) - (message.outgoing_channel_id = $util.Long.fromValue(object.outgoing_channel_id)).unsigned = true; - else if (typeof object.outgoing_channel_id === "string") - message.outgoing_channel_id = parseInt(object.outgoing_channel_id, 10); - else if (typeof object.outgoing_channel_id === "number") - message.outgoing_channel_id = object.outgoing_channel_id; - else if (typeof object.outgoing_channel_id === "object") - message.outgoing_channel_id = new $util.LongBits(object.outgoing_channel_id.low >>> 0, object.outgoing_channel_id.high >>> 0).toNumber(true); - if (object.incoming_htlc_id != null) - if ($util.Long) - (message.incoming_htlc_id = $util.Long.fromValue(object.incoming_htlc_id)).unsigned = true; - else if (typeof object.incoming_htlc_id === "string") - message.incoming_htlc_id = parseInt(object.incoming_htlc_id, 10); - else if (typeof object.incoming_htlc_id === "number") - message.incoming_htlc_id = object.incoming_htlc_id; - else if (typeof object.incoming_htlc_id === "object") - message.incoming_htlc_id = new $util.LongBits(object.incoming_htlc_id.low >>> 0, object.incoming_htlc_id.high >>> 0).toNumber(true); - if (object.outgoing_htlc_id != null) - if ($util.Long) - (message.outgoing_htlc_id = $util.Long.fromValue(object.outgoing_htlc_id)).unsigned = true; - else if (typeof object.outgoing_htlc_id === "string") - message.outgoing_htlc_id = parseInt(object.outgoing_htlc_id, 10); - else if (typeof object.outgoing_htlc_id === "number") - message.outgoing_htlc_id = object.outgoing_htlc_id; - else if (typeof object.outgoing_htlc_id === "object") - message.outgoing_htlc_id = new $util.LongBits(object.outgoing_htlc_id.low >>> 0, object.outgoing_htlc_id.high >>> 0).toNumber(true); - if (object.timestamp_ns != null) - if ($util.Long) - (message.timestamp_ns = $util.Long.fromValue(object.timestamp_ns)).unsigned = true; - else if (typeof object.timestamp_ns === "string") - message.timestamp_ns = parseInt(object.timestamp_ns, 10); - else if (typeof object.timestamp_ns === "number") - message.timestamp_ns = object.timestamp_ns; - else if (typeof object.timestamp_ns === "object") - message.timestamp_ns = new $util.LongBits(object.timestamp_ns.low >>> 0, object.timestamp_ns.high >>> 0).toNumber(true); - switch (object.event_type) { - default: - if (typeof object.event_type === "number") { - message.event_type = object.event_type; - break; - } - break; - case "UNKNOWN": - case 0: - message.event_type = 0; - break; - case "SEND": - case 1: - message.event_type = 1; - break; - case "RECEIVE": - case 2: - message.event_type = 2; - break; - case "FORWARD": - case 3: - message.event_type = 3; - break; - } - if (object.forward_event != null) { - if (typeof object.forward_event !== "object") - throw TypeError(".routerrpc.HtlcEvent.forward_event: object expected"); - message.forward_event = $root.routerrpc.ForwardEvent.fromObject(object.forward_event); - } - if (object.forward_fail_event != null) { - if (typeof object.forward_fail_event !== "object") - throw TypeError(".routerrpc.HtlcEvent.forward_fail_event: object expected"); - message.forward_fail_event = $root.routerrpc.ForwardFailEvent.fromObject(object.forward_fail_event); - } - if (object.settle_event != null) { - if (typeof object.settle_event !== "object") - throw TypeError(".routerrpc.HtlcEvent.settle_event: object expected"); - message.settle_event = $root.routerrpc.SettleEvent.fromObject(object.settle_event); - } - if (object.link_fail_event != null) { - if (typeof object.link_fail_event !== "object") - throw TypeError(".routerrpc.HtlcEvent.link_fail_event: object expected"); - message.link_fail_event = $root.routerrpc.LinkFailEvent.fromObject(object.link_fail_event); - } - if (object.subscribed_event != null) { - if (typeof object.subscribed_event !== "object") - throw TypeError(".routerrpc.HtlcEvent.subscribed_event: object expected"); - message.subscribed_event = $root.routerrpc.SubscribedEvent.fromObject(object.subscribed_event); - } - if (object.final_htlc_event != null) { - if (typeof object.final_htlc_event !== "object") - throw TypeError(".routerrpc.HtlcEvent.final_htlc_event: object expected"); - message.final_htlc_event = $root.routerrpc.FinalHtlcEvent.fromObject(object.final_htlc_event); - } + let message = new $root.routerrpc.SettleEvent(); + if (object.preimage != null) + if (typeof object.preimage === "string") + $util.base64.decode(object.preimage, message.preimage = $util.newBuffer($util.base64.length(object.preimage)), 0); + else if (object.preimage.length >= 0) + message.preimage = object.preimage; return message; }; /** - * Creates a plain object from a HtlcEvent message. Also converts values to other types if specified. + * Creates a plain object from a SettleEvent message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.HtlcEvent + * @memberof routerrpc.SettleEvent * @static - * @param {routerrpc.HtlcEvent} message HtlcEvent + * @param {routerrpc.SettleEvent} message SettleEvent * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HtlcEvent.toObject = function toObject(message, options) { + SettleEvent.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.incoming_channel_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.incoming_channel_id = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.outgoing_channel_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.outgoing_channel_id = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.incoming_htlc_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.incoming_htlc_id = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.outgoing_htlc_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.outgoing_htlc_id = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.timestamp_ns = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp_ns = options.longs === String ? "0" : 0; - object.event_type = options.enums === String ? "UNKNOWN" : 0; - } - if (message.incoming_channel_id != null && message.hasOwnProperty("incoming_channel_id")) - if (typeof message.incoming_channel_id === "number") - object.incoming_channel_id = options.longs === String ? String(message.incoming_channel_id) : message.incoming_channel_id; - else - object.incoming_channel_id = options.longs === String ? $util.Long.prototype.toString.call(message.incoming_channel_id) : options.longs === Number ? new $util.LongBits(message.incoming_channel_id.low >>> 0, message.incoming_channel_id.high >>> 0).toNumber(true) : message.incoming_channel_id; - if (message.outgoing_channel_id != null && message.hasOwnProperty("outgoing_channel_id")) - if (typeof message.outgoing_channel_id === "number") - object.outgoing_channel_id = options.longs === String ? String(message.outgoing_channel_id) : message.outgoing_channel_id; - else - object.outgoing_channel_id = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_channel_id) : options.longs === Number ? new $util.LongBits(message.outgoing_channel_id.low >>> 0, message.outgoing_channel_id.high >>> 0).toNumber(true) : message.outgoing_channel_id; - if (message.incoming_htlc_id != null && message.hasOwnProperty("incoming_htlc_id")) - if (typeof message.incoming_htlc_id === "number") - object.incoming_htlc_id = options.longs === String ? String(message.incoming_htlc_id) : message.incoming_htlc_id; - else - object.incoming_htlc_id = options.longs === String ? $util.Long.prototype.toString.call(message.incoming_htlc_id) : options.longs === Number ? new $util.LongBits(message.incoming_htlc_id.low >>> 0, message.incoming_htlc_id.high >>> 0).toNumber(true) : message.incoming_htlc_id; - if (message.outgoing_htlc_id != null && message.hasOwnProperty("outgoing_htlc_id")) - if (typeof message.outgoing_htlc_id === "number") - object.outgoing_htlc_id = options.longs === String ? String(message.outgoing_htlc_id) : message.outgoing_htlc_id; - else - object.outgoing_htlc_id = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_htlc_id) : options.longs === Number ? new $util.LongBits(message.outgoing_htlc_id.low >>> 0, message.outgoing_htlc_id.high >>> 0).toNumber(true) : message.outgoing_htlc_id; - if (message.timestamp_ns != null && message.hasOwnProperty("timestamp_ns")) - if (typeof message.timestamp_ns === "number") - object.timestamp_ns = options.longs === String ? String(message.timestamp_ns) : message.timestamp_ns; - else - object.timestamp_ns = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp_ns) : options.longs === Number ? new $util.LongBits(message.timestamp_ns.low >>> 0, message.timestamp_ns.high >>> 0).toNumber(true) : message.timestamp_ns; - if (message.event_type != null && message.hasOwnProperty("event_type")) - object.event_type = options.enums === String ? $root.routerrpc.HtlcEvent.EventType[message.event_type] === undefined ? message.event_type : $root.routerrpc.HtlcEvent.EventType[message.event_type] : message.event_type; - if (message.forward_event != null && message.hasOwnProperty("forward_event")) { - object.forward_event = $root.routerrpc.ForwardEvent.toObject(message.forward_event, options); - if (options.oneofs) - object.event = "forward_event"; - } - if (message.forward_fail_event != null && message.hasOwnProperty("forward_fail_event")) { - object.forward_fail_event = $root.routerrpc.ForwardFailEvent.toObject(message.forward_fail_event, options); - if (options.oneofs) - object.event = "forward_fail_event"; - } - if (message.settle_event != null && message.hasOwnProperty("settle_event")) { - object.settle_event = $root.routerrpc.SettleEvent.toObject(message.settle_event, options); - if (options.oneofs) - object.event = "settle_event"; - } - if (message.link_fail_event != null && message.hasOwnProperty("link_fail_event")) { - object.link_fail_event = $root.routerrpc.LinkFailEvent.toObject(message.link_fail_event, options); - if (options.oneofs) - object.event = "link_fail_event"; - } - if (message.subscribed_event != null && message.hasOwnProperty("subscribed_event")) { - object.subscribed_event = $root.routerrpc.SubscribedEvent.toObject(message.subscribed_event, options); - if (options.oneofs) - object.event = "subscribed_event"; - } - if (message.final_htlc_event != null && message.hasOwnProperty("final_htlc_event")) { - object.final_htlc_event = $root.routerrpc.FinalHtlcEvent.toObject(message.final_htlc_event, options); - if (options.oneofs) - object.event = "final_htlc_event"; - } + if (options.defaults) + if (options.bytes === String) + object.preimage = ""; + else { + object.preimage = []; + if (options.bytes !== Array) + object.preimage = $util.newBuffer(object.preimage); + } + if (message.preimage != null && message.hasOwnProperty("preimage")) + object.preimage = options.bytes === String ? $util.base64.encode(message.preimage, 0, message.preimage.length) : options.bytes === Array ? Array.prototype.slice.call(message.preimage) : message.preimage; return object; }; /** - * Converts this HtlcEvent to JSON. + * Converts this SettleEvent to JSON. * @function toJSON - * @memberof routerrpc.HtlcEvent + * @memberof routerrpc.SettleEvent * @instance * @returns {Object.} JSON object */ - HtlcEvent.prototype.toJSON = function toJSON() { + SettleEvent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for HtlcEvent + * Gets the default type url for SettleEvent * @function getTypeUrl - * @memberof routerrpc.HtlcEvent + * @memberof routerrpc.SettleEvent * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - HtlcEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SettleEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.HtlcEvent"; + return typeUrlPrefix + "/routerrpc.SettleEvent"; }; - /** - * EventType enum. - * @name routerrpc.HtlcEvent.EventType - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} SEND=1 SEND value - * @property {number} RECEIVE=2 RECEIVE value - * @property {number} FORWARD=3 FORWARD value - */ - HtlcEvent.EventType = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "SEND"] = 1; - values[valuesById[2] = "RECEIVE"] = 2; - values[valuesById[3] = "FORWARD"] = 3; - return values; - })(); - - return HtlcEvent; + return SettleEvent; })(); - routerrpc.HtlcInfo = (function() { + routerrpc.FinalHtlcEvent = (function() { /** - * Properties of a HtlcInfo. + * Properties of a FinalHtlcEvent. * @memberof routerrpc - * @interface IHtlcInfo - * @property {number|null} [incoming_timelock] HtlcInfo incoming_timelock - * @property {number|null} [outgoing_timelock] HtlcInfo outgoing_timelock - * @property {Long|null} [incoming_amt_msat] HtlcInfo incoming_amt_msat - * @property {Long|null} [outgoing_amt_msat] HtlcInfo outgoing_amt_msat + * @interface IFinalHtlcEvent + * @property {boolean|null} [settled] FinalHtlcEvent settled + * @property {boolean|null} [offchain] FinalHtlcEvent offchain */ /** - * Constructs a new HtlcInfo. + * Constructs a new FinalHtlcEvent. * @memberof routerrpc - * @classdesc Represents a HtlcInfo. - * @implements IHtlcInfo + * @classdesc Represents a FinalHtlcEvent. + * @implements IFinalHtlcEvent * @constructor - * @param {routerrpc.IHtlcInfo=} [properties] Properties to set + * @param {routerrpc.IFinalHtlcEvent=} [properties] Properties to set */ - function HtlcInfo(properties) { + function FinalHtlcEvent(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -92741,117 +95570,89 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * HtlcInfo incoming_timelock. - * @member {number} incoming_timelock - * @memberof routerrpc.HtlcInfo - * @instance - */ - HtlcInfo.prototype.incoming_timelock = 0; - - /** - * HtlcInfo outgoing_timelock. - * @member {number} outgoing_timelock - * @memberof routerrpc.HtlcInfo - * @instance - */ - HtlcInfo.prototype.outgoing_timelock = 0; - - /** - * HtlcInfo incoming_amt_msat. - * @member {Long} incoming_amt_msat - * @memberof routerrpc.HtlcInfo + * FinalHtlcEvent settled. + * @member {boolean} settled + * @memberof routerrpc.FinalHtlcEvent * @instance */ - HtlcInfo.prototype.incoming_amt_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + FinalHtlcEvent.prototype.settled = false; /** - * HtlcInfo outgoing_amt_msat. - * @member {Long} outgoing_amt_msat - * @memberof routerrpc.HtlcInfo + * FinalHtlcEvent offchain. + * @member {boolean} offchain + * @memberof routerrpc.FinalHtlcEvent * @instance */ - HtlcInfo.prototype.outgoing_amt_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + FinalHtlcEvent.prototype.offchain = false; /** - * Creates a new HtlcInfo instance using the specified properties. + * Creates a new FinalHtlcEvent instance using the specified properties. * @function create - * @memberof routerrpc.HtlcInfo + * @memberof routerrpc.FinalHtlcEvent * @static - * @param {routerrpc.IHtlcInfo=} [properties] Properties to set - * @returns {routerrpc.HtlcInfo} HtlcInfo instance + * @param {routerrpc.IFinalHtlcEvent=} [properties] Properties to set + * @returns {routerrpc.FinalHtlcEvent} FinalHtlcEvent instance */ - HtlcInfo.create = function create(properties) { - return new HtlcInfo(properties); + FinalHtlcEvent.create = function create(properties) { + return new FinalHtlcEvent(properties); }; /** - * Encodes the specified HtlcInfo message. Does not implicitly {@link routerrpc.HtlcInfo.verify|verify} messages. + * Encodes the specified FinalHtlcEvent message. Does not implicitly {@link routerrpc.FinalHtlcEvent.verify|verify} messages. * @function encode - * @memberof routerrpc.HtlcInfo + * @memberof routerrpc.FinalHtlcEvent * @static - * @param {routerrpc.IHtlcInfo} message HtlcInfo message or plain object to encode + * @param {routerrpc.IFinalHtlcEvent} message FinalHtlcEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HtlcInfo.encode = function encode(message, writer) { + FinalHtlcEvent.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.incoming_timelock != null && Object.hasOwnProperty.call(message, "incoming_timelock")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.incoming_timelock); - if (message.outgoing_timelock != null && Object.hasOwnProperty.call(message, "outgoing_timelock")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.outgoing_timelock); - if (message.incoming_amt_msat != null && Object.hasOwnProperty.call(message, "incoming_amt_msat")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.incoming_amt_msat); - if (message.outgoing_amt_msat != null && Object.hasOwnProperty.call(message, "outgoing_amt_msat")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.outgoing_amt_msat); + if (message.settled != null && Object.hasOwnProperty.call(message, "settled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.settled); + if (message.offchain != null && Object.hasOwnProperty.call(message, "offchain")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.offchain); return writer; }; /** - * Encodes the specified HtlcInfo message, length delimited. Does not implicitly {@link routerrpc.HtlcInfo.verify|verify} messages. + * Encodes the specified FinalHtlcEvent message, length delimited. Does not implicitly {@link routerrpc.FinalHtlcEvent.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.HtlcInfo + * @memberof routerrpc.FinalHtlcEvent * @static - * @param {routerrpc.IHtlcInfo} message HtlcInfo message or plain object to encode + * @param {routerrpc.IFinalHtlcEvent} message FinalHtlcEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HtlcInfo.encodeDelimited = function encodeDelimited(message, writer) { + FinalHtlcEvent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HtlcInfo message from the specified reader or buffer. + * Decodes a FinalHtlcEvent message from the specified reader or buffer. * @function decode - * @memberof routerrpc.HtlcInfo + * @memberof routerrpc.FinalHtlcEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.HtlcInfo} HtlcInfo + * @returns {routerrpc.FinalHtlcEvent} FinalHtlcEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HtlcInfo.decode = function decode(reader, length) { + FinalHtlcEvent.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.HtlcInfo(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.FinalHtlcEvent(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.incoming_timelock = reader.uint32(); + message.settled = reader.bool(); break; } case 2: { - message.outgoing_timelock = reader.uint32(); - break; - } - case 3: { - message.incoming_amt_msat = reader.uint64(); - break; - } - case 4: { - message.outgoing_amt_msat = reader.uint64(); + message.offchain = reader.bool(); break; } default: @@ -92863,175 +95664,130 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a HtlcInfo message from the specified reader or buffer, length delimited. + * Decodes a FinalHtlcEvent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.HtlcInfo + * @memberof routerrpc.FinalHtlcEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.HtlcInfo} HtlcInfo + * @returns {routerrpc.FinalHtlcEvent} FinalHtlcEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HtlcInfo.decodeDelimited = function decodeDelimited(reader) { + FinalHtlcEvent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HtlcInfo message. + * Verifies a FinalHtlcEvent message. * @function verify - * @memberof routerrpc.HtlcInfo + * @memberof routerrpc.FinalHtlcEvent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HtlcInfo.verify = function verify(message) { + FinalHtlcEvent.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.incoming_timelock != null && message.hasOwnProperty("incoming_timelock")) - if (!$util.isInteger(message.incoming_timelock)) - return "incoming_timelock: integer expected"; - if (message.outgoing_timelock != null && message.hasOwnProperty("outgoing_timelock")) - if (!$util.isInteger(message.outgoing_timelock)) - return "outgoing_timelock: integer expected"; - if (message.incoming_amt_msat != null && message.hasOwnProperty("incoming_amt_msat")) - if (!$util.isInteger(message.incoming_amt_msat) && !(message.incoming_amt_msat && $util.isInteger(message.incoming_amt_msat.low) && $util.isInteger(message.incoming_amt_msat.high))) - return "incoming_amt_msat: integer|Long expected"; - if (message.outgoing_amt_msat != null && message.hasOwnProperty("outgoing_amt_msat")) - if (!$util.isInteger(message.outgoing_amt_msat) && !(message.outgoing_amt_msat && $util.isInteger(message.outgoing_amt_msat.low) && $util.isInteger(message.outgoing_amt_msat.high))) - return "outgoing_amt_msat: integer|Long expected"; + if (message.settled != null && message.hasOwnProperty("settled")) + if (typeof message.settled !== "boolean") + return "settled: boolean expected"; + if (message.offchain != null && message.hasOwnProperty("offchain")) + if (typeof message.offchain !== "boolean") + return "offchain: boolean expected"; return null; }; /** - * Creates a HtlcInfo message from a plain object. Also converts values to their respective internal types. + * Creates a FinalHtlcEvent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.HtlcInfo + * @memberof routerrpc.FinalHtlcEvent * @static * @param {Object.} object Plain object - * @returns {routerrpc.HtlcInfo} HtlcInfo + * @returns {routerrpc.FinalHtlcEvent} FinalHtlcEvent */ - HtlcInfo.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.HtlcInfo) + FinalHtlcEvent.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.FinalHtlcEvent) return object; - let message = new $root.routerrpc.HtlcInfo(); - if (object.incoming_timelock != null) - message.incoming_timelock = object.incoming_timelock >>> 0; - if (object.outgoing_timelock != null) - message.outgoing_timelock = object.outgoing_timelock >>> 0; - if (object.incoming_amt_msat != null) - if ($util.Long) - (message.incoming_amt_msat = $util.Long.fromValue(object.incoming_amt_msat)).unsigned = true; - else if (typeof object.incoming_amt_msat === "string") - message.incoming_amt_msat = parseInt(object.incoming_amt_msat, 10); - else if (typeof object.incoming_amt_msat === "number") - message.incoming_amt_msat = object.incoming_amt_msat; - else if (typeof object.incoming_amt_msat === "object") - message.incoming_amt_msat = new $util.LongBits(object.incoming_amt_msat.low >>> 0, object.incoming_amt_msat.high >>> 0).toNumber(true); - if (object.outgoing_amt_msat != null) - if ($util.Long) - (message.outgoing_amt_msat = $util.Long.fromValue(object.outgoing_amt_msat)).unsigned = true; - else if (typeof object.outgoing_amt_msat === "string") - message.outgoing_amt_msat = parseInt(object.outgoing_amt_msat, 10); - else if (typeof object.outgoing_amt_msat === "number") - message.outgoing_amt_msat = object.outgoing_amt_msat; - else if (typeof object.outgoing_amt_msat === "object") - message.outgoing_amt_msat = new $util.LongBits(object.outgoing_amt_msat.low >>> 0, object.outgoing_amt_msat.high >>> 0).toNumber(true); + let message = new $root.routerrpc.FinalHtlcEvent(); + if (object.settled != null) + message.settled = Boolean(object.settled); + if (object.offchain != null) + message.offchain = Boolean(object.offchain); return message; }; /** - * Creates a plain object from a HtlcInfo message. Also converts values to other types if specified. + * Creates a plain object from a FinalHtlcEvent message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.HtlcInfo + * @memberof routerrpc.FinalHtlcEvent * @static - * @param {routerrpc.HtlcInfo} message HtlcInfo + * @param {routerrpc.FinalHtlcEvent} message FinalHtlcEvent * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HtlcInfo.toObject = function toObject(message, options) { + FinalHtlcEvent.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; if (options.defaults) { - object.incoming_timelock = 0; - object.outgoing_timelock = 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.incoming_amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.incoming_amt_msat = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.outgoing_amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.outgoing_amt_msat = options.longs === String ? "0" : 0; + object.settled = false; + object.offchain = false; } - if (message.incoming_timelock != null && message.hasOwnProperty("incoming_timelock")) - object.incoming_timelock = message.incoming_timelock; - if (message.outgoing_timelock != null && message.hasOwnProperty("outgoing_timelock")) - object.outgoing_timelock = message.outgoing_timelock; - if (message.incoming_amt_msat != null && message.hasOwnProperty("incoming_amt_msat")) - if (typeof message.incoming_amt_msat === "number") - object.incoming_amt_msat = options.longs === String ? String(message.incoming_amt_msat) : message.incoming_amt_msat; - else - object.incoming_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.incoming_amt_msat) : options.longs === Number ? new $util.LongBits(message.incoming_amt_msat.low >>> 0, message.incoming_amt_msat.high >>> 0).toNumber(true) : message.incoming_amt_msat; - if (message.outgoing_amt_msat != null && message.hasOwnProperty("outgoing_amt_msat")) - if (typeof message.outgoing_amt_msat === "number") - object.outgoing_amt_msat = options.longs === String ? String(message.outgoing_amt_msat) : message.outgoing_amt_msat; - else - object.outgoing_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_amt_msat) : options.longs === Number ? new $util.LongBits(message.outgoing_amt_msat.low >>> 0, message.outgoing_amt_msat.high >>> 0).toNumber(true) : message.outgoing_amt_msat; + if (message.settled != null && message.hasOwnProperty("settled")) + object.settled = message.settled; + if (message.offchain != null && message.hasOwnProperty("offchain")) + object.offchain = message.offchain; return object; }; /** - * Converts this HtlcInfo to JSON. + * Converts this FinalHtlcEvent to JSON. * @function toJSON - * @memberof routerrpc.HtlcInfo + * @memberof routerrpc.FinalHtlcEvent * @instance * @returns {Object.} JSON object */ - HtlcInfo.prototype.toJSON = function toJSON() { + FinalHtlcEvent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for HtlcInfo + * Gets the default type url for FinalHtlcEvent * @function getTypeUrl - * @memberof routerrpc.HtlcInfo + * @memberof routerrpc.FinalHtlcEvent * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - HtlcInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FinalHtlcEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.HtlcInfo"; + return typeUrlPrefix + "/routerrpc.FinalHtlcEvent"; }; - return HtlcInfo; + return FinalHtlcEvent; })(); - routerrpc.ForwardEvent = (function() { + routerrpc.SubscribedEvent = (function() { /** - * Properties of a ForwardEvent. + * Properties of a SubscribedEvent. * @memberof routerrpc - * @interface IForwardEvent - * @property {routerrpc.IHtlcInfo|null} [info] ForwardEvent info + * @interface ISubscribedEvent */ /** - * Constructs a new ForwardEvent. + * Constructs a new SubscribedEvent. * @memberof routerrpc - * @classdesc Represents a ForwardEvent. - * @implements IForwardEvent + * @classdesc Represents a SubscribedEvent. + * @implements ISubscribedEvent * @constructor - * @param {routerrpc.IForwardEvent=} [properties] Properties to set + * @param {routerrpc.ISubscribedEvent=} [properties] Properties to set */ - function ForwardEvent(properties) { + function SubscribedEvent(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -93039,77 +95795,63 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * ForwardEvent info. - * @member {routerrpc.IHtlcInfo|null|undefined} info - * @memberof routerrpc.ForwardEvent - * @instance - */ - ForwardEvent.prototype.info = null; - - /** - * Creates a new ForwardEvent instance using the specified properties. + * Creates a new SubscribedEvent instance using the specified properties. * @function create - * @memberof routerrpc.ForwardEvent + * @memberof routerrpc.SubscribedEvent * @static - * @param {routerrpc.IForwardEvent=} [properties] Properties to set - * @returns {routerrpc.ForwardEvent} ForwardEvent instance + * @param {routerrpc.ISubscribedEvent=} [properties] Properties to set + * @returns {routerrpc.SubscribedEvent} SubscribedEvent instance */ - ForwardEvent.create = function create(properties) { - return new ForwardEvent(properties); + SubscribedEvent.create = function create(properties) { + return new SubscribedEvent(properties); }; /** - * Encodes the specified ForwardEvent message. Does not implicitly {@link routerrpc.ForwardEvent.verify|verify} messages. + * Encodes the specified SubscribedEvent message. Does not implicitly {@link routerrpc.SubscribedEvent.verify|verify} messages. * @function encode - * @memberof routerrpc.ForwardEvent + * @memberof routerrpc.SubscribedEvent * @static - * @param {routerrpc.IForwardEvent} message ForwardEvent message or plain object to encode + * @param {routerrpc.ISubscribedEvent} message SubscribedEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ForwardEvent.encode = function encode(message, writer) { + SubscribedEvent.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.routerrpc.HtlcInfo.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ForwardEvent message, length delimited. Does not implicitly {@link routerrpc.ForwardEvent.verify|verify} messages. + * Encodes the specified SubscribedEvent message, length delimited. Does not implicitly {@link routerrpc.SubscribedEvent.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.ForwardEvent + * @memberof routerrpc.SubscribedEvent * @static - * @param {routerrpc.IForwardEvent} message ForwardEvent message or plain object to encode + * @param {routerrpc.ISubscribedEvent} message SubscribedEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ForwardEvent.encodeDelimited = function encodeDelimited(message, writer) { + SubscribedEvent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ForwardEvent message from the specified reader or buffer. + * Decodes a SubscribedEvent message from the specified reader or buffer. * @function decode - * @memberof routerrpc.ForwardEvent + * @memberof routerrpc.SubscribedEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.ForwardEvent} ForwardEvent + * @returns {routerrpc.SubscribedEvent} SubscribedEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ForwardEvent.decode = function decode(reader, length) { + SubscribedEvent.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.ForwardEvent(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SubscribedEvent(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.info = $root.routerrpc.HtlcInfo.decode(reader, reader.uint32()); - break; - } default: reader.skipType(tag & 7); break; @@ -93119,126 +95861,112 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a ForwardEvent message from the specified reader or buffer, length delimited. + * Decodes a SubscribedEvent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.ForwardEvent + * @memberof routerrpc.SubscribedEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.ForwardEvent} ForwardEvent + * @returns {routerrpc.SubscribedEvent} SubscribedEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ForwardEvent.decodeDelimited = function decodeDelimited(reader) { + SubscribedEvent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ForwardEvent message. + * Verifies a SubscribedEvent message. * @function verify - * @memberof routerrpc.ForwardEvent + * @memberof routerrpc.SubscribedEvent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ForwardEvent.verify = function verify(message) { + SubscribedEvent.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.info != null && message.hasOwnProperty("info")) { - let error = $root.routerrpc.HtlcInfo.verify(message.info); - if (error) - return "info." + error; - } return null; }; /** - * Creates a ForwardEvent message from a plain object. Also converts values to their respective internal types. + * Creates a SubscribedEvent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.ForwardEvent + * @memberof routerrpc.SubscribedEvent * @static * @param {Object.} object Plain object - * @returns {routerrpc.ForwardEvent} ForwardEvent + * @returns {routerrpc.SubscribedEvent} SubscribedEvent */ - ForwardEvent.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.ForwardEvent) + SubscribedEvent.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.SubscribedEvent) return object; - let message = new $root.routerrpc.ForwardEvent(); - if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".routerrpc.ForwardEvent.info: object expected"); - message.info = $root.routerrpc.HtlcInfo.fromObject(object.info); - } - return message; + return new $root.routerrpc.SubscribedEvent(); }; /** - * Creates a plain object from a ForwardEvent message. Also converts values to other types if specified. + * Creates a plain object from a SubscribedEvent message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.ForwardEvent + * @memberof routerrpc.SubscribedEvent * @static - * @param {routerrpc.ForwardEvent} message ForwardEvent + * @param {routerrpc.SubscribedEvent} message SubscribedEvent * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ForwardEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) - object.info = null; - if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.routerrpc.HtlcInfo.toObject(message.info, options); - return object; + SubscribedEvent.toObject = function toObject() { + return {}; }; /** - * Converts this ForwardEvent to JSON. + * Converts this SubscribedEvent to JSON. * @function toJSON - * @memberof routerrpc.ForwardEvent + * @memberof routerrpc.SubscribedEvent * @instance * @returns {Object.} JSON object */ - ForwardEvent.prototype.toJSON = function toJSON() { + SubscribedEvent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ForwardEvent + * Gets the default type url for SubscribedEvent * @function getTypeUrl - * @memberof routerrpc.ForwardEvent + * @memberof routerrpc.SubscribedEvent * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ForwardEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SubscribedEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.ForwardEvent"; + return typeUrlPrefix + "/routerrpc.SubscribedEvent"; }; - return ForwardEvent; + return SubscribedEvent; })(); - routerrpc.ForwardFailEvent = (function() { + routerrpc.LinkFailEvent = (function() { /** - * Properties of a ForwardFailEvent. + * Properties of a LinkFailEvent. * @memberof routerrpc - * @interface IForwardFailEvent + * @interface ILinkFailEvent + * @property {routerrpc.IHtlcInfo|null} [info] LinkFailEvent info + * @property {lnrpc.Failure.FailureCode|null} [wire_failure] LinkFailEvent wire_failure + * @property {routerrpc.FailureDetail|null} [failure_detail] LinkFailEvent failure_detail + * @property {string|null} [failure_string] LinkFailEvent failure_string */ /** - * Constructs a new ForwardFailEvent. + * Constructs a new LinkFailEvent. * @memberof routerrpc - * @classdesc Represents a ForwardFailEvent. - * @implements IForwardFailEvent + * @classdesc Represents a LinkFailEvent. + * @implements ILinkFailEvent * @constructor - * @param {routerrpc.IForwardFailEvent=} [properties] Properties to set + * @param {routerrpc.ILinkFailEvent=} [properties] Properties to set */ - function ForwardFailEvent(properties) { + function LinkFailEvent(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -93246,63 +95974,119 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * Creates a new ForwardFailEvent instance using the specified properties. + * LinkFailEvent info. + * @member {routerrpc.IHtlcInfo|null|undefined} info + * @memberof routerrpc.LinkFailEvent + * @instance + */ + LinkFailEvent.prototype.info = null; + + /** + * LinkFailEvent wire_failure. + * @member {lnrpc.Failure.FailureCode} wire_failure + * @memberof routerrpc.LinkFailEvent + * @instance + */ + LinkFailEvent.prototype.wire_failure = 0; + + /** + * LinkFailEvent failure_detail. + * @member {routerrpc.FailureDetail} failure_detail + * @memberof routerrpc.LinkFailEvent + * @instance + */ + LinkFailEvent.prototype.failure_detail = 0; + + /** + * LinkFailEvent failure_string. + * @member {string} failure_string + * @memberof routerrpc.LinkFailEvent + * @instance + */ + LinkFailEvent.prototype.failure_string = ""; + + /** + * Creates a new LinkFailEvent instance using the specified properties. * @function create - * @memberof routerrpc.ForwardFailEvent + * @memberof routerrpc.LinkFailEvent * @static - * @param {routerrpc.IForwardFailEvent=} [properties] Properties to set - * @returns {routerrpc.ForwardFailEvent} ForwardFailEvent instance + * @param {routerrpc.ILinkFailEvent=} [properties] Properties to set + * @returns {routerrpc.LinkFailEvent} LinkFailEvent instance */ - ForwardFailEvent.create = function create(properties) { - return new ForwardFailEvent(properties); + LinkFailEvent.create = function create(properties) { + return new LinkFailEvent(properties); }; /** - * Encodes the specified ForwardFailEvent message. Does not implicitly {@link routerrpc.ForwardFailEvent.verify|verify} messages. + * Encodes the specified LinkFailEvent message. Does not implicitly {@link routerrpc.LinkFailEvent.verify|verify} messages. * @function encode - * @memberof routerrpc.ForwardFailEvent + * @memberof routerrpc.LinkFailEvent * @static - * @param {routerrpc.IForwardFailEvent} message ForwardFailEvent message or plain object to encode + * @param {routerrpc.ILinkFailEvent} message LinkFailEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ForwardFailEvent.encode = function encode(message, writer) { + LinkFailEvent.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + $root.routerrpc.HtlcInfo.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.wire_failure != null && Object.hasOwnProperty.call(message, "wire_failure")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.wire_failure); + if (message.failure_detail != null && Object.hasOwnProperty.call(message, "failure_detail")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.failure_detail); + if (message.failure_string != null && Object.hasOwnProperty.call(message, "failure_string")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.failure_string); return writer; }; /** - * Encodes the specified ForwardFailEvent message, length delimited. Does not implicitly {@link routerrpc.ForwardFailEvent.verify|verify} messages. + * Encodes the specified LinkFailEvent message, length delimited. Does not implicitly {@link routerrpc.LinkFailEvent.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.ForwardFailEvent + * @memberof routerrpc.LinkFailEvent * @static - * @param {routerrpc.IForwardFailEvent} message ForwardFailEvent message or plain object to encode + * @param {routerrpc.ILinkFailEvent} message LinkFailEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ForwardFailEvent.encodeDelimited = function encodeDelimited(message, writer) { + LinkFailEvent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ForwardFailEvent message from the specified reader or buffer. + * Decodes a LinkFailEvent message from the specified reader or buffer. * @function decode - * @memberof routerrpc.ForwardFailEvent + * @memberof routerrpc.LinkFailEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.ForwardFailEvent} ForwardFailEvent + * @returns {routerrpc.LinkFailEvent} LinkFailEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ForwardFailEvent.decode = function decode(reader, length) { + LinkFailEvent.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.ForwardFailEvent(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.LinkFailEvent(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.info = $root.routerrpc.HtlcInfo.decode(reader, reader.uint32()); + break; + } + case 2: { + message.wire_failure = reader.int32(); + break; + } + case 3: { + message.failure_detail = reader.int32(); + break; + } + case 4: { + message.failure_string = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -93312,109 +96096,513 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a ForwardFailEvent message from the specified reader or buffer, length delimited. + * Decodes a LinkFailEvent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.ForwardFailEvent + * @memberof routerrpc.LinkFailEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.ForwardFailEvent} ForwardFailEvent + * @returns {routerrpc.LinkFailEvent} LinkFailEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ForwardFailEvent.decodeDelimited = function decodeDelimited(reader) { + LinkFailEvent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ForwardFailEvent message. + * Verifies a LinkFailEvent message. * @function verify - * @memberof routerrpc.ForwardFailEvent + * @memberof routerrpc.LinkFailEvent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ForwardFailEvent.verify = function verify(message) { + LinkFailEvent.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.info != null && message.hasOwnProperty("info")) { + let error = $root.routerrpc.HtlcInfo.verify(message.info); + if (error) + return "info." + error; + } + if (message.wire_failure != null && message.hasOwnProperty("wire_failure")) + switch (message.wire_failure) { + default: + return "wire_failure: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 997: + case 998: + case 999: + break; + } + if (message.failure_detail != null && message.hasOwnProperty("failure_detail")) + switch (message.failure_detail) { + default: + return "failure_detail: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + break; + } + if (message.failure_string != null && message.hasOwnProperty("failure_string")) + if (!$util.isString(message.failure_string)) + return "failure_string: string expected"; return null; }; /** - * Creates a ForwardFailEvent message from a plain object. Also converts values to their respective internal types. + * Creates a LinkFailEvent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.ForwardFailEvent + * @memberof routerrpc.LinkFailEvent * @static * @param {Object.} object Plain object - * @returns {routerrpc.ForwardFailEvent} ForwardFailEvent + * @returns {routerrpc.LinkFailEvent} LinkFailEvent */ - ForwardFailEvent.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.ForwardFailEvent) + LinkFailEvent.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.LinkFailEvent) return object; - return new $root.routerrpc.ForwardFailEvent(); + let message = new $root.routerrpc.LinkFailEvent(); + if (object.info != null) { + if (typeof object.info !== "object") + throw TypeError(".routerrpc.LinkFailEvent.info: object expected"); + message.info = $root.routerrpc.HtlcInfo.fromObject(object.info); + } + switch (object.wire_failure) { + default: + if (typeof object.wire_failure === "number") { + message.wire_failure = object.wire_failure; + break; + } + break; + case "RESERVED": + case 0: + message.wire_failure = 0; + break; + case "INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS": + case 1: + message.wire_failure = 1; + break; + case "INCORRECT_PAYMENT_AMOUNT": + case 2: + message.wire_failure = 2; + break; + case "FINAL_INCORRECT_CLTV_EXPIRY": + case 3: + message.wire_failure = 3; + break; + case "FINAL_INCORRECT_HTLC_AMOUNT": + case 4: + message.wire_failure = 4; + break; + case "FINAL_EXPIRY_TOO_SOON": + case 5: + message.wire_failure = 5; + break; + case "INVALID_REALM": + case 6: + message.wire_failure = 6; + break; + case "EXPIRY_TOO_SOON": + case 7: + message.wire_failure = 7; + break; + case "INVALID_ONION_VERSION": + case 8: + message.wire_failure = 8; + break; + case "INVALID_ONION_HMAC": + case 9: + message.wire_failure = 9; + break; + case "INVALID_ONION_KEY": + case 10: + message.wire_failure = 10; + break; + case "AMOUNT_BELOW_MINIMUM": + case 11: + message.wire_failure = 11; + break; + case "FEE_INSUFFICIENT": + case 12: + message.wire_failure = 12; + break; + case "INCORRECT_CLTV_EXPIRY": + case 13: + message.wire_failure = 13; + break; + case "CHANNEL_DISABLED": + case 14: + message.wire_failure = 14; + break; + case "TEMPORARY_CHANNEL_FAILURE": + case 15: + message.wire_failure = 15; + break; + case "REQUIRED_NODE_FEATURE_MISSING": + case 16: + message.wire_failure = 16; + break; + case "REQUIRED_CHANNEL_FEATURE_MISSING": + case 17: + message.wire_failure = 17; + break; + case "UNKNOWN_NEXT_PEER": + case 18: + message.wire_failure = 18; + break; + case "TEMPORARY_NODE_FAILURE": + case 19: + message.wire_failure = 19; + break; + case "PERMANENT_NODE_FAILURE": + case 20: + message.wire_failure = 20; + break; + case "PERMANENT_CHANNEL_FAILURE": + case 21: + message.wire_failure = 21; + break; + case "EXPIRY_TOO_FAR": + case 22: + message.wire_failure = 22; + break; + case "MPP_TIMEOUT": + case 23: + message.wire_failure = 23; + break; + case "INVALID_ONION_PAYLOAD": + case 24: + message.wire_failure = 24; + break; + case "INVALID_ONION_BLINDING": + case 25: + message.wire_failure = 25; + break; + case "INTERNAL_FAILURE": + case 997: + message.wire_failure = 997; + break; + case "UNKNOWN_FAILURE": + case 998: + message.wire_failure = 998; + break; + case "UNREADABLE_FAILURE": + case 999: + message.wire_failure = 999; + break; + } + switch (object.failure_detail) { + default: + if (typeof object.failure_detail === "number") { + message.failure_detail = object.failure_detail; + break; + } + break; + case "UNKNOWN": + case 0: + message.failure_detail = 0; + break; + case "NO_DETAIL": + case 1: + message.failure_detail = 1; + break; + case "ONION_DECODE": + case 2: + message.failure_detail = 2; + break; + case "LINK_NOT_ELIGIBLE": + case 3: + message.failure_detail = 3; + break; + case "ON_CHAIN_TIMEOUT": + case 4: + message.failure_detail = 4; + break; + case "HTLC_EXCEEDS_MAX": + case 5: + message.failure_detail = 5; + break; + case "INSUFFICIENT_BALANCE": + case 6: + message.failure_detail = 6; + break; + case "INCOMPLETE_FORWARD": + case 7: + message.failure_detail = 7; + break; + case "HTLC_ADD_FAILED": + case 8: + message.failure_detail = 8; + break; + case "FORWARDS_DISABLED": + case 9: + message.failure_detail = 9; + break; + case "INVOICE_CANCELED": + case 10: + message.failure_detail = 10; + break; + case "INVOICE_UNDERPAID": + case 11: + message.failure_detail = 11; + break; + case "INVOICE_EXPIRY_TOO_SOON": + case 12: + message.failure_detail = 12; + break; + case "INVOICE_NOT_OPEN": + case 13: + message.failure_detail = 13; + break; + case "MPP_INVOICE_TIMEOUT": + case 14: + message.failure_detail = 14; + break; + case "ADDRESS_MISMATCH": + case 15: + message.failure_detail = 15; + break; + case "SET_TOTAL_MISMATCH": + case 16: + message.failure_detail = 16; + break; + case "SET_TOTAL_TOO_LOW": + case 17: + message.failure_detail = 17; + break; + case "SET_OVERPAID": + case 18: + message.failure_detail = 18; + break; + case "UNKNOWN_INVOICE": + case 19: + message.failure_detail = 19; + break; + case "INVALID_KEYSEND": + case 20: + message.failure_detail = 20; + break; + case "MPP_IN_PROGRESS": + case 21: + message.failure_detail = 21; + break; + case "CIRCULAR_ROUTE": + case 22: + message.failure_detail = 22; + break; + } + if (object.failure_string != null) + message.failure_string = String(object.failure_string); + return message; }; /** - * Creates a plain object from a ForwardFailEvent message. Also converts values to other types if specified. + * Creates a plain object from a LinkFailEvent message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.ForwardFailEvent + * @memberof routerrpc.LinkFailEvent * @static - * @param {routerrpc.ForwardFailEvent} message ForwardFailEvent + * @param {routerrpc.LinkFailEvent} message LinkFailEvent * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ForwardFailEvent.toObject = function toObject() { - return {}; + LinkFailEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.info = null; + object.wire_failure = options.enums === String ? "RESERVED" : 0; + object.failure_detail = options.enums === String ? "UNKNOWN" : 0; + object.failure_string = ""; + } + if (message.info != null && message.hasOwnProperty("info")) + object.info = $root.routerrpc.HtlcInfo.toObject(message.info, options); + if (message.wire_failure != null && message.hasOwnProperty("wire_failure")) + object.wire_failure = options.enums === String ? $root.lnrpc.Failure.FailureCode[message.wire_failure] === undefined ? message.wire_failure : $root.lnrpc.Failure.FailureCode[message.wire_failure] : message.wire_failure; + if (message.failure_detail != null && message.hasOwnProperty("failure_detail")) + object.failure_detail = options.enums === String ? $root.routerrpc.FailureDetail[message.failure_detail] === undefined ? message.failure_detail : $root.routerrpc.FailureDetail[message.failure_detail] : message.failure_detail; + if (message.failure_string != null && message.hasOwnProperty("failure_string")) + object.failure_string = message.failure_string; + return object; }; /** - * Converts this ForwardFailEvent to JSON. + * Converts this LinkFailEvent to JSON. * @function toJSON - * @memberof routerrpc.ForwardFailEvent + * @memberof routerrpc.LinkFailEvent * @instance * @returns {Object.} JSON object */ - ForwardFailEvent.prototype.toJSON = function toJSON() { + LinkFailEvent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ForwardFailEvent + * Gets the default type url for LinkFailEvent * @function getTypeUrl - * @memberof routerrpc.ForwardFailEvent + * @memberof routerrpc.LinkFailEvent * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ForwardFailEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + LinkFailEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.ForwardFailEvent"; + return typeUrlPrefix + "/routerrpc.LinkFailEvent"; }; - return ForwardFailEvent; + return LinkFailEvent; })(); - routerrpc.SettleEvent = (function() { + /** + * FailureDetail enum. + * @name routerrpc.FailureDetail + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} NO_DETAIL=1 NO_DETAIL value + * @property {number} ONION_DECODE=2 ONION_DECODE value + * @property {number} LINK_NOT_ELIGIBLE=3 LINK_NOT_ELIGIBLE value + * @property {number} ON_CHAIN_TIMEOUT=4 ON_CHAIN_TIMEOUT value + * @property {number} HTLC_EXCEEDS_MAX=5 HTLC_EXCEEDS_MAX value + * @property {number} INSUFFICIENT_BALANCE=6 INSUFFICIENT_BALANCE value + * @property {number} INCOMPLETE_FORWARD=7 INCOMPLETE_FORWARD value + * @property {number} HTLC_ADD_FAILED=8 HTLC_ADD_FAILED value + * @property {number} FORWARDS_DISABLED=9 FORWARDS_DISABLED value + * @property {number} INVOICE_CANCELED=10 INVOICE_CANCELED value + * @property {number} INVOICE_UNDERPAID=11 INVOICE_UNDERPAID value + * @property {number} INVOICE_EXPIRY_TOO_SOON=12 INVOICE_EXPIRY_TOO_SOON value + * @property {number} INVOICE_NOT_OPEN=13 INVOICE_NOT_OPEN value + * @property {number} MPP_INVOICE_TIMEOUT=14 MPP_INVOICE_TIMEOUT value + * @property {number} ADDRESS_MISMATCH=15 ADDRESS_MISMATCH value + * @property {number} SET_TOTAL_MISMATCH=16 SET_TOTAL_MISMATCH value + * @property {number} SET_TOTAL_TOO_LOW=17 SET_TOTAL_TOO_LOW value + * @property {number} SET_OVERPAID=18 SET_OVERPAID value + * @property {number} UNKNOWN_INVOICE=19 UNKNOWN_INVOICE value + * @property {number} INVALID_KEYSEND=20 INVALID_KEYSEND value + * @property {number} MPP_IN_PROGRESS=21 MPP_IN_PROGRESS value + * @property {number} CIRCULAR_ROUTE=22 CIRCULAR_ROUTE value + */ + routerrpc.FailureDetail = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "NO_DETAIL"] = 1; + values[valuesById[2] = "ONION_DECODE"] = 2; + values[valuesById[3] = "LINK_NOT_ELIGIBLE"] = 3; + values[valuesById[4] = "ON_CHAIN_TIMEOUT"] = 4; + values[valuesById[5] = "HTLC_EXCEEDS_MAX"] = 5; + values[valuesById[6] = "INSUFFICIENT_BALANCE"] = 6; + values[valuesById[7] = "INCOMPLETE_FORWARD"] = 7; + values[valuesById[8] = "HTLC_ADD_FAILED"] = 8; + values[valuesById[9] = "FORWARDS_DISABLED"] = 9; + values[valuesById[10] = "INVOICE_CANCELED"] = 10; + values[valuesById[11] = "INVOICE_UNDERPAID"] = 11; + values[valuesById[12] = "INVOICE_EXPIRY_TOO_SOON"] = 12; + values[valuesById[13] = "INVOICE_NOT_OPEN"] = 13; + values[valuesById[14] = "MPP_INVOICE_TIMEOUT"] = 14; + values[valuesById[15] = "ADDRESS_MISMATCH"] = 15; + values[valuesById[16] = "SET_TOTAL_MISMATCH"] = 16; + values[valuesById[17] = "SET_TOTAL_TOO_LOW"] = 17; + values[valuesById[18] = "SET_OVERPAID"] = 18; + values[valuesById[19] = "UNKNOWN_INVOICE"] = 19; + values[valuesById[20] = "INVALID_KEYSEND"] = 20; + values[valuesById[21] = "MPP_IN_PROGRESS"] = 21; + values[valuesById[22] = "CIRCULAR_ROUTE"] = 22; + return values; + })(); + + /** + * PaymentState enum. + * @name routerrpc.PaymentState + * @enum {number} + * @property {number} IN_FLIGHT=0 IN_FLIGHT value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED_TIMEOUT=2 FAILED_TIMEOUT value + * @property {number} FAILED_NO_ROUTE=3 FAILED_NO_ROUTE value + * @property {number} FAILED_ERROR=4 FAILED_ERROR value + * @property {number} FAILED_INCORRECT_PAYMENT_DETAILS=5 FAILED_INCORRECT_PAYMENT_DETAILS value + * @property {number} FAILED_INSUFFICIENT_BALANCE=6 FAILED_INSUFFICIENT_BALANCE value + */ + routerrpc.PaymentState = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IN_FLIGHT"] = 0; + values[valuesById[1] = "SUCCEEDED"] = 1; + values[valuesById[2] = "FAILED_TIMEOUT"] = 2; + values[valuesById[3] = "FAILED_NO_ROUTE"] = 3; + values[valuesById[4] = "FAILED_ERROR"] = 4; + values[valuesById[5] = "FAILED_INCORRECT_PAYMENT_DETAILS"] = 5; + values[valuesById[6] = "FAILED_INSUFFICIENT_BALANCE"] = 6; + return values; + })(); + + routerrpc.PaymentStatus = (function() { /** - * Properties of a SettleEvent. + * Properties of a PaymentStatus. * @memberof routerrpc - * @interface ISettleEvent - * @property {Uint8Array|null} [preimage] SettleEvent preimage + * @interface IPaymentStatus + * @property {routerrpc.PaymentState|null} [state] PaymentStatus state + * @property {Uint8Array|null} [preimage] PaymentStatus preimage + * @property {Array.|null} [htlcs] PaymentStatus htlcs */ /** - * Constructs a new SettleEvent. + * Constructs a new PaymentStatus. * @memberof routerrpc - * @classdesc Represents a SettleEvent. - * @implements ISettleEvent + * @classdesc Represents a PaymentStatus. + * @implements IPaymentStatus * @constructor - * @param {routerrpc.ISettleEvent=} [properties] Properties to set + * @param {routerrpc.IPaymentStatus=} [properties] Properties to set */ - function SettleEvent(properties) { + function PaymentStatus(properties) { + this.htlcs = []; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -93422,77 +96610,108 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * SettleEvent preimage. + * PaymentStatus state. + * @member {routerrpc.PaymentState} state + * @memberof routerrpc.PaymentStatus + * @instance + */ + PaymentStatus.prototype.state = 0; + + /** + * PaymentStatus preimage. * @member {Uint8Array} preimage - * @memberof routerrpc.SettleEvent + * @memberof routerrpc.PaymentStatus * @instance */ - SettleEvent.prototype.preimage = $util.newBuffer([]); + PaymentStatus.prototype.preimage = $util.newBuffer([]); /** - * Creates a new SettleEvent instance using the specified properties. + * PaymentStatus htlcs. + * @member {Array.} htlcs + * @memberof routerrpc.PaymentStatus + * @instance + */ + PaymentStatus.prototype.htlcs = $util.emptyArray; + + /** + * Creates a new PaymentStatus instance using the specified properties. * @function create - * @memberof routerrpc.SettleEvent + * @memberof routerrpc.PaymentStatus * @static - * @param {routerrpc.ISettleEvent=} [properties] Properties to set - * @returns {routerrpc.SettleEvent} SettleEvent instance + * @param {routerrpc.IPaymentStatus=} [properties] Properties to set + * @returns {routerrpc.PaymentStatus} PaymentStatus instance */ - SettleEvent.create = function create(properties) { - return new SettleEvent(properties); + PaymentStatus.create = function create(properties) { + return new PaymentStatus(properties); }; /** - * Encodes the specified SettleEvent message. Does not implicitly {@link routerrpc.SettleEvent.verify|verify} messages. + * Encodes the specified PaymentStatus message. Does not implicitly {@link routerrpc.PaymentStatus.verify|verify} messages. * @function encode - * @memberof routerrpc.SettleEvent + * @memberof routerrpc.PaymentStatus * @static - * @param {routerrpc.ISettleEvent} message SettleEvent message or plain object to encode + * @param {routerrpc.IPaymentStatus} message PaymentStatus message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SettleEvent.encode = function encode(message, writer) { + PaymentStatus.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.preimage); + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.preimage); + if (message.htlcs != null && message.htlcs.length) + for (let i = 0; i < message.htlcs.length; ++i) + $root.lnrpc.HTLCAttempt.encode(message.htlcs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified SettleEvent message, length delimited. Does not implicitly {@link routerrpc.SettleEvent.verify|verify} messages. + * Encodes the specified PaymentStatus message, length delimited. Does not implicitly {@link routerrpc.PaymentStatus.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.SettleEvent + * @memberof routerrpc.PaymentStatus * @static - * @param {routerrpc.ISettleEvent} message SettleEvent message or plain object to encode + * @param {routerrpc.IPaymentStatus} message PaymentStatus message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SettleEvent.encodeDelimited = function encodeDelimited(message, writer) { + PaymentStatus.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SettleEvent message from the specified reader or buffer. + * Decodes a PaymentStatus message from the specified reader or buffer. * @function decode - * @memberof routerrpc.SettleEvent + * @memberof routerrpc.PaymentStatus * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.SettleEvent} SettleEvent + * @returns {routerrpc.PaymentStatus} PaymentStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SettleEvent.decode = function decode(reader, length) { + PaymentStatus.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SettleEvent(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.PaymentStatus(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { + message.state = reader.int32(); + break; + } + case 2: { message.preimage = reader.bytes(); break; } + case 4: { + if (!(message.htlcs && message.htlcs.length)) + message.htlcs = []; + message.htlcs.push($root.lnrpc.HTLCAttempt.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -93502,72 +96721,143 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a SettleEvent message from the specified reader or buffer, length delimited. + * Decodes a PaymentStatus message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.SettleEvent + * @memberof routerrpc.PaymentStatus * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.SettleEvent} SettleEvent + * @returns {routerrpc.PaymentStatus} PaymentStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SettleEvent.decodeDelimited = function decodeDelimited(reader) { + PaymentStatus.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SettleEvent message. + * Verifies a PaymentStatus message. * @function verify - * @memberof routerrpc.SettleEvent + * @memberof routerrpc.PaymentStatus * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SettleEvent.verify = function verify(message) { + PaymentStatus.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } if (message.preimage != null && message.hasOwnProperty("preimage")) if (!(message.preimage && typeof message.preimage.length === "number" || $util.isString(message.preimage))) return "preimage: buffer expected"; + if (message.htlcs != null && message.hasOwnProperty("htlcs")) { + if (!Array.isArray(message.htlcs)) + return "htlcs: array expected"; + for (let i = 0; i < message.htlcs.length; ++i) { + let error = $root.lnrpc.HTLCAttempt.verify(message.htlcs[i]); + if (error) + return "htlcs." + error; + } + } return null; }; /** - * Creates a SettleEvent message from a plain object. Also converts values to their respective internal types. + * Creates a PaymentStatus message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.SettleEvent + * @memberof routerrpc.PaymentStatus * @static * @param {Object.} object Plain object - * @returns {routerrpc.SettleEvent} SettleEvent + * @returns {routerrpc.PaymentStatus} PaymentStatus */ - SettleEvent.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.SettleEvent) + PaymentStatus.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.PaymentStatus) return object; - let message = new $root.routerrpc.SettleEvent(); + let message = new $root.routerrpc.PaymentStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "IN_FLIGHT": + case 0: + message.state = 0; + break; + case "SUCCEEDED": + case 1: + message.state = 1; + break; + case "FAILED_TIMEOUT": + case 2: + message.state = 2; + break; + case "FAILED_NO_ROUTE": + case 3: + message.state = 3; + break; + case "FAILED_ERROR": + case 4: + message.state = 4; + break; + case "FAILED_INCORRECT_PAYMENT_DETAILS": + case 5: + message.state = 5; + break; + case "FAILED_INSUFFICIENT_BALANCE": + case 6: + message.state = 6; + break; + } if (object.preimage != null) if (typeof object.preimage === "string") $util.base64.decode(object.preimage, message.preimage = $util.newBuffer($util.base64.length(object.preimage)), 0); else if (object.preimage.length >= 0) message.preimage = object.preimage; + if (object.htlcs) { + if (!Array.isArray(object.htlcs)) + throw TypeError(".routerrpc.PaymentStatus.htlcs: array expected"); + message.htlcs = []; + for (let i = 0; i < object.htlcs.length; ++i) { + if (typeof object.htlcs[i] !== "object") + throw TypeError(".routerrpc.PaymentStatus.htlcs: object expected"); + message.htlcs[i] = $root.lnrpc.HTLCAttempt.fromObject(object.htlcs[i]); + } + } return message; }; /** - * Creates a plain object from a SettleEvent message. Also converts values to other types if specified. + * Creates a plain object from a PaymentStatus message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.SettleEvent + * @memberof routerrpc.PaymentStatus * @static - * @param {routerrpc.SettleEvent} message SettleEvent + * @param {routerrpc.PaymentStatus} message PaymentStatus * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SettleEvent.toObject = function toObject(message, options) { + PaymentStatus.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.defaults) + if (options.arrays || options.defaults) + object.htlcs = []; + if (options.defaults) { + object.state = options.enums === String ? "IN_FLIGHT" : 0; if (options.bytes === String) object.preimage = ""; else { @@ -93575,59 +96865,67 @@ export const routerrpc = $root.routerrpc = (() => { if (options.bytes !== Array) object.preimage = $util.newBuffer(object.preimage); } + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.routerrpc.PaymentState[message.state] === undefined ? message.state : $root.routerrpc.PaymentState[message.state] : message.state; if (message.preimage != null && message.hasOwnProperty("preimage")) object.preimage = options.bytes === String ? $util.base64.encode(message.preimage, 0, message.preimage.length) : options.bytes === Array ? Array.prototype.slice.call(message.preimage) : message.preimage; + if (message.htlcs && message.htlcs.length) { + object.htlcs = []; + for (let j = 0; j < message.htlcs.length; ++j) + object.htlcs[j] = $root.lnrpc.HTLCAttempt.toObject(message.htlcs[j], options); + } return object; }; /** - * Converts this SettleEvent to JSON. + * Converts this PaymentStatus to JSON. * @function toJSON - * @memberof routerrpc.SettleEvent + * @memberof routerrpc.PaymentStatus * @instance * @returns {Object.} JSON object */ - SettleEvent.prototype.toJSON = function toJSON() { + PaymentStatus.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SettleEvent + * Gets the default type url for PaymentStatus * @function getTypeUrl - * @memberof routerrpc.SettleEvent + * @memberof routerrpc.PaymentStatus * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SettleEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PaymentStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.SettleEvent"; + return typeUrlPrefix + "/routerrpc.PaymentStatus"; }; - return SettleEvent; + return PaymentStatus; })(); - routerrpc.FinalHtlcEvent = (function() { + routerrpc.CircuitKey = (function() { /** - * Properties of a FinalHtlcEvent. + * Properties of a CircuitKey. * @memberof routerrpc - * @interface IFinalHtlcEvent - * @property {boolean|null} [settled] FinalHtlcEvent settled - * @property {boolean|null} [offchain] FinalHtlcEvent offchain + * @interface ICircuitKey + * @property {Long|null} [chan_id] The id of the channel that the is part of this circuit. + * @property {Long|null} [htlc_id] The index of the incoming htlc in the incoming channel. */ /** - * Constructs a new FinalHtlcEvent. + * Constructs a new CircuitKey. * @memberof routerrpc - * @classdesc Represents a FinalHtlcEvent. - * @implements IFinalHtlcEvent + * @classdesc Represents a CircuitKey. + * @implements ICircuitKey * @constructor - * @param {routerrpc.IFinalHtlcEvent=} [properties] Properties to set + * @param {routerrpc.ICircuitKey=} [properties] Properties to set */ - function FinalHtlcEvent(properties) { + function CircuitKey(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -93635,89 +96933,89 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * FinalHtlcEvent settled. - * @member {boolean} settled - * @memberof routerrpc.FinalHtlcEvent + * The id of the channel that the is part of this circuit. + * @member {Long} chan_id + * @memberof routerrpc.CircuitKey * @instance */ - FinalHtlcEvent.prototype.settled = false; + CircuitKey.prototype.chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * FinalHtlcEvent offchain. - * @member {boolean} offchain - * @memberof routerrpc.FinalHtlcEvent + * The index of the incoming htlc in the incoming channel. + * @member {Long} htlc_id + * @memberof routerrpc.CircuitKey * @instance */ - FinalHtlcEvent.prototype.offchain = false; + CircuitKey.prototype.htlc_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Creates a new FinalHtlcEvent instance using the specified properties. + * Creates a new CircuitKey instance using the specified properties. * @function create - * @memberof routerrpc.FinalHtlcEvent + * @memberof routerrpc.CircuitKey * @static - * @param {routerrpc.IFinalHtlcEvent=} [properties] Properties to set - * @returns {routerrpc.FinalHtlcEvent} FinalHtlcEvent instance + * @param {routerrpc.ICircuitKey=} [properties] Properties to set + * @returns {routerrpc.CircuitKey} CircuitKey instance */ - FinalHtlcEvent.create = function create(properties) { - return new FinalHtlcEvent(properties); + CircuitKey.create = function create(properties) { + return new CircuitKey(properties); }; /** - * Encodes the specified FinalHtlcEvent message. Does not implicitly {@link routerrpc.FinalHtlcEvent.verify|verify} messages. + * Encodes the specified CircuitKey message. Does not implicitly {@link routerrpc.CircuitKey.verify|verify} messages. * @function encode - * @memberof routerrpc.FinalHtlcEvent + * @memberof routerrpc.CircuitKey * @static - * @param {routerrpc.IFinalHtlcEvent} message FinalHtlcEvent message or plain object to encode + * @param {routerrpc.ICircuitKey} message CircuitKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FinalHtlcEvent.encode = function encode(message, writer) { + CircuitKey.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.settled != null && Object.hasOwnProperty.call(message, "settled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.settled); - if (message.offchain != null && Object.hasOwnProperty.call(message, "offchain")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.offchain); + if (message.chan_id != null && Object.hasOwnProperty.call(message, "chan_id")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.chan_id); + if (message.htlc_id != null && Object.hasOwnProperty.call(message, "htlc_id")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.htlc_id); return writer; }; /** - * Encodes the specified FinalHtlcEvent message, length delimited. Does not implicitly {@link routerrpc.FinalHtlcEvent.verify|verify} messages. + * Encodes the specified CircuitKey message, length delimited. Does not implicitly {@link routerrpc.CircuitKey.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.FinalHtlcEvent + * @memberof routerrpc.CircuitKey * @static - * @param {routerrpc.IFinalHtlcEvent} message FinalHtlcEvent message or plain object to encode + * @param {routerrpc.ICircuitKey} message CircuitKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FinalHtlcEvent.encodeDelimited = function encodeDelimited(message, writer) { + CircuitKey.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FinalHtlcEvent message from the specified reader or buffer. + * Decodes a CircuitKey message from the specified reader or buffer. * @function decode - * @memberof routerrpc.FinalHtlcEvent + * @memberof routerrpc.CircuitKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.FinalHtlcEvent} FinalHtlcEvent + * @returns {routerrpc.CircuitKey} CircuitKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FinalHtlcEvent.decode = function decode(reader, length) { + CircuitKey.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.FinalHtlcEvent(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.CircuitKey(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.settled = reader.bool(); + message.chan_id = reader.uint64(); break; } case 2: { - message.offchain = reader.bool(); + message.htlc_id = reader.uint64(); break; } default: @@ -93729,130 +97027,171 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a FinalHtlcEvent message from the specified reader or buffer, length delimited. + * Decodes a CircuitKey message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.FinalHtlcEvent + * @memberof routerrpc.CircuitKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.FinalHtlcEvent} FinalHtlcEvent + * @returns {routerrpc.CircuitKey} CircuitKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FinalHtlcEvent.decodeDelimited = function decodeDelimited(reader) { + CircuitKey.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FinalHtlcEvent message. + * Verifies a CircuitKey message. * @function verify - * @memberof routerrpc.FinalHtlcEvent + * @memberof routerrpc.CircuitKey * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FinalHtlcEvent.verify = function verify(message) { + CircuitKey.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.settled != null && message.hasOwnProperty("settled")) - if (typeof message.settled !== "boolean") - return "settled: boolean expected"; - if (message.offchain != null && message.hasOwnProperty("offchain")) - if (typeof message.offchain !== "boolean") - return "offchain: boolean expected"; + if (message.chan_id != null && message.hasOwnProperty("chan_id")) + if (!$util.isInteger(message.chan_id) && !(message.chan_id && $util.isInteger(message.chan_id.low) && $util.isInteger(message.chan_id.high))) + return "chan_id: integer|Long expected"; + if (message.htlc_id != null && message.hasOwnProperty("htlc_id")) + if (!$util.isInteger(message.htlc_id) && !(message.htlc_id && $util.isInteger(message.htlc_id.low) && $util.isInteger(message.htlc_id.high))) + return "htlc_id: integer|Long expected"; return null; }; /** - * Creates a FinalHtlcEvent message from a plain object. Also converts values to their respective internal types. + * Creates a CircuitKey message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.FinalHtlcEvent + * @memberof routerrpc.CircuitKey * @static * @param {Object.} object Plain object - * @returns {routerrpc.FinalHtlcEvent} FinalHtlcEvent + * @returns {routerrpc.CircuitKey} CircuitKey */ - FinalHtlcEvent.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.FinalHtlcEvent) + CircuitKey.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.CircuitKey) return object; - let message = new $root.routerrpc.FinalHtlcEvent(); - if (object.settled != null) - message.settled = Boolean(object.settled); - if (object.offchain != null) - message.offchain = Boolean(object.offchain); + let message = new $root.routerrpc.CircuitKey(); + if (object.chan_id != null) + if ($util.Long) + (message.chan_id = $util.Long.fromValue(object.chan_id)).unsigned = true; + else if (typeof object.chan_id === "string") + message.chan_id = parseInt(object.chan_id, 10); + else if (typeof object.chan_id === "number") + message.chan_id = object.chan_id; + else if (typeof object.chan_id === "object") + message.chan_id = new $util.LongBits(object.chan_id.low >>> 0, object.chan_id.high >>> 0).toNumber(true); + if (object.htlc_id != null) + if ($util.Long) + (message.htlc_id = $util.Long.fromValue(object.htlc_id)).unsigned = true; + else if (typeof object.htlc_id === "string") + message.htlc_id = parseInt(object.htlc_id, 10); + else if (typeof object.htlc_id === "number") + message.htlc_id = object.htlc_id; + else if (typeof object.htlc_id === "object") + message.htlc_id = new $util.LongBits(object.htlc_id.low >>> 0, object.htlc_id.high >>> 0).toNumber(true); return message; }; /** - * Creates a plain object from a FinalHtlcEvent message. Also converts values to other types if specified. + * Creates a plain object from a CircuitKey message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.FinalHtlcEvent + * @memberof routerrpc.CircuitKey * @static - * @param {routerrpc.FinalHtlcEvent} message FinalHtlcEvent + * @param {routerrpc.CircuitKey} message CircuitKey * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FinalHtlcEvent.toObject = function toObject(message, options) { + CircuitKey.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; if (options.defaults) { - object.settled = false; - object.offchain = false; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.chan_id = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.htlc_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.htlc_id = options.longs === String ? "0" : 0; } - if (message.settled != null && message.hasOwnProperty("settled")) - object.settled = message.settled; - if (message.offchain != null && message.hasOwnProperty("offchain")) - object.offchain = message.offchain; + if (message.chan_id != null && message.hasOwnProperty("chan_id")) + if (typeof message.chan_id === "number") + object.chan_id = options.longs === String ? String(message.chan_id) : message.chan_id; + else + object.chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.chan_id) : options.longs === Number ? new $util.LongBits(message.chan_id.low >>> 0, message.chan_id.high >>> 0).toNumber(true) : message.chan_id; + if (message.htlc_id != null && message.hasOwnProperty("htlc_id")) + if (typeof message.htlc_id === "number") + object.htlc_id = options.longs === String ? String(message.htlc_id) : message.htlc_id; + else + object.htlc_id = options.longs === String ? $util.Long.prototype.toString.call(message.htlc_id) : options.longs === Number ? new $util.LongBits(message.htlc_id.low >>> 0, message.htlc_id.high >>> 0).toNumber(true) : message.htlc_id; return object; }; /** - * Converts this FinalHtlcEvent to JSON. + * Converts this CircuitKey to JSON. * @function toJSON - * @memberof routerrpc.FinalHtlcEvent + * @memberof routerrpc.CircuitKey * @instance * @returns {Object.} JSON object */ - FinalHtlcEvent.prototype.toJSON = function toJSON() { + CircuitKey.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FinalHtlcEvent + * Gets the default type url for CircuitKey * @function getTypeUrl - * @memberof routerrpc.FinalHtlcEvent + * @memberof routerrpc.CircuitKey * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FinalHtlcEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CircuitKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.FinalHtlcEvent"; + return typeUrlPrefix + "/routerrpc.CircuitKey"; }; - return FinalHtlcEvent; + return CircuitKey; })(); - routerrpc.SubscribedEvent = (function() { + routerrpc.ForwardHtlcInterceptRequest = (function() { /** - * Properties of a SubscribedEvent. + * Properties of a ForwardHtlcInterceptRequest. * @memberof routerrpc - * @interface ISubscribedEvent + * @interface IForwardHtlcInterceptRequest + * @property {routerrpc.ICircuitKey|null} [incoming_circuit_key] ForwardHtlcInterceptRequest incoming_circuit_key + * @property {Long|null} [incoming_amount_msat] ForwardHtlcInterceptRequest incoming_amount_msat + * @property {number|null} [incoming_expiry] ForwardHtlcInterceptRequest incoming_expiry + * @property {Uint8Array|null} [payment_hash] ForwardHtlcInterceptRequest payment_hash + * @property {Long|null} [outgoing_requested_chan_id] ForwardHtlcInterceptRequest outgoing_requested_chan_id + * @property {Long|null} [outgoing_amount_msat] ForwardHtlcInterceptRequest outgoing_amount_msat + * @property {number|null} [outgoing_expiry] ForwardHtlcInterceptRequest outgoing_expiry + * @property {Object.|null} [custom_records] ForwardHtlcInterceptRequest custom_records + * @property {Uint8Array|null} [onion_blob] ForwardHtlcInterceptRequest onion_blob + * @property {number|null} [auto_fail_height] ForwardHtlcInterceptRequest auto_fail_height + * @property {Object.|null} [in_wire_custom_records] ForwardHtlcInterceptRequest in_wire_custom_records */ /** - * Constructs a new SubscribedEvent. + * Constructs a new ForwardHtlcInterceptRequest. * @memberof routerrpc - * @classdesc Represents a SubscribedEvent. - * @implements ISubscribedEvent + * @classdesc Represents a ForwardHtlcInterceptRequest. + * @implements IForwardHtlcInterceptRequest * @constructor - * @param {routerrpc.ISubscribedEvent=} [properties] Properties to set + * @param {routerrpc.IForwardHtlcInterceptRequest=} [properties] Properties to set */ - function SubscribedEvent(properties) { + function ForwardHtlcInterceptRequest(properties) { + this.custom_records = {}; + this.in_wire_custom_records = {}; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -93860,63 +97199,257 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * Creates a new SubscribedEvent instance using the specified properties. + * ForwardHtlcInterceptRequest incoming_circuit_key. + * @member {routerrpc.ICircuitKey|null|undefined} incoming_circuit_key + * @memberof routerrpc.ForwardHtlcInterceptRequest + * @instance + */ + ForwardHtlcInterceptRequest.prototype.incoming_circuit_key = null; + + /** + * ForwardHtlcInterceptRequest incoming_amount_msat. + * @member {Long} incoming_amount_msat + * @memberof routerrpc.ForwardHtlcInterceptRequest + * @instance + */ + ForwardHtlcInterceptRequest.prototype.incoming_amount_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ForwardHtlcInterceptRequest incoming_expiry. + * @member {number} incoming_expiry + * @memberof routerrpc.ForwardHtlcInterceptRequest + * @instance + */ + ForwardHtlcInterceptRequest.prototype.incoming_expiry = 0; + + /** + * ForwardHtlcInterceptRequest payment_hash. + * @member {Uint8Array} payment_hash + * @memberof routerrpc.ForwardHtlcInterceptRequest + * @instance + */ + ForwardHtlcInterceptRequest.prototype.payment_hash = $util.newBuffer([]); + + /** + * ForwardHtlcInterceptRequest outgoing_requested_chan_id. + * @member {Long} outgoing_requested_chan_id + * @memberof routerrpc.ForwardHtlcInterceptRequest + * @instance + */ + ForwardHtlcInterceptRequest.prototype.outgoing_requested_chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ForwardHtlcInterceptRequest outgoing_amount_msat. + * @member {Long} outgoing_amount_msat + * @memberof routerrpc.ForwardHtlcInterceptRequest + * @instance + */ + ForwardHtlcInterceptRequest.prototype.outgoing_amount_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ForwardHtlcInterceptRequest outgoing_expiry. + * @member {number} outgoing_expiry + * @memberof routerrpc.ForwardHtlcInterceptRequest + * @instance + */ + ForwardHtlcInterceptRequest.prototype.outgoing_expiry = 0; + + /** + * ForwardHtlcInterceptRequest custom_records. + * @member {Object.} custom_records + * @memberof routerrpc.ForwardHtlcInterceptRequest + * @instance + */ + ForwardHtlcInterceptRequest.prototype.custom_records = $util.emptyObject; + + /** + * ForwardHtlcInterceptRequest onion_blob. + * @member {Uint8Array} onion_blob + * @memberof routerrpc.ForwardHtlcInterceptRequest + * @instance + */ + ForwardHtlcInterceptRequest.prototype.onion_blob = $util.newBuffer([]); + + /** + * ForwardHtlcInterceptRequest auto_fail_height. + * @member {number} auto_fail_height + * @memberof routerrpc.ForwardHtlcInterceptRequest + * @instance + */ + ForwardHtlcInterceptRequest.prototype.auto_fail_height = 0; + + /** + * ForwardHtlcInterceptRequest in_wire_custom_records. + * @member {Object.} in_wire_custom_records + * @memberof routerrpc.ForwardHtlcInterceptRequest + * @instance + */ + ForwardHtlcInterceptRequest.prototype.in_wire_custom_records = $util.emptyObject; + + /** + * Creates a new ForwardHtlcInterceptRequest instance using the specified properties. * @function create - * @memberof routerrpc.SubscribedEvent + * @memberof routerrpc.ForwardHtlcInterceptRequest * @static - * @param {routerrpc.ISubscribedEvent=} [properties] Properties to set - * @returns {routerrpc.SubscribedEvent} SubscribedEvent instance + * @param {routerrpc.IForwardHtlcInterceptRequest=} [properties] Properties to set + * @returns {routerrpc.ForwardHtlcInterceptRequest} ForwardHtlcInterceptRequest instance */ - SubscribedEvent.create = function create(properties) { - return new SubscribedEvent(properties); + ForwardHtlcInterceptRequest.create = function create(properties) { + return new ForwardHtlcInterceptRequest(properties); }; /** - * Encodes the specified SubscribedEvent message. Does not implicitly {@link routerrpc.SubscribedEvent.verify|verify} messages. + * Encodes the specified ForwardHtlcInterceptRequest message. Does not implicitly {@link routerrpc.ForwardHtlcInterceptRequest.verify|verify} messages. * @function encode - * @memberof routerrpc.SubscribedEvent + * @memberof routerrpc.ForwardHtlcInterceptRequest * @static - * @param {routerrpc.ISubscribedEvent} message SubscribedEvent message or plain object to encode + * @param {routerrpc.IForwardHtlcInterceptRequest} message ForwardHtlcInterceptRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SubscribedEvent.encode = function encode(message, writer) { + ForwardHtlcInterceptRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.incoming_circuit_key != null && Object.hasOwnProperty.call(message, "incoming_circuit_key")) + $root.routerrpc.CircuitKey.encode(message.incoming_circuit_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.payment_hash); + if (message.outgoing_amount_msat != null && Object.hasOwnProperty.call(message, "outgoing_amount_msat")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.outgoing_amount_msat); + if (message.outgoing_expiry != null && Object.hasOwnProperty.call(message, "outgoing_expiry")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.outgoing_expiry); + if (message.incoming_amount_msat != null && Object.hasOwnProperty.call(message, "incoming_amount_msat")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.incoming_amount_msat); + if (message.incoming_expiry != null && Object.hasOwnProperty.call(message, "incoming_expiry")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.incoming_expiry); + if (message.outgoing_requested_chan_id != null && Object.hasOwnProperty.call(message, "outgoing_requested_chan_id")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.outgoing_requested_chan_id); + if (message.custom_records != null && Object.hasOwnProperty.call(message, "custom_records")) + for (let keys = Object.keys(message.custom_records), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.custom_records[keys[i]]).ldelim(); + if (message.onion_blob != null && Object.hasOwnProperty.call(message, "onion_blob")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.onion_blob); + if (message.auto_fail_height != null && Object.hasOwnProperty.call(message, "auto_fail_height")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.auto_fail_height); + if (message.in_wire_custom_records != null && Object.hasOwnProperty.call(message, "in_wire_custom_records")) + for (let keys = Object.keys(message.in_wire_custom_records), i = 0; i < keys.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.in_wire_custom_records[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified SubscribedEvent message, length delimited. Does not implicitly {@link routerrpc.SubscribedEvent.verify|verify} messages. + * Encodes the specified ForwardHtlcInterceptRequest message, length delimited. Does not implicitly {@link routerrpc.ForwardHtlcInterceptRequest.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.SubscribedEvent + * @memberof routerrpc.ForwardHtlcInterceptRequest * @static - * @param {routerrpc.ISubscribedEvent} message SubscribedEvent message or plain object to encode + * @param {routerrpc.IForwardHtlcInterceptRequest} message ForwardHtlcInterceptRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SubscribedEvent.encodeDelimited = function encodeDelimited(message, writer) { + ForwardHtlcInterceptRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SubscribedEvent message from the specified reader or buffer. + * Decodes a ForwardHtlcInterceptRequest message from the specified reader or buffer. * @function decode - * @memberof routerrpc.SubscribedEvent + * @memberof routerrpc.ForwardHtlcInterceptRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.SubscribedEvent} SubscribedEvent + * @returns {routerrpc.ForwardHtlcInterceptRequest} ForwardHtlcInterceptRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SubscribedEvent.decode = function decode(reader, length) { + ForwardHtlcInterceptRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SubscribedEvent(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.ForwardHtlcInterceptRequest(), key, value; while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.incoming_circuit_key = $root.routerrpc.CircuitKey.decode(reader, reader.uint32()); + break; + } + case 5: { + message.incoming_amount_msat = reader.uint64(); + break; + } + case 6: { + message.incoming_expiry = reader.uint32(); + break; + } + case 2: { + message.payment_hash = reader.bytes(); + break; + } + case 7: { + message.outgoing_requested_chan_id = reader.uint64(); + break; + } + case 3: { + message.outgoing_amount_msat = reader.uint64(); + break; + } + case 4: { + message.outgoing_expiry = reader.uint32(); + break; + } + case 8: { + if (message.custom_records === $util.emptyObject) + message.custom_records = {}; + let end2 = reader.uint32() + reader.pos; + key = 0; + value = []; + while (reader.pos < end2) { + let tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint64(); + break; + case 2: + value = reader.bytes(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value; + break; + } + case 9: { + message.onion_blob = reader.bytes(); + break; + } + case 10: { + message.auto_fail_height = reader.int32(); + break; + } + case 11: { + if (message.in_wire_custom_records === $util.emptyObject) + message.in_wire_custom_records = {}; + let end2 = reader.uint32() + reader.pos; + key = 0; + value = []; + while (reader.pos < end2) { + let tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint64(); + break; + case 2: + value = reader.bytes(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.in_wire_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value; + break; + } default: reader.skipType(tag & 7); break; @@ -93926,112 +97459,324 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a SubscribedEvent message from the specified reader or buffer, length delimited. + * Decodes a ForwardHtlcInterceptRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.SubscribedEvent + * @memberof routerrpc.ForwardHtlcInterceptRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.SubscribedEvent} SubscribedEvent + * @returns {routerrpc.ForwardHtlcInterceptRequest} ForwardHtlcInterceptRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SubscribedEvent.decodeDelimited = function decodeDelimited(reader) { + ForwardHtlcInterceptRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SubscribedEvent message. + * Verifies a ForwardHtlcInterceptRequest message. * @function verify - * @memberof routerrpc.SubscribedEvent + * @memberof routerrpc.ForwardHtlcInterceptRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SubscribedEvent.verify = function verify(message) { + ForwardHtlcInterceptRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.incoming_circuit_key != null && message.hasOwnProperty("incoming_circuit_key")) { + let error = $root.routerrpc.CircuitKey.verify(message.incoming_circuit_key); + if (error) + return "incoming_circuit_key." + error; + } + if (message.incoming_amount_msat != null && message.hasOwnProperty("incoming_amount_msat")) + if (!$util.isInteger(message.incoming_amount_msat) && !(message.incoming_amount_msat && $util.isInteger(message.incoming_amount_msat.low) && $util.isInteger(message.incoming_amount_msat.high))) + return "incoming_amount_msat: integer|Long expected"; + if (message.incoming_expiry != null && message.hasOwnProperty("incoming_expiry")) + if (!$util.isInteger(message.incoming_expiry)) + return "incoming_expiry: integer expected"; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + if (!(message.payment_hash && typeof message.payment_hash.length === "number" || $util.isString(message.payment_hash))) + return "payment_hash: buffer expected"; + if (message.outgoing_requested_chan_id != null && message.hasOwnProperty("outgoing_requested_chan_id")) + if (!$util.isInteger(message.outgoing_requested_chan_id) && !(message.outgoing_requested_chan_id && $util.isInteger(message.outgoing_requested_chan_id.low) && $util.isInteger(message.outgoing_requested_chan_id.high))) + return "outgoing_requested_chan_id: integer|Long expected"; + if (message.outgoing_amount_msat != null && message.hasOwnProperty("outgoing_amount_msat")) + if (!$util.isInteger(message.outgoing_amount_msat) && !(message.outgoing_amount_msat && $util.isInteger(message.outgoing_amount_msat.low) && $util.isInteger(message.outgoing_amount_msat.high))) + return "outgoing_amount_msat: integer|Long expected"; + if (message.outgoing_expiry != null && message.hasOwnProperty("outgoing_expiry")) + if (!$util.isInteger(message.outgoing_expiry)) + return "outgoing_expiry: integer expected"; + if (message.custom_records != null && message.hasOwnProperty("custom_records")) { + if (!$util.isObject(message.custom_records)) + return "custom_records: object expected"; + let key = Object.keys(message.custom_records); + for (let i = 0; i < key.length; ++i) { + if (!$util.key64Re.test(key[i])) + return "custom_records: integer|Long key{k:uint64} expected"; + if (!(message.custom_records[key[i]] && typeof message.custom_records[key[i]].length === "number" || $util.isString(message.custom_records[key[i]]))) + return "custom_records: buffer{k:uint64} expected"; + } + } + if (message.onion_blob != null && message.hasOwnProperty("onion_blob")) + if (!(message.onion_blob && typeof message.onion_blob.length === "number" || $util.isString(message.onion_blob))) + return "onion_blob: buffer expected"; + if (message.auto_fail_height != null && message.hasOwnProperty("auto_fail_height")) + if (!$util.isInteger(message.auto_fail_height)) + return "auto_fail_height: integer expected"; + if (message.in_wire_custom_records != null && message.hasOwnProperty("in_wire_custom_records")) { + if (!$util.isObject(message.in_wire_custom_records)) + return "in_wire_custom_records: object expected"; + let key = Object.keys(message.in_wire_custom_records); + for (let i = 0; i < key.length; ++i) { + if (!$util.key64Re.test(key[i])) + return "in_wire_custom_records: integer|Long key{k:uint64} expected"; + if (!(message.in_wire_custom_records[key[i]] && typeof message.in_wire_custom_records[key[i]].length === "number" || $util.isString(message.in_wire_custom_records[key[i]]))) + return "in_wire_custom_records: buffer{k:uint64} expected"; + } + } return null; }; /** - * Creates a SubscribedEvent message from a plain object. Also converts values to their respective internal types. + * Creates a ForwardHtlcInterceptRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.SubscribedEvent + * @memberof routerrpc.ForwardHtlcInterceptRequest * @static * @param {Object.} object Plain object - * @returns {routerrpc.SubscribedEvent} SubscribedEvent + * @returns {routerrpc.ForwardHtlcInterceptRequest} ForwardHtlcInterceptRequest */ - SubscribedEvent.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.SubscribedEvent) + ForwardHtlcInterceptRequest.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.ForwardHtlcInterceptRequest) return object; - return new $root.routerrpc.SubscribedEvent(); + let message = new $root.routerrpc.ForwardHtlcInterceptRequest(); + if (object.incoming_circuit_key != null) { + if (typeof object.incoming_circuit_key !== "object") + throw TypeError(".routerrpc.ForwardHtlcInterceptRequest.incoming_circuit_key: object expected"); + message.incoming_circuit_key = $root.routerrpc.CircuitKey.fromObject(object.incoming_circuit_key); + } + if (object.incoming_amount_msat != null) + if ($util.Long) + (message.incoming_amount_msat = $util.Long.fromValue(object.incoming_amount_msat)).unsigned = true; + else if (typeof object.incoming_amount_msat === "string") + message.incoming_amount_msat = parseInt(object.incoming_amount_msat, 10); + else if (typeof object.incoming_amount_msat === "number") + message.incoming_amount_msat = object.incoming_amount_msat; + else if (typeof object.incoming_amount_msat === "object") + message.incoming_amount_msat = new $util.LongBits(object.incoming_amount_msat.low >>> 0, object.incoming_amount_msat.high >>> 0).toNumber(true); + if (object.incoming_expiry != null) + message.incoming_expiry = object.incoming_expiry >>> 0; + if (object.payment_hash != null) + if (typeof object.payment_hash === "string") + $util.base64.decode(object.payment_hash, message.payment_hash = $util.newBuffer($util.base64.length(object.payment_hash)), 0); + else if (object.payment_hash.length >= 0) + message.payment_hash = object.payment_hash; + if (object.outgoing_requested_chan_id != null) + if ($util.Long) + (message.outgoing_requested_chan_id = $util.Long.fromValue(object.outgoing_requested_chan_id)).unsigned = true; + else if (typeof object.outgoing_requested_chan_id === "string") + message.outgoing_requested_chan_id = parseInt(object.outgoing_requested_chan_id, 10); + else if (typeof object.outgoing_requested_chan_id === "number") + message.outgoing_requested_chan_id = object.outgoing_requested_chan_id; + else if (typeof object.outgoing_requested_chan_id === "object") + message.outgoing_requested_chan_id = new $util.LongBits(object.outgoing_requested_chan_id.low >>> 0, object.outgoing_requested_chan_id.high >>> 0).toNumber(true); + if (object.outgoing_amount_msat != null) + if ($util.Long) + (message.outgoing_amount_msat = $util.Long.fromValue(object.outgoing_amount_msat)).unsigned = true; + else if (typeof object.outgoing_amount_msat === "string") + message.outgoing_amount_msat = parseInt(object.outgoing_amount_msat, 10); + else if (typeof object.outgoing_amount_msat === "number") + message.outgoing_amount_msat = object.outgoing_amount_msat; + else if (typeof object.outgoing_amount_msat === "object") + message.outgoing_amount_msat = new $util.LongBits(object.outgoing_amount_msat.low >>> 0, object.outgoing_amount_msat.high >>> 0).toNumber(true); + if (object.outgoing_expiry != null) + message.outgoing_expiry = object.outgoing_expiry >>> 0; + if (object.custom_records) { + if (typeof object.custom_records !== "object") + throw TypeError(".routerrpc.ForwardHtlcInterceptRequest.custom_records: object expected"); + message.custom_records = {}; + for (let keys = Object.keys(object.custom_records), i = 0; i < keys.length; ++i) + if (typeof object.custom_records[keys[i]] === "string") + $util.base64.decode(object.custom_records[keys[i]], message.custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.custom_records[keys[i]])), 0); + else if (object.custom_records[keys[i]].length >= 0) + message.custom_records[keys[i]] = object.custom_records[keys[i]]; + } + if (object.onion_blob != null) + if (typeof object.onion_blob === "string") + $util.base64.decode(object.onion_blob, message.onion_blob = $util.newBuffer($util.base64.length(object.onion_blob)), 0); + else if (object.onion_blob.length >= 0) + message.onion_blob = object.onion_blob; + if (object.auto_fail_height != null) + message.auto_fail_height = object.auto_fail_height | 0; + if (object.in_wire_custom_records) { + if (typeof object.in_wire_custom_records !== "object") + throw TypeError(".routerrpc.ForwardHtlcInterceptRequest.in_wire_custom_records: object expected"); + message.in_wire_custom_records = {}; + for (let keys = Object.keys(object.in_wire_custom_records), i = 0; i < keys.length; ++i) + if (typeof object.in_wire_custom_records[keys[i]] === "string") + $util.base64.decode(object.in_wire_custom_records[keys[i]], message.in_wire_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.in_wire_custom_records[keys[i]])), 0); + else if (object.in_wire_custom_records[keys[i]].length >= 0) + message.in_wire_custom_records[keys[i]] = object.in_wire_custom_records[keys[i]]; + } + return message; }; /** - * Creates a plain object from a SubscribedEvent message. Also converts values to other types if specified. + * Creates a plain object from a ForwardHtlcInterceptRequest message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.SubscribedEvent + * @memberof routerrpc.ForwardHtlcInterceptRequest * @static - * @param {routerrpc.SubscribedEvent} message SubscribedEvent + * @param {routerrpc.ForwardHtlcInterceptRequest} message ForwardHtlcInterceptRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SubscribedEvent.toObject = function toObject() { - return {}; + ForwardHtlcInterceptRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.objects || options.defaults) { + object.custom_records = {}; + object.in_wire_custom_records = {}; + } + if (options.defaults) { + object.incoming_circuit_key = null; + if (options.bytes === String) + object.payment_hash = ""; + else { + object.payment_hash = []; + if (options.bytes !== Array) + object.payment_hash = $util.newBuffer(object.payment_hash); + } + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.outgoing_amount_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.outgoing_amount_msat = options.longs === String ? "0" : 0; + object.outgoing_expiry = 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.incoming_amount_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.incoming_amount_msat = options.longs === String ? "0" : 0; + object.incoming_expiry = 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.outgoing_requested_chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.outgoing_requested_chan_id = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.onion_blob = ""; + else { + object.onion_blob = []; + if (options.bytes !== Array) + object.onion_blob = $util.newBuffer(object.onion_blob); + } + object.auto_fail_height = 0; + } + if (message.incoming_circuit_key != null && message.hasOwnProperty("incoming_circuit_key")) + object.incoming_circuit_key = $root.routerrpc.CircuitKey.toObject(message.incoming_circuit_key, options); + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + object.payment_hash = options.bytes === String ? $util.base64.encode(message.payment_hash, 0, message.payment_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_hash) : message.payment_hash; + if (message.outgoing_amount_msat != null && message.hasOwnProperty("outgoing_amount_msat")) + if (typeof message.outgoing_amount_msat === "number") + object.outgoing_amount_msat = options.longs === String ? String(message.outgoing_amount_msat) : message.outgoing_amount_msat; + else + object.outgoing_amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_amount_msat) : options.longs === Number ? new $util.LongBits(message.outgoing_amount_msat.low >>> 0, message.outgoing_amount_msat.high >>> 0).toNumber(true) : message.outgoing_amount_msat; + if (message.outgoing_expiry != null && message.hasOwnProperty("outgoing_expiry")) + object.outgoing_expiry = message.outgoing_expiry; + if (message.incoming_amount_msat != null && message.hasOwnProperty("incoming_amount_msat")) + if (typeof message.incoming_amount_msat === "number") + object.incoming_amount_msat = options.longs === String ? String(message.incoming_amount_msat) : message.incoming_amount_msat; + else + object.incoming_amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.incoming_amount_msat) : options.longs === Number ? new $util.LongBits(message.incoming_amount_msat.low >>> 0, message.incoming_amount_msat.high >>> 0).toNumber(true) : message.incoming_amount_msat; + if (message.incoming_expiry != null && message.hasOwnProperty("incoming_expiry")) + object.incoming_expiry = message.incoming_expiry; + if (message.outgoing_requested_chan_id != null && message.hasOwnProperty("outgoing_requested_chan_id")) + if (typeof message.outgoing_requested_chan_id === "number") + object.outgoing_requested_chan_id = options.longs === String ? String(message.outgoing_requested_chan_id) : message.outgoing_requested_chan_id; + else + object.outgoing_requested_chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_requested_chan_id) : options.longs === Number ? new $util.LongBits(message.outgoing_requested_chan_id.low >>> 0, message.outgoing_requested_chan_id.high >>> 0).toNumber(true) : message.outgoing_requested_chan_id; + let keys2; + if (message.custom_records && (keys2 = Object.keys(message.custom_records)).length) { + object.custom_records = {}; + for (let j = 0; j < keys2.length; ++j) + object.custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.custom_records[keys2[j]], 0, message.custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_records[keys2[j]]) : message.custom_records[keys2[j]]; + } + if (message.onion_blob != null && message.hasOwnProperty("onion_blob")) + object.onion_blob = options.bytes === String ? $util.base64.encode(message.onion_blob, 0, message.onion_blob.length) : options.bytes === Array ? Array.prototype.slice.call(message.onion_blob) : message.onion_blob; + if (message.auto_fail_height != null && message.hasOwnProperty("auto_fail_height")) + object.auto_fail_height = message.auto_fail_height; + if (message.in_wire_custom_records && (keys2 = Object.keys(message.in_wire_custom_records)).length) { + object.in_wire_custom_records = {}; + for (let j = 0; j < keys2.length; ++j) + object.in_wire_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.in_wire_custom_records[keys2[j]], 0, message.in_wire_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.in_wire_custom_records[keys2[j]]) : message.in_wire_custom_records[keys2[j]]; + } + return object; }; /** - * Converts this SubscribedEvent to JSON. + * Converts this ForwardHtlcInterceptRequest to JSON. * @function toJSON - * @memberof routerrpc.SubscribedEvent + * @memberof routerrpc.ForwardHtlcInterceptRequest * @instance * @returns {Object.} JSON object */ - SubscribedEvent.prototype.toJSON = function toJSON() { + ForwardHtlcInterceptRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SubscribedEvent + * Gets the default type url for ForwardHtlcInterceptRequest * @function getTypeUrl - * @memberof routerrpc.SubscribedEvent + * @memberof routerrpc.ForwardHtlcInterceptRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SubscribedEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ForwardHtlcInterceptRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.SubscribedEvent"; + return typeUrlPrefix + "/routerrpc.ForwardHtlcInterceptRequest"; }; - return SubscribedEvent; + return ForwardHtlcInterceptRequest; })(); - routerrpc.LinkFailEvent = (function() { + routerrpc.ForwardHtlcInterceptResponse = (function() { /** - * Properties of a LinkFailEvent. + * Properties of a ForwardHtlcInterceptResponse. * @memberof routerrpc - * @interface ILinkFailEvent - * @property {routerrpc.IHtlcInfo|null} [info] LinkFailEvent info - * @property {lnrpc.Failure.FailureCode|null} [wire_failure] LinkFailEvent wire_failure - * @property {routerrpc.FailureDetail|null} [failure_detail] LinkFailEvent failure_detail - * @property {string|null} [failure_string] LinkFailEvent failure_string + * @interface IForwardHtlcInterceptResponse + * @property {routerrpc.ICircuitKey|null} [incoming_circuit_key] The key of this forwarded htlc. It defines the incoming channel id and + * the index in this channel. + * @property {routerrpc.ResolveHoldForwardAction|null} [action] ForwardHtlcInterceptResponse action + * @property {Uint8Array|null} [preimage] ForwardHtlcInterceptResponse preimage + * @property {Uint8Array|null} [failure_message] ForwardHtlcInterceptResponse failure_message + * @property {lnrpc.Failure.FailureCode|null} [failure_code] ForwardHtlcInterceptResponse failure_code + * @property {Long|null} [in_amount_msat] ForwardHtlcInterceptResponse in_amount_msat + * @property {Long|null} [out_amount_msat] ForwardHtlcInterceptResponse out_amount_msat + * @property {Object.|null} [out_wire_custom_records] ForwardHtlcInterceptResponse out_wire_custom_records */ /** - * Constructs a new LinkFailEvent. + * Constructs a new ForwardHtlcInterceptResponse. * @memberof routerrpc - * @classdesc Represents a LinkFailEvent. - * @implements ILinkFailEvent + * @classdesc ForwardHtlcInterceptResponse enables the caller to resolve a previously hold + * forward. The caller can choose either to: + * - `Resume`: Execute the default behavior (usually forward). + * - `ResumeModified`: Execute the default behavior (usually forward) with HTLC + * field modifications. + * - `Reject`: Fail the htlc backwards. + * - `Settle`: Settle this htlc with a given preimage. + * @implements IForwardHtlcInterceptResponse * @constructor - * @param {routerrpc.ILinkFailEvent=} [properties] Properties to set + * @param {routerrpc.IForwardHtlcInterceptResponse=} [properties] Properties to set */ - function LinkFailEvent(properties) { + function ForwardHtlcInterceptResponse(properties) { + this.out_wire_custom_records = {}; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -94039,117 +97784,194 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * LinkFailEvent info. - * @member {routerrpc.IHtlcInfo|null|undefined} info - * @memberof routerrpc.LinkFailEvent + * The key of this forwarded htlc. It defines the incoming channel id and + * the index in this channel. + * @member {routerrpc.ICircuitKey|null|undefined} incoming_circuit_key + * @memberof routerrpc.ForwardHtlcInterceptResponse * @instance */ - LinkFailEvent.prototype.info = null; + ForwardHtlcInterceptResponse.prototype.incoming_circuit_key = null; /** - * LinkFailEvent wire_failure. - * @member {lnrpc.Failure.FailureCode} wire_failure - * @memberof routerrpc.LinkFailEvent + * ForwardHtlcInterceptResponse action. + * @member {routerrpc.ResolveHoldForwardAction} action + * @memberof routerrpc.ForwardHtlcInterceptResponse * @instance */ - LinkFailEvent.prototype.wire_failure = 0; + ForwardHtlcInterceptResponse.prototype.action = 0; /** - * LinkFailEvent failure_detail. - * @member {routerrpc.FailureDetail} failure_detail - * @memberof routerrpc.LinkFailEvent + * ForwardHtlcInterceptResponse preimage. + * @member {Uint8Array} preimage + * @memberof routerrpc.ForwardHtlcInterceptResponse * @instance */ - LinkFailEvent.prototype.failure_detail = 0; + ForwardHtlcInterceptResponse.prototype.preimage = $util.newBuffer([]); /** - * LinkFailEvent failure_string. - * @member {string} failure_string - * @memberof routerrpc.LinkFailEvent + * ForwardHtlcInterceptResponse failure_message. + * @member {Uint8Array} failure_message + * @memberof routerrpc.ForwardHtlcInterceptResponse * @instance */ - LinkFailEvent.prototype.failure_string = ""; + ForwardHtlcInterceptResponse.prototype.failure_message = $util.newBuffer([]); /** - * Creates a new LinkFailEvent instance using the specified properties. + * ForwardHtlcInterceptResponse failure_code. + * @member {lnrpc.Failure.FailureCode} failure_code + * @memberof routerrpc.ForwardHtlcInterceptResponse + * @instance + */ + ForwardHtlcInterceptResponse.prototype.failure_code = 0; + + /** + * ForwardHtlcInterceptResponse in_amount_msat. + * @member {Long} in_amount_msat + * @memberof routerrpc.ForwardHtlcInterceptResponse + * @instance + */ + ForwardHtlcInterceptResponse.prototype.in_amount_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ForwardHtlcInterceptResponse out_amount_msat. + * @member {Long} out_amount_msat + * @memberof routerrpc.ForwardHtlcInterceptResponse + * @instance + */ + ForwardHtlcInterceptResponse.prototype.out_amount_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ForwardHtlcInterceptResponse out_wire_custom_records. + * @member {Object.} out_wire_custom_records + * @memberof routerrpc.ForwardHtlcInterceptResponse + * @instance + */ + ForwardHtlcInterceptResponse.prototype.out_wire_custom_records = $util.emptyObject; + + /** + * Creates a new ForwardHtlcInterceptResponse instance using the specified properties. * @function create - * @memberof routerrpc.LinkFailEvent + * @memberof routerrpc.ForwardHtlcInterceptResponse * @static - * @param {routerrpc.ILinkFailEvent=} [properties] Properties to set - * @returns {routerrpc.LinkFailEvent} LinkFailEvent instance + * @param {routerrpc.IForwardHtlcInterceptResponse=} [properties] Properties to set + * @returns {routerrpc.ForwardHtlcInterceptResponse} ForwardHtlcInterceptResponse instance */ - LinkFailEvent.create = function create(properties) { - return new LinkFailEvent(properties); + ForwardHtlcInterceptResponse.create = function create(properties) { + return new ForwardHtlcInterceptResponse(properties); }; /** - * Encodes the specified LinkFailEvent message. Does not implicitly {@link routerrpc.LinkFailEvent.verify|verify} messages. + * Encodes the specified ForwardHtlcInterceptResponse message. Does not implicitly {@link routerrpc.ForwardHtlcInterceptResponse.verify|verify} messages. * @function encode - * @memberof routerrpc.LinkFailEvent + * @memberof routerrpc.ForwardHtlcInterceptResponse * @static - * @param {routerrpc.ILinkFailEvent} message LinkFailEvent message or plain object to encode + * @param {routerrpc.IForwardHtlcInterceptResponse} message ForwardHtlcInterceptResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LinkFailEvent.encode = function encode(message, writer) { + ForwardHtlcInterceptResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.routerrpc.HtlcInfo.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.wire_failure != null && Object.hasOwnProperty.call(message, "wire_failure")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.wire_failure); - if (message.failure_detail != null && Object.hasOwnProperty.call(message, "failure_detail")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.failure_detail); - if (message.failure_string != null && Object.hasOwnProperty.call(message, "failure_string")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.failure_string); + if (message.incoming_circuit_key != null && Object.hasOwnProperty.call(message, "incoming_circuit_key")) + $root.routerrpc.CircuitKey.encode(message.incoming_circuit_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.action); + if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.preimage); + if (message.failure_message != null && Object.hasOwnProperty.call(message, "failure_message")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.failure_message); + if (message.failure_code != null && Object.hasOwnProperty.call(message, "failure_code")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.failure_code); + if (message.in_amount_msat != null && Object.hasOwnProperty.call(message, "in_amount_msat")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.in_amount_msat); + if (message.out_amount_msat != null && Object.hasOwnProperty.call(message, "out_amount_msat")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.out_amount_msat); + if (message.out_wire_custom_records != null && Object.hasOwnProperty.call(message, "out_wire_custom_records")) + for (let keys = Object.keys(message.out_wire_custom_records), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.out_wire_custom_records[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified LinkFailEvent message, length delimited. Does not implicitly {@link routerrpc.LinkFailEvent.verify|verify} messages. + * Encodes the specified ForwardHtlcInterceptResponse message, length delimited. Does not implicitly {@link routerrpc.ForwardHtlcInterceptResponse.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.LinkFailEvent + * @memberof routerrpc.ForwardHtlcInterceptResponse * @static - * @param {routerrpc.ILinkFailEvent} message LinkFailEvent message or plain object to encode + * @param {routerrpc.IForwardHtlcInterceptResponse} message ForwardHtlcInterceptResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LinkFailEvent.encodeDelimited = function encodeDelimited(message, writer) { + ForwardHtlcInterceptResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LinkFailEvent message from the specified reader or buffer. + * Decodes a ForwardHtlcInterceptResponse message from the specified reader or buffer. * @function decode - * @memberof routerrpc.LinkFailEvent + * @memberof routerrpc.ForwardHtlcInterceptResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.LinkFailEvent} LinkFailEvent + * @returns {routerrpc.ForwardHtlcInterceptResponse} ForwardHtlcInterceptResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LinkFailEvent.decode = function decode(reader, length) { + ForwardHtlcInterceptResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.LinkFailEvent(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.ForwardHtlcInterceptResponse(), key, value; while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.info = $root.routerrpc.HtlcInfo.decode(reader, reader.uint32()); + message.incoming_circuit_key = $root.routerrpc.CircuitKey.decode(reader, reader.uint32()); break; } case 2: { - message.wire_failure = reader.int32(); + message.action = reader.int32(); break; } case 3: { - message.failure_detail = reader.int32(); + message.preimage = reader.bytes(); break; } case 4: { - message.failure_string = reader.string(); + message.failure_message = reader.bytes(); + break; + } + case 5: { + message.failure_code = reader.int32(); + break; + } + case 6: { + message.in_amount_msat = reader.uint64(); + break; + } + case 7: { + message.out_amount_msat = reader.uint64(); + break; + } + case 8: { + if (message.out_wire_custom_records === $util.emptyObject) + message.out_wire_custom_records = {}; + let end2 = reader.uint32() + reader.pos; + key = 0; + value = []; + while (reader.pos < end2) { + let tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint64(); + break; + case 2: + value = reader.bytes(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.out_wire_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value; break; } default: @@ -94161,76 +97983,57 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a LinkFailEvent message from the specified reader or buffer, length delimited. + * Decodes a ForwardHtlcInterceptResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.LinkFailEvent + * @memberof routerrpc.ForwardHtlcInterceptResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.LinkFailEvent} LinkFailEvent + * @returns {routerrpc.ForwardHtlcInterceptResponse} ForwardHtlcInterceptResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LinkFailEvent.decodeDelimited = function decodeDelimited(reader) { + ForwardHtlcInterceptResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LinkFailEvent message. + * Verifies a ForwardHtlcInterceptResponse message. * @function verify - * @memberof routerrpc.LinkFailEvent + * @memberof routerrpc.ForwardHtlcInterceptResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LinkFailEvent.verify = function verify(message) { + ForwardHtlcInterceptResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.info != null && message.hasOwnProperty("info")) { - let error = $root.routerrpc.HtlcInfo.verify(message.info); + if (message.incoming_circuit_key != null && message.hasOwnProperty("incoming_circuit_key")) { + let error = $root.routerrpc.CircuitKey.verify(message.incoming_circuit_key); if (error) - return "info." + error; + return "incoming_circuit_key." + error; } - if (message.wire_failure != null && message.hasOwnProperty("wire_failure")) - switch (message.wire_failure) { + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { default: - return "wire_failure: enum value expected"; + return "action: enum value expected"; case 0: case 1: case 2: case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: - case 24: - case 25: - case 997: - case 998: - case 999: break; } - if (message.failure_detail != null && message.hasOwnProperty("failure_detail")) - switch (message.failure_detail) { + if (message.preimage != null && message.hasOwnProperty("preimage")) + if (!(message.preimage && typeof message.preimage.length === "number" || $util.isString(message.preimage))) + return "preimage: buffer expected"; + if (message.failure_message != null && message.hasOwnProperty("failure_message")) + if (!(message.failure_message && typeof message.failure_message.length === "number" || $util.isString(message.failure_message))) + return "failure_message: buffer expected"; + if (message.failure_code != null && message.hasOwnProperty("failure_code")) + switch (message.failure_code) { default: - return "failure_detail: enum value expected"; + return "failure_code: enum value expected"; case 0: case 1: case 2: @@ -94254,420 +98057,379 @@ export const routerrpc = $root.routerrpc = (() => { case 20: case 21: case 22: + case 23: + case 24: + case 25: + case 997: + case 998: + case 999: break; } - if (message.failure_string != null && message.hasOwnProperty("failure_string")) - if (!$util.isString(message.failure_string)) - return "failure_string: string expected"; + if (message.in_amount_msat != null && message.hasOwnProperty("in_amount_msat")) + if (!$util.isInteger(message.in_amount_msat) && !(message.in_amount_msat && $util.isInteger(message.in_amount_msat.low) && $util.isInteger(message.in_amount_msat.high))) + return "in_amount_msat: integer|Long expected"; + if (message.out_amount_msat != null && message.hasOwnProperty("out_amount_msat")) + if (!$util.isInteger(message.out_amount_msat) && !(message.out_amount_msat && $util.isInteger(message.out_amount_msat.low) && $util.isInteger(message.out_amount_msat.high))) + return "out_amount_msat: integer|Long expected"; + if (message.out_wire_custom_records != null && message.hasOwnProperty("out_wire_custom_records")) { + if (!$util.isObject(message.out_wire_custom_records)) + return "out_wire_custom_records: object expected"; + let key = Object.keys(message.out_wire_custom_records); + for (let i = 0; i < key.length; ++i) { + if (!$util.key64Re.test(key[i])) + return "out_wire_custom_records: integer|Long key{k:uint64} expected"; + if (!(message.out_wire_custom_records[key[i]] && typeof message.out_wire_custom_records[key[i]].length === "number" || $util.isString(message.out_wire_custom_records[key[i]]))) + return "out_wire_custom_records: buffer{k:uint64} expected"; + } + } return null; }; /** - * Creates a LinkFailEvent message from a plain object. Also converts values to their respective internal types. + * Creates a ForwardHtlcInterceptResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.LinkFailEvent + * @memberof routerrpc.ForwardHtlcInterceptResponse * @static * @param {Object.} object Plain object - * @returns {routerrpc.LinkFailEvent} LinkFailEvent + * @returns {routerrpc.ForwardHtlcInterceptResponse} ForwardHtlcInterceptResponse */ - LinkFailEvent.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.LinkFailEvent) + ForwardHtlcInterceptResponse.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.ForwardHtlcInterceptResponse) return object; - let message = new $root.routerrpc.LinkFailEvent(); - if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".routerrpc.LinkFailEvent.info: object expected"); - message.info = $root.routerrpc.HtlcInfo.fromObject(object.info); + let message = new $root.routerrpc.ForwardHtlcInterceptResponse(); + if (object.incoming_circuit_key != null) { + if (typeof object.incoming_circuit_key !== "object") + throw TypeError(".routerrpc.ForwardHtlcInterceptResponse.incoming_circuit_key: object expected"); + message.incoming_circuit_key = $root.routerrpc.CircuitKey.fromObject(object.incoming_circuit_key); } - switch (object.wire_failure) { + switch (object.action) { default: - if (typeof object.wire_failure === "number") { - message.wire_failure = object.wire_failure; + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "SETTLE": + case 0: + message.action = 0; + break; + case "FAIL": + case 1: + message.action = 1; + break; + case "RESUME": + case 2: + message.action = 2; + break; + case "RESUME_MODIFIED": + case 3: + message.action = 3; + break; + } + if (object.preimage != null) + if (typeof object.preimage === "string") + $util.base64.decode(object.preimage, message.preimage = $util.newBuffer($util.base64.length(object.preimage)), 0); + else if (object.preimage.length >= 0) + message.preimage = object.preimage; + if (object.failure_message != null) + if (typeof object.failure_message === "string") + $util.base64.decode(object.failure_message, message.failure_message = $util.newBuffer($util.base64.length(object.failure_message)), 0); + else if (object.failure_message.length >= 0) + message.failure_message = object.failure_message; + switch (object.failure_code) { + default: + if (typeof object.failure_code === "number") { + message.failure_code = object.failure_code; break; } break; case "RESERVED": case 0: - message.wire_failure = 0; + message.failure_code = 0; break; case "INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS": case 1: - message.wire_failure = 1; + message.failure_code = 1; break; case "INCORRECT_PAYMENT_AMOUNT": case 2: - message.wire_failure = 2; + message.failure_code = 2; break; case "FINAL_INCORRECT_CLTV_EXPIRY": case 3: - message.wire_failure = 3; + message.failure_code = 3; break; case "FINAL_INCORRECT_HTLC_AMOUNT": case 4: - message.wire_failure = 4; + message.failure_code = 4; break; case "FINAL_EXPIRY_TOO_SOON": case 5: - message.wire_failure = 5; + message.failure_code = 5; break; case "INVALID_REALM": case 6: - message.wire_failure = 6; + message.failure_code = 6; break; case "EXPIRY_TOO_SOON": case 7: - message.wire_failure = 7; + message.failure_code = 7; break; case "INVALID_ONION_VERSION": case 8: - message.wire_failure = 8; + message.failure_code = 8; break; case "INVALID_ONION_HMAC": case 9: - message.wire_failure = 9; + message.failure_code = 9; break; case "INVALID_ONION_KEY": case 10: - message.wire_failure = 10; + message.failure_code = 10; break; case "AMOUNT_BELOW_MINIMUM": case 11: - message.wire_failure = 11; + message.failure_code = 11; break; case "FEE_INSUFFICIENT": case 12: - message.wire_failure = 12; + message.failure_code = 12; break; case "INCORRECT_CLTV_EXPIRY": case 13: - message.wire_failure = 13; + message.failure_code = 13; break; case "CHANNEL_DISABLED": case 14: - message.wire_failure = 14; + message.failure_code = 14; break; case "TEMPORARY_CHANNEL_FAILURE": case 15: - message.wire_failure = 15; + message.failure_code = 15; break; case "REQUIRED_NODE_FEATURE_MISSING": case 16: - message.wire_failure = 16; + message.failure_code = 16; break; case "REQUIRED_CHANNEL_FEATURE_MISSING": case 17: - message.wire_failure = 17; + message.failure_code = 17; break; case "UNKNOWN_NEXT_PEER": case 18: - message.wire_failure = 18; + message.failure_code = 18; break; case "TEMPORARY_NODE_FAILURE": case 19: - message.wire_failure = 19; + message.failure_code = 19; break; case "PERMANENT_NODE_FAILURE": case 20: - message.wire_failure = 20; + message.failure_code = 20; break; case "PERMANENT_CHANNEL_FAILURE": case 21: - message.wire_failure = 21; + message.failure_code = 21; break; case "EXPIRY_TOO_FAR": case 22: - message.wire_failure = 22; + message.failure_code = 22; break; case "MPP_TIMEOUT": case 23: - message.wire_failure = 23; + message.failure_code = 23; break; case "INVALID_ONION_PAYLOAD": case 24: - message.wire_failure = 24; + message.failure_code = 24; break; case "INVALID_ONION_BLINDING": case 25: - message.wire_failure = 25; + message.failure_code = 25; break; case "INTERNAL_FAILURE": case 997: - message.wire_failure = 997; + message.failure_code = 997; break; case "UNKNOWN_FAILURE": case 998: - message.wire_failure = 998; + message.failure_code = 998; break; case "UNREADABLE_FAILURE": case 999: - message.wire_failure = 999; + message.failure_code = 999; break; } - switch (object.failure_detail) { - default: - if (typeof object.failure_detail === "number") { - message.failure_detail = object.failure_detail; - break; - } - break; - case "UNKNOWN": - case 0: - message.failure_detail = 0; - break; - case "NO_DETAIL": - case 1: - message.failure_detail = 1; - break; - case "ONION_DECODE": - case 2: - message.failure_detail = 2; - break; - case "LINK_NOT_ELIGIBLE": - case 3: - message.failure_detail = 3; - break; - case "ON_CHAIN_TIMEOUT": - case 4: - message.failure_detail = 4; - break; - case "HTLC_EXCEEDS_MAX": - case 5: - message.failure_detail = 5; - break; - case "INSUFFICIENT_BALANCE": - case 6: - message.failure_detail = 6; - break; - case "INCOMPLETE_FORWARD": - case 7: - message.failure_detail = 7; - break; - case "HTLC_ADD_FAILED": - case 8: - message.failure_detail = 8; - break; - case "FORWARDS_DISABLED": - case 9: - message.failure_detail = 9; - break; - case "INVOICE_CANCELED": - case 10: - message.failure_detail = 10; - break; - case "INVOICE_UNDERPAID": - case 11: - message.failure_detail = 11; - break; - case "INVOICE_EXPIRY_TOO_SOON": - case 12: - message.failure_detail = 12; - break; - case "INVOICE_NOT_OPEN": - case 13: - message.failure_detail = 13; - break; - case "MPP_INVOICE_TIMEOUT": - case 14: - message.failure_detail = 14; - break; - case "ADDRESS_MISMATCH": - case 15: - message.failure_detail = 15; - break; - case "SET_TOTAL_MISMATCH": - case 16: - message.failure_detail = 16; - break; - case "SET_TOTAL_TOO_LOW": - case 17: - message.failure_detail = 17; - break; - case "SET_OVERPAID": - case 18: - message.failure_detail = 18; - break; - case "UNKNOWN_INVOICE": - case 19: - message.failure_detail = 19; - break; - case "INVALID_KEYSEND": - case 20: - message.failure_detail = 20; - break; - case "MPP_IN_PROGRESS": - case 21: - message.failure_detail = 21; - break; - case "CIRCULAR_ROUTE": - case 22: - message.failure_detail = 22; - break; + if (object.in_amount_msat != null) + if ($util.Long) + (message.in_amount_msat = $util.Long.fromValue(object.in_amount_msat)).unsigned = true; + else if (typeof object.in_amount_msat === "string") + message.in_amount_msat = parseInt(object.in_amount_msat, 10); + else if (typeof object.in_amount_msat === "number") + message.in_amount_msat = object.in_amount_msat; + else if (typeof object.in_amount_msat === "object") + message.in_amount_msat = new $util.LongBits(object.in_amount_msat.low >>> 0, object.in_amount_msat.high >>> 0).toNumber(true); + if (object.out_amount_msat != null) + if ($util.Long) + (message.out_amount_msat = $util.Long.fromValue(object.out_amount_msat)).unsigned = true; + else if (typeof object.out_amount_msat === "string") + message.out_amount_msat = parseInt(object.out_amount_msat, 10); + else if (typeof object.out_amount_msat === "number") + message.out_amount_msat = object.out_amount_msat; + else if (typeof object.out_amount_msat === "object") + message.out_amount_msat = new $util.LongBits(object.out_amount_msat.low >>> 0, object.out_amount_msat.high >>> 0).toNumber(true); + if (object.out_wire_custom_records) { + if (typeof object.out_wire_custom_records !== "object") + throw TypeError(".routerrpc.ForwardHtlcInterceptResponse.out_wire_custom_records: object expected"); + message.out_wire_custom_records = {}; + for (let keys = Object.keys(object.out_wire_custom_records), i = 0; i < keys.length; ++i) + if (typeof object.out_wire_custom_records[keys[i]] === "string") + $util.base64.decode(object.out_wire_custom_records[keys[i]], message.out_wire_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.out_wire_custom_records[keys[i]])), 0); + else if (object.out_wire_custom_records[keys[i]].length >= 0) + message.out_wire_custom_records[keys[i]] = object.out_wire_custom_records[keys[i]]; } - if (object.failure_string != null) - message.failure_string = String(object.failure_string); return message; }; /** - * Creates a plain object from a LinkFailEvent message. Also converts values to other types if specified. + * Creates a plain object from a ForwardHtlcInterceptResponse message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.LinkFailEvent + * @memberof routerrpc.ForwardHtlcInterceptResponse * @static - * @param {routerrpc.LinkFailEvent} message LinkFailEvent + * @param {routerrpc.ForwardHtlcInterceptResponse} message ForwardHtlcInterceptResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LinkFailEvent.toObject = function toObject(message, options) { + ForwardHtlcInterceptResponse.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; + if (options.objects || options.defaults) + object.out_wire_custom_records = {}; if (options.defaults) { - object.info = null; - object.wire_failure = options.enums === String ? "RESERVED" : 0; - object.failure_detail = options.enums === String ? "UNKNOWN" : 0; - object.failure_string = ""; + object.incoming_circuit_key = null; + object.action = options.enums === String ? "SETTLE" : 0; + if (options.bytes === String) + object.preimage = ""; + else { + object.preimage = []; + if (options.bytes !== Array) + object.preimage = $util.newBuffer(object.preimage); + } + if (options.bytes === String) + object.failure_message = ""; + else { + object.failure_message = []; + if (options.bytes !== Array) + object.failure_message = $util.newBuffer(object.failure_message); + } + object.failure_code = options.enums === String ? "RESERVED" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.in_amount_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.in_amount_msat = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.out_amount_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.out_amount_msat = options.longs === String ? "0" : 0; + } + if (message.incoming_circuit_key != null && message.hasOwnProperty("incoming_circuit_key")) + object.incoming_circuit_key = $root.routerrpc.CircuitKey.toObject(message.incoming_circuit_key, options); + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.routerrpc.ResolveHoldForwardAction[message.action] === undefined ? message.action : $root.routerrpc.ResolveHoldForwardAction[message.action] : message.action; + if (message.preimage != null && message.hasOwnProperty("preimage")) + object.preimage = options.bytes === String ? $util.base64.encode(message.preimage, 0, message.preimage.length) : options.bytes === Array ? Array.prototype.slice.call(message.preimage) : message.preimage; + if (message.failure_message != null && message.hasOwnProperty("failure_message")) + object.failure_message = options.bytes === String ? $util.base64.encode(message.failure_message, 0, message.failure_message.length) : options.bytes === Array ? Array.prototype.slice.call(message.failure_message) : message.failure_message; + if (message.failure_code != null && message.hasOwnProperty("failure_code")) + object.failure_code = options.enums === String ? $root.lnrpc.Failure.FailureCode[message.failure_code] === undefined ? message.failure_code : $root.lnrpc.Failure.FailureCode[message.failure_code] : message.failure_code; + if (message.in_amount_msat != null && message.hasOwnProperty("in_amount_msat")) + if (typeof message.in_amount_msat === "number") + object.in_amount_msat = options.longs === String ? String(message.in_amount_msat) : message.in_amount_msat; + else + object.in_amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.in_amount_msat) : options.longs === Number ? new $util.LongBits(message.in_amount_msat.low >>> 0, message.in_amount_msat.high >>> 0).toNumber(true) : message.in_amount_msat; + if (message.out_amount_msat != null && message.hasOwnProperty("out_amount_msat")) + if (typeof message.out_amount_msat === "number") + object.out_amount_msat = options.longs === String ? String(message.out_amount_msat) : message.out_amount_msat; + else + object.out_amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.out_amount_msat) : options.longs === Number ? new $util.LongBits(message.out_amount_msat.low >>> 0, message.out_amount_msat.high >>> 0).toNumber(true) : message.out_amount_msat; + let keys2; + if (message.out_wire_custom_records && (keys2 = Object.keys(message.out_wire_custom_records)).length) { + object.out_wire_custom_records = {}; + for (let j = 0; j < keys2.length; ++j) + object.out_wire_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.out_wire_custom_records[keys2[j]], 0, message.out_wire_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.out_wire_custom_records[keys2[j]]) : message.out_wire_custom_records[keys2[j]]; } - if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.routerrpc.HtlcInfo.toObject(message.info, options); - if (message.wire_failure != null && message.hasOwnProperty("wire_failure")) - object.wire_failure = options.enums === String ? $root.lnrpc.Failure.FailureCode[message.wire_failure] === undefined ? message.wire_failure : $root.lnrpc.Failure.FailureCode[message.wire_failure] : message.wire_failure; - if (message.failure_detail != null && message.hasOwnProperty("failure_detail")) - object.failure_detail = options.enums === String ? $root.routerrpc.FailureDetail[message.failure_detail] === undefined ? message.failure_detail : $root.routerrpc.FailureDetail[message.failure_detail] : message.failure_detail; - if (message.failure_string != null && message.hasOwnProperty("failure_string")) - object.failure_string = message.failure_string; return object; }; /** - * Converts this LinkFailEvent to JSON. + * Converts this ForwardHtlcInterceptResponse to JSON. * @function toJSON - * @memberof routerrpc.LinkFailEvent + * @memberof routerrpc.ForwardHtlcInterceptResponse * @instance * @returns {Object.} JSON object */ - LinkFailEvent.prototype.toJSON = function toJSON() { + ForwardHtlcInterceptResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for LinkFailEvent + * Gets the default type url for ForwardHtlcInterceptResponse * @function getTypeUrl - * @memberof routerrpc.LinkFailEvent + * @memberof routerrpc.ForwardHtlcInterceptResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - LinkFailEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ForwardHtlcInterceptResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.LinkFailEvent"; + return typeUrlPrefix + "/routerrpc.ForwardHtlcInterceptResponse"; }; - return LinkFailEvent; - })(); - - /** - * FailureDetail enum. - * @name routerrpc.FailureDetail - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} NO_DETAIL=1 NO_DETAIL value - * @property {number} ONION_DECODE=2 ONION_DECODE value - * @property {number} LINK_NOT_ELIGIBLE=3 LINK_NOT_ELIGIBLE value - * @property {number} ON_CHAIN_TIMEOUT=4 ON_CHAIN_TIMEOUT value - * @property {number} HTLC_EXCEEDS_MAX=5 HTLC_EXCEEDS_MAX value - * @property {number} INSUFFICIENT_BALANCE=6 INSUFFICIENT_BALANCE value - * @property {number} INCOMPLETE_FORWARD=7 INCOMPLETE_FORWARD value - * @property {number} HTLC_ADD_FAILED=8 HTLC_ADD_FAILED value - * @property {number} FORWARDS_DISABLED=9 FORWARDS_DISABLED value - * @property {number} INVOICE_CANCELED=10 INVOICE_CANCELED value - * @property {number} INVOICE_UNDERPAID=11 INVOICE_UNDERPAID value - * @property {number} INVOICE_EXPIRY_TOO_SOON=12 INVOICE_EXPIRY_TOO_SOON value - * @property {number} INVOICE_NOT_OPEN=13 INVOICE_NOT_OPEN value - * @property {number} MPP_INVOICE_TIMEOUT=14 MPP_INVOICE_TIMEOUT value - * @property {number} ADDRESS_MISMATCH=15 ADDRESS_MISMATCH value - * @property {number} SET_TOTAL_MISMATCH=16 SET_TOTAL_MISMATCH value - * @property {number} SET_TOTAL_TOO_LOW=17 SET_TOTAL_TOO_LOW value - * @property {number} SET_OVERPAID=18 SET_OVERPAID value - * @property {number} UNKNOWN_INVOICE=19 UNKNOWN_INVOICE value - * @property {number} INVALID_KEYSEND=20 INVALID_KEYSEND value - * @property {number} MPP_IN_PROGRESS=21 MPP_IN_PROGRESS value - * @property {number} CIRCULAR_ROUTE=22 CIRCULAR_ROUTE value - */ - routerrpc.FailureDetail = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "NO_DETAIL"] = 1; - values[valuesById[2] = "ONION_DECODE"] = 2; - values[valuesById[3] = "LINK_NOT_ELIGIBLE"] = 3; - values[valuesById[4] = "ON_CHAIN_TIMEOUT"] = 4; - values[valuesById[5] = "HTLC_EXCEEDS_MAX"] = 5; - values[valuesById[6] = "INSUFFICIENT_BALANCE"] = 6; - values[valuesById[7] = "INCOMPLETE_FORWARD"] = 7; - values[valuesById[8] = "HTLC_ADD_FAILED"] = 8; - values[valuesById[9] = "FORWARDS_DISABLED"] = 9; - values[valuesById[10] = "INVOICE_CANCELED"] = 10; - values[valuesById[11] = "INVOICE_UNDERPAID"] = 11; - values[valuesById[12] = "INVOICE_EXPIRY_TOO_SOON"] = 12; - values[valuesById[13] = "INVOICE_NOT_OPEN"] = 13; - values[valuesById[14] = "MPP_INVOICE_TIMEOUT"] = 14; - values[valuesById[15] = "ADDRESS_MISMATCH"] = 15; - values[valuesById[16] = "SET_TOTAL_MISMATCH"] = 16; - values[valuesById[17] = "SET_TOTAL_TOO_LOW"] = 17; - values[valuesById[18] = "SET_OVERPAID"] = 18; - values[valuesById[19] = "UNKNOWN_INVOICE"] = 19; - values[valuesById[20] = "INVALID_KEYSEND"] = 20; - values[valuesById[21] = "MPP_IN_PROGRESS"] = 21; - values[valuesById[22] = "CIRCULAR_ROUTE"] = 22; - return values; + return ForwardHtlcInterceptResponse; })(); /** - * PaymentState enum. - * @name routerrpc.PaymentState + * ResolveHoldForwardAction enum. + * @name routerrpc.ResolveHoldForwardAction * @enum {number} - * @property {number} IN_FLIGHT=0 IN_FLIGHT value - * @property {number} SUCCEEDED=1 SUCCEEDED value - * @property {number} FAILED_TIMEOUT=2 FAILED_TIMEOUT value - * @property {number} FAILED_NO_ROUTE=3 FAILED_NO_ROUTE value - * @property {number} FAILED_ERROR=4 FAILED_ERROR value - * @property {number} FAILED_INCORRECT_PAYMENT_DETAILS=5 FAILED_INCORRECT_PAYMENT_DETAILS value - * @property {number} FAILED_INSUFFICIENT_BALANCE=6 FAILED_INSUFFICIENT_BALANCE value + * @property {number} SETTLE=0 SETTLE value + * @property {number} FAIL=1 FAIL value + * @property {number} RESUME=2 RESUME value + * @property {number} RESUME_MODIFIED=3 RESUME_MODIFIED value */ - routerrpc.PaymentState = (function() { + routerrpc.ResolveHoldForwardAction = (function() { const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IN_FLIGHT"] = 0; - values[valuesById[1] = "SUCCEEDED"] = 1; - values[valuesById[2] = "FAILED_TIMEOUT"] = 2; - values[valuesById[3] = "FAILED_NO_ROUTE"] = 3; - values[valuesById[4] = "FAILED_ERROR"] = 4; - values[valuesById[5] = "FAILED_INCORRECT_PAYMENT_DETAILS"] = 5; - values[valuesById[6] = "FAILED_INSUFFICIENT_BALANCE"] = 6; + values[valuesById[0] = "SETTLE"] = 0; + values[valuesById[1] = "FAIL"] = 1; + values[valuesById[2] = "RESUME"] = 2; + values[valuesById[3] = "RESUME_MODIFIED"] = 3; return values; })(); - routerrpc.PaymentStatus = (function() { + routerrpc.UpdateChanStatusRequest = (function() { /** - * Properties of a PaymentStatus. + * Properties of an UpdateChanStatusRequest. * @memberof routerrpc - * @interface IPaymentStatus - * @property {routerrpc.PaymentState|null} [state] PaymentStatus state - * @property {Uint8Array|null} [preimage] PaymentStatus preimage - * @property {Array.|null} [htlcs] PaymentStatus htlcs + * @interface IUpdateChanStatusRequest + * @property {lnrpc.IChannelPoint|null} [chan_point] UpdateChanStatusRequest chan_point + * @property {routerrpc.ChanStatusAction|null} [action] UpdateChanStatusRequest action */ /** - * Constructs a new PaymentStatus. + * Constructs a new UpdateChanStatusRequest. * @memberof routerrpc - * @classdesc Represents a PaymentStatus. - * @implements IPaymentStatus + * @classdesc Represents an UpdateChanStatusRequest. + * @implements IUpdateChanStatusRequest * @constructor - * @param {routerrpc.IPaymentStatus=} [properties] Properties to set + * @param {routerrpc.IUpdateChanStatusRequest=} [properties] Properties to set */ - function PaymentStatus(properties) { - this.htlcs = []; + function UpdateChanStatusRequest(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -94675,106 +98437,89 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * PaymentStatus state. - * @member {routerrpc.PaymentState} state - * @memberof routerrpc.PaymentStatus - * @instance - */ - PaymentStatus.prototype.state = 0; - - /** - * PaymentStatus preimage. - * @member {Uint8Array} preimage - * @memberof routerrpc.PaymentStatus + * UpdateChanStatusRequest chan_point. + * @member {lnrpc.IChannelPoint|null|undefined} chan_point + * @memberof routerrpc.UpdateChanStatusRequest * @instance */ - PaymentStatus.prototype.preimage = $util.newBuffer([]); + UpdateChanStatusRequest.prototype.chan_point = null; /** - * PaymentStatus htlcs. - * @member {Array.} htlcs - * @memberof routerrpc.PaymentStatus + * UpdateChanStatusRequest action. + * @member {routerrpc.ChanStatusAction} action + * @memberof routerrpc.UpdateChanStatusRequest * @instance */ - PaymentStatus.prototype.htlcs = $util.emptyArray; + UpdateChanStatusRequest.prototype.action = 0; /** - * Creates a new PaymentStatus instance using the specified properties. + * Creates a new UpdateChanStatusRequest instance using the specified properties. * @function create - * @memberof routerrpc.PaymentStatus + * @memberof routerrpc.UpdateChanStatusRequest * @static - * @param {routerrpc.IPaymentStatus=} [properties] Properties to set - * @returns {routerrpc.PaymentStatus} PaymentStatus instance + * @param {routerrpc.IUpdateChanStatusRequest=} [properties] Properties to set + * @returns {routerrpc.UpdateChanStatusRequest} UpdateChanStatusRequest instance */ - PaymentStatus.create = function create(properties) { - return new PaymentStatus(properties); + UpdateChanStatusRequest.create = function create(properties) { + return new UpdateChanStatusRequest(properties); }; /** - * Encodes the specified PaymentStatus message. Does not implicitly {@link routerrpc.PaymentStatus.verify|verify} messages. + * Encodes the specified UpdateChanStatusRequest message. Does not implicitly {@link routerrpc.UpdateChanStatusRequest.verify|verify} messages. * @function encode - * @memberof routerrpc.PaymentStatus + * @memberof routerrpc.UpdateChanStatusRequest * @static - * @param {routerrpc.IPaymentStatus} message PaymentStatus message or plain object to encode + * @param {routerrpc.IUpdateChanStatusRequest} message UpdateChanStatusRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PaymentStatus.encode = function encode(message, writer) { + UpdateChanStatusRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.preimage); - if (message.htlcs != null && message.htlcs.length) - for (let i = 0; i < message.htlcs.length; ++i) - $root.lnrpc.HTLCAttempt.encode(message.htlcs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.chan_point != null && Object.hasOwnProperty.call(message, "chan_point")) + $root.lnrpc.ChannelPoint.encode(message.chan_point, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.action); return writer; }; /** - * Encodes the specified PaymentStatus message, length delimited. Does not implicitly {@link routerrpc.PaymentStatus.verify|verify} messages. + * Encodes the specified UpdateChanStatusRequest message, length delimited. Does not implicitly {@link routerrpc.UpdateChanStatusRequest.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.PaymentStatus + * @memberof routerrpc.UpdateChanStatusRequest * @static - * @param {routerrpc.IPaymentStatus} message PaymentStatus message or plain object to encode + * @param {routerrpc.IUpdateChanStatusRequest} message UpdateChanStatusRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PaymentStatus.encodeDelimited = function encodeDelimited(message, writer) { + UpdateChanStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PaymentStatus message from the specified reader or buffer. + * Decodes an UpdateChanStatusRequest message from the specified reader or buffer. * @function decode - * @memberof routerrpc.PaymentStatus + * @memberof routerrpc.UpdateChanStatusRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.PaymentStatus} PaymentStatus + * @returns {routerrpc.UpdateChanStatusRequest} UpdateChanStatusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PaymentStatus.decode = function decode(reader, length) { + UpdateChanStatusRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.PaymentStatus(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.UpdateChanStatusRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.state = reader.int32(); + message.chan_point = $root.lnrpc.ChannelPoint.decode(reader, reader.uint32()); break; } case 2: { - message.preimage = reader.bytes(); - break; - } - case 4: { - if (!(message.htlcs && message.htlcs.length)) - message.htlcs = []; - message.htlcs.push($root.lnrpc.HTLCAttempt.decode(reader, reader.uint32())); + message.action = reader.int32(); break; } default: @@ -94786,211 +98531,175 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a PaymentStatus message from the specified reader or buffer, length delimited. + * Decodes an UpdateChanStatusRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.PaymentStatus + * @memberof routerrpc.UpdateChanStatusRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.PaymentStatus} PaymentStatus + * @returns {routerrpc.UpdateChanStatusRequest} UpdateChanStatusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PaymentStatus.decodeDelimited = function decodeDelimited(reader) { + UpdateChanStatusRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PaymentStatus message. + * Verifies an UpdateChanStatusRequest message. * @function verify - * @memberof routerrpc.PaymentStatus + * @memberof routerrpc.UpdateChanStatusRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PaymentStatus.verify = function verify(message) { + UpdateChanStatusRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { + if (message.chan_point != null && message.hasOwnProperty("chan_point")) { + let error = $root.lnrpc.ChannelPoint.verify(message.chan_point); + if (error) + return "chan_point." + error; + } + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { default: - return "state: enum value expected"; + return "action: enum value expected"; case 0: case 1: case 2: - case 3: - case 4: - case 5: - case 6: break; } - if (message.preimage != null && message.hasOwnProperty("preimage")) - if (!(message.preimage && typeof message.preimage.length === "number" || $util.isString(message.preimage))) - return "preimage: buffer expected"; - if (message.htlcs != null && message.hasOwnProperty("htlcs")) { - if (!Array.isArray(message.htlcs)) - return "htlcs: array expected"; - for (let i = 0; i < message.htlcs.length; ++i) { - let error = $root.lnrpc.HTLCAttempt.verify(message.htlcs[i]); - if (error) - return "htlcs." + error; - } - } return null; }; /** - * Creates a PaymentStatus message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateChanStatusRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.PaymentStatus + * @memberof routerrpc.UpdateChanStatusRequest * @static * @param {Object.} object Plain object - * @returns {routerrpc.PaymentStatus} PaymentStatus + * @returns {routerrpc.UpdateChanStatusRequest} UpdateChanStatusRequest */ - PaymentStatus.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.PaymentStatus) + UpdateChanStatusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.UpdateChanStatusRequest) return object; - let message = new $root.routerrpc.PaymentStatus(); - switch (object.state) { + let message = new $root.routerrpc.UpdateChanStatusRequest(); + if (object.chan_point != null) { + if (typeof object.chan_point !== "object") + throw TypeError(".routerrpc.UpdateChanStatusRequest.chan_point: object expected"); + message.chan_point = $root.lnrpc.ChannelPoint.fromObject(object.chan_point); + } + switch (object.action) { default: - if (typeof object.state === "number") { - message.state = object.state; + if (typeof object.action === "number") { + message.action = object.action; break; } break; - case "IN_FLIGHT": + case "ENABLE": case 0: - message.state = 0; + message.action = 0; break; - case "SUCCEEDED": + case "DISABLE": case 1: - message.state = 1; + message.action = 1; break; - case "FAILED_TIMEOUT": + case "AUTO": case 2: - message.state = 2; - break; - case "FAILED_NO_ROUTE": - case 3: - message.state = 3; - break; - case "FAILED_ERROR": - case 4: - message.state = 4; - break; - case "FAILED_INCORRECT_PAYMENT_DETAILS": - case 5: - message.state = 5; - break; - case "FAILED_INSUFFICIENT_BALANCE": - case 6: - message.state = 6; + message.action = 2; break; } - if (object.preimage != null) - if (typeof object.preimage === "string") - $util.base64.decode(object.preimage, message.preimage = $util.newBuffer($util.base64.length(object.preimage)), 0); - else if (object.preimage.length >= 0) - message.preimage = object.preimage; - if (object.htlcs) { - if (!Array.isArray(object.htlcs)) - throw TypeError(".routerrpc.PaymentStatus.htlcs: array expected"); - message.htlcs = []; - for (let i = 0; i < object.htlcs.length; ++i) { - if (typeof object.htlcs[i] !== "object") - throw TypeError(".routerrpc.PaymentStatus.htlcs: object expected"); - message.htlcs[i] = $root.lnrpc.HTLCAttempt.fromObject(object.htlcs[i]); - } - } return message; }; /** - * Creates a plain object from a PaymentStatus message. Also converts values to other types if specified. + * Creates a plain object from an UpdateChanStatusRequest message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.PaymentStatus + * @memberof routerrpc.UpdateChanStatusRequest * @static - * @param {routerrpc.PaymentStatus} message PaymentStatus + * @param {routerrpc.UpdateChanStatusRequest} message UpdateChanStatusRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PaymentStatus.toObject = function toObject(message, options) { + UpdateChanStatusRequest.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.arrays || options.defaults) - object.htlcs = []; if (options.defaults) { - object.state = options.enums === String ? "IN_FLIGHT" : 0; - if (options.bytes === String) - object.preimage = ""; - else { - object.preimage = []; - if (options.bytes !== Array) - object.preimage = $util.newBuffer(object.preimage); - } - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.routerrpc.PaymentState[message.state] === undefined ? message.state : $root.routerrpc.PaymentState[message.state] : message.state; - if (message.preimage != null && message.hasOwnProperty("preimage")) - object.preimage = options.bytes === String ? $util.base64.encode(message.preimage, 0, message.preimage.length) : options.bytes === Array ? Array.prototype.slice.call(message.preimage) : message.preimage; - if (message.htlcs && message.htlcs.length) { - object.htlcs = []; - for (let j = 0; j < message.htlcs.length; ++j) - object.htlcs[j] = $root.lnrpc.HTLCAttempt.toObject(message.htlcs[j], options); + object.chan_point = null; + object.action = options.enums === String ? "ENABLE" : 0; } + if (message.chan_point != null && message.hasOwnProperty("chan_point")) + object.chan_point = $root.lnrpc.ChannelPoint.toObject(message.chan_point, options); + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.routerrpc.ChanStatusAction[message.action] === undefined ? message.action : $root.routerrpc.ChanStatusAction[message.action] : message.action; return object; }; /** - * Converts this PaymentStatus to JSON. + * Converts this UpdateChanStatusRequest to JSON. * @function toJSON - * @memberof routerrpc.PaymentStatus + * @memberof routerrpc.UpdateChanStatusRequest * @instance * @returns {Object.} JSON object */ - PaymentStatus.prototype.toJSON = function toJSON() { + UpdateChanStatusRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PaymentStatus + * Gets the default type url for UpdateChanStatusRequest * @function getTypeUrl - * @memberof routerrpc.PaymentStatus + * @memberof routerrpc.UpdateChanStatusRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PaymentStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateChanStatusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.PaymentStatus"; + return typeUrlPrefix + "/routerrpc.UpdateChanStatusRequest"; }; - return PaymentStatus; + return UpdateChanStatusRequest; })(); - routerrpc.CircuitKey = (function() { + /** + * ChanStatusAction enum. + * @name routerrpc.ChanStatusAction + * @enum {number} + * @property {number} ENABLE=0 ENABLE value + * @property {number} DISABLE=1 DISABLE value + * @property {number} AUTO=2 AUTO value + */ + routerrpc.ChanStatusAction = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENABLE"] = 0; + values[valuesById[1] = "DISABLE"] = 1; + values[valuesById[2] = "AUTO"] = 2; + return values; + })(); + + routerrpc.UpdateChanStatusResponse = (function() { /** - * Properties of a CircuitKey. + * Properties of an UpdateChanStatusResponse. * @memberof routerrpc - * @interface ICircuitKey - * @property {Long|null} [chan_id] The id of the channel that the is part of this circuit. - * @property {Long|null} [htlc_id] The index of the incoming htlc in the incoming channel. + * @interface IUpdateChanStatusResponse */ /** - * Constructs a new CircuitKey. + * Constructs a new UpdateChanStatusResponse. * @memberof routerrpc - * @classdesc Represents a CircuitKey. - * @implements ICircuitKey + * @classdesc Represents an UpdateChanStatusResponse. + * @implements IUpdateChanStatusResponse * @constructor - * @param {routerrpc.ICircuitKey=} [properties] Properties to set + * @param {routerrpc.IUpdateChanStatusResponse=} [properties] Properties to set */ - function CircuitKey(properties) { + function UpdateChanStatusResponse(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -94998,91 +98707,63 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * The id of the channel that the is part of this circuit. - * @member {Long} chan_id - * @memberof routerrpc.CircuitKey - * @instance - */ - CircuitKey.prototype.chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * The index of the incoming htlc in the incoming channel. - * @member {Long} htlc_id - * @memberof routerrpc.CircuitKey - * @instance - */ - CircuitKey.prototype.htlc_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new CircuitKey instance using the specified properties. + * Creates a new UpdateChanStatusResponse instance using the specified properties. * @function create - * @memberof routerrpc.CircuitKey + * @memberof routerrpc.UpdateChanStatusResponse * @static - * @param {routerrpc.ICircuitKey=} [properties] Properties to set - * @returns {routerrpc.CircuitKey} CircuitKey instance + * @param {routerrpc.IUpdateChanStatusResponse=} [properties] Properties to set + * @returns {routerrpc.UpdateChanStatusResponse} UpdateChanStatusResponse instance */ - CircuitKey.create = function create(properties) { - return new CircuitKey(properties); + UpdateChanStatusResponse.create = function create(properties) { + return new UpdateChanStatusResponse(properties); }; /** - * Encodes the specified CircuitKey message. Does not implicitly {@link routerrpc.CircuitKey.verify|verify} messages. + * Encodes the specified UpdateChanStatusResponse message. Does not implicitly {@link routerrpc.UpdateChanStatusResponse.verify|verify} messages. * @function encode - * @memberof routerrpc.CircuitKey + * @memberof routerrpc.UpdateChanStatusResponse * @static - * @param {routerrpc.ICircuitKey} message CircuitKey message or plain object to encode + * @param {routerrpc.IUpdateChanStatusResponse} message UpdateChanStatusResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CircuitKey.encode = function encode(message, writer) { + UpdateChanStatusResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.chan_id != null && Object.hasOwnProperty.call(message, "chan_id")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.chan_id); - if (message.htlc_id != null && Object.hasOwnProperty.call(message, "htlc_id")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.htlc_id); return writer; }; /** - * Encodes the specified CircuitKey message, length delimited. Does not implicitly {@link routerrpc.CircuitKey.verify|verify} messages. + * Encodes the specified UpdateChanStatusResponse message, length delimited. Does not implicitly {@link routerrpc.UpdateChanStatusResponse.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.CircuitKey + * @memberof routerrpc.UpdateChanStatusResponse * @static - * @param {routerrpc.ICircuitKey} message CircuitKey message or plain object to encode + * @param {routerrpc.IUpdateChanStatusResponse} message UpdateChanStatusResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CircuitKey.encodeDelimited = function encodeDelimited(message, writer) { + UpdateChanStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CircuitKey message from the specified reader or buffer. + * Decodes an UpdateChanStatusResponse message from the specified reader or buffer. * @function decode - * @memberof routerrpc.CircuitKey + * @memberof routerrpc.UpdateChanStatusResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.CircuitKey} CircuitKey + * @returns {routerrpc.UpdateChanStatusResponse} UpdateChanStatusResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CircuitKey.decode = function decode(reader, length) { + UpdateChanStatusResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.CircuitKey(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.UpdateChanStatusResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.chan_id = reader.uint64(); - break; - } - case 2: { - message.htlc_id = reader.uint64(); - break; - } default: reader.skipType(tag & 7); break; @@ -95092,391 +98773,189 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a CircuitKey message from the specified reader or buffer, length delimited. + * Decodes an UpdateChanStatusResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.CircuitKey + * @memberof routerrpc.UpdateChanStatusResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.CircuitKey} CircuitKey + * @returns {routerrpc.UpdateChanStatusResponse} UpdateChanStatusResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CircuitKey.decodeDelimited = function decodeDelimited(reader) { + UpdateChanStatusResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CircuitKey message. + * Verifies an UpdateChanStatusResponse message. * @function verify - * @memberof routerrpc.CircuitKey + * @memberof routerrpc.UpdateChanStatusResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CircuitKey.verify = function verify(message) { + UpdateChanStatusResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.chan_id != null && message.hasOwnProperty("chan_id")) - if (!$util.isInteger(message.chan_id) && !(message.chan_id && $util.isInteger(message.chan_id.low) && $util.isInteger(message.chan_id.high))) - return "chan_id: integer|Long expected"; - if (message.htlc_id != null && message.hasOwnProperty("htlc_id")) - if (!$util.isInteger(message.htlc_id) && !(message.htlc_id && $util.isInteger(message.htlc_id.low) && $util.isInteger(message.htlc_id.high))) - return "htlc_id: integer|Long expected"; return null; }; /** - * Creates a CircuitKey message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateChanStatusResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.CircuitKey + * @memberof routerrpc.UpdateChanStatusResponse * @static * @param {Object.} object Plain object - * @returns {routerrpc.CircuitKey} CircuitKey + * @returns {routerrpc.UpdateChanStatusResponse} UpdateChanStatusResponse */ - CircuitKey.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.CircuitKey) + UpdateChanStatusResponse.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.UpdateChanStatusResponse) return object; - let message = new $root.routerrpc.CircuitKey(); - if (object.chan_id != null) - if ($util.Long) - (message.chan_id = $util.Long.fromValue(object.chan_id)).unsigned = true; - else if (typeof object.chan_id === "string") - message.chan_id = parseInt(object.chan_id, 10); - else if (typeof object.chan_id === "number") - message.chan_id = object.chan_id; - else if (typeof object.chan_id === "object") - message.chan_id = new $util.LongBits(object.chan_id.low >>> 0, object.chan_id.high >>> 0).toNumber(true); - if (object.htlc_id != null) - if ($util.Long) - (message.htlc_id = $util.Long.fromValue(object.htlc_id)).unsigned = true; - else if (typeof object.htlc_id === "string") - message.htlc_id = parseInt(object.htlc_id, 10); - else if (typeof object.htlc_id === "number") - message.htlc_id = object.htlc_id; - else if (typeof object.htlc_id === "object") - message.htlc_id = new $util.LongBits(object.htlc_id.low >>> 0, object.htlc_id.high >>> 0).toNumber(true); - return message; + return new $root.routerrpc.UpdateChanStatusResponse(); }; /** - * Creates a plain object from a CircuitKey message. Also converts values to other types if specified. + * Creates a plain object from an UpdateChanStatusResponse message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.CircuitKey + * @memberof routerrpc.UpdateChanStatusResponse * @static - * @param {routerrpc.CircuitKey} message CircuitKey + * @param {routerrpc.UpdateChanStatusResponse} message UpdateChanStatusResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CircuitKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - let object = {}; - if (options.defaults) { - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.chan_id = options.longs === String ? "0" : 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.htlc_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.htlc_id = options.longs === String ? "0" : 0; - } - if (message.chan_id != null && message.hasOwnProperty("chan_id")) - if (typeof message.chan_id === "number") - object.chan_id = options.longs === String ? String(message.chan_id) : message.chan_id; - else - object.chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.chan_id) : options.longs === Number ? new $util.LongBits(message.chan_id.low >>> 0, message.chan_id.high >>> 0).toNumber(true) : message.chan_id; - if (message.htlc_id != null && message.hasOwnProperty("htlc_id")) - if (typeof message.htlc_id === "number") - object.htlc_id = options.longs === String ? String(message.htlc_id) : message.htlc_id; - else - object.htlc_id = options.longs === String ? $util.Long.prototype.toString.call(message.htlc_id) : options.longs === Number ? new $util.LongBits(message.htlc_id.low >>> 0, message.htlc_id.high >>> 0).toNumber(true) : message.htlc_id; - return object; + UpdateChanStatusResponse.toObject = function toObject() { + return {}; }; /** - * Converts this CircuitKey to JSON. + * Converts this UpdateChanStatusResponse to JSON. * @function toJSON - * @memberof routerrpc.CircuitKey + * @memberof routerrpc.UpdateChanStatusResponse * @instance * @returns {Object.} JSON object */ - CircuitKey.prototype.toJSON = function toJSON() { + UpdateChanStatusResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CircuitKey + * Gets the default type url for UpdateChanStatusResponse * @function getTypeUrl - * @memberof routerrpc.CircuitKey + * @memberof routerrpc.UpdateChanStatusResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CircuitKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateChanStatusResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.CircuitKey"; - }; - - return CircuitKey; - })(); - - routerrpc.ForwardHtlcInterceptRequest = (function() { - - /** - * Properties of a ForwardHtlcInterceptRequest. - * @memberof routerrpc - * @interface IForwardHtlcInterceptRequest - * @property {routerrpc.ICircuitKey|null} [incoming_circuit_key] ForwardHtlcInterceptRequest incoming_circuit_key - * @property {Long|null} [incoming_amount_msat] ForwardHtlcInterceptRequest incoming_amount_msat - * @property {number|null} [incoming_expiry] ForwardHtlcInterceptRequest incoming_expiry - * @property {Uint8Array|null} [payment_hash] ForwardHtlcInterceptRequest payment_hash - * @property {Long|null} [outgoing_requested_chan_id] ForwardHtlcInterceptRequest outgoing_requested_chan_id - * @property {Long|null} [outgoing_amount_msat] ForwardHtlcInterceptRequest outgoing_amount_msat - * @property {number|null} [outgoing_expiry] ForwardHtlcInterceptRequest outgoing_expiry - * @property {Object.|null} [custom_records] ForwardHtlcInterceptRequest custom_records - * @property {Uint8Array|null} [onion_blob] ForwardHtlcInterceptRequest onion_blob - * @property {number|null} [auto_fail_height] ForwardHtlcInterceptRequest auto_fail_height - */ - - /** - * Constructs a new ForwardHtlcInterceptRequest. - * @memberof routerrpc - * @classdesc Represents a ForwardHtlcInterceptRequest. - * @implements IForwardHtlcInterceptRequest - * @constructor - * @param {routerrpc.IForwardHtlcInterceptRequest=} [properties] Properties to set - */ - function ForwardHtlcInterceptRequest(properties) { - this.custom_records = {}; - if (properties) - for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ForwardHtlcInterceptRequest incoming_circuit_key. - * @member {routerrpc.ICircuitKey|null|undefined} incoming_circuit_key - * @memberof routerrpc.ForwardHtlcInterceptRequest - * @instance - */ - ForwardHtlcInterceptRequest.prototype.incoming_circuit_key = null; - - /** - * ForwardHtlcInterceptRequest incoming_amount_msat. - * @member {Long} incoming_amount_msat - * @memberof routerrpc.ForwardHtlcInterceptRequest - * @instance - */ - ForwardHtlcInterceptRequest.prototype.incoming_amount_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * ForwardHtlcInterceptRequest incoming_expiry. - * @member {number} incoming_expiry - * @memberof routerrpc.ForwardHtlcInterceptRequest - * @instance - */ - ForwardHtlcInterceptRequest.prototype.incoming_expiry = 0; - - /** - * ForwardHtlcInterceptRequest payment_hash. - * @member {Uint8Array} payment_hash - * @memberof routerrpc.ForwardHtlcInterceptRequest - * @instance - */ - ForwardHtlcInterceptRequest.prototype.payment_hash = $util.newBuffer([]); - - /** - * ForwardHtlcInterceptRequest outgoing_requested_chan_id. - * @member {Long} outgoing_requested_chan_id - * @memberof routerrpc.ForwardHtlcInterceptRequest - * @instance - */ - ForwardHtlcInterceptRequest.prototype.outgoing_requested_chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * ForwardHtlcInterceptRequest outgoing_amount_msat. - * @member {Long} outgoing_amount_msat - * @memberof routerrpc.ForwardHtlcInterceptRequest - * @instance - */ - ForwardHtlcInterceptRequest.prototype.outgoing_amount_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * ForwardHtlcInterceptRequest outgoing_expiry. - * @member {number} outgoing_expiry - * @memberof routerrpc.ForwardHtlcInterceptRequest - * @instance - */ - ForwardHtlcInterceptRequest.prototype.outgoing_expiry = 0; + return typeUrlPrefix + "/routerrpc.UpdateChanStatusResponse"; + }; + + return UpdateChanStatusResponse; + })(); + + routerrpc.AddAliasesRequest = (function() { /** - * ForwardHtlcInterceptRequest custom_records. - * @member {Object.} custom_records - * @memberof routerrpc.ForwardHtlcInterceptRequest - * @instance + * Properties of an AddAliasesRequest. + * @memberof routerrpc + * @interface IAddAliasesRequest + * @property {Array.|null} [alias_maps] AddAliasesRequest alias_maps */ - ForwardHtlcInterceptRequest.prototype.custom_records = $util.emptyObject; /** - * ForwardHtlcInterceptRequest onion_blob. - * @member {Uint8Array} onion_blob - * @memberof routerrpc.ForwardHtlcInterceptRequest - * @instance + * Constructs a new AddAliasesRequest. + * @memberof routerrpc + * @classdesc Represents an AddAliasesRequest. + * @implements IAddAliasesRequest + * @constructor + * @param {routerrpc.IAddAliasesRequest=} [properties] Properties to set */ - ForwardHtlcInterceptRequest.prototype.onion_blob = $util.newBuffer([]); + function AddAliasesRequest(properties) { + this.alias_maps = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * ForwardHtlcInterceptRequest auto_fail_height. - * @member {number} auto_fail_height - * @memberof routerrpc.ForwardHtlcInterceptRequest + * AddAliasesRequest alias_maps. + * @member {Array.} alias_maps + * @memberof routerrpc.AddAliasesRequest * @instance */ - ForwardHtlcInterceptRequest.prototype.auto_fail_height = 0; + AddAliasesRequest.prototype.alias_maps = $util.emptyArray; /** - * Creates a new ForwardHtlcInterceptRequest instance using the specified properties. + * Creates a new AddAliasesRequest instance using the specified properties. * @function create - * @memberof routerrpc.ForwardHtlcInterceptRequest + * @memberof routerrpc.AddAliasesRequest * @static - * @param {routerrpc.IForwardHtlcInterceptRequest=} [properties] Properties to set - * @returns {routerrpc.ForwardHtlcInterceptRequest} ForwardHtlcInterceptRequest instance + * @param {routerrpc.IAddAliasesRequest=} [properties] Properties to set + * @returns {routerrpc.AddAliasesRequest} AddAliasesRequest instance */ - ForwardHtlcInterceptRequest.create = function create(properties) { - return new ForwardHtlcInterceptRequest(properties); + AddAliasesRequest.create = function create(properties) { + return new AddAliasesRequest(properties); }; /** - * Encodes the specified ForwardHtlcInterceptRequest message. Does not implicitly {@link routerrpc.ForwardHtlcInterceptRequest.verify|verify} messages. + * Encodes the specified AddAliasesRequest message. Does not implicitly {@link routerrpc.AddAliasesRequest.verify|verify} messages. * @function encode - * @memberof routerrpc.ForwardHtlcInterceptRequest + * @memberof routerrpc.AddAliasesRequest * @static - * @param {routerrpc.IForwardHtlcInterceptRequest} message ForwardHtlcInterceptRequest message or plain object to encode + * @param {routerrpc.IAddAliasesRequest} message AddAliasesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ForwardHtlcInterceptRequest.encode = function encode(message, writer) { + AddAliasesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.incoming_circuit_key != null && Object.hasOwnProperty.call(message, "incoming_circuit_key")) - $root.routerrpc.CircuitKey.encode(message.incoming_circuit_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.payment_hash); - if (message.outgoing_amount_msat != null && Object.hasOwnProperty.call(message, "outgoing_amount_msat")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.outgoing_amount_msat); - if (message.outgoing_expiry != null && Object.hasOwnProperty.call(message, "outgoing_expiry")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.outgoing_expiry); - if (message.incoming_amount_msat != null && Object.hasOwnProperty.call(message, "incoming_amount_msat")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.incoming_amount_msat); - if (message.incoming_expiry != null && Object.hasOwnProperty.call(message, "incoming_expiry")) - writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.incoming_expiry); - if (message.outgoing_requested_chan_id != null && Object.hasOwnProperty.call(message, "outgoing_requested_chan_id")) - writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.outgoing_requested_chan_id); - if (message.custom_records != null && Object.hasOwnProperty.call(message, "custom_records")) - for (let keys = Object.keys(message.custom_records), i = 0; i < keys.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.custom_records[keys[i]]).ldelim(); - if (message.onion_blob != null && Object.hasOwnProperty.call(message, "onion_blob")) - writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.onion_blob); - if (message.auto_fail_height != null && Object.hasOwnProperty.call(message, "auto_fail_height")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.auto_fail_height); + if (message.alias_maps != null && message.alias_maps.length) + for (let i = 0; i < message.alias_maps.length; ++i) + $root.lnrpc.AliasMap.encode(message.alias_maps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ForwardHtlcInterceptRequest message, length delimited. Does not implicitly {@link routerrpc.ForwardHtlcInterceptRequest.verify|verify} messages. + * Encodes the specified AddAliasesRequest message, length delimited. Does not implicitly {@link routerrpc.AddAliasesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.ForwardHtlcInterceptRequest + * @memberof routerrpc.AddAliasesRequest * @static - * @param {routerrpc.IForwardHtlcInterceptRequest} message ForwardHtlcInterceptRequest message or plain object to encode + * @param {routerrpc.IAddAliasesRequest} message AddAliasesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ForwardHtlcInterceptRequest.encodeDelimited = function encodeDelimited(message, writer) { + AddAliasesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ForwardHtlcInterceptRequest message from the specified reader or buffer. + * Decodes an AddAliasesRequest message from the specified reader or buffer. * @function decode - * @memberof routerrpc.ForwardHtlcInterceptRequest + * @memberof routerrpc.AddAliasesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.ForwardHtlcInterceptRequest} ForwardHtlcInterceptRequest + * @returns {routerrpc.AddAliasesRequest} AddAliasesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ForwardHtlcInterceptRequest.decode = function decode(reader, length) { + AddAliasesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.ForwardHtlcInterceptRequest(), key, value; + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.AddAliasesRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.incoming_circuit_key = $root.routerrpc.CircuitKey.decode(reader, reader.uint32()); - break; - } - case 5: { - message.incoming_amount_msat = reader.uint64(); - break; - } - case 6: { - message.incoming_expiry = reader.uint32(); - break; - } - case 2: { - message.payment_hash = reader.bytes(); - break; - } - case 7: { - message.outgoing_requested_chan_id = reader.uint64(); - break; - } - case 3: { - message.outgoing_amount_msat = reader.uint64(); - break; - } - case 4: { - message.outgoing_expiry = reader.uint32(); - break; - } - case 8: { - if (message.custom_records === $util.emptyObject) - message.custom_records = {}; - let end2 = reader.uint32() + reader.pos; - key = 0; - value = []; - while (reader.pos < end2) { - let tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.uint64(); - break; - case 2: - value = reader.bytes(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value; - break; - } - case 9: { - message.onion_blob = reader.bytes(); - break; - } - case 10: { - message.auto_fail_height = reader.int32(); + if (!(message.alias_maps && message.alias_maps.length)) + message.alias_maps = []; + message.alias_maps.push($root.lnrpc.AliasMap.decode(reader, reader.uint32())); break; } default: @@ -95488,290 +98967,140 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a ForwardHtlcInterceptRequest message from the specified reader or buffer, length delimited. + * Decodes an AddAliasesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.ForwardHtlcInterceptRequest + * @memberof routerrpc.AddAliasesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.ForwardHtlcInterceptRequest} ForwardHtlcInterceptRequest + * @returns {routerrpc.AddAliasesRequest} AddAliasesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ForwardHtlcInterceptRequest.decodeDelimited = function decodeDelimited(reader) { + AddAliasesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ForwardHtlcInterceptRequest message. + * Verifies an AddAliasesRequest message. * @function verify - * @memberof routerrpc.ForwardHtlcInterceptRequest + * @memberof routerrpc.AddAliasesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ForwardHtlcInterceptRequest.verify = function verify(message) { + AddAliasesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.incoming_circuit_key != null && message.hasOwnProperty("incoming_circuit_key")) { - let error = $root.routerrpc.CircuitKey.verify(message.incoming_circuit_key); - if (error) - return "incoming_circuit_key." + error; - } - if (message.incoming_amount_msat != null && message.hasOwnProperty("incoming_amount_msat")) - if (!$util.isInteger(message.incoming_amount_msat) && !(message.incoming_amount_msat && $util.isInteger(message.incoming_amount_msat.low) && $util.isInteger(message.incoming_amount_msat.high))) - return "incoming_amount_msat: integer|Long expected"; - if (message.incoming_expiry != null && message.hasOwnProperty("incoming_expiry")) - if (!$util.isInteger(message.incoming_expiry)) - return "incoming_expiry: integer expected"; - if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) - if (!(message.payment_hash && typeof message.payment_hash.length === "number" || $util.isString(message.payment_hash))) - return "payment_hash: buffer expected"; - if (message.outgoing_requested_chan_id != null && message.hasOwnProperty("outgoing_requested_chan_id")) - if (!$util.isInteger(message.outgoing_requested_chan_id) && !(message.outgoing_requested_chan_id && $util.isInteger(message.outgoing_requested_chan_id.low) && $util.isInteger(message.outgoing_requested_chan_id.high))) - return "outgoing_requested_chan_id: integer|Long expected"; - if (message.outgoing_amount_msat != null && message.hasOwnProperty("outgoing_amount_msat")) - if (!$util.isInteger(message.outgoing_amount_msat) && !(message.outgoing_amount_msat && $util.isInteger(message.outgoing_amount_msat.low) && $util.isInteger(message.outgoing_amount_msat.high))) - return "outgoing_amount_msat: integer|Long expected"; - if (message.outgoing_expiry != null && message.hasOwnProperty("outgoing_expiry")) - if (!$util.isInteger(message.outgoing_expiry)) - return "outgoing_expiry: integer expected"; - if (message.custom_records != null && message.hasOwnProperty("custom_records")) { - if (!$util.isObject(message.custom_records)) - return "custom_records: object expected"; - let key = Object.keys(message.custom_records); - for (let i = 0; i < key.length; ++i) { - if (!$util.key64Re.test(key[i])) - return "custom_records: integer|Long key{k:uint64} expected"; - if (!(message.custom_records[key[i]] && typeof message.custom_records[key[i]].length === "number" || $util.isString(message.custom_records[key[i]]))) - return "custom_records: buffer{k:uint64} expected"; + if (message.alias_maps != null && message.hasOwnProperty("alias_maps")) { + if (!Array.isArray(message.alias_maps)) + return "alias_maps: array expected"; + for (let i = 0; i < message.alias_maps.length; ++i) { + let error = $root.lnrpc.AliasMap.verify(message.alias_maps[i]); + if (error) + return "alias_maps." + error; } } - if (message.onion_blob != null && message.hasOwnProperty("onion_blob")) - if (!(message.onion_blob && typeof message.onion_blob.length === "number" || $util.isString(message.onion_blob))) - return "onion_blob: buffer expected"; - if (message.auto_fail_height != null && message.hasOwnProperty("auto_fail_height")) - if (!$util.isInteger(message.auto_fail_height)) - return "auto_fail_height: integer expected"; return null; }; /** - * Creates a ForwardHtlcInterceptRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AddAliasesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.ForwardHtlcInterceptRequest + * @memberof routerrpc.AddAliasesRequest * @static * @param {Object.} object Plain object - * @returns {routerrpc.ForwardHtlcInterceptRequest} ForwardHtlcInterceptRequest + * @returns {routerrpc.AddAliasesRequest} AddAliasesRequest */ - ForwardHtlcInterceptRequest.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.ForwardHtlcInterceptRequest) + AddAliasesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.AddAliasesRequest) return object; - let message = new $root.routerrpc.ForwardHtlcInterceptRequest(); - if (object.incoming_circuit_key != null) { - if (typeof object.incoming_circuit_key !== "object") - throw TypeError(".routerrpc.ForwardHtlcInterceptRequest.incoming_circuit_key: object expected"); - message.incoming_circuit_key = $root.routerrpc.CircuitKey.fromObject(object.incoming_circuit_key); - } - if (object.incoming_amount_msat != null) - if ($util.Long) - (message.incoming_amount_msat = $util.Long.fromValue(object.incoming_amount_msat)).unsigned = true; - else if (typeof object.incoming_amount_msat === "string") - message.incoming_amount_msat = parseInt(object.incoming_amount_msat, 10); - else if (typeof object.incoming_amount_msat === "number") - message.incoming_amount_msat = object.incoming_amount_msat; - else if (typeof object.incoming_amount_msat === "object") - message.incoming_amount_msat = new $util.LongBits(object.incoming_amount_msat.low >>> 0, object.incoming_amount_msat.high >>> 0).toNumber(true); - if (object.incoming_expiry != null) - message.incoming_expiry = object.incoming_expiry >>> 0; - if (object.payment_hash != null) - if (typeof object.payment_hash === "string") - $util.base64.decode(object.payment_hash, message.payment_hash = $util.newBuffer($util.base64.length(object.payment_hash)), 0); - else if (object.payment_hash.length >= 0) - message.payment_hash = object.payment_hash; - if (object.outgoing_requested_chan_id != null) - if ($util.Long) - (message.outgoing_requested_chan_id = $util.Long.fromValue(object.outgoing_requested_chan_id)).unsigned = true; - else if (typeof object.outgoing_requested_chan_id === "string") - message.outgoing_requested_chan_id = parseInt(object.outgoing_requested_chan_id, 10); - else if (typeof object.outgoing_requested_chan_id === "number") - message.outgoing_requested_chan_id = object.outgoing_requested_chan_id; - else if (typeof object.outgoing_requested_chan_id === "object") - message.outgoing_requested_chan_id = new $util.LongBits(object.outgoing_requested_chan_id.low >>> 0, object.outgoing_requested_chan_id.high >>> 0).toNumber(true); - if (object.outgoing_amount_msat != null) - if ($util.Long) - (message.outgoing_amount_msat = $util.Long.fromValue(object.outgoing_amount_msat)).unsigned = true; - else if (typeof object.outgoing_amount_msat === "string") - message.outgoing_amount_msat = parseInt(object.outgoing_amount_msat, 10); - else if (typeof object.outgoing_amount_msat === "number") - message.outgoing_amount_msat = object.outgoing_amount_msat; - else if (typeof object.outgoing_amount_msat === "object") - message.outgoing_amount_msat = new $util.LongBits(object.outgoing_amount_msat.low >>> 0, object.outgoing_amount_msat.high >>> 0).toNumber(true); - if (object.outgoing_expiry != null) - message.outgoing_expiry = object.outgoing_expiry >>> 0; - if (object.custom_records) { - if (typeof object.custom_records !== "object") - throw TypeError(".routerrpc.ForwardHtlcInterceptRequest.custom_records: object expected"); - message.custom_records = {}; - for (let keys = Object.keys(object.custom_records), i = 0; i < keys.length; ++i) - if (typeof object.custom_records[keys[i]] === "string") - $util.base64.decode(object.custom_records[keys[i]], message.custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.custom_records[keys[i]])), 0); - else if (object.custom_records[keys[i]].length >= 0) - message.custom_records[keys[i]] = object.custom_records[keys[i]]; + let message = new $root.routerrpc.AddAliasesRequest(); + if (object.alias_maps) { + if (!Array.isArray(object.alias_maps)) + throw TypeError(".routerrpc.AddAliasesRequest.alias_maps: array expected"); + message.alias_maps = []; + for (let i = 0; i < object.alias_maps.length; ++i) { + if (typeof object.alias_maps[i] !== "object") + throw TypeError(".routerrpc.AddAliasesRequest.alias_maps: object expected"); + message.alias_maps[i] = $root.lnrpc.AliasMap.fromObject(object.alias_maps[i]); + } } - if (object.onion_blob != null) - if (typeof object.onion_blob === "string") - $util.base64.decode(object.onion_blob, message.onion_blob = $util.newBuffer($util.base64.length(object.onion_blob)), 0); - else if (object.onion_blob.length >= 0) - message.onion_blob = object.onion_blob; - if (object.auto_fail_height != null) - message.auto_fail_height = object.auto_fail_height | 0; return message; }; /** - * Creates a plain object from a ForwardHtlcInterceptRequest message. Also converts values to other types if specified. + * Creates a plain object from an AddAliasesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.ForwardHtlcInterceptRequest + * @memberof routerrpc.AddAliasesRequest * @static - * @param {routerrpc.ForwardHtlcInterceptRequest} message ForwardHtlcInterceptRequest + * @param {routerrpc.AddAliasesRequest} message AddAliasesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ForwardHtlcInterceptRequest.toObject = function toObject(message, options) { + AddAliasesRequest.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.objects || options.defaults) - object.custom_records = {}; - if (options.defaults) { - object.incoming_circuit_key = null; - if (options.bytes === String) - object.payment_hash = ""; - else { - object.payment_hash = []; - if (options.bytes !== Array) - object.payment_hash = $util.newBuffer(object.payment_hash); - } - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.outgoing_amount_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.outgoing_amount_msat = options.longs === String ? "0" : 0; - object.outgoing_expiry = 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.incoming_amount_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.incoming_amount_msat = options.longs === String ? "0" : 0; - object.incoming_expiry = 0; - if ($util.Long) { - let long = new $util.Long(0, 0, true); - object.outgoing_requested_chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.outgoing_requested_chan_id = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.onion_blob = ""; - else { - object.onion_blob = []; - if (options.bytes !== Array) - object.onion_blob = $util.newBuffer(object.onion_blob); - } - object.auto_fail_height = 0; - } - if (message.incoming_circuit_key != null && message.hasOwnProperty("incoming_circuit_key")) - object.incoming_circuit_key = $root.routerrpc.CircuitKey.toObject(message.incoming_circuit_key, options); - if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) - object.payment_hash = options.bytes === String ? $util.base64.encode(message.payment_hash, 0, message.payment_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_hash) : message.payment_hash; - if (message.outgoing_amount_msat != null && message.hasOwnProperty("outgoing_amount_msat")) - if (typeof message.outgoing_amount_msat === "number") - object.outgoing_amount_msat = options.longs === String ? String(message.outgoing_amount_msat) : message.outgoing_amount_msat; - else - object.outgoing_amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_amount_msat) : options.longs === Number ? new $util.LongBits(message.outgoing_amount_msat.low >>> 0, message.outgoing_amount_msat.high >>> 0).toNumber(true) : message.outgoing_amount_msat; - if (message.outgoing_expiry != null && message.hasOwnProperty("outgoing_expiry")) - object.outgoing_expiry = message.outgoing_expiry; - if (message.incoming_amount_msat != null && message.hasOwnProperty("incoming_amount_msat")) - if (typeof message.incoming_amount_msat === "number") - object.incoming_amount_msat = options.longs === String ? String(message.incoming_amount_msat) : message.incoming_amount_msat; - else - object.incoming_amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.incoming_amount_msat) : options.longs === Number ? new $util.LongBits(message.incoming_amount_msat.low >>> 0, message.incoming_amount_msat.high >>> 0).toNumber(true) : message.incoming_amount_msat; - if (message.incoming_expiry != null && message.hasOwnProperty("incoming_expiry")) - object.incoming_expiry = message.incoming_expiry; - if (message.outgoing_requested_chan_id != null && message.hasOwnProperty("outgoing_requested_chan_id")) - if (typeof message.outgoing_requested_chan_id === "number") - object.outgoing_requested_chan_id = options.longs === String ? String(message.outgoing_requested_chan_id) : message.outgoing_requested_chan_id; - else - object.outgoing_requested_chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_requested_chan_id) : options.longs === Number ? new $util.LongBits(message.outgoing_requested_chan_id.low >>> 0, message.outgoing_requested_chan_id.high >>> 0).toNumber(true) : message.outgoing_requested_chan_id; - let keys2; - if (message.custom_records && (keys2 = Object.keys(message.custom_records)).length) { - object.custom_records = {}; - for (let j = 0; j < keys2.length; ++j) - object.custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.custom_records[keys2[j]], 0, message.custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_records[keys2[j]]) : message.custom_records[keys2[j]]; + if (options.arrays || options.defaults) + object.alias_maps = []; + if (message.alias_maps && message.alias_maps.length) { + object.alias_maps = []; + for (let j = 0; j < message.alias_maps.length; ++j) + object.alias_maps[j] = $root.lnrpc.AliasMap.toObject(message.alias_maps[j], options); } - if (message.onion_blob != null && message.hasOwnProperty("onion_blob")) - object.onion_blob = options.bytes === String ? $util.base64.encode(message.onion_blob, 0, message.onion_blob.length) : options.bytes === Array ? Array.prototype.slice.call(message.onion_blob) : message.onion_blob; - if (message.auto_fail_height != null && message.hasOwnProperty("auto_fail_height")) - object.auto_fail_height = message.auto_fail_height; return object; }; /** - * Converts this ForwardHtlcInterceptRequest to JSON. + * Converts this AddAliasesRequest to JSON. * @function toJSON - * @memberof routerrpc.ForwardHtlcInterceptRequest + * @memberof routerrpc.AddAliasesRequest * @instance * @returns {Object.} JSON object */ - ForwardHtlcInterceptRequest.prototype.toJSON = function toJSON() { + AddAliasesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ForwardHtlcInterceptRequest + * Gets the default type url for AddAliasesRequest * @function getTypeUrl - * @memberof routerrpc.ForwardHtlcInterceptRequest + * @memberof routerrpc.AddAliasesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ForwardHtlcInterceptRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AddAliasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.ForwardHtlcInterceptRequest"; + return typeUrlPrefix + "/routerrpc.AddAliasesRequest"; }; - return ForwardHtlcInterceptRequest; + return AddAliasesRequest; })(); - routerrpc.ForwardHtlcInterceptResponse = (function() { + routerrpc.AddAliasesResponse = (function() { /** - * Properties of a ForwardHtlcInterceptResponse. + * Properties of an AddAliasesResponse. * @memberof routerrpc - * @interface IForwardHtlcInterceptResponse - * @property {routerrpc.ICircuitKey|null} [incoming_circuit_key] The key of this forwarded htlc. It defines the incoming channel id and - * the index in this channel. - * @property {routerrpc.ResolveHoldForwardAction|null} [action] ForwardHtlcInterceptResponse action - * @property {Uint8Array|null} [preimage] ForwardHtlcInterceptResponse preimage - * @property {Uint8Array|null} [failure_message] ForwardHtlcInterceptResponse failure_message - * @property {lnrpc.Failure.FailureCode|null} [failure_code] ForwardHtlcInterceptResponse failure_code + * @interface IAddAliasesResponse + * @property {Array.|null} [alias_maps] AddAliasesResponse alias_maps */ /** - * Constructs a new ForwardHtlcInterceptResponse. + * Constructs a new AddAliasesResponse. * @memberof routerrpc - * @classdesc ForwardHtlcInterceptResponse enables the caller to resolve a previously hold - * forward. The caller can choose either to: - * - `Resume`: Execute the default behavior (usually forward). - * - `Reject`: Fail the htlc backwards. - * - `Settle`: Settle this htlc with a given preimage. - * @implements IForwardHtlcInterceptResponse + * @classdesc Represents an AddAliasesResponse. + * @implements IAddAliasesResponse * @constructor - * @param {routerrpc.IForwardHtlcInterceptResponse=} [properties] Properties to set + * @param {routerrpc.IAddAliasesResponse=} [properties] Properties to set */ - function ForwardHtlcInterceptResponse(properties) { + function AddAliasesResponse(properties) { + this.alias_maps = []; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -95779,132 +99108,78 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * The key of this forwarded htlc. It defines the incoming channel id and - * the index in this channel. - * @member {routerrpc.ICircuitKey|null|undefined} incoming_circuit_key - * @memberof routerrpc.ForwardHtlcInterceptResponse - * @instance - */ - ForwardHtlcInterceptResponse.prototype.incoming_circuit_key = null; - - /** - * ForwardHtlcInterceptResponse action. - * @member {routerrpc.ResolveHoldForwardAction} action - * @memberof routerrpc.ForwardHtlcInterceptResponse - * @instance - */ - ForwardHtlcInterceptResponse.prototype.action = 0; - - /** - * ForwardHtlcInterceptResponse preimage. - * @member {Uint8Array} preimage - * @memberof routerrpc.ForwardHtlcInterceptResponse - * @instance - */ - ForwardHtlcInterceptResponse.prototype.preimage = $util.newBuffer([]); - - /** - * ForwardHtlcInterceptResponse failure_message. - * @member {Uint8Array} failure_message - * @memberof routerrpc.ForwardHtlcInterceptResponse - * @instance - */ - ForwardHtlcInterceptResponse.prototype.failure_message = $util.newBuffer([]); - - /** - * ForwardHtlcInterceptResponse failure_code. - * @member {lnrpc.Failure.FailureCode} failure_code - * @memberof routerrpc.ForwardHtlcInterceptResponse + * AddAliasesResponse alias_maps. + * @member {Array.} alias_maps + * @memberof routerrpc.AddAliasesResponse * @instance */ - ForwardHtlcInterceptResponse.prototype.failure_code = 0; + AddAliasesResponse.prototype.alias_maps = $util.emptyArray; /** - * Creates a new ForwardHtlcInterceptResponse instance using the specified properties. + * Creates a new AddAliasesResponse instance using the specified properties. * @function create - * @memberof routerrpc.ForwardHtlcInterceptResponse + * @memberof routerrpc.AddAliasesResponse * @static - * @param {routerrpc.IForwardHtlcInterceptResponse=} [properties] Properties to set - * @returns {routerrpc.ForwardHtlcInterceptResponse} ForwardHtlcInterceptResponse instance + * @param {routerrpc.IAddAliasesResponse=} [properties] Properties to set + * @returns {routerrpc.AddAliasesResponse} AddAliasesResponse instance */ - ForwardHtlcInterceptResponse.create = function create(properties) { - return new ForwardHtlcInterceptResponse(properties); + AddAliasesResponse.create = function create(properties) { + return new AddAliasesResponse(properties); }; /** - * Encodes the specified ForwardHtlcInterceptResponse message. Does not implicitly {@link routerrpc.ForwardHtlcInterceptResponse.verify|verify} messages. + * Encodes the specified AddAliasesResponse message. Does not implicitly {@link routerrpc.AddAliasesResponse.verify|verify} messages. * @function encode - * @memberof routerrpc.ForwardHtlcInterceptResponse + * @memberof routerrpc.AddAliasesResponse * @static - * @param {routerrpc.IForwardHtlcInterceptResponse} message ForwardHtlcInterceptResponse message or plain object to encode + * @param {routerrpc.IAddAliasesResponse} message AddAliasesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ForwardHtlcInterceptResponse.encode = function encode(message, writer) { + AddAliasesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.incoming_circuit_key != null && Object.hasOwnProperty.call(message, "incoming_circuit_key")) - $root.routerrpc.CircuitKey.encode(message.incoming_circuit_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.action); - if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.preimage); - if (message.failure_message != null && Object.hasOwnProperty.call(message, "failure_message")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.failure_message); - if (message.failure_code != null && Object.hasOwnProperty.call(message, "failure_code")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.failure_code); + if (message.alias_maps != null && message.alias_maps.length) + for (let i = 0; i < message.alias_maps.length; ++i) + $root.lnrpc.AliasMap.encode(message.alias_maps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ForwardHtlcInterceptResponse message, length delimited. Does not implicitly {@link routerrpc.ForwardHtlcInterceptResponse.verify|verify} messages. + * Encodes the specified AddAliasesResponse message, length delimited. Does not implicitly {@link routerrpc.AddAliasesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.ForwardHtlcInterceptResponse + * @memberof routerrpc.AddAliasesResponse * @static - * @param {routerrpc.IForwardHtlcInterceptResponse} message ForwardHtlcInterceptResponse message or plain object to encode + * @param {routerrpc.IAddAliasesResponse} message AddAliasesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ForwardHtlcInterceptResponse.encodeDelimited = function encodeDelimited(message, writer) { + AddAliasesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ForwardHtlcInterceptResponse message from the specified reader or buffer. + * Decodes an AddAliasesResponse message from the specified reader or buffer. * @function decode - * @memberof routerrpc.ForwardHtlcInterceptResponse + * @memberof routerrpc.AddAliasesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.ForwardHtlcInterceptResponse} ForwardHtlcInterceptResponse + * @returns {routerrpc.AddAliasesResponse} AddAliasesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ForwardHtlcInterceptResponse.decode = function decode(reader, length) { + AddAliasesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.ForwardHtlcInterceptResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.AddAliasesResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.incoming_circuit_key = $root.routerrpc.CircuitKey.decode(reader, reader.uint32()); - break; - } - case 2: { - message.action = reader.int32(); - break; - } - case 3: { - message.preimage = reader.bytes(); - break; - } - case 4: { - message.failure_message = reader.bytes(); - break; - } - case 5: { - message.failure_code = reader.int32(); + if (!(message.alias_maps && message.alias_maps.length)) + message.alias_maps = []; + message.alias_maps.push($root.lnrpc.AliasMap.decode(reader, reader.uint32())); break; } default: @@ -95916,373 +99191,140 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes a ForwardHtlcInterceptResponse message from the specified reader or buffer, length delimited. + * Decodes an AddAliasesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.ForwardHtlcInterceptResponse + * @memberof routerrpc.AddAliasesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.ForwardHtlcInterceptResponse} ForwardHtlcInterceptResponse + * @returns {routerrpc.AddAliasesResponse} AddAliasesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ForwardHtlcInterceptResponse.decodeDelimited = function decodeDelimited(reader) { + AddAliasesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ForwardHtlcInterceptResponse message. + * Verifies an AddAliasesResponse message. * @function verify - * @memberof routerrpc.ForwardHtlcInterceptResponse + * @memberof routerrpc.AddAliasesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ForwardHtlcInterceptResponse.verify = function verify(message) { + AddAliasesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.incoming_circuit_key != null && message.hasOwnProperty("incoming_circuit_key")) { - let error = $root.routerrpc.CircuitKey.verify(message.incoming_circuit_key); - if (error) - return "incoming_circuit_key." + error; - } - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.preimage != null && message.hasOwnProperty("preimage")) - if (!(message.preimage && typeof message.preimage.length === "number" || $util.isString(message.preimage))) - return "preimage: buffer expected"; - if (message.failure_message != null && message.hasOwnProperty("failure_message")) - if (!(message.failure_message && typeof message.failure_message.length === "number" || $util.isString(message.failure_message))) - return "failure_message: buffer expected"; - if (message.failure_code != null && message.hasOwnProperty("failure_code")) - switch (message.failure_code) { - default: - return "failure_code: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: - case 24: - case 25: - case 997: - case 998: - case 999: - break; + if (message.alias_maps != null && message.hasOwnProperty("alias_maps")) { + if (!Array.isArray(message.alias_maps)) + return "alias_maps: array expected"; + for (let i = 0; i < message.alias_maps.length; ++i) { + let error = $root.lnrpc.AliasMap.verify(message.alias_maps[i]); + if (error) + return "alias_maps." + error; } + } return null; }; /** - * Creates a ForwardHtlcInterceptResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AddAliasesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.ForwardHtlcInterceptResponse + * @memberof routerrpc.AddAliasesResponse * @static * @param {Object.} object Plain object - * @returns {routerrpc.ForwardHtlcInterceptResponse} ForwardHtlcInterceptResponse + * @returns {routerrpc.AddAliasesResponse} AddAliasesResponse */ - ForwardHtlcInterceptResponse.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.ForwardHtlcInterceptResponse) + AddAliasesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.AddAliasesResponse) return object; - let message = new $root.routerrpc.ForwardHtlcInterceptResponse(); - if (object.incoming_circuit_key != null) { - if (typeof object.incoming_circuit_key !== "object") - throw TypeError(".routerrpc.ForwardHtlcInterceptResponse.incoming_circuit_key: object expected"); - message.incoming_circuit_key = $root.routerrpc.CircuitKey.fromObject(object.incoming_circuit_key); - } - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; - } - break; - case "SETTLE": - case 0: - message.action = 0; - break; - case "FAIL": - case 1: - message.action = 1; - break; - case "RESUME": - case 2: - message.action = 2; - break; - } - if (object.preimage != null) - if (typeof object.preimage === "string") - $util.base64.decode(object.preimage, message.preimage = $util.newBuffer($util.base64.length(object.preimage)), 0); - else if (object.preimage.length >= 0) - message.preimage = object.preimage; - if (object.failure_message != null) - if (typeof object.failure_message === "string") - $util.base64.decode(object.failure_message, message.failure_message = $util.newBuffer($util.base64.length(object.failure_message)), 0); - else if (object.failure_message.length >= 0) - message.failure_message = object.failure_message; - switch (object.failure_code) { - default: - if (typeof object.failure_code === "number") { - message.failure_code = object.failure_code; - break; + let message = new $root.routerrpc.AddAliasesResponse(); + if (object.alias_maps) { + if (!Array.isArray(object.alias_maps)) + throw TypeError(".routerrpc.AddAliasesResponse.alias_maps: array expected"); + message.alias_maps = []; + for (let i = 0; i < object.alias_maps.length; ++i) { + if (typeof object.alias_maps[i] !== "object") + throw TypeError(".routerrpc.AddAliasesResponse.alias_maps: object expected"); + message.alias_maps[i] = $root.lnrpc.AliasMap.fromObject(object.alias_maps[i]); } - break; - case "RESERVED": - case 0: - message.failure_code = 0; - break; - case "INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS": - case 1: - message.failure_code = 1; - break; - case "INCORRECT_PAYMENT_AMOUNT": - case 2: - message.failure_code = 2; - break; - case "FINAL_INCORRECT_CLTV_EXPIRY": - case 3: - message.failure_code = 3; - break; - case "FINAL_INCORRECT_HTLC_AMOUNT": - case 4: - message.failure_code = 4; - break; - case "FINAL_EXPIRY_TOO_SOON": - case 5: - message.failure_code = 5; - break; - case "INVALID_REALM": - case 6: - message.failure_code = 6; - break; - case "EXPIRY_TOO_SOON": - case 7: - message.failure_code = 7; - break; - case "INVALID_ONION_VERSION": - case 8: - message.failure_code = 8; - break; - case "INVALID_ONION_HMAC": - case 9: - message.failure_code = 9; - break; - case "INVALID_ONION_KEY": - case 10: - message.failure_code = 10; - break; - case "AMOUNT_BELOW_MINIMUM": - case 11: - message.failure_code = 11; - break; - case "FEE_INSUFFICIENT": - case 12: - message.failure_code = 12; - break; - case "INCORRECT_CLTV_EXPIRY": - case 13: - message.failure_code = 13; - break; - case "CHANNEL_DISABLED": - case 14: - message.failure_code = 14; - break; - case "TEMPORARY_CHANNEL_FAILURE": - case 15: - message.failure_code = 15; - break; - case "REQUIRED_NODE_FEATURE_MISSING": - case 16: - message.failure_code = 16; - break; - case "REQUIRED_CHANNEL_FEATURE_MISSING": - case 17: - message.failure_code = 17; - break; - case "UNKNOWN_NEXT_PEER": - case 18: - message.failure_code = 18; - break; - case "TEMPORARY_NODE_FAILURE": - case 19: - message.failure_code = 19; - break; - case "PERMANENT_NODE_FAILURE": - case 20: - message.failure_code = 20; - break; - case "PERMANENT_CHANNEL_FAILURE": - case 21: - message.failure_code = 21; - break; - case "EXPIRY_TOO_FAR": - case 22: - message.failure_code = 22; - break; - case "MPP_TIMEOUT": - case 23: - message.failure_code = 23; - break; - case "INVALID_ONION_PAYLOAD": - case 24: - message.failure_code = 24; - break; - case "INVALID_ONION_BLINDING": - case 25: - message.failure_code = 25; - break; - case "INTERNAL_FAILURE": - case 997: - message.failure_code = 997; - break; - case "UNKNOWN_FAILURE": - case 998: - message.failure_code = 998; - break; - case "UNREADABLE_FAILURE": - case 999: - message.failure_code = 999; - break; } return message; }; /** - * Creates a plain object from a ForwardHtlcInterceptResponse message. Also converts values to other types if specified. + * Creates a plain object from an AddAliasesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.ForwardHtlcInterceptResponse + * @memberof routerrpc.AddAliasesResponse * @static - * @param {routerrpc.ForwardHtlcInterceptResponse} message ForwardHtlcInterceptResponse + * @param {routerrpc.AddAliasesResponse} message AddAliasesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ForwardHtlcInterceptResponse.toObject = function toObject(message, options) { + AddAliasesResponse.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.defaults) { - object.incoming_circuit_key = null; - object.action = options.enums === String ? "SETTLE" : 0; - if (options.bytes === String) - object.preimage = ""; - else { - object.preimage = []; - if (options.bytes !== Array) - object.preimage = $util.newBuffer(object.preimage); - } - if (options.bytes === String) - object.failure_message = ""; - else { - object.failure_message = []; - if (options.bytes !== Array) - object.failure_message = $util.newBuffer(object.failure_message); - } - object.failure_code = options.enums === String ? "RESERVED" : 0; + if (options.arrays || options.defaults) + object.alias_maps = []; + if (message.alias_maps && message.alias_maps.length) { + object.alias_maps = []; + for (let j = 0; j < message.alias_maps.length; ++j) + object.alias_maps[j] = $root.lnrpc.AliasMap.toObject(message.alias_maps[j], options); } - if (message.incoming_circuit_key != null && message.hasOwnProperty("incoming_circuit_key")) - object.incoming_circuit_key = $root.routerrpc.CircuitKey.toObject(message.incoming_circuit_key, options); - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.routerrpc.ResolveHoldForwardAction[message.action] === undefined ? message.action : $root.routerrpc.ResolveHoldForwardAction[message.action] : message.action; - if (message.preimage != null && message.hasOwnProperty("preimage")) - object.preimage = options.bytes === String ? $util.base64.encode(message.preimage, 0, message.preimage.length) : options.bytes === Array ? Array.prototype.slice.call(message.preimage) : message.preimage; - if (message.failure_message != null && message.hasOwnProperty("failure_message")) - object.failure_message = options.bytes === String ? $util.base64.encode(message.failure_message, 0, message.failure_message.length) : options.bytes === Array ? Array.prototype.slice.call(message.failure_message) : message.failure_message; - if (message.failure_code != null && message.hasOwnProperty("failure_code")) - object.failure_code = options.enums === String ? $root.lnrpc.Failure.FailureCode[message.failure_code] === undefined ? message.failure_code : $root.lnrpc.Failure.FailureCode[message.failure_code] : message.failure_code; return object; }; /** - * Converts this ForwardHtlcInterceptResponse to JSON. + * Converts this AddAliasesResponse to JSON. * @function toJSON - * @memberof routerrpc.ForwardHtlcInterceptResponse + * @memberof routerrpc.AddAliasesResponse * @instance * @returns {Object.} JSON object */ - ForwardHtlcInterceptResponse.prototype.toJSON = function toJSON() { + AddAliasesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ForwardHtlcInterceptResponse + * Gets the default type url for AddAliasesResponse * @function getTypeUrl - * @memberof routerrpc.ForwardHtlcInterceptResponse + * @memberof routerrpc.AddAliasesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ForwardHtlcInterceptResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AddAliasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.ForwardHtlcInterceptResponse"; + return typeUrlPrefix + "/routerrpc.AddAliasesResponse"; }; - return ForwardHtlcInterceptResponse; - })(); - - /** - * ResolveHoldForwardAction enum. - * @name routerrpc.ResolveHoldForwardAction - * @enum {number} - * @property {number} SETTLE=0 SETTLE value - * @property {number} FAIL=1 FAIL value - * @property {number} RESUME=2 RESUME value - */ - routerrpc.ResolveHoldForwardAction = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SETTLE"] = 0; - values[valuesById[1] = "FAIL"] = 1; - values[valuesById[2] = "RESUME"] = 2; - return values; + return AddAliasesResponse; })(); - routerrpc.UpdateChanStatusRequest = (function() { + routerrpc.DeleteAliasesRequest = (function() { /** - * Properties of an UpdateChanStatusRequest. + * Properties of a DeleteAliasesRequest. * @memberof routerrpc - * @interface IUpdateChanStatusRequest - * @property {lnrpc.IChannelPoint|null} [chan_point] UpdateChanStatusRequest chan_point - * @property {routerrpc.ChanStatusAction|null} [action] UpdateChanStatusRequest action + * @interface IDeleteAliasesRequest + * @property {Array.|null} [alias_maps] DeleteAliasesRequest alias_maps */ /** - * Constructs a new UpdateChanStatusRequest. + * Constructs a new DeleteAliasesRequest. * @memberof routerrpc - * @classdesc Represents an UpdateChanStatusRequest. - * @implements IUpdateChanStatusRequest + * @classdesc Represents a DeleteAliasesRequest. + * @implements IDeleteAliasesRequest * @constructor - * @param {routerrpc.IUpdateChanStatusRequest=} [properties] Properties to set + * @param {routerrpc.IDeleteAliasesRequest=} [properties] Properties to set */ - function UpdateChanStatusRequest(properties) { + function DeleteAliasesRequest(properties) { + this.alias_maps = []; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -96290,89 +99332,78 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * UpdateChanStatusRequest chan_point. - * @member {lnrpc.IChannelPoint|null|undefined} chan_point - * @memberof routerrpc.UpdateChanStatusRequest - * @instance - */ - UpdateChanStatusRequest.prototype.chan_point = null; - - /** - * UpdateChanStatusRequest action. - * @member {routerrpc.ChanStatusAction} action - * @memberof routerrpc.UpdateChanStatusRequest + * DeleteAliasesRequest alias_maps. + * @member {Array.} alias_maps + * @memberof routerrpc.DeleteAliasesRequest * @instance */ - UpdateChanStatusRequest.prototype.action = 0; + DeleteAliasesRequest.prototype.alias_maps = $util.emptyArray; /** - * Creates a new UpdateChanStatusRequest instance using the specified properties. + * Creates a new DeleteAliasesRequest instance using the specified properties. * @function create - * @memberof routerrpc.UpdateChanStatusRequest + * @memberof routerrpc.DeleteAliasesRequest * @static - * @param {routerrpc.IUpdateChanStatusRequest=} [properties] Properties to set - * @returns {routerrpc.UpdateChanStatusRequest} UpdateChanStatusRequest instance + * @param {routerrpc.IDeleteAliasesRequest=} [properties] Properties to set + * @returns {routerrpc.DeleteAliasesRequest} DeleteAliasesRequest instance */ - UpdateChanStatusRequest.create = function create(properties) { - return new UpdateChanStatusRequest(properties); + DeleteAliasesRequest.create = function create(properties) { + return new DeleteAliasesRequest(properties); }; /** - * Encodes the specified UpdateChanStatusRequest message. Does not implicitly {@link routerrpc.UpdateChanStatusRequest.verify|verify} messages. + * Encodes the specified DeleteAliasesRequest message. Does not implicitly {@link routerrpc.DeleteAliasesRequest.verify|verify} messages. * @function encode - * @memberof routerrpc.UpdateChanStatusRequest + * @memberof routerrpc.DeleteAliasesRequest * @static - * @param {routerrpc.IUpdateChanStatusRequest} message UpdateChanStatusRequest message or plain object to encode + * @param {routerrpc.IDeleteAliasesRequest} message DeleteAliasesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateChanStatusRequest.encode = function encode(message, writer) { + DeleteAliasesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.chan_point != null && Object.hasOwnProperty.call(message, "chan_point")) - $root.lnrpc.ChannelPoint.encode(message.chan_point, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.action); + if (message.alias_maps != null && message.alias_maps.length) + for (let i = 0; i < message.alias_maps.length; ++i) + $root.lnrpc.AliasMap.encode(message.alias_maps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateChanStatusRequest message, length delimited. Does not implicitly {@link routerrpc.UpdateChanStatusRequest.verify|verify} messages. + * Encodes the specified DeleteAliasesRequest message, length delimited. Does not implicitly {@link routerrpc.DeleteAliasesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.UpdateChanStatusRequest + * @memberof routerrpc.DeleteAliasesRequest * @static - * @param {routerrpc.IUpdateChanStatusRequest} message UpdateChanStatusRequest message or plain object to encode + * @param {routerrpc.IDeleteAliasesRequest} message DeleteAliasesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateChanStatusRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteAliasesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateChanStatusRequest message from the specified reader or buffer. + * Decodes a DeleteAliasesRequest message from the specified reader or buffer. * @function decode - * @memberof routerrpc.UpdateChanStatusRequest + * @memberof routerrpc.DeleteAliasesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.UpdateChanStatusRequest} UpdateChanStatusRequest + * @returns {routerrpc.DeleteAliasesRequest} DeleteAliasesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateChanStatusRequest.decode = function decode(reader, length) { + DeleteAliasesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.UpdateChanStatusRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.DeleteAliasesRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.chan_point = $root.lnrpc.ChannelPoint.decode(reader, reader.uint32()); - break; - } - case 2: { - message.action = reader.int32(); + if (!(message.alias_maps && message.alias_maps.length)) + message.alias_maps = []; + message.alias_maps.push($root.lnrpc.AliasMap.decode(reader, reader.uint32())); break; } default: @@ -96384,175 +99415,140 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes an UpdateChanStatusRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteAliasesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.UpdateChanStatusRequest + * @memberof routerrpc.DeleteAliasesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.UpdateChanStatusRequest} UpdateChanStatusRequest + * @returns {routerrpc.DeleteAliasesRequest} DeleteAliasesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateChanStatusRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteAliasesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateChanStatusRequest message. + * Verifies a DeleteAliasesRequest message. * @function verify - * @memberof routerrpc.UpdateChanStatusRequest + * @memberof routerrpc.DeleteAliasesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateChanStatusRequest.verify = function verify(message) { + DeleteAliasesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.chan_point != null && message.hasOwnProperty("chan_point")) { - let error = $root.lnrpc.ChannelPoint.verify(message.chan_point); - if (error) - return "chan_point." + error; - } - if (message.action != null && message.hasOwnProperty("action")) - switch (message.action) { - default: - return "action: enum value expected"; - case 0: - case 1: - case 2: - break; + if (message.alias_maps != null && message.hasOwnProperty("alias_maps")) { + if (!Array.isArray(message.alias_maps)) + return "alias_maps: array expected"; + for (let i = 0; i < message.alias_maps.length; ++i) { + let error = $root.lnrpc.AliasMap.verify(message.alias_maps[i]); + if (error) + return "alias_maps." + error; } + } return null; }; /** - * Creates an UpdateChanStatusRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteAliasesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.UpdateChanStatusRequest + * @memberof routerrpc.DeleteAliasesRequest * @static * @param {Object.} object Plain object - * @returns {routerrpc.UpdateChanStatusRequest} UpdateChanStatusRequest + * @returns {routerrpc.DeleteAliasesRequest} DeleteAliasesRequest */ - UpdateChanStatusRequest.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.UpdateChanStatusRequest) + DeleteAliasesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.DeleteAliasesRequest) return object; - let message = new $root.routerrpc.UpdateChanStatusRequest(); - if (object.chan_point != null) { - if (typeof object.chan_point !== "object") - throw TypeError(".routerrpc.UpdateChanStatusRequest.chan_point: object expected"); - message.chan_point = $root.lnrpc.ChannelPoint.fromObject(object.chan_point); - } - switch (object.action) { - default: - if (typeof object.action === "number") { - message.action = object.action; - break; + let message = new $root.routerrpc.DeleteAliasesRequest(); + if (object.alias_maps) { + if (!Array.isArray(object.alias_maps)) + throw TypeError(".routerrpc.DeleteAliasesRequest.alias_maps: array expected"); + message.alias_maps = []; + for (let i = 0; i < object.alias_maps.length; ++i) { + if (typeof object.alias_maps[i] !== "object") + throw TypeError(".routerrpc.DeleteAliasesRequest.alias_maps: object expected"); + message.alias_maps[i] = $root.lnrpc.AliasMap.fromObject(object.alias_maps[i]); } - break; - case "ENABLE": - case 0: - message.action = 0; - break; - case "DISABLE": - case 1: - message.action = 1; - break; - case "AUTO": - case 2: - message.action = 2; - break; } return message; }; /** - * Creates a plain object from an UpdateChanStatusRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteAliasesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.UpdateChanStatusRequest + * @memberof routerrpc.DeleteAliasesRequest * @static - * @param {routerrpc.UpdateChanStatusRequest} message UpdateChanStatusRequest + * @param {routerrpc.DeleteAliasesRequest} message DeleteAliasesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateChanStatusRequest.toObject = function toObject(message, options) { + DeleteAliasesRequest.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.defaults) { - object.chan_point = null; - object.action = options.enums === String ? "ENABLE" : 0; + if (options.arrays || options.defaults) + object.alias_maps = []; + if (message.alias_maps && message.alias_maps.length) { + object.alias_maps = []; + for (let j = 0; j < message.alias_maps.length; ++j) + object.alias_maps[j] = $root.lnrpc.AliasMap.toObject(message.alias_maps[j], options); } - if (message.chan_point != null && message.hasOwnProperty("chan_point")) - object.chan_point = $root.lnrpc.ChannelPoint.toObject(message.chan_point, options); - if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.routerrpc.ChanStatusAction[message.action] === undefined ? message.action : $root.routerrpc.ChanStatusAction[message.action] : message.action; return object; }; /** - * Converts this UpdateChanStatusRequest to JSON. + * Converts this DeleteAliasesRequest to JSON. * @function toJSON - * @memberof routerrpc.UpdateChanStatusRequest + * @memberof routerrpc.DeleteAliasesRequest * @instance * @returns {Object.} JSON object */ - UpdateChanStatusRequest.prototype.toJSON = function toJSON() { + DeleteAliasesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateChanStatusRequest + * Gets the default type url for DeleteAliasesRequest * @function getTypeUrl - * @memberof routerrpc.UpdateChanStatusRequest + * @memberof routerrpc.DeleteAliasesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateChanStatusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteAliasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.UpdateChanStatusRequest"; + return typeUrlPrefix + "/routerrpc.DeleteAliasesRequest"; }; - return UpdateChanStatusRequest; - })(); - - /** - * ChanStatusAction enum. - * @name routerrpc.ChanStatusAction - * @enum {number} - * @property {number} ENABLE=0 ENABLE value - * @property {number} DISABLE=1 DISABLE value - * @property {number} AUTO=2 AUTO value - */ - routerrpc.ChanStatusAction = (function() { - const valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENABLE"] = 0; - values[valuesById[1] = "DISABLE"] = 1; - values[valuesById[2] = "AUTO"] = 2; - return values; + return DeleteAliasesRequest; })(); - routerrpc.UpdateChanStatusResponse = (function() { + routerrpc.DeleteAliasesResponse = (function() { /** - * Properties of an UpdateChanStatusResponse. + * Properties of a DeleteAliasesResponse. * @memberof routerrpc - * @interface IUpdateChanStatusResponse + * @interface IDeleteAliasesResponse + * @property {Array.|null} [alias_maps] DeleteAliasesResponse alias_maps */ /** - * Constructs a new UpdateChanStatusResponse. + * Constructs a new DeleteAliasesResponse. * @memberof routerrpc - * @classdesc Represents an UpdateChanStatusResponse. - * @implements IUpdateChanStatusResponse + * @classdesc Represents a DeleteAliasesResponse. + * @implements IDeleteAliasesResponse * @constructor - * @param {routerrpc.IUpdateChanStatusResponse=} [properties] Properties to set + * @param {routerrpc.IDeleteAliasesResponse=} [properties] Properties to set */ - function UpdateChanStatusResponse(properties) { + function DeleteAliasesResponse(properties) { + this.alias_maps = []; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -96560,63 +99556,80 @@ export const routerrpc = $root.routerrpc = (() => { } /** - * Creates a new UpdateChanStatusResponse instance using the specified properties. + * DeleteAliasesResponse alias_maps. + * @member {Array.} alias_maps + * @memberof routerrpc.DeleteAliasesResponse + * @instance + */ + DeleteAliasesResponse.prototype.alias_maps = $util.emptyArray; + + /** + * Creates a new DeleteAliasesResponse instance using the specified properties. * @function create - * @memberof routerrpc.UpdateChanStatusResponse + * @memberof routerrpc.DeleteAliasesResponse * @static - * @param {routerrpc.IUpdateChanStatusResponse=} [properties] Properties to set - * @returns {routerrpc.UpdateChanStatusResponse} UpdateChanStatusResponse instance + * @param {routerrpc.IDeleteAliasesResponse=} [properties] Properties to set + * @returns {routerrpc.DeleteAliasesResponse} DeleteAliasesResponse instance */ - UpdateChanStatusResponse.create = function create(properties) { - return new UpdateChanStatusResponse(properties); + DeleteAliasesResponse.create = function create(properties) { + return new DeleteAliasesResponse(properties); }; /** - * Encodes the specified UpdateChanStatusResponse message. Does not implicitly {@link routerrpc.UpdateChanStatusResponse.verify|verify} messages. + * Encodes the specified DeleteAliasesResponse message. Does not implicitly {@link routerrpc.DeleteAliasesResponse.verify|verify} messages. * @function encode - * @memberof routerrpc.UpdateChanStatusResponse + * @memberof routerrpc.DeleteAliasesResponse * @static - * @param {routerrpc.IUpdateChanStatusResponse} message UpdateChanStatusResponse message or plain object to encode + * @param {routerrpc.IDeleteAliasesResponse} message DeleteAliasesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateChanStatusResponse.encode = function encode(message, writer) { + DeleteAliasesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.alias_maps != null && message.alias_maps.length) + for (let i = 0; i < message.alias_maps.length; ++i) + $root.lnrpc.AliasMap.encode(message.alias_maps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateChanStatusResponse message, length delimited. Does not implicitly {@link routerrpc.UpdateChanStatusResponse.verify|verify} messages. + * Encodes the specified DeleteAliasesResponse message, length delimited. Does not implicitly {@link routerrpc.DeleteAliasesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof routerrpc.UpdateChanStatusResponse + * @memberof routerrpc.DeleteAliasesResponse * @static - * @param {routerrpc.IUpdateChanStatusResponse} message UpdateChanStatusResponse message or plain object to encode + * @param {routerrpc.IDeleteAliasesResponse} message DeleteAliasesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateChanStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { + DeleteAliasesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateChanStatusResponse message from the specified reader or buffer. + * Decodes a DeleteAliasesResponse message from the specified reader or buffer. * @function decode - * @memberof routerrpc.UpdateChanStatusResponse + * @memberof routerrpc.DeleteAliasesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {routerrpc.UpdateChanStatusResponse} UpdateChanStatusResponse + * @returns {routerrpc.DeleteAliasesResponse} DeleteAliasesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateChanStatusResponse.decode = function decode(reader, length) { + DeleteAliasesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.UpdateChanStatusResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.DeleteAliasesResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + if (!(message.alias_maps && message.alias_maps.length)) + message.alias_maps = []; + message.alias_maps.push($root.lnrpc.AliasMap.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -96626,89 +99639,119 @@ export const routerrpc = $root.routerrpc = (() => { }; /** - * Decodes an UpdateChanStatusResponse message from the specified reader or buffer, length delimited. + * Decodes a DeleteAliasesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof routerrpc.UpdateChanStatusResponse + * @memberof routerrpc.DeleteAliasesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {routerrpc.UpdateChanStatusResponse} UpdateChanStatusResponse + * @returns {routerrpc.DeleteAliasesResponse} DeleteAliasesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateChanStatusResponse.decodeDelimited = function decodeDelimited(reader) { + DeleteAliasesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateChanStatusResponse message. + * Verifies a DeleteAliasesResponse message. * @function verify - * @memberof routerrpc.UpdateChanStatusResponse + * @memberof routerrpc.DeleteAliasesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateChanStatusResponse.verify = function verify(message) { + DeleteAliasesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.alias_maps != null && message.hasOwnProperty("alias_maps")) { + if (!Array.isArray(message.alias_maps)) + return "alias_maps: array expected"; + for (let i = 0; i < message.alias_maps.length; ++i) { + let error = $root.lnrpc.AliasMap.verify(message.alias_maps[i]); + if (error) + return "alias_maps." + error; + } + } return null; }; /** - * Creates an UpdateChanStatusResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteAliasesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof routerrpc.UpdateChanStatusResponse + * @memberof routerrpc.DeleteAliasesResponse * @static * @param {Object.} object Plain object - * @returns {routerrpc.UpdateChanStatusResponse} UpdateChanStatusResponse + * @returns {routerrpc.DeleteAliasesResponse} DeleteAliasesResponse */ - UpdateChanStatusResponse.fromObject = function fromObject(object) { - if (object instanceof $root.routerrpc.UpdateChanStatusResponse) + DeleteAliasesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.routerrpc.DeleteAliasesResponse) return object; - return new $root.routerrpc.UpdateChanStatusResponse(); + let message = new $root.routerrpc.DeleteAliasesResponse(); + if (object.alias_maps) { + if (!Array.isArray(object.alias_maps)) + throw TypeError(".routerrpc.DeleteAliasesResponse.alias_maps: array expected"); + message.alias_maps = []; + for (let i = 0; i < object.alias_maps.length; ++i) { + if (typeof object.alias_maps[i] !== "object") + throw TypeError(".routerrpc.DeleteAliasesResponse.alias_maps: object expected"); + message.alias_maps[i] = $root.lnrpc.AliasMap.fromObject(object.alias_maps[i]); + } + } + return message; }; /** - * Creates a plain object from an UpdateChanStatusResponse message. Also converts values to other types if specified. + * Creates a plain object from a DeleteAliasesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof routerrpc.UpdateChanStatusResponse + * @memberof routerrpc.DeleteAliasesResponse * @static - * @param {routerrpc.UpdateChanStatusResponse} message UpdateChanStatusResponse + * @param {routerrpc.DeleteAliasesResponse} message DeleteAliasesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateChanStatusResponse.toObject = function toObject() { - return {}; + DeleteAliasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.alias_maps = []; + if (message.alias_maps && message.alias_maps.length) { + object.alias_maps = []; + for (let j = 0; j < message.alias_maps.length; ++j) + object.alias_maps[j] = $root.lnrpc.AliasMap.toObject(message.alias_maps[j], options); + } + return object; }; /** - * Converts this UpdateChanStatusResponse to JSON. + * Converts this DeleteAliasesResponse to JSON. * @function toJSON - * @memberof routerrpc.UpdateChanStatusResponse + * @memberof routerrpc.DeleteAliasesResponse * @instance * @returns {Object.} JSON object */ - UpdateChanStatusResponse.prototype.toJSON = function toJSON() { + DeleteAliasesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateChanStatusResponse + * Gets the default type url for DeleteAliasesResponse * @function getTypeUrl - * @memberof routerrpc.UpdateChanStatusResponse + * @memberof routerrpc.DeleteAliasesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateChanStatusResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteAliasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/routerrpc.UpdateChanStatusResponse"; + return typeUrlPrefix + "/routerrpc.DeleteAliasesResponse"; }; - return UpdateChanStatusResponse; + return DeleteAliasesResponse; })(); return routerrpc; @@ -115602,6 +118645,7 @@ export const walletrpc = $root.walletrpc = (() => { * @memberof walletrpc * @interface IEstimateFeeResponse * @property {Long|null} [sat_per_kw] EstimateFeeResponse sat_per_kw + * @property {Long|null} [min_relay_fee_sat_per_kw] EstimateFeeResponse min_relay_fee_sat_per_kw */ /** @@ -115627,6 +118671,14 @@ export const walletrpc = $root.walletrpc = (() => { */ EstimateFeeResponse.prototype.sat_per_kw = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * EstimateFeeResponse min_relay_fee_sat_per_kw. + * @member {Long} min_relay_fee_sat_per_kw + * @memberof walletrpc.EstimateFeeResponse + * @instance + */ + EstimateFeeResponse.prototype.min_relay_fee_sat_per_kw = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** * Creates a new EstimateFeeResponse instance using the specified properties. * @function create @@ -115653,6 +118705,8 @@ export const walletrpc = $root.walletrpc = (() => { writer = $Writer.create(); if (message.sat_per_kw != null && Object.hasOwnProperty.call(message, "sat_per_kw")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.sat_per_kw); + if (message.min_relay_fee_sat_per_kw != null && Object.hasOwnProperty.call(message, "min_relay_fee_sat_per_kw")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.min_relay_fee_sat_per_kw); return writer; }; @@ -115691,6 +118745,10 @@ export const walletrpc = $root.walletrpc = (() => { message.sat_per_kw = reader.int64(); break; } + case 2: { + message.min_relay_fee_sat_per_kw = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -115729,6 +118787,9 @@ export const walletrpc = $root.walletrpc = (() => { if (message.sat_per_kw != null && message.hasOwnProperty("sat_per_kw")) if (!$util.isInteger(message.sat_per_kw) && !(message.sat_per_kw && $util.isInteger(message.sat_per_kw.low) && $util.isInteger(message.sat_per_kw.high))) return "sat_per_kw: integer|Long expected"; + if (message.min_relay_fee_sat_per_kw != null && message.hasOwnProperty("min_relay_fee_sat_per_kw")) + if (!$util.isInteger(message.min_relay_fee_sat_per_kw) && !(message.min_relay_fee_sat_per_kw && $util.isInteger(message.min_relay_fee_sat_per_kw.low) && $util.isInteger(message.min_relay_fee_sat_per_kw.high))) + return "min_relay_fee_sat_per_kw: integer|Long expected"; return null; }; @@ -115753,6 +118814,15 @@ export const walletrpc = $root.walletrpc = (() => { message.sat_per_kw = object.sat_per_kw; else if (typeof object.sat_per_kw === "object") message.sat_per_kw = new $util.LongBits(object.sat_per_kw.low >>> 0, object.sat_per_kw.high >>> 0).toNumber(); + if (object.min_relay_fee_sat_per_kw != null) + if ($util.Long) + (message.min_relay_fee_sat_per_kw = $util.Long.fromValue(object.min_relay_fee_sat_per_kw)).unsigned = false; + else if (typeof object.min_relay_fee_sat_per_kw === "string") + message.min_relay_fee_sat_per_kw = parseInt(object.min_relay_fee_sat_per_kw, 10); + else if (typeof object.min_relay_fee_sat_per_kw === "number") + message.min_relay_fee_sat_per_kw = object.min_relay_fee_sat_per_kw; + else if (typeof object.min_relay_fee_sat_per_kw === "object") + message.min_relay_fee_sat_per_kw = new $util.LongBits(object.min_relay_fee_sat_per_kw.low >>> 0, object.min_relay_fee_sat_per_kw.high >>> 0).toNumber(); return message; }; @@ -115769,17 +118839,28 @@ export const walletrpc = $root.walletrpc = (() => { if (!options) options = {}; let object = {}; - if (options.defaults) + if (options.defaults) { if ($util.Long) { let long = new $util.Long(0, 0, false); object.sat_per_kw = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.sat_per_kw = options.longs === String ? "0" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.min_relay_fee_sat_per_kw = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.min_relay_fee_sat_per_kw = options.longs === String ? "0" : 0; + } if (message.sat_per_kw != null && message.hasOwnProperty("sat_per_kw")) if (typeof message.sat_per_kw === "number") object.sat_per_kw = options.longs === String ? String(message.sat_per_kw) : message.sat_per_kw; else object.sat_per_kw = options.longs === String ? $util.Long.prototype.toString.call(message.sat_per_kw) : options.longs === Number ? new $util.LongBits(message.sat_per_kw.low >>> 0, message.sat_per_kw.high >>> 0).toNumber() : message.sat_per_kw; + if (message.min_relay_fee_sat_per_kw != null && message.hasOwnProperty("min_relay_fee_sat_per_kw")) + if (typeof message.min_relay_fee_sat_per_kw === "number") + object.min_relay_fee_sat_per_kw = options.longs === String ? String(message.min_relay_fee_sat_per_kw) : message.min_relay_fee_sat_per_kw; + else + object.min_relay_fee_sat_per_kw = options.longs === String ? $util.Long.prototype.toString.call(message.min_relay_fee_sat_per_kw) : options.longs === Number ? new $util.LongBits(message.min_relay_fee_sat_per_kw.low >>> 0, message.min_relay_fee_sat_per_kw.high >>> 0).toNumber() : message.min_relay_fee_sat_per_kw; return object; }; diff --git a/proto/lightning.proto b/proto/lightning.proto index 4c391ad53..409564e53 100644 --- a/proto/lightning.proto +++ b/proto/lightning.proto @@ -1388,8 +1388,14 @@ enum CommitmentType { A channel that uses musig2 for the funding output, and the new tapscript features where relevant. */ - // TODO(roasbeef): need script enforce mirror type for the above as well? SIMPLE_TAPROOT = 5; + + /* + Identical to the SIMPLE_TAPROOT channel type, but with extra functionality. + This channel type also commits to additional meta data in the tapscript + leaves for the scripts in a channel. + */ + SIMPLE_TAPROOT_OVERLAY = 6; } message ChannelConstraints { @@ -1592,6 +1598,11 @@ message Channel { the channel's operation. */ string memo = 36; + + /* + Custom channel data that might be populated in custom channels. + */ + bytes custom_channel_data = 37; } message ListChannelsRequest { @@ -2028,10 +2039,38 @@ message ChannelOpenUpdate { ChannelPoint channel_point = 1; } +message CloseOutput { + // The amount in satoshi of this close output. This amount is the final + // commitment balance of the channel and the actual amount paid out on chain + // might be smaller due to subtracted fees. + int64 amount_sat = 1; + + // The pkScript of the close output. + bytes pk_script = 2; + + // Whether this output is for the local or remote node. + bool is_local = 3; + + // The TLV encoded custom channel data records for this output, which might + // be set for custom channels. + bytes custom_channel_data = 4; +} + message ChannelCloseUpdate { bytes closing_txid = 1; bool success = 2; + + // The local channel close output. If the local channel balance was dust to + // begin with, this output will not be set. + CloseOutput local_close_output = 3; + + // The remote channel close output. If the remote channel balance was dust + // to begin with, this output will not be set. + CloseOutput remote_close_output = 4; + + // Any additional outputs that might be added for custom channel types. + repeated CloseOutput additional_outputs = 5; } message CloseChannelRequest { @@ -2709,6 +2748,11 @@ message PendingChannelsResponse { impacts the channel's operation. */ string memo = 13; + + /* + Custom channel data that might be populated in custom channels. + */ + bytes custom_channel_data = 34; } message PendingOpenChannel { @@ -2968,6 +3012,12 @@ message ChannelBalanceResponse { // Sum of channels pending remote balances. Amount pending_open_remote_balance = 8; + + /* + Custom channel data that might be populated if there are custom channels + present. + */ + bytes custom_channel_data = 9; } message QueryRoutesRequest { @@ -3293,6 +3343,20 @@ message Route { The total amount in millisatoshis. */ int64 total_amt_msat = 6; + + /* + The actual on-chain amount that was sent out to the first hop. This value is + only different from the total_amt_msat field if this is a custom channel + payment and the value transported in the HTLC is different from the BTC + amount in the HTLC. If this value is zero, then this is an old payment that + didn't have this value yet and can be ignored. + */ + int64 first_hop_amount_msat = 7; + + /* + Custom channel data that might be populated in custom channels. + */ + bytes custom_channel_data = 8; } message NodeInfoRequest { @@ -3927,6 +3991,11 @@ message InvoiceHTLC { // Details relevant to AMP HTLCs, only populated if this is an AMP HTLC. AMP amp = 11; + + /* + Custom channel data that might be populated in custom channels. + */ + bytes custom_channel_data = 12; } // Details specific to AMP HTLCs. @@ -4167,6 +4236,12 @@ message Payment { uint64 payment_index = 15; PaymentFailureReason failure_reason = 16; + + /* + The custom TLV records that were sent to the first hop as part of the HTLC + wire message for this payment. + */ + map first_hop_custom_records = 17; } message HTLCAttempt { diff --git a/proto/routerrpc/router.proto b/proto/routerrpc/router.proto index a90982880..92da75192 100644 --- a/proto/routerrpc/router.proto +++ b/proto/routerrpc/router.proto @@ -176,6 +176,25 @@ service Router { */ rpc UpdateChanStatus (UpdateChanStatusRequest) returns (UpdateChanStatusResponse); + + /* + XAddLocalChanAliases is an experimental API that creates a set of new + channel SCID alias mappings. The final total set of aliases in the manager + after the add operation is returned. This is only a locally stored alias, + and will not be communicated to the channel peer via any message. Therefore, + routing over such an alias will only work if the peer also calls this same + RPC on their end. If an alias already exists, an error is returned + */ + rpc XAddLocalChanAliases (AddAliasesRequest) returns (AddAliasesResponse); + + /* + XDeleteLocalChanAliases is an experimental API that deletes a set of alias + mappings. The final total set of aliases in the manager after the delete + operation is returned. The deletion will not be communicated to the channel + peer via any message. + */ + rpc XDeleteLocalChanAliases (DeleteAliasesRequest) + returns (DeleteAliasesResponse); } message SendPaymentRequest { @@ -330,6 +349,24 @@ message SendPaymentRequest { only, to 1 to optimize for reliability only or a value inbetween for a mix. */ double time_pref = 23; + + /* + If set, the payment loop can be interrupted by manually canceling the + payment context, even before the payment timeout is reached. Note that the + payment may still succeed after cancellation, as in-flight attempts can + still settle afterwards. Canceling will only prevent further attempts from + being sent. + */ + bool cancelable = 24; + + /* + An optional field that can be used to pass an arbitrary set of TLV records + to the first hop peer of this payment. This can be used to pass application + specific data during the payment attempt. Record types are required to be in + the custom range >= 65536. When using REST, the values must be encoded as + base64. + */ + map first_hop_custom_records = 25; } message TrackPaymentRequest { @@ -423,6 +460,15 @@ message SendToRouteRequest { routes, incorrect payment details, or insufficient funds. */ bool skip_temp_err = 3; + + /* + An optional field that can be used to pass an arbitrary set of TLV records + to the first hop peer of this payment. This can be used to pass application + specific data during the payment attempt. Record types are required to be in + the custom range >= 65536. When using REST, the values must be encoded as + base64. + */ + map first_hop_custom_records = 4; } message SendToRouteResponse { @@ -698,6 +744,15 @@ message BuildRouteRequest { This is also called payment secret in specifications (e.g. BOLT 11). */ bytes payment_addr = 5; + + /* + An optional field that can be used to pass an arbitrary set of TLV records + to the first hop peer of this payment. This can be used to pass application + specific data during the payment attempt. Record types are required to be in + the custom range >= 65536. When using REST, the values must be encoded as + base64. + */ + map first_hop_custom_records = 6; } message BuildRouteResponse { @@ -954,12 +1009,17 @@ message ForwardHtlcInterceptRequest { // The block height at which this htlc will be auto-failed to prevent the // channel from force-closing. int32 auto_fail_height = 10; + + // The custom records of the peer's incoming p2p wire message. + map in_wire_custom_records = 11; } /** ForwardHtlcInterceptResponse enables the caller to resolve a previously hold forward. The caller can choose either to: - `Resume`: Execute the default behavior (usually forward). +- `ResumeModified`: Execute the default behavior (usually forward) with HTLC + field modifications. - `Reject`: Fail the htlc backwards. - `Settle`: Settle this htlc with a given preimage. */ @@ -990,12 +1050,36 @@ message ForwardHtlcInterceptResponse { // For backwards-compatibility reasons, TEMPORARY_CHANNEL_FAILURE is the // default value for this field. lnrpc.Failure.FailureCode failure_code = 5; + + // The amount that was set on the p2p wire message of the incoming HTLC. + // This field is ignored if the action is not RESUME_MODIFIED or the amount + // is zero. + uint64 in_amount_msat = 6; + + // The amount to set on the p2p wire message of the resumed HTLC. This field + // is ignored if the action is not RESUME_MODIFIED or the amount is zero. + uint64 out_amount_msat = 7; + + // Any custom records that should be set on the p2p wire message message of + // the resumed HTLC. This field is ignored if the action is not + // RESUME_MODIFIED. + map out_wire_custom_records = 8; } enum ResolveHoldForwardAction { + // SETTLE is an action that is used to settle an HTLC instead of forwarding + // it. SETTLE = 0; + + // FAIL is an action that is used to fail an HTLC backwards. FAIL = 1; + + // RESUME is an action that is used to resume a forward HTLC. RESUME = 2; + + // RESUME_MODIFIED is an action that is used to resume a hold forward HTLC + // with modifications specified during interception. + RESUME_MODIFIED = 3; } message UpdateChanStatusRequest { @@ -1012,3 +1096,19 @@ enum ChanStatusAction { message UpdateChanStatusResponse { } + +message AddAliasesRequest { + repeated lnrpc.AliasMap alias_maps = 1; +} + +message AddAliasesResponse { + repeated lnrpc.AliasMap alias_maps = 1; +} + +message DeleteAliasesRequest { + repeated lnrpc.AliasMap alias_maps = 1; +} + +message DeleteAliasesResponse { + repeated lnrpc.AliasMap alias_maps = 1; +} \ No newline at end of file diff --git a/proto/walletrpc/walletkit.proto b/proto/walletrpc/walletkit.proto index 8d9529bb8..513e4f8ee 100644 --- a/proto/walletrpc/walletkit.proto +++ b/proto/walletrpc/walletkit.proto @@ -854,6 +854,9 @@ message EstimateFeeResponse { confirmation target in the request. */ int64 sat_per_kw = 1; + + // The current minimum relay fee based on our chain backend in sat/kw. + int64 min_relay_fee_sat_per_kw = 2; } enum WitnessType { diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/invoicesrpc/invoices.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/invoicesrpc/invoices.ts index f326b4f71..61d2fa290 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/invoicesrpc/invoices.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/invoicesrpc/invoices.ts @@ -121,6 +121,57 @@ export interface LookupInvoiceMsg { lookupModifier: LookupModifier; } +/** CircuitKey is a unique identifier for an HTLC. */ +export interface CircuitKey { + /** The id of the channel that the is part of this circuit. */ + chanId: string; + /** The index of the incoming htlc in the incoming channel. */ + htlcId: string; +} + +export interface HtlcModifyRequest { + /** + * The invoice the intercepted HTLC is attempting to settle. The HTLCs in + * the invoice are only HTLCs that have already been accepted or settled, + * not including the current intercepted HTLC. + */ + invoice: Invoice | undefined; + /** The unique identifier of the HTLC of this intercepted HTLC. */ + exitHtlcCircuitKey: CircuitKey | undefined; + /** The amount in milli-satoshi that the exit HTLC is attempting to pay. */ + exitHtlcAmt: string; + /** The absolute expiry height of the exit HTLC. */ + exitHtlcExpiry: number; + /** The current block height. */ + currentHeight: number; + /** The wire message custom records of the exit HTLC. */ + exitHtlcWireCustomRecords: { [key: string]: Uint8Array | string }; +} + +export interface HtlcModifyRequest_ExitHtlcWireCustomRecordsEntry { + key: string; + value: Uint8Array | string; +} + +export interface HtlcModifyResponse { + /** The circuit key of the HTLC that the client wants to modify. */ + circuitKey: CircuitKey | undefined; + /** + * The modified amount in milli-satoshi that the exit HTLC is paying. This + * value can be different from the actual on-chain HTLC amount, in case the + * HTLC carries other valuable items, as can be the case with custom channel + * types. + */ + amtPaid?: string | undefined; + /** + * This flag indicates whether the HTLCs associated with the invoices should + * be cancelled. The interceptor client may set this field if some + * unexpected behavior is encountered. Setting this will ignore the amt_paid + * field. + */ + cancelSet: boolean; +} + /** * Invoices is a service that can be used to create, accept, settle and cancel * invoices. @@ -162,10 +213,21 @@ export interface Invoices { request?: DeepPartial ): Promise; /** - * LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced + * LookupInvoiceV2 attempts to look up at invoice. An invoice can be referenced * using either its payment hash, payment address, or set ID. */ lookupInvoiceV2(request?: DeepPartial): Promise; + /** + * HtlcModifier is a bidirectional streaming RPC that allows a client to + * intercept and modify the HTLCs that attempt to settle the given invoice. The + * server will send HTLCs of invoices to the client and the client can modify + * some aspects of the HTLC in order to pass the invoice acceptance tests. + */ + htlcModifier( + request?: DeepPartial, + onMessage?: (msg: HtlcModifyRequest) => void, + onError?: (err: Error) => void + ): void; } type Builtin = diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/lightning.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/lightning.ts index e777b5147..de8a03c7a 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/lightning.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/lightning.ts @@ -73,8 +73,17 @@ export enum CommitmentType { * channel before its maturity date. */ SCRIPT_ENFORCED_LEASE = 'SCRIPT_ENFORCED_LEASE', - /** SIMPLE_TAPROOT - TODO(roasbeef): need script enforce mirror type for the above as well? */ + /** + * SIMPLE_TAPROOT - A channel that uses musig2 for the funding output, and the new tapscript + * features where relevant. + */ SIMPLE_TAPROOT = 'SIMPLE_TAPROOT', + /** + * SIMPLE_TAPROOT_OVERLAY - Identical to the SIMPLE_TAPROOT channel type, but with extra functionality. + * This channel type also commits to additional meta data in the tapscript + * leaves for the scripts in a channel. + */ + SIMPLE_TAPROOT_OVERLAY = 'SIMPLE_TAPROOT_OVERLAY', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -1030,6 +1039,8 @@ export interface Channel { * the channel's operation. */ memo: string; + /** Custom channel data that might be populated in custom channels. */ + customChannelData: Uint8Array | string; } export interface ListChannelsRequest { @@ -1359,9 +1370,39 @@ export interface ChannelOpenUpdate { channelPoint: ChannelPoint | undefined; } +export interface CloseOutput { + /** + * The amount in satoshi of this close output. This amount is the final + * commitment balance of the channel and the actual amount paid out on chain + * might be smaller due to subtracted fees. + */ + amountSat: string; + /** The pkScript of the close output. */ + pkScript: Uint8Array | string; + /** Whether this output is for the local or remote node. */ + isLocal: boolean; + /** + * The TLV encoded custom channel data records for this output, which might + * be set for custom channels. + */ + customChannelData: Uint8Array | string; +} + export interface ChannelCloseUpdate { closingTxid: Uint8Array | string; success: boolean; + /** + * The local channel close output. If the local channel balance was dust to + * begin with, this output will not be set. + */ + localCloseOutput: CloseOutput | undefined; + /** + * The remote channel close output. If the remote channel balance was dust + * to begin with, this output will not be set. + */ + remoteCloseOutput: CloseOutput | undefined; + /** Any additional outputs that might be added for custom channel types. */ + additionalOutputs: CloseOutput[]; } export interface CloseChannelRequest { @@ -1994,6 +2035,8 @@ export interface PendingChannelsResponse_PendingChannel { * impacts the channel's operation. */ memo: string; + /** Custom channel data that might be populated in custom channels. */ + customChannelData: Uint8Array | string; } export interface PendingChannelsResponse_PendingOpenChannel { @@ -2215,6 +2258,11 @@ export interface ChannelBalanceResponse { pendingOpenLocalBalance: Amount | undefined; /** Sum of channels pending remote balances. */ pendingOpenRemoteBalance: Amount | undefined; + /** + * Custom channel data that might be populated if there are custom channels + * present. + */ + customChannelData: Uint8Array | string; } export interface QueryRoutesRequest { @@ -2510,6 +2558,16 @@ export interface Route { totalFeesMsat: string; /** The total amount in millisatoshis. */ totalAmtMsat: string; + /** + * The actual on-chain amount that was sent out to the first hop. This value is + * only different from the total_amt_msat field if this is a custom channel + * payment and the value transported in the HTLC is different from the BTC + * amount in the HTLC. If this value is zero, then this is an old payment that + * didn't have this value yet and can be ignored. + */ + firstHopAmountMsat: string; + /** Custom channel data that might be populated in custom channels. */ + customChannelData: Uint8Array | string; } export interface NodeInfoRequest { @@ -3093,6 +3151,8 @@ export interface InvoiceHTLC { mppTotalAmtMsat: string; /** Details relevant to AMP HTLCs, only populated if this is an AMP HTLC. */ amp: AMP | undefined; + /** Custom channel data that might be populated in custom channels. */ + customChannelData: Uint8Array | string; } export interface InvoiceHTLC_CustomRecordsEntry { @@ -3275,6 +3335,11 @@ export interface Payment { */ paymentIndex: string; failureReason: PaymentFailureReason; + /** + * The custom TLV records that were sent to the first hop as part of the HTLC + * wire message for this payment. + */ + firstHopCustomRecords: { [key: string]: Uint8Array | string }; } export enum Payment_PaymentStatus { @@ -3295,6 +3360,11 @@ export enum Payment_PaymentStatus { UNRECOGNIZED = 'UNRECOGNIZED' } +export interface Payment_FirstHopCustomRecordsEntry { + key: string; + value: Uint8Array | string; +} + export interface HTLCAttempt { /** The unique ID that is used for this attempt. */ attemptId: string; diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/routerrpc/router.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/routerrpc/router.ts index d07488cdb..9a1be5629 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/routerrpc/router.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/lnd/routerrpc/router.ts @@ -8,6 +8,7 @@ import type { Failure, HTLCAttempt, ChannelPoint, + AliasMap, Payment } from '../lightning'; @@ -63,9 +64,20 @@ export enum PaymentState { } export enum ResolveHoldForwardAction { + /** + * SETTLE - SETTLE is an action that is used to settle an HTLC instead of forwarding + * it. + */ SETTLE = 'SETTLE', + /** FAIL - FAIL is an action that is used to fail an HTLC backwards. */ FAIL = 'FAIL', + /** RESUME - RESUME is an action that is used to resume a forward HTLC. */ RESUME = 'RESUME', + /** + * RESUME_MODIFIED - RESUME_MODIFIED is an action that is used to resume a hold forward HTLC + * with modifications specified during interception. + */ + RESUME_MODIFIED = 'RESUME_MODIFIED', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -210,6 +222,14 @@ export interface SendPaymentRequest { * being sent. */ cancelable: boolean; + /** + * An optional field that can be used to pass an arbitrary set of TLV records + * to the first hop peer of this payment. This can be used to pass application + * specific data during the payment attempt. Record types are required to be in + * the custom range >= 65536. When using REST, the values must be encoded as + * base64. + */ + firstHopCustomRecords: { [key: string]: Uint8Array | string }; } export interface SendPaymentRequest_DestCustomRecordsEntry { @@ -217,6 +237,11 @@ export interface SendPaymentRequest_DestCustomRecordsEntry { value: Uint8Array | string; } +export interface SendPaymentRequest_FirstHopCustomRecordsEntry { + key: string; + value: Uint8Array | string; +} + export interface TrackPaymentRequest { /** The hash of the payment to look up. */ paymentHash: Uint8Array | string; @@ -300,6 +325,19 @@ export interface SendToRouteRequest { * routes, incorrect payment details, or insufficient funds. */ skipTempErr: boolean; + /** + * An optional field that can be used to pass an arbitrary set of TLV records + * to the first hop peer of this payment. This can be used to pass application + * specific data during the payment attempt. Record types are required to be in + * the custom range >= 65536. When using REST, the values must be encoded as + * base64. + */ + firstHopCustomRecords: { [key: string]: Uint8Array | string }; +} + +export interface SendToRouteRequest_FirstHopCustomRecordsEntry { + key: string; + value: Uint8Array | string; } export interface SendToRouteResponse { @@ -536,6 +574,19 @@ export interface BuildRouteRequest { * This is also called payment secret in specifications (e.g. BOLT 11). */ paymentAddr: Uint8Array | string; + /** + * An optional field that can be used to pass an arbitrary set of TLV records + * to the first hop peer of this payment. This can be used to pass application + * specific data during the payment attempt. Record types are required to be in + * the custom range >= 65536. When using REST, the values must be encoded as + * base64. + */ + firstHopCustomRecords: { [key: string]: Uint8Array | string }; +} + +export interface BuildRouteRequest_FirstHopCustomRecordsEntry { + key: string; + value: Uint8Array | string; } export interface BuildRouteResponse { @@ -693,6 +744,8 @@ export interface ForwardHtlcInterceptRequest { * channel from force-closing. */ autoFailHeight: number; + /** The custom records of the peer's incoming p2p wire message. */ + inWireCustomRecords: { [key: string]: Uint8Array | string }; } export interface ForwardHtlcInterceptRequest_CustomRecordsEntry { @@ -700,10 +753,17 @@ export interface ForwardHtlcInterceptRequest_CustomRecordsEntry { value: Uint8Array | string; } +export interface ForwardHtlcInterceptRequest_InWireCustomRecordsEntry { + key: string; + value: Uint8Array | string; +} + /** * ForwardHtlcInterceptResponse enables the caller to resolve a previously hold * forward. The caller can choose either to: * - `Resume`: Execute the default behavior (usually forward). + * - `ResumeModified`: Execute the default behavior (usually forward) with HTLC + * field modifications. * - `Reject`: Fail the htlc backwards. * - `Settle`: Settle this htlc with a given preimage. */ @@ -734,6 +794,28 @@ export interface ForwardHtlcInterceptResponse { * default value for this field. */ failureCode: Failure_FailureCode; + /** + * The amount that was set on the p2p wire message of the incoming HTLC. + * This field is ignored if the action is not RESUME_MODIFIED or the amount + * is zero. + */ + inAmountMsat: string; + /** + * The amount to set on the p2p wire message of the resumed HTLC. This field + * is ignored if the action is not RESUME_MODIFIED or the amount is zero. + */ + outAmountMsat: string; + /** + * Any custom records that should be set on the p2p wire message message of + * the resumed HTLC. This field is ignored if the action is not + * RESUME_MODIFIED. + */ + outWireCustomRecords: { [key: string]: Uint8Array | string }; +} + +export interface ForwardHtlcInterceptResponse_OutWireCustomRecordsEntry { + key: string; + value: Uint8Array | string; } export interface UpdateChanStatusRequest { @@ -743,6 +825,22 @@ export interface UpdateChanStatusRequest { export interface UpdateChanStatusResponse {} +export interface AddAliasesRequest { + aliasMaps: AliasMap[]; +} + +export interface AddAliasesResponse { + aliasMaps: AliasMap[]; +} + +export interface DeleteAliasesRequest { + aliasMaps: AliasMap[]; +} + +export interface DeleteAliasesResponse { + aliasMaps: AliasMap[]; +} + /** * Router is a service that offers advanced interaction with the router * subsystem of the daemon. @@ -930,6 +1028,26 @@ export interface Router { updateChanStatus( request?: DeepPartial ): Promise; + /** + * XAddLocalChanAliases is an experimental API that creates a set of new + * channel SCID alias mappings. The final total set of aliases in the manager + * after the add operation is returned. This is only a locally stored alias, + * and will not be communicated to the channel peer via any message. Therefore, + * routing over such an alias will only work if the peer also calls this same + * RPC on their end. If an alias already exists, an error is returned + */ + xAddLocalChanAliases( + request?: DeepPartial + ): Promise; + /** + * XDeleteLocalChanAliases is an experimental API that deletes a set of alias + * mappings. The final total set of aliases in the manager after the delete + * operation is returned. The deletion will not be communicated to the channel + * peer via any message. + */ + xDeleteLocalChanAliases( + request?: DeepPartial + ): Promise; } type Builtin = diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/loop/client.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/loop/client.ts index 8d6838c60..11e4edf0d 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/loop/client.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/loop/client.ts @@ -185,6 +185,89 @@ export enum AutoReason { UNRECOGNIZED = 'UNRECOGNIZED' } +export enum DepositState { + /** UNKNOWN_STATE - UNKNOWN_STATE is the default state of a deposit. */ + UNKNOWN_STATE = 'UNKNOWN_STATE', + /** + * DEPOSITED - DEPOSITED indicates that the deposit has been sufficiently confirmed on + * chain. + */ + DEPOSITED = 'DEPOSITED', + /** + * WITHDRAWING - WITHDRAWING indicates that the deposit is currently being withdrawn. It + * flips to WITHDRAWN once the withdrawal transaction has been sufficiently + * confirmed. + */ + WITHDRAWING = 'WITHDRAWING', + /** WITHDRAWN - WITHDRAWN indicates that the deposit has been withdrawn. */ + WITHDRAWN = 'WITHDRAWN', + /** + * LOOPING_IN - LOOPING_IN indicates that the deposit is currently being used in a static + * address loop-in swap. + */ + LOOPING_IN = 'LOOPING_IN', + /** + * LOOPED_IN - LOOPED_IN indicates that the deposit was used in a static address loop-in + * swap. + */ + LOOPED_IN = 'LOOPED_IN', + /** + * SWEEP_HTLC_TIMEOUT - SWEEP_HTLC_TIMEOUT indicates that the deposit is part of an active loop-in + * of which the respective htlc was published by the server and the timeout + * path has opened up for the client to sweep. + */ + SWEEP_HTLC_TIMEOUT = 'SWEEP_HTLC_TIMEOUT', + /** + * HTLC_TIMEOUT_SWEPT - HTLC_TIMEOUT_SWEPT indicates that the timeout path of the htlc has been + * swept by the client. + */ + HTLC_TIMEOUT_SWEPT = 'HTLC_TIMEOUT_SWEPT', + /** + * PUBLISH_EXPIRED - PUBLISH_EXPIRED indicates that the deposit has expired and the sweep + * transaction has been published. + */ + PUBLISH_EXPIRED = 'PUBLISH_EXPIRED', + /** + * WAIT_FOR_EXPIRY_SWEEP - WAIT_FOR_EXPIRY_SWEEP indicates that the deposit has expired and the sweep + * transaction has not yet been sufficiently confirmed. + */ + WAIT_FOR_EXPIRY_SWEEP = 'WAIT_FOR_EXPIRY_SWEEP', + /** + * EXPIRED - EXPIRED indicates that the deposit has expired and the sweep transaction + * has been sufficiently confirmed. + */ + EXPIRED = 'EXPIRED', + UNRECOGNIZED = 'UNRECOGNIZED' +} + +export enum StaticAddressLoopInSwapState { + /** UNKNOWN_STATIC_ADDRESS_SWAP_STATE - */ + UNKNOWN_STATIC_ADDRESS_SWAP_STATE = 'UNKNOWN_STATIC_ADDRESS_SWAP_STATE', + /** INIT_HTLC - */ + INIT_HTLC = 'INIT_HTLC', + /** SIGN_HTLC_TX - */ + SIGN_HTLC_TX = 'SIGN_HTLC_TX', + /** MONITOR_INVOICE_HTLC_TX - */ + MONITOR_INVOICE_HTLC_TX = 'MONITOR_INVOICE_HTLC_TX', + /** PAYMENT_RECEIVED - */ + PAYMENT_RECEIVED = 'PAYMENT_RECEIVED', + /** SWEEP_STATIC_ADDRESS_HTLC_TIMEOUT - */ + SWEEP_STATIC_ADDRESS_HTLC_TIMEOUT = 'SWEEP_STATIC_ADDRESS_HTLC_TIMEOUT', + /** MONITOR_HTLC_TIMEOUT_SWEEP - */ + MONITOR_HTLC_TIMEOUT_SWEEP = 'MONITOR_HTLC_TIMEOUT_SWEEP', + /** HTLC_STATIC_ADDRESS_TIMEOUT_SWEPT - */ + HTLC_STATIC_ADDRESS_TIMEOUT_SWEPT = 'HTLC_STATIC_ADDRESS_TIMEOUT_SWEPT', + /** SUCCEEDED - */ + SUCCEEDED = 'SUCCEEDED', + /** SUCCEEDED_TRANSITIONING_FAILED - */ + SUCCEEDED_TRANSITIONING_FAILED = 'SUCCEEDED_TRANSITIONING_FAILED', + /** UNLOCK_DEPOSITS - */ + UNLOCK_DEPOSITS = 'UNLOCK_DEPOSITS', + /** FAILED_STATIC_ADDRESS_SWAP - */ + FAILED_STATIC_ADDRESS_SWAP = 'FAILED_STATIC_ADDRESS_SWAP', + UNRECOGNIZED = 'UNRECOGNIZED' +} + export interface LoopOutRequest { /** Requested swap amount in sat. This does not include the swap and miner fee. */ amt: string; @@ -554,6 +637,12 @@ export interface QuoteRequest { * probing and payment. */ private: boolean; + /** + * Static address deposit outpoints that will be quoted for. This option only + * pertains to loop in swaps. Either this or the amt parameter can be set at + * the same time. + */ + depositOutpoints: string[]; } export interface InQuoteResponse { @@ -613,6 +702,10 @@ export interface TokensResponse { tokens: L402Token[]; } +export interface FetchL402TokenRequest {} + +export interface FetchL402TokenResponse {} + export interface L402Token { /** The base macaroon that was baked by the auth server. */ baseMacaroon: Uint8Array | string; @@ -974,6 +1067,232 @@ export interface InstantOut { sweepTxId: string; } +export interface NewStaticAddressRequest { + /** The client's public key for the 2-of-2 MuSig2 taproot static address. */ + clientKey: Uint8Array | string; +} + +export interface NewStaticAddressResponse { + /** The taproot static address. */ + address: string; + /** The CSV expiry of the static address. */ + expiry: number; +} + +export interface ListUnspentDepositsRequest { + /** The number of minimum confirmations a utxo must have to be listed. */ + minConfs: number; + /** + * The number of maximum confirmations a utxo may have to be listed. A zero + * value indicates that there is no maximum. + */ + maxConfs: number; +} + +export interface ListUnspentDepositsResponse { + /** A list of utxos behind the static address. */ + utxos: Utxo[]; +} + +export interface Utxo { + /** The static address of the utxo. */ + staticAddress: string; + /** The value of the unspent coin in satoshis. */ + amountSat: string; + /** The outpoint in the form txid:index. */ + outpoint: string; + /** The number of confirmations for the Utxo. */ + confirmations: string; +} + +export interface WithdrawDepositsRequest { + /** The outpoints of the deposits to withdraw. */ + outpoints: OutPoint[]; + /** If set to true, all deposits will be withdrawn. */ + all: boolean; + /** The address to withdraw the funds to. */ + destAddr: string; + /** The fee rate in sat/vbyte to use for the withdrawal transaction. */ + satPerVbyte: string; +} + +export interface WithdrawDepositsResponse { + /** The transaction hash of the withdrawal transaction. */ + withdrawalTxHash: string; + /** The pkscript of the withdrawal transaction. */ + pkScript: string; +} + +export interface OutPoint { + /** Raw bytes representing the transaction id. */ + txidBytes: Uint8Array | string; + /** Reversed, hex-encoded string representing the transaction id. */ + txidStr: string; + /** The index of the output on the transaction. */ + outputIndex: number; +} + +export interface ListStaticAddressDepositsRequest { + /** Filters the list of all stored deposits by deposit state. */ + stateFilter: DepositState; + /** Filters the list of all stored deposits by the outpoint. */ + outpoints: string[]; +} + +export interface ListStaticAddressDepositsResponse { + /** A list of all deposits that match the filtered state. */ + filteredDeposits: Deposit[]; +} + +export interface ListStaticAddressSwapsRequest {} + +export interface ListStaticAddressSwapsResponse { + /** A list of all swaps known static address loop-in swaps. */ + swaps: StaticAddressLoopInSwap[]; +} + +export interface StaticAddressSummaryRequest {} + +export interface StaticAddressSummaryResponse { + /** The static address of the client. */ + staticAddress: string; + /** The CSV expiry of the static address. */ + relativeExpiryBlocks: string; + /** The total number of deposits. */ + totalNumDeposits: number; + /** The total value of unconfirmed deposits. */ + valueUnconfirmedSatoshis: string; + /** The total value of confirmed deposits. */ + valueDepositedSatoshis: string; + /** The total value of all expired deposits. */ + valueExpiredSatoshis: string; + /** The total value of all deposits that have been withdrawn. */ + valueWithdrawnSatoshis: string; + /** The total value of all loop-ins that have been finalized. */ + valueLoopedInSatoshis: string; + /** The total value of all htlc timeout sweeps that the client swept. */ + valueHtlcTimeoutSweepsSatoshis: string; +} + +export interface Deposit { + /** The identifier of the deposit. */ + id: Uint8Array | string; + /** The state of the deposit. */ + state: DepositState; + /** The outpoint of the deposit in format txid:index. */ + outpoint: string; + /** The value of the deposit in satoshis. */ + value: string; + /** The block height at which the deposit was confirmed. */ + confirmationHeight: string; + /** + * The number of blocks that are left until the deposit cannot be used for a + * loop-in swap anymore. + */ + blocksUntilExpiry: string; +} + +export interface StaticAddressLoopInSwap { + /** The swap hash of the swap. It represents the unique identifier of the swap. */ + swapHash: Uint8Array | string; + /** */ + depositOutpoints: string[]; + /** */ + state: StaticAddressLoopInSwapState; + /** + * The swap amount of the swap. It is the sum of the values of the deposit + * outpoints that were used for this swap. + */ + swapAmountSatoshis: string; + /** + * The invoiced swap amount. It is the swap amount minus the quoted server + * fees. + */ + paymentRequestAmountSatoshis: string; +} + +export interface StaticAddressLoopInRequest { + /** The outpoints of the deposits to loop-in. */ + outpoints: string[]; + /** + * Maximum satoshis we are willing to pay the server for the swap. This value + * is not disclosed in the swap initiation call, but if the server asks for a + * higher fee, we abort the swap. Typically this value is taken from the + * response of the GetQuote call. + */ + maxSwapFeeSatoshis: string; + /** + * Optionally the client can specify the last hop pubkey when requesting a + * loop-in quote. This is useful to get better off-chain routing fee from the + * server. + */ + lastHop: Uint8Array | string; + /** + * An optional label for this swap. This field is limited to 500 characters and + * may not be one of the reserved values in loop/labels Reserved list. + */ + label: string; + /** + * An optional identification string that will be appended to the user agent + * string sent to the server to give information about the usage of loop. This + * initiator part is meant for user interfaces to add their name to give the + * full picture of the binary used (loopd, LiT) and the method used for + * triggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI). + */ + initiator: string; + /** Optional route hints to reach the destination through private channels. */ + routeHints: RouteHint[]; + /** + * Private indicates whether the destination node should be considered private. + * In which case, loop will generate hop hints to assist with probing and + * payment. + */ + private: boolean; + /** + * The swap payment timeout allows the user to specify an upper limit for the + * amount of time the server is allowed to take to fulfill the off-chain swap + * payment. If the timeout is reached the swap will be aborted on the server + * side and the client can retry the swap with different parameters. + */ + paymentTimeoutSeconds: number; +} + +export interface StaticAddressLoopInResponse { + /** The swap hash that identifies this swap. */ + swapHash: Uint8Array | string; + /** The state the swap is in. */ + state: string; + /** The amount of the swap. */ + amount: string; + /** The htlc cltv expiry height of the swap. */ + htlcCltv: number; + /** The quoted swap fee in satoshis. */ + quotedSwapFeeSatoshis: string; + /** The maximum total swap fee the client is willing to pay for the swap. */ + maxSwapFeeSatoshis: string; + /** The block height at which the swap was initiated. */ + initiationHeight: number; + /** The static address protocol version. */ + protocolVersion: string; + /** An optional label for this swap. */ + label: string; + /** + * An optional identification string that will be appended to the user agent + * string sent to the server to give information about the usage of loop. This + * initiator part is meant for user interfaces to add their name to give the + * full picture of the binary used (loopd, LiT) and the method used for + * triggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI). + */ + initiator: string; + /** + * The swap payment timeout allows the user to specify an upper limit for the + * amount of time the server is allowed to take to fulfill the off-chain swap + * payment. If the timeout is reached the swap will be aborted on the server + * side and the client can retry the swap with different parameters. + */ + paymentTimeoutSeconds: number; +} + /** * SwapClient is a service that handles the client side process of onchain/offchain * swaps. The service is designed for a single client. @@ -1075,6 +1394,14 @@ export interface SwapClient { getLsatTokens( request?: DeepPartial ): Promise; + /** + * loop: `fetchl402` + * FetchL402Token fetches an L402 token from the server, this is required in + * order to receive reservation notifications from the server. + */ + fetchL402Token( + request?: DeepPartial + ): Promise; /** * loop: `getinfo` * GetInfo gets basic information about the loop daemon. @@ -1139,6 +1466,58 @@ export interface SwapClient { listInstantOuts( request?: DeepPartial ): Promise; + /** + * loop: `static newstaticaddress` + * NewStaticAddress requests a new static address for loop-ins from the server. + */ + newStaticAddress( + request?: DeepPartial + ): Promise; + /** + * loop: `static listunspentdeposits` + * ListUnspentDeposits returns a list of utxos deposited at a static address. + */ + listUnspentDeposits( + request?: DeepPartial + ): Promise; + /** + * loop:`static withdraw` + * WithdrawDeposits withdraws a selection or all deposits of a static address. + */ + withdrawDeposits( + request?: DeepPartial + ): Promise; + /** + * loop:`listdeposits` + * ListStaticAddressDeposits returns a list of filtered static address + * deposits. + */ + listStaticAddressDeposits( + request?: DeepPartial + ): Promise; + /** + * loop:`listswaps` + * ListStaticAddressSwaps returns a list of filtered static address + * swaps. + */ + listStaticAddressSwaps( + request?: DeepPartial + ): Promise; + /** + * loop:`static summary` + * GetStaticAddressSummary returns a summary of static address related + * statistics. + */ + getStaticAddressSummary( + request?: DeepPartial + ): Promise; + /** + * loop:`static` + * StaticAddressLoopIn initiates a static address loop-in swap. + */ + staticAddressLoopIn( + request?: DeepPartial + ): Promise; } type Builtin = diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/pool/auctioneerrpc/auctioneer.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/pool/auctioneerrpc/auctioneer.ts index 1d57f65e7..c4d7538c5 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/pool/auctioneerrpc/auctioneer.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/pool/auctioneerrpc/auctioneer.ts @@ -11,8 +11,6 @@ export enum ChannelType { * outputs that pay directly to the channel initiator (the seller). */ SCRIPT_ENFORCED_LEASE = 'SCRIPT_ENFORCED_LEASE', - /** SIMPLE_TAPROOT - A channel type that uses a Pay-to-Taproot output for the funding output. */ - SIMPLE_TAPROOT = 'SIMPLE_TAPROOT', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -62,8 +60,6 @@ export enum OrderChannelType { * channel initiator/seller. */ ORDER_CHANNEL_TYPE_SCRIPT_ENFORCED = 'ORDER_CHANNEL_TYPE_SCRIPT_ENFORCED', - /** ORDER_CHANNEL_TYPE_SIMPLE_TAPROOT - A channel type that uses a Pay-to-Taproot output for the funding output. */ - ORDER_CHANNEL_TYPE_SIMPLE_TAPROOT = 'ORDER_CHANNEL_TYPE_SIMPLE_TAPROOT', UNRECOGNIZED = 'UNRECOGNIZED' } diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/schema.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/schema.ts index d32d01e85..144032370 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/schema.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/schema.ts @@ -46,6 +46,7 @@ export const subscriptionMethods = [ 'chainrpc.ChainNotifier.RegisterSpendNtfn', 'chainrpc.ChainNotifier.RegisterBlockEpochNtfn', 'invoicesrpc.Invoices.SubscribeSingleInvoice', + 'invoicesrpc.Invoices.HtlcModifier', 'lnrpc.Lightning.SubscribeTransactions', 'lnrpc.Lightning.SubscribePeerEvents', 'lnrpc.Lightning.SubscribeChannelEvents', @@ -70,6 +71,7 @@ export const subscriptionMethods = [ 'poolrpc.ChannelAuctioneer.SubscribeBatchAuction', 'poolrpc.ChannelAuctioneer.SubscribeSidecar', 'poolrpc.HashMail.RecvStream', - 'taprpc.TaprootAssets.SubscribeSendAssetEventNtfns', - 'taprpc.TaprootAssets.SubscribeReceiveAssetEventNtfns' + 'mintrpc.Mint.SubscribeMintEvents', + 'taprpc.TaprootAssets.SubscribeReceiveEvents', + 'taprpc.TaprootAssets.SubscribeSendEvents' ]; diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/assetwalletrpc/assetwallet.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/assetwalletrpc/assetwallet.ts index 4cef8d06a..57a96712e 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/assetwalletrpc/assetwallet.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/assetwalletrpc/assetwallet.ts @@ -6,24 +6,55 @@ import type { SendAssetResponse } from '../taprootassets'; -export interface FundVirtualPsbtRequest { +export enum CoinSelectType { /** - * Use an existing PSBT packet as the template for the funded PSBT. - * - * TODO(guggero): Actually implement this. We can't use the "reserved" - * keyword here because we're in a oneof, so we add the field but implement - * it later. + * COIN_SELECT_DEFAULT - Use the default coin selection type, which currently allows script keys and + * key spend paths. + */ + COIN_SELECT_DEFAULT = 'COIN_SELECT_DEFAULT', + /** + * COIN_SELECT_BIP86_ONLY - Explicitly only select inputs that are known to be BIP-086 compliant (have + * a key-spend path only and no script tree). + */ + COIN_SELECT_BIP86_ONLY = 'COIN_SELECT_BIP86_ONLY', + /** + * COIN_SELECT_SCRIPT_TREES_ALLOWED - Allow the selection of inputs that have a script tree spend path as well as + * a key spend path. */ + COIN_SELECT_SCRIPT_TREES_ALLOWED = 'COIN_SELECT_SCRIPT_TREES_ALLOWED', + UNRECOGNIZED = 'UNRECOGNIZED' +} + +export interface FundVirtualPsbtRequest { + /** Use an existing PSBT packet as the template for the funded PSBT. */ psbt: Uint8Array | string | undefined; /** Use the asset outputs and optional asset inputs from this raw template. */ raw: TxTemplate | undefined; + /** + * Specify the type of coins that should be selected. Defaults to allowing both + * script trees and BIP-086 compliant inputs. + */ + coinSelectType: CoinSelectType; } export interface FundVirtualPsbtResponse { - /** The funded but not yet signed PSBT packet. */ + /** The funded but not yet signed virtual PSBT packet. */ fundedPsbt: Uint8Array | string; /** The index of the added change output or -1 if no change was left over. */ changeOutputIndex: number; + /** + * The list of passive virtual transactions that are anchored in the same BTC + * level anchor transaction inputs as the funded "active" asset above. These + * assets can be ignored when using the AnchorVirtualPsbts RPC, since they are + * retrieved, signed and committed automatically in that method. But the + * passive assets have to be included in the CommitVirtualPsbts RPC which is + * used when custom BTC level anchor transactions are created. + * The main difference to the "active" asset above is that the passive assets + * will not get their own entry in the transfer table of the database, since + * they are just carried along and not directly affected by the direct user + * action. + */ + passiveAssetPsbts: Uint8Array | string[]; } export interface TxTemplate { @@ -84,6 +115,116 @@ export interface AnchorVirtualPsbtsRequest { virtualPsbts: Uint8Array | string[]; } +export interface CommitVirtualPsbtsRequest { + /** + * The list of virtual transactions that should be mapped to the given BTC + * level anchor transaction template. The virtual transactions are expected to + * be signed (or use ASSET_VERSION_V1 with segregated witness to allow for + * signing after committing) and ready to be committed to the anchor + * transaction. + */ + virtualPsbts: Uint8Array | string[]; + /** + * The list of passive virtual transactions that are anchored in the same BTC + * level anchor transaction inputs as the "active" assets above. These can be + * obtained by calling FundVirtualPsbt and using the passive assets returned. + * The virtual transactions are expected to be signed (or use ASSET_VERSION_V1 + * with segregated witness to allow for signing after committing) and ready to + * be committed to the anchor transaction. + * The main difference to the "active" assets above is that the passive assets + * will not get their own entry in the transfer table of the database, since + * they are just carried along and not directly affected by the direct user + * action. + */ + passiveAssetPsbts: Uint8Array | string[]; + /** + * The template of the BTC level anchor transaction that the virtual + * transactions should be mapped to. The template is expected to already + * contain all asset related inputs and outputs corresponding to the virtual + * transactions given above. This can be achieved by using + * tapfreighter.PrepareAnchoringTemplate for example. + */ + anchorPsbt: Uint8Array | string; + /** + * Use the existing output within the anchor PSBT with the specified + * index as the change output. Any leftover change will be added to the + * already specified amount of that output. To add a new change output to + * the PSBT, set the "add" field below instead. + */ + existingOutputIndex: number | undefined; + /** Add a new P2TR change output to the PSBT if required. */ + add: boolean | undefined; + /** The target number of blocks that the transaction should be confirmed in. */ + targetConf: number | undefined; + /** + * The fee rate, expressed in sat/vbyte, that should be used to fund the + * BTC level anchor transaction. + */ + satPerVbyte: string | undefined; +} + +export interface CommitVirtualPsbtsResponse { + /** + * The funded BTC level anchor transaction with all outputs updated to commit + * to the virtual transactions given. The transaction is ready to be signed, + * unless some of the asset inputs don't belong to this daemon, in which case + * the anchor input derivation info must be added to those inputs first. + */ + anchorPsbt: Uint8Array | string; + /** + * The updated virtual transactions that now contain the state transition + * proofs for being committed to the BTC level anchor transaction above. If the + * assets in the virtual transaction outputs are ASSET_VERSION_V1 and not yet + * signed, then the proofs need to be updated to include the witness before + * they become fully valid. + */ + virtualPsbts: Uint8Array | string[]; + /** + * The updated passive virtual transactions that were committed to the same BTC + * level anchor transaction as the "active" virtual transactions given. If the + * assets in the virtual transaction outputs are ASSET_VERSION_V1 and not yet + * signed, then the proofs need to be updated to include the witness before + * they become fully valid. + */ + passiveAssetPsbts: Uint8Array | string[]; + /** The index of the (added) change output or -1 if no change was left over. */ + changeOutputIndex: number; + /** + * The list of UTXO lock leases that were acquired for the inputs in the funded + * PSBT packet from lnd. Only inputs added to the PSBT by this RPC are locked, + * inputs that were already present in the PSBT are not locked. + */ + lndLockedUtxos: OutPoint[]; +} + +export interface PublishAndLogRequest { + /** + * The funded BTC level anchor transaction with all outputs updated to commit + * to the virtual transactions given. The transaction is ready to be signed, + * unless some of the asset inputs don't belong to this daemon, in which case + * the anchor input derivation info must be added to those inputs first. + */ + anchorPsbt: Uint8Array | string; + /** + * The updated virtual transactions that contain the state transition proofs + * of being committed to the BTC level anchor transaction above. + */ + virtualPsbts: Uint8Array | string[]; + /** + * The updated passive virtual transactions that contain the state transition + * proofs of being committed to the BTC level anchor transaction above. + */ + passiveAssetPsbts: Uint8Array | string[]; + /** The index of the (added) change output or -1 if no change was left over. */ + changeOutputIndex: number; + /** + * The list of UTXO lock leases that were acquired for the inputs in the funded + * PSBT packet from lnd. Only inputs added to the PSBT by this RPC are locked, + * inputs that were already present in the PSBT are not locked. + */ + lndLockedUtxos: OutPoint[]; +} + export interface NextInternalKeyRequest { keyFamily: number; } @@ -100,10 +241,41 @@ export interface NextScriptKeyResponse { scriptKey: ScriptKey | undefined; } +export interface QueryInternalKeyRequest { + /** + * The internal key to look for. This can either be the 32-byte x-only raw + * internal key or the 33-byte raw internal key with the parity byte. + */ + internalKey: Uint8Array | string; +} + +export interface QueryInternalKeyResponse { + internalKey: KeyDescriptor | undefined; +} + +export interface QueryScriptKeyRequest { + /** + * The tweaked script key to look for. This can either be the 32-byte + * x-only tweaked script key or the 33-byte tweaked script key with the + * parity byte. + */ + tweakedScriptKey: Uint8Array | string; +} + +export interface QueryScriptKeyResponse { + scriptKey: ScriptKey | undefined; +} + export interface ProveAssetOwnershipRequest { assetId: Uint8Array | string; scriptKey: Uint8Array | string; outpoint: OutPoint | undefined; + /** + * An optional 32-byte challenge that may be used to bind the generated + * proof. This challenge needs to be also presented on the + * VerifyAssetOwnership RPC in order to check the proof against it. + */ + challenge: Uint8Array | string; } export interface ProveAssetOwnershipResponse { @@ -112,10 +284,26 @@ export interface ProveAssetOwnershipResponse { export interface VerifyAssetOwnershipRequest { proofWithWitness: Uint8Array | string; + /** + * An optional 32-byte challenge that may be used to check the ownership + * proof against. This challenge must match the one that the prover used + * on the ProveAssetOwnership RPC. + */ + challenge: Uint8Array | string; } export interface VerifyAssetOwnershipResponse { validProof: boolean; + /** The outpoint the proof commits to. */ + outpoint: OutPoint | undefined; + /** The outpoint in the human-readable form "hash:index". */ + outpointStr: string; + /** The block hash the output is part of. */ + blockHash: Uint8Array | string; + /** The block hash as hexadecimal string of the byte-reversed hash. */ + blockHashStr: string; + /** The block height of the block the output is part of. */ + blockHeight: number; } export interface RemoveUTXOLeaseRequest { @@ -125,6 +313,14 @@ export interface RemoveUTXOLeaseRequest { export interface RemoveUTXOLeaseResponse {} +export interface DeclareScriptKeyRequest { + scriptKey: ScriptKey | undefined; +} + +export interface DeclareScriptKeyResponse { + scriptKey: ScriptKey | undefined; +} + export interface AssetWallet { /** * FundVirtualPsbt selects inputs from the available asset commitments to fund @@ -142,14 +338,34 @@ export interface AssetWallet { ): Promise; /** * AnchorVirtualPsbts merges and then commits multiple virtual transactions in - * a single BTC level anchor transaction. - * - * TODO(guggero): Actually implement accepting and merging multiple - * transactions. + * a single BTC level anchor transaction. This RPC should be used if the BTC + * level anchor transaction of the assets to be spent are encumbered by a + * normal key and don't require any special spending conditions. For any custom + * spending conditions on the BTC level, the two RPCs CommitVirtualPsbts and + * PublishAndLogTransfer should be used instead (which in combination do the + * same as this RPC but allow for more flexibility). */ anchorVirtualPsbts( request?: DeepPartial ): Promise; + /** + * CommitVirtualPsbts creates the output commitments and proofs for the given + * virtual transactions by committing them to the BTC level anchor transaction. + * In addition, the BTC level anchor transaction is funded and prepared up to + * the point where it is ready to be signed. + */ + commitVirtualPsbts( + request?: DeepPartial + ): Promise; + /** + * PublishAndLogTransfer accepts a fully committed and signed anchor + * transaction and publishes it to the Bitcoin network. It also logs the + * transfer of the given active and passive assets in the database and ships + * any outgoing proofs to the counterparties. + */ + publishAndLogTransfer( + request?: DeepPartial + ): Promise; /** * NextInternalKey derives the next internal key for the given key family and * stores it as an internal key in the database to make sure it is identified @@ -169,6 +385,17 @@ export interface AssetWallet { nextScriptKey( request?: DeepPartial ): Promise; + /** QueryInternalKey returns the key descriptor for the given internal key. */ + queryInternalKey( + request?: DeepPartial + ): Promise; + /** + * QueryScriptKey returns the full script key descriptor for the given tweaked + * script key. + */ + queryScriptKey( + request?: DeepPartial + ): Promise; /** * tapcli: `proofs proveownership` * ProveAssetOwnership creates an ownership proof embedded in an asset @@ -194,6 +421,15 @@ export interface AssetWallet { removeUTXOLease( request?: DeepPartial ): Promise; + /** + * DeclareScriptKey declares a new script key to the wallet. This is useful + * when the script key contains scripts, which would mean it wouldn't be + * recognized by the wallet automatically. Declaring a script key will make any + * assets sent to the script key be recognized as being local assets. + */ + declareScriptKey( + request?: DeepPartial + ): Promise; } type Builtin = diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/mintrpc/mint.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/mintrpc/mint.ts index 597333d51..2ba97625c 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/mintrpc/mint.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/mintrpc/mint.ts @@ -1,5 +1,16 @@ /* eslint-disable */ -import type { AssetVersion, AssetType, AssetMeta } from '../taprootassets'; +import type { + AssetVersion, + AssetType, + AssetMeta, + KeyDescriptor, + ScriptKey, + GroupKeyRequest, + GroupVirtualTx, + TapscriptFullTree, + TapBranch, + GroupWitness +} from '../taprootassets'; export enum BatchState { BATCH_STATE_UNKNOWN = 'BATCH_STATE_UNKNOWN', @@ -36,13 +47,38 @@ export interface PendingAsset { * for future asset issuance. */ newGroupedAsset: boolean; - /** The specific group key this asset should be minted with. */ + /** The specific existing group key this asset should be minted with. */ groupKey: Uint8Array | string; /** * The name of the asset in the batch that will anchor a new asset group. * This asset will be minted with the same group key as the anchor asset. */ groupAnchor: string; + /** + * The optional key that will be used as the internal key for an asset group + * created with this asset. + */ + groupInternalKey: KeyDescriptor | undefined; + /** + * The optional root of a tapscript tree that will be used when constructing a + * new asset group key. This enables future issuance authorized with a script + * witness. + */ + groupTapscriptRoot: Uint8Array | string; + /** + * The optional script key to use for the new asset. If no script key is given, + * a BIP-86 key will be derived from the underlying wallet. + */ + scriptKey: ScriptKey | undefined; +} + +export interface UnsealedAsset { + /** The pending asset with an unsealed asset group. */ + asset: PendingAsset | undefined; + /** The group key request for the asset. */ + groupKeyRequest: GroupKeyRequest | undefined; + /** The group virtual transaction for the asset. */ + groupVirtualTx: GroupVirtualTx | undefined; } export interface MintAsset { @@ -72,13 +108,42 @@ export interface MintAsset { * an existing asset group. */ groupedAsset: boolean; - /** The specific group key this asset should be minted with. */ + /** The specific existing group key this asset should be minted with. */ groupKey: Uint8Array | string; /** * The name of the asset in the batch that will anchor a new asset group. * This asset will be minted with the same group key as the anchor asset. */ groupAnchor: string; + /** + * The optional key that will be used as the internal key for an asset group + * created with this asset. + */ + groupInternalKey: KeyDescriptor | undefined; + /** + * The optional root of a tapscript tree that will be used when constructing a + * new asset group key. This enables future issuance authorized with a script + * witness. + */ + groupTapscriptRoot: Uint8Array | string; + /** + * The optional script key to use for the new asset. If no script key is given, + * a BIP-86 key will be derived from the underlying wallet. + */ + scriptKey: ScriptKey | undefined; + /** + * Decimal display dictates the number of decimal places to shift the amount to + * the left converting from Taproot Asset integer representation to a + * UX-recognizable fractional quantity. + * + * For example, if the decimal_display value is 2 and there's 100 of those + * assets, then a wallet would display the amount as "1.00". This field is + * intended as information for wallets that display balances and has no impact + * on the behavior of the daemon or any other part of the protocol. This value + * is encoded in the MetaData field as a JSON field, therefore it is only + * compatible with assets that have a JSON MetaData field. + */ + decimalDisplay: number; } export interface MintAssetRequest { @@ -113,6 +178,61 @@ export interface MintingBatch { state: BatchState; /** The assets that are part of the batch. */ assets: PendingAsset[]; + /** The time the batch was created as a Unix timestamp (in seconds). */ + createdAt: string; + /** The current height of the block chain at the time of the batch creation. */ + heightHint: number; + /** + * The genesis transaction as a PSBT packet. Only populated if the batch has + * been committed. + */ + batchPsbt: Uint8Array | string; +} + +export interface VerboseBatch { + /** The minting batch, without any assets. */ + batch: MintingBatch | undefined; + /** The assets that are part of the batch. */ + unsealedAssets: UnsealedAsset[]; +} + +export interface FundBatchRequest { + /** + * If true, then the assets currently in the batch won't be returned in the + * response. This is mainly to avoid a lot of data being transmitted and + * possibly printed on the command line in the case of a very large batch. + */ + shortResponse: boolean; + /** The optional fee rate to use for the minting transaction, in sat/kw. */ + feeRate: number; + /** + * An ordered list of TapLeafs, which will be used to construct a + * Tapscript tree. + */ + fullTree: TapscriptFullTree | undefined; + /** A TapBranch that represents a Tapscript tree managed externally. */ + branch: TapBranch | undefined; +} + +export interface FundBatchResponse { + /** The funded batch. */ + batch: MintingBatch | undefined; +} + +export interface SealBatchRequest { + /** + * If true, then the assets currently in the batch won't be returned in the + * response. This is mainly to avoid a lot of data being transmitted and + * possibly printed on the command line in the case of a very large batch. + */ + shortResponse: boolean; + /** The assetID, witness pairs that authorize asset membership in a group. */ + groupWitnesses: GroupWitness[]; +} + +export interface SealBatchResponse { + /** The sealed batch. */ + batch: MintingBatch | undefined; } export interface FinalizeBatchRequest { @@ -124,6 +244,13 @@ export interface FinalizeBatchRequest { shortResponse: boolean; /** The optional fee rate to use for the minting transaction, in sat/kw. */ feeRate: number; + /** + * An ordered list of TapLeafs, which will be used to construct a + * Tapscript tree. + */ + fullTree: TapscriptFullTree | undefined; + /** A TapBranch that represents a Tapscript tree managed externally. */ + branch: TapBranch | undefined; } export interface FinalizeBatchResponse { @@ -149,10 +276,39 @@ export interface ListBatchRequest { * encoded string (use this for REST). */ batchKeyStr: string | undefined; + /** + * If true, pending asset group information will be shown for the pending + * batch. + */ + verbose: boolean; } export interface ListBatchResponse { - batches: MintingBatch[]; + batches: VerboseBatch[]; +} + +export interface SubscribeMintEventsRequest { + /** + * If true, then the assets currently in the batch won't be returned in the + * event's batch. This is mainly to avoid a lot of data being transmitted and + * possibly printed on the command line in the case of a very large batch. + */ + shortResponse: boolean; +} + +export interface MintEvent { + /** Execute timestamp (Unix timestamp in microseconds). */ + timestamp: string; + /** + * The last state of the batch that was successfully executed. If error + * below is set, then the batch_state is the state that lead to the error + * during its execution. + */ + batchState: BatchState; + /** The batch that the event is for. */ + batch: MintingBatch | undefined; + /** An optional error, indicating that executing the batch_state failed. */ + error: string; } export interface Mint { @@ -167,6 +323,28 @@ export interface Mint { mintAsset( request?: DeepPartial ): Promise; + /** + * tapcli `assets mint fund` + * FundBatch will attempt to fund the current pending batch with a genesis + * input, or create a new funded batch if no batch exists yet. This RPC is only + * needed if a custom witness is needed to finalize the batch. Otherwise, + * FinalizeBatch can be called directly. + */ + fundBatch( + request?: DeepPartial + ): Promise; + /** + * tapcli `assets mint seal` + * SealBatch will attempt to seal the current pending batch by creating and + * validating asset group witness for all assets in the batch. If a witness + * is not provided, a signature will be derived to serve as the witness. This + * RPC is only needed if any assets in the batch have a custom asset group key + * that require an external signer. Otherwise, FinalizeBatch can be called + * directly. + */ + sealBatch( + request?: DeepPartial + ): Promise; /** * tapcli: `assets mint finalize` * FinalizeBatch will attempt to finalize the current pending batch. @@ -189,6 +367,16 @@ export interface Mint { listBatches( request?: DeepPartial ): Promise; + /** + * tapcli: `events mint` + * SubscribeMintEvents allows a caller to subscribe to mint events for asset + * creation batches. + */ + subscribeMintEvents( + request?: DeepPartial, + onMessage?: (msg: MintEvent) => void, + onError?: (err: Error) => void + ): void; } type Builtin = diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/taprootassets.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/taprootassets.ts index 410877bb8..660b1f8f6 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/taprootassets.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/taprootassets.ts @@ -22,6 +22,11 @@ export enum AssetMetaType { * should be interpreted as opaque blobs. */ META_TYPE_OPAQUE = 'META_TYPE_OPAQUE', + /** + * META_TYPE_JSON - JSON is used for asset meta blobs that are to be interpreted as valid JSON + * strings. + */ + META_TYPE_JSON = 'META_TYPE_JSON', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -52,28 +57,40 @@ export enum OutputType { * output. In either case, the asset of this output has a tx witness. */ OUTPUT_TYPE_SPLIT_ROOT = 'OUTPUT_TYPE_SPLIT_ROOT', + UNRECOGNIZED = 'UNRECOGNIZED' +} + +/** + * ProofDeliveryStatus is an enum that describes the status of the delivery of + * a proof associated with an asset transfer output. + */ +export enum ProofDeliveryStatus { + /** PROOF_DELIVERY_STATUS_NOT_APPLICABLE - Delivery is not applicable; the proof will not be delivered. */ + PROOF_DELIVERY_STATUS_NOT_APPLICABLE = 'PROOF_DELIVERY_STATUS_NOT_APPLICABLE', + /** PROOF_DELIVERY_STATUS_COMPLETE - The proof has been successfully delivered. */ + PROOF_DELIVERY_STATUS_COMPLETE = 'PROOF_DELIVERY_STATUS_COMPLETE', /** - * OUTPUT_TYPE_PASSIVE_ASSETS_ONLY - OUTPUT_TYPE_PASSIVE_ASSETS_ONLY indicates that this output only carries - * passive assets and therefore the asset in this output is nil. The passive - * assets themselves are signed in their own virtual transactions and - * are not present in this packet. + * PROOF_DELIVERY_STATUS_PENDING - The proof is pending delivery. This status indicates that the proof has + * not yet been delivered successfully. One or more attempts at proof + * delivery may have been made. */ - OUTPUT_TYPE_PASSIVE_ASSETS_ONLY = 'OUTPUT_TYPE_PASSIVE_ASSETS_ONLY', + PROOF_DELIVERY_STATUS_PENDING = 'PROOF_DELIVERY_STATUS_PENDING', + UNRECOGNIZED = 'UNRECOGNIZED' +} + +export enum AddrVersion { /** - * OUTPUT_TYPE_PASSIVE_SPLIT_ROOT - OUTPUT_TYPE_PASSIVE_SPLIT_ROOT is a split root output that carries the - * change from a split or a tombstone from a non-interactive full value send - * output, as well as passive assets. + * ADDR_VERSION_UNSPECIFIED - ADDR_VERSION_UNSPECIFIED is the default value for an address version in + * an RPC message. It is unmarshalled to the latest address version. */ - OUTPUT_TYPE_PASSIVE_SPLIT_ROOT = 'OUTPUT_TYPE_PASSIVE_SPLIT_ROOT', + ADDR_VERSION_UNSPECIFIED = 'ADDR_VERSION_UNSPECIFIED', + /** ADDR_VERSION_V0 - ADDR_VERSION_V0 is the initial address version. */ + ADDR_VERSION_V0 = 'ADDR_VERSION_V0', /** - * OUTPUT_TYPE_SIMPLE_PASSIVE_ASSETS - OUTPUT_TYPE_SIMPLE_PASSIVE_ASSETS is a plain full-value interactive send - * output that also carries passive assets. This is a special case where we - * send the full value of a single asset in a commitment to a new script - * key, but also carry passive assets in the same output. This is useful for - * key rotation (send-to-self) scenarios or asset burns where we burn the - * full supply of a single asset within a commitment. + * ADDR_VERSION_V1 - ADDR_VERSION_V1 is the address version that uses V2 Taproot Asset + * commitments. */ - OUTPUT_TYPE_SIMPLE_PASSIVE_ASSETS = 'OUTPUT_TYPE_SIMPLE_PASSIVE_ASSETS', + ADDR_VERSION_V1 = 'ADDR_VERSION_V1', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -86,23 +103,69 @@ export enum AddrEventStatus { UNRECOGNIZED = 'UNRECOGNIZED' } -/** - * ProofTransferType is the type of proof transfer attempt. The transfer is - * either a proof delivery to the transfer counterparty or receiving a proof - * from the transfer counterparty. Note that the transfer counterparty is - * usually the proof courier service. - */ -export enum ProofTransferType { +export enum SendState { + /** + * SEND_STATE_VIRTUAL_INPUT_SELECT - Input coin selection to pick out which asset inputs should be spent is + * executed during this state. + */ + SEND_STATE_VIRTUAL_INPUT_SELECT = 'SEND_STATE_VIRTUAL_INPUT_SELECT', + /** SEND_STATE_VIRTUAL_SIGN - The virtual transaction is signed during this state. */ + SEND_STATE_VIRTUAL_SIGN = 'SEND_STATE_VIRTUAL_SIGN', + /** SEND_STATE_ANCHOR_SIGN - The Bitcoin anchor transaction is signed during this state. */ + SEND_STATE_ANCHOR_SIGN = 'SEND_STATE_ANCHOR_SIGN', + /** + * SEND_STATE_LOG_COMMITMENT - The outbound packet is written to the database during this state, + * including the partial proof suffixes. Only parcels that complete this + * state can be resumed on restart. + */ + SEND_STATE_LOG_COMMITMENT = 'SEND_STATE_LOG_COMMITMENT', + /** + * SEND_STATE_BROADCAST - The Bitcoin anchor transaction is broadcast to the network during this + * state. + */ + SEND_STATE_BROADCAST = 'SEND_STATE_BROADCAST', + /** + * SEND_STATE_WAIT_CONFIRMATION - The on-chain anchor transaction needs to reach at least 1 confirmation. + * This state waits for the confirmation. + */ + SEND_STATE_WAIT_CONFIRMATION = 'SEND_STATE_WAIT_CONFIRMATION', + /** + * SEND_STATE_STORE_PROOFS - The anchor transaction was confirmed in a block and the full proofs can + * now be constructed during this stage. + */ + SEND_STATE_STORE_PROOFS = 'SEND_STATE_STORE_PROOFS', + /** + * SEND_STATE_TRANSFER_PROOFS - The full proofs are sent to the recipient(s) with the proof courier + * service during this state. + */ + SEND_STATE_TRANSFER_PROOFS = 'SEND_STATE_TRANSFER_PROOFS', + /** SEND_STATE_COMPLETED - The send state machine has completed the send process. */ + SEND_STATE_COMPLETED = 'SEND_STATE_COMPLETED', + UNRECOGNIZED = 'UNRECOGNIZED' +} + +export enum ParcelType { + /** PARCEL_TYPE_ADDRESS - The parcel is an address parcel. */ + PARCEL_TYPE_ADDRESS = 'PARCEL_TYPE_ADDRESS', + /** + * PARCEL_TYPE_PRE_SIGNED - The parcel type is a pre-signed parcel where the virtual transactions are + * signed outside of the send state machine. Parcels of this type will only + * get send states starting from SEND_STATE_ANCHOR_SIGN. + */ + PARCEL_TYPE_PRE_SIGNED = 'PARCEL_TYPE_PRE_SIGNED', /** - * PROOF_TRANSFER_TYPE_SEND - This value indicates that the proof transfer attempt is a delivery to the - * transfer counterparty. + * PARCEL_TYPE_PENDING - The parcel is pending and was resumed on the latest restart of the + * daemon. The original parcel type (address or pre-signed) is not known + * anymore, as it's not relevant for the remaining steps. Parcels of this + * type will only get send states starting from SEND_STATE_BROADCAST. */ - PROOF_TRANSFER_TYPE_SEND = 'PROOF_TRANSFER_TYPE_SEND', + PARCEL_TYPE_PENDING = 'PARCEL_TYPE_PENDING', /** - * PROOF_TRANSFER_TYPE_RECEIVE - This value indicates that the proof transfer attempt is a receive from - * the transfer counterparty. + * PARCEL_TYPE_PRE_ANCHORED - The parcel type is a pre-anchored parcel where the full anchor + * transaction and all proofs are already available. Parcels of this type + * will only get send states starting from SEND_STATE_LOG_COMMITMENT. */ - PROOF_TRANSFER_TYPE_RECEIVE = 'PROOF_TRANSFER_TYPE_RECEIVE', + PARCEL_TYPE_PRE_ANCHORED = 'PARCEL_TYPE_PRE_ANCHORED', UNRECOGNIZED = 'UNRECOGNIZED' } @@ -126,6 +189,14 @@ export interface ListAssetRequest { withWitness: boolean; includeSpent: boolean; includeLeased: boolean; + /** + * List assets that aren't confirmed yet. Only freshly minted assets will + * show in the asset list with a block height of 0. All other forms of + * unconfirmed assets will not appear in the list until the transaction is + * confirmed (check either transfers or receives for unconfirmed outbound or + * inbound assets). + */ + includeUnconfirmedMints: boolean; } export interface AnchorInfo { @@ -172,8 +243,71 @@ export interface GenesisInfo { * the genesis transaction. */ outputIndex: number; - /** The version of the Taproot Asset commitment that created this asset. */ - version: number; +} + +export interface GroupKeyRequest { + /** The internal key for the asset group before any tweaks have been applied. */ + rawKey: KeyDescriptor | undefined; + /** + * The genesis of the group anchor asset, which is used to derive the single + * tweak for the group key. For a new group key, this will be the genesis of + * new_asset. + */ + anchorGenesis: GenesisInfo | undefined; + /** + * The optional root of a tapscript tree that will be used when constructing a + * new asset group key. This enables future issuance authorized with a script + * witness. + */ + tapscriptRoot: Uint8Array | string; + /** + * The serialized asset which we are requesting group membership for. A + * successful request will produce a witness that authorizes this asset to be a + * member of this asset group. + */ + newAsset: Uint8Array | string; +} + +export interface TxOut { + /** The value of the output being spent. */ + value: string; + /** The script of the output being spent. */ + pkScript: Uint8Array | string; +} + +export interface GroupVirtualTx { + /** + * The virtual transaction that represents the genesis state transition of a + * grouped asset. + */ + transaction: Uint8Array | string; + /** + * The transaction output that represents a grouped asset. The tweaked + * group key is set as the PkScript of this output. This is used in combination + * with Tx to produce an asset group witness. + */ + prevOut: TxOut | undefined; + /** + * The asset ID of the grouped asset in a GroupKeyRequest. This ID is + * needed to construct a sign descriptor, as it is the single tweak for the + * group internal key. + */ + genesisId: Uint8Array | string; + /** + * The tweaked group key for a specific GroupKeyRequest. This is used to + * construct a complete group key after producing an asset group witness. + */ + tweakedKey: Uint8Array | string; +} + +export interface GroupWitness { + /** + * The asset ID of the pending asset that should be assigned this asset + * group witness. + */ + genesisId: Uint8Array | string; + /** The serialized witness stack for the asset group. */ + witness: Uint8Array | string[]; } export interface AssetGroup { @@ -189,6 +323,11 @@ export interface AssetGroup { * specified by the above key. */ assetWitness: Uint8Array | string; + /** + * The root hash of a tapscript tree, which enables future issuance authorized + * with a script witness. + */ + tapscriptRoot: Uint8Array | string; } export interface GroupKeyReveal { @@ -203,6 +342,22 @@ export interface GenesisReveal { genesisBaseReveal: GenesisInfo | undefined; } +export interface DecimalDisplay { + /** + * Decimal display dictates the number of decimal places to shift the amount to + * the left converting from Taproot Asset integer representation to a + * UX-recognizable fractional quantity. + * + * For example, if the decimal_display value is 2 and there's 100 of those + * assets, then a wallet would display the amount as "1.00". This field is + * intended as information for wallets that display balances and has no impact + * on the behavior of the daemon or any other part of the protocol. This value + * is encoded in the MetaData field as a JSON field, therefore it is only + * compatible with assets that have a JSON MetaData field. + */ + decimalDisplay: number; +} + export interface Asset { /** The version of the Taproot Asset. */ version: AssetVersion; @@ -245,6 +400,32 @@ export interface Asset { * assets in this output are destroyed and can no longer be spent. */ isBurn: boolean; + /** + * Indicates whether this script key has either been derived by the local + * wallet or was explicitly declared to be known by using the + * DeclareScriptKey RPC. Knowing the key conceptually means the key belongs + * to the local wallet or is at least known by a software that operates on + * the local wallet. The flag is never serialized in proofs, so this is + * never explicitly set for keys foreign to the local wallet. Therefore, if + * this method returns true for a script key, it means the asset with the + * script key will be shown in the wallet balance. + */ + scriptKeyDeclaredKnown: boolean; + /** + * Indicates whether the script key is known to have a Tapscript spend path, + * meaning that the Taproot merkle root tweak is not empty. This will only + * ever be true if either script_key_is_local or script_key_internals_known + * is true as well, since the presence of a Tapscript spend path cannot be + * determined for script keys that aren't known to the wallet of the local + * tapd node. + */ + scriptKeyHasScriptPath: boolean; + /** + * This field defines a decimal display value that may be present. If this + * field is null, it means the presence of a decimal display field is + * unknown in the current context. + */ + decimalDisplay: DecimalDisplay | undefined; } export interface PrevWitness { @@ -259,6 +440,17 @@ export interface SplitCommitment { export interface ListAssetResponse { assets: Asset[]; + /** + * This is a count of unconfirmed outgoing transfers. Unconfirmed transfers + * do not appear as assets in this endpoint response. + */ + unconfirmedTransfers: string; + /** + * This is a count of freshly minted assets that haven't been confirmed on + * chain yet. These assets will appear in the asset list with a block height + * of 0 if include_unconfirmed_mints is set to true in the request. + */ + unconfirmedMints: string; } export interface ListUtxosRequest { @@ -282,6 +474,13 @@ export interface ManagedUtxo { merkleRoot: Uint8Array | string; /** The assets held at this UTXO. */ assets: Asset[]; + /** The lease owner for this UTXO. If blank the UTXO isn't leased. */ + leaseOwner: Uint8Array | string; + /** + * The expiry time as a unix time stamp for this lease. If blank the utxo + * isn't leased. + */ + leaseExpiryUnix: string; } export interface ListUtxosResponse { @@ -346,6 +545,8 @@ export interface ListBalancesRequest { * asset group. */ groupKeyFilter: Uint8Array | string; + /** An option to include previous leased assets in the balances. */ + includeLeased: boolean; } export interface AssetBalance { @@ -377,13 +578,47 @@ export interface ListBalancesResponse_AssetGroupBalancesEntry { value: AssetGroupBalance | undefined; } -export interface ListTransfersRequest {} +export interface ListTransfersRequest { + /** + * anchor_txid specifies the hexadecimal encoded txid string of the anchor + * transaction for which to retrieve transfers. An empty value indicates + * that this parameter should be disregarded in transfer selection. + */ + anchorTxid: string; +} export interface ListTransfersResponse { /** The unordered list of outgoing asset transfers. */ transfers: AssetTransfer[]; } +/** + * ChainHash represents a hash value, typically a double SHA-256 of some data. + * Common examples include block hashes and transaction hashes. + * + * This versatile message type is used in various Bitcoin-related messages and + * structures, providing two different formats of the same hash to accommodate + * both developer and user needs. + */ +export interface ChainHash { + /** + * The raw hash value in byte format. + * + * This format is optimized for programmatic use, particularly for Go + * developers, enabling easy integration with other RPC calls or binary + * operations. + */ + hash: Uint8Array | string; + /** + * The byte-reversed hash value as a hexadecimal string. + * + * This format is intended for human interaction, making it easy to copy, + * paste, and use in contexts like command-line arguments or configuration + * files. + */ + hashStr: string; +} + export interface AssetTransfer { transferTimestamp: string; /** @@ -397,6 +632,12 @@ export interface AssetTransfer { inputs: TransferInput[]; /** Describes the set of newly created asset outputs. */ outputs: TransferOutput[]; + /** + * The block hash of the blockchain block that contains the anchor + * transaction. If this value is unset, the anchor transaction is + * unconfirmed. + */ + anchorTxBlockHash: ChainHash | undefined; } export interface TransferInput { @@ -440,6 +681,10 @@ export interface TransferOutput { splitCommitRootHash: Uint8Array | string; outputType: OutputType; assetVersion: AssetVersion; + lockTime: string; + relativeLockTime: string; + /** The delivery status of the proof associated with this output. */ + proofDeliveryStatus: ProofDeliveryStatus; } export interface StopRequest {} @@ -491,6 +736,8 @@ export interface Addr { proofCourierAddr: string; /** The asset version of the address. */ assetVersion: AssetVersion; + /** The version of the address. */ + addressVersion: AddrVersion; } export interface QueryAddrRequest { @@ -549,6 +796,8 @@ export interface NewAddrRequest { proofCourierAddr: string; /** The asset version to use when sending/receiving to/from this address. */ assetVersion: AssetVersion; + /** The version of this address. */ + addressVersion: AddrVersion; } export interface ScriptKey { @@ -581,6 +830,23 @@ export interface KeyDescriptor { keyLoc: KeyLocator | undefined; } +export interface TapscriptFullTree { + /** The complete, ordered list of all tap leaves of the tree. */ + allLeaves: TapLeaf[]; +} + +export interface TapLeaf { + /** The script of the tap leaf. */ + script: Uint8Array | string; +} + +export interface TapBranch { + /** The TapHash of the left child of the root hash of a Tapscript tree. */ + leftTaphash: Uint8Array | string; + /** The TapHash of the right child of the root hash of a Tapscript tree. */ + rightTaphash: Uint8Array | string; +} + export interface DecodeAddrRequest { addr: string; } @@ -767,61 +1033,6 @@ export interface GetInfoResponse { syncToChain: boolean; } -export interface SubscribeSendAssetEventNtfnsRequest {} - -export interface SendAssetEvent { - /** An event which indicates that a send state is about to be executed. */ - executeSendStateEvent: ExecuteSendStateEvent | undefined; - /** - * An event which indicates that the proof transfer backoff wait period - * will start imminently. - */ - proofTransferBackoffWaitEvent: ProofTransferBackoffWaitEvent | undefined; -} - -export interface ExecuteSendStateEvent { - /** Execute timestamp (microseconds). */ - timestamp: string; - /** The send state that is about to be executed. */ - sendState: string; -} - -export interface ProofTransferBackoffWaitEvent { - /** Transfer attempt timestamp (microseconds). */ - timestamp: string; - /** Backoff is the active backoff wait duration. */ - backoff: string; - /** - * Tries counter is the number of tries we've made so far during the - * course of the current backoff procedure to deliver the proof to the - * receiver. - */ - triesCounter: string; - /** The type of proof transfer attempt. */ - transferType: ProofTransferType; -} - -export interface SubscribeReceiveAssetEventNtfnsRequest {} - -export interface AssetReceiveCompleteEvent { - /** Event creation timestamp. */ - timestamp: string; - /** The address that received the asset. */ - address: Addr | undefined; - /** The outpoint of the transaction that was used to receive the asset. */ - outpoint: string; -} - -export interface ReceiveAssetEvent { - /** - * An event which indicates that the proof transfer backoff wait period - * will start imminently. - */ - proofTransferBackoffWaitEvent: ProofTransferBackoffWaitEvent | undefined; - /** An event which indicates that an asset receive process has finished. */ - assetReceiveCompleteEvent: AssetReceiveCompleteEvent | undefined; -} - export interface FetchAssetMetaRequest { /** The asset ID of the asset to fetch the meta for. */ assetId: Uint8Array | string | undefined; @@ -845,6 +1056,8 @@ export interface BurnAssetRequest { * for the burn to succeed. */ confirmationText: string; + /** A note that may contain user defined metadata related to this burn. */ + note: string; } export interface BurnAssetResponse { @@ -854,6 +1067,32 @@ export interface BurnAssetResponse { burnProof: DecodedProof | undefined; } +export interface ListBurnsRequest { + /** The asset id of the burnt asset. */ + assetId: Uint8Array | string; + /** The tweaked group key of the group this asset belongs to. */ + tweakedGroupKey: Uint8Array | string; + /** The txid of the transaction that the burn was anchored to. */ + anchorTxid: Uint8Array | string; +} + +export interface AssetBurn { + /** A note that may contain user defined metadata related to this burn. */ + note: string; + /** The asset id of the burnt asset. */ + assetId: Uint8Array | string; + /** The tweaked group key of the group this asset belongs to. */ + tweakedGroupKey: Uint8Array | string; + /** The amount of burnt assets. */ + amount: string; + /** The txid of the transaction that the burn was anchored to. */ + anchorTxid: Uint8Array | string; +} + +export interface ListBurnsResponse { + burns: AssetBurn[]; +} + export interface OutPoint { /** Raw bytes representing the transaction id. */ txid: Uint8Array | string; @@ -861,6 +1100,109 @@ export interface OutPoint { outputIndex: number; } +export interface SubscribeReceiveEventsRequest { + /** + * Filter receives by a specific address. Leave empty to get all receive + * events for all addresses. + */ + filterAddr: string; + /** + * The start time as a Unix timestamp in microseconds. If not set (default + * value 0), the daemon will start streaming events from the current time. + */ + startTimestamp: string; +} + +export interface ReceiveEvent { + /** Event creation timestamp (Unix timestamp in microseconds). */ + timestamp: string; + /** The address that received the asset. */ + address: Addr | undefined; + /** The outpoint of the transaction that was used to receive the asset. */ + outpoint: string; + /** + * The status of the event. If error below is set, then the status is the + * state that lead to the error during its execution. + */ + status: AddrEventStatus; + /** + * The height of the block the asset receive transaction was mined in. This + * is only set if the status is ADDR_EVENT_STATUS_TRANSACTION_CONFIRMED or + * later. + */ + confirmationHeight: number; + /** An optional error, indicating that executing the status above failed. */ + error: string; +} + +export interface SubscribeSendEventsRequest { + /** + * Filter send events by a specific recipient script key. Leave empty to get + * all receive events for all parcels. + */ + filterScriptKey: Uint8Array | string; +} + +export interface SendEvent { + /** Execute timestamp (Unix timestamp in microseconds). */ + timestamp: string; + /** + * The send state that was executed successfully. If error below is set, + * then the send_state is the state that lead to the error during its + * execution. + */ + sendState: string; + /** The type of the outbound send parcel. */ + parcelType: ParcelType; + /** + * The list of addresses the parcel sends to (recipient addresses only, not + * including change going back to own wallet). This is only set for parcels + * of type PARCEL_TYPE_ADDRESS. + */ + addresses: Addr[]; + /** The virtual packets that are part of the parcel. */ + virtualPackets: Uint8Array | string[]; + /** + * The passive virtual packets that are carried along with the parcel. This + * is empty if there were no other assets in the input commitment that is + * being spent with the "active" virtual packets above. + */ + passiveVirtualPackets: Uint8Array | string[]; + /** + * The Bitcoin on-chain anchor transaction that commits the sent assets + * on-chain. This is only set after the send state SEND_STATE_ANCHOR_SIGN. + */ + anchorTransaction: AnchorTransaction | undefined; + /** + * The final transfer as it will be stored in the database. This is only set + * after the send state SEND_STATE_LOG_COMMITMENT. + */ + transfer: AssetTransfer | undefined; + /** An optional error, indicating that executing the send_state failed. */ + error: string; +} + +export interface AnchorTransaction { + anchorPsbt: Uint8Array | string; + /** The index of the (added) change output or -1 if no change was left over. */ + changeOutputIndex: number; + /** + * The total number of satoshis in on-chain fees paid by the anchor + * transaction. + */ + chainFeesSats: string; + /** The fee rate in sat/kWU that was targeted by the anchor transaction. */ + targetFeeRateSatKw: number; + /** + * The list of UTXO lock leases that were acquired for the inputs in the funded + * PSBT packet from lnd. Only inputs added to the PSBT by this RPC are locked, + * inputs that were already present in the PSBT are not locked. + */ + lndLockedUtxos: OutPoint[]; + /** The final, signed anchor transaction that was broadcast to the network. */ + finalTx: Uint8Array | string; +} + export interface TaprootAssets { /** * tapcli: `assets list` @@ -983,29 +1325,20 @@ export interface TaprootAssets { burnAsset( request?: DeepPartial ): Promise; + /** + * tapcli: `assets listburns` + * ListBurns lists the asset burns that this wallet has performed. These assets + * are not recoverable in any way. Filters may be applied to return more + * specific results. + */ + listBurns( + request?: DeepPartial + ): Promise; /** * tapcli: `getinfo` * GetInfo returns the information for the node. */ getInfo(request?: DeepPartial): Promise; - /** - * SubscribeSendAssetEventNtfns registers a subscription to the event - * notification stream which relates to the asset sending process. - */ - subscribeSendAssetEventNtfns( - request?: DeepPartial, - onMessage?: (msg: SendAssetEvent) => void, - onError?: (err: Error) => void - ): void; - /** - * SubscribeReceiveAssetEventNtfns registers a subscription to the event - * notification stream which relates to the asset receive process. - */ - subscribeReceiveAssetEventNtfns( - request?: DeepPartial, - onMessage?: (msg: ReceiveAssetEvent) => void, - onError?: (err: Error) => void - ): void; /** * tapcli: `assets meta` * FetchAssetMeta allows a caller to fetch the reveal meta data for an asset @@ -1014,6 +1347,26 @@ export interface TaprootAssets { fetchAssetMeta( request?: DeepPartial ): Promise; + /** + * tapcli: `events receive` + * SubscribeReceiveEvents allows a caller to subscribe to receive events for + * incoming asset transfers. + */ + subscribeReceiveEvents( + request?: DeepPartial, + onMessage?: (msg: ReceiveEvent) => void, + onError?: (err: Error) => void + ): void; + /** + * tapcli: `events send` + * SubscribeSendEvents allows a caller to subscribe to send events for outgoing + * asset transfers. + */ + subscribeSendEvents( + request?: DeepPartial, + onMessage?: (msg: SendEvent) => void, + onError?: (err: Error) => void + ): void; } type Builtin = diff --git a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/universerpc/universe.ts b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/universerpc/universe.ts index c490eed15..c6f7d36b6 100644 --- a/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/universerpc/universe.ts +++ b/zeus_modules/@lightninglabs/lnc-core/lib/types/proto/tapd/universerpc/universe.ts @@ -47,6 +47,23 @@ export enum AssetTypeFilter { UNRECOGNIZED = 'UNRECOGNIZED' } +export interface MultiverseRootRequest { + /** The proof type to calculate the multiverse root for. */ + proofType: ProofType; + /** + * An optional list of universe IDs to include in the multiverse root. If + * none are specified, then all known universes of the given proof type are + * included. NOTE: The proof type within the IDs must either be unspecified + * or match the proof type above. + */ + specificIds: ID[]; +} + +export interface MultiverseRootResponse { + /** The root of the multiverse tree. */ + multiverseRoot: MerkleSumNode | undefined; +} + export interface AssetRootRequest { /** * If true, then the response will include the amounts for each asset ID @@ -199,7 +216,7 @@ export interface UniverseKey { } export interface AssetProofResponse { - /** The request original request for the issuance proof. */ + /** The original request for the issuance proof. */ req: UniverseKey | undefined; /** The Universe root that includes this asset leaf. */ universeRoot: UniverseRoot | undefined; @@ -229,6 +246,18 @@ export interface AssetProof { assetLeaf: AssetLeaf | undefined; } +export interface PushProofRequest { + /** The ID of the asset to push the proof for. */ + key: UniverseKey | undefined; + /** The universe server to push the proof to. */ + server: UniverseFederationServer | undefined; +} + +export interface PushProofResponse { + /** The ID of the asset a push was requested for. */ + key: UniverseKey | undefined; +} + export interface InfoRequest {} export interface InfoResponse { @@ -439,6 +468,15 @@ export interface QueryFederationSyncConfigResponse { } export interface Universe { + /** + * tapcli: `universe multiverse` + * MultiverseRoot returns the root of the multiverse tree. This is useful to + * determine the equality of two multiverse trees, since the root can directly + * be compared to another multiverse root to find out if a sync is required. + */ + multiverseRoot( + request?: DeepPartial + ): Promise; /** * tapcli: `universe roots` * AssetRoots queries for the known Universe roots associated with each known @@ -502,6 +540,15 @@ export interface Universe { * updated asset_id/group_key. */ insertProof(request?: DeepPartial): Promise; + /** + * tapcli: `universe proofs push` + * PushProof attempts to query the local universe for a proof specified by a + * UniverseKey. If found, a connection is made to a remote Universe server to + * attempt to upload the asset leaf. + */ + pushProof( + request?: DeepPartial + ): Promise; /** * tapcli: `universe info` * Info returns a set of information about the current state of the Universe. diff --git a/zeus_modules/@lightninglabs/lnc-core/package.json b/zeus_modules/@lightninglabs/lnc-core/package.json index 3e4d1f391..42da9b37d 100644 --- a/zeus_modules/@lightninglabs/lnc-core/package.json +++ b/zeus_modules/@lightninglabs/lnc-core/package.json @@ -5,12 +5,12 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "config": { - "lnd_release_tag": "v0.18.3-beta", - "loop_release_tag": "v0.28.5-beta", - "pool_release_tag": "v0.6.5-beta", + "lnd_release_tag": "v0.18.4-beta", + "loop_release_tag": "v0.29.0-beta", + "pool_release_tag": "v0.6.4-beta", "faraday_release_tag": "v0.2.13-alpha", - "tapd_release_tag": "v0-3-3-lnd-18", - "lit_release_tag": "v0.13.2-alpha", + "tapd_release_tag": "v0.5.0-rc2", + "lit_release_tag": "v0.13.6-alpha", "protoc_version": "21.9" }, "scripts": { diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.2-alpha/firewall.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.6-alpha/firewall.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.2-alpha/firewall.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.6-alpha/firewall.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.2-alpha/lit-autopilot.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.6-alpha/lit-autopilot.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.2-alpha/lit-autopilot.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.6-alpha/lit-autopilot.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.2-alpha/lit-sessions.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.6-alpha/lit-sessions.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.2-alpha/lit-sessions.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.6-alpha/lit-sessions.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.2-alpha/lit-status.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.6-alpha/lit-status.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.2-alpha/lit-status.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lit/v0.13.6-alpha/lit-status.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/autopilotrpc/autopilot.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/autopilotrpc/autopilot.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/autopilotrpc/autopilot.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/autopilotrpc/autopilot.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/chainrpc/chainnotifier.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/chainrpc/chainnotifier.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/chainrpc/chainnotifier.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/chainrpc/chainnotifier.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/invoicesrpc/invoices.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/invoicesrpc/invoices.proto similarity index 73% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/invoicesrpc/invoices.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/invoicesrpc/invoices.proto index 7afffba4e..d9d3bc123 100644 --- a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/invoicesrpc/invoices.proto +++ b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/invoicesrpc/invoices.proto @@ -55,10 +55,19 @@ service Invoices { rpc SettleInvoice (SettleInvoiceMsg) returns (SettleInvoiceResp); /* - LookupInvoiceV2 attempts to look up at invoice. An invoice can be refrenced + LookupInvoiceV2 attempts to look up at invoice. An invoice can be referenced using either its payment hash, payment address, or set ID. */ rpc LookupInvoiceV2 (LookupInvoiceMsg) returns (lnrpc.Invoice); + + /* + HtlcModifier is a bidirectional streaming RPC that allows a client to + intercept and modify the HTLCs that attempt to settle the given invoice. The + server will send HTLCs of invoices to the client and the client can modify + some aspects of the HTLC in order to pass the invoice acceptance tests. + */ + rpc HtlcModifier (stream HtlcModifyResponse) + returns (stream HtlcModifyRequest); } message CancelInvoiceMsg { @@ -192,3 +201,51 @@ message LookupInvoiceMsg { LookupModifier lookup_modifier = 4; } + +// CircuitKey is a unique identifier for an HTLC. +message CircuitKey { + // The id of the channel that the is part of this circuit. + uint64 chan_id = 1; + + // The index of the incoming htlc in the incoming channel. + uint64 htlc_id = 2; +} + +message HtlcModifyRequest { + // The invoice the intercepted HTLC is attempting to settle. The HTLCs in + // the invoice are only HTLCs that have already been accepted or settled, + // not including the current intercepted HTLC. + lnrpc.Invoice invoice = 1; + + // The unique identifier of the HTLC of this intercepted HTLC. + CircuitKey exit_htlc_circuit_key = 2; + + // The amount in milli-satoshi that the exit HTLC is attempting to pay. + uint64 exit_htlc_amt = 3; + + // The absolute expiry height of the exit HTLC. + uint32 exit_htlc_expiry = 4; + + // The current block height. + uint32 current_height = 5; + + // The wire message custom records of the exit HTLC. + map exit_htlc_wire_custom_records = 6; +} + +message HtlcModifyResponse { + // The circuit key of the HTLC that the client wants to modify. + CircuitKey circuit_key = 1; + + // The modified amount in milli-satoshi that the exit HTLC is paying. This + // value can be different from the actual on-chain HTLC amount, in case the + // HTLC carries other valuable items, as can be the case with custom channel + // types. + optional uint64 amt_paid = 2; + + // This flag indicates whether the HTLCs associated with the invoices should + // be cancelled. The interceptor client may set this field if some + // unexpected behavior is encountered. Setting this will ignore the amt_paid + // field. + bool cancel_set = 3; +} diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/lightning.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/lightning.proto similarity index 98% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/lightning.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/lightning.proto index 201bb0df2..644930515 100644 --- a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/lightning.proto +++ b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/lightning.proto @@ -1388,8 +1388,14 @@ enum CommitmentType { A channel that uses musig2 for the funding output, and the new tapscript features where relevant. */ - // TODO(roasbeef): need script enforce mirror type for the above as well? SIMPLE_TAPROOT = 5; + + /* + Identical to the SIMPLE_TAPROOT channel type, but with extra functionality. + This channel type also commits to additional meta data in the tapscript + leaves for the scripts in a channel. + */ + SIMPLE_TAPROOT_OVERLAY = 6; } message ChannelConstraints { @@ -1592,6 +1598,11 @@ message Channel { the channel's operation. */ string memo = 36; + + /* + Custom channel data that might be populated in custom channels. + */ + bytes custom_channel_data = 37; } message ListChannelsRequest { @@ -2028,10 +2039,38 @@ message ChannelOpenUpdate { ChannelPoint channel_point = 1; } +message CloseOutput { + // The amount in satoshi of this close output. This amount is the final + // commitment balance of the channel and the actual amount paid out on chain + // might be smaller due to subtracted fees. + int64 amount_sat = 1; + + // The pkScript of the close output. + bytes pk_script = 2; + + // Whether this output is for the local or remote node. + bool is_local = 3; + + // The TLV encoded custom channel data records for this output, which might + // be set for custom channels. + bytes custom_channel_data = 4; +} + message ChannelCloseUpdate { bytes closing_txid = 1; bool success = 2; + + // The local channel close output. If the local channel balance was dust to + // begin with, this output will not be set. + CloseOutput local_close_output = 3; + + // The remote channel close output. If the remote channel balance was dust + // to begin with, this output will not be set. + CloseOutput remote_close_output = 4; + + // Any additional outputs that might be added for custom channel types. + repeated CloseOutput additional_outputs = 5; } message CloseChannelRequest { @@ -2709,6 +2748,11 @@ message PendingChannelsResponse { impacts the channel's operation. */ string memo = 13; + + /* + Custom channel data that might be populated in custom channels. + */ + bytes custom_channel_data = 34; } message PendingOpenChannel { @@ -2968,6 +3012,12 @@ message ChannelBalanceResponse { // Sum of channels pending remote balances. Amount pending_open_remote_balance = 8; + + /* + Custom channel data that might be populated if there are custom channels + present. + */ + bytes custom_channel_data = 9; } message QueryRoutesRequest { @@ -3293,6 +3343,20 @@ message Route { The total amount in millisatoshis. */ int64 total_amt_msat = 6; + + /* + The actual on-chain amount that was sent out to the first hop. This value is + only different from the total_amt_msat field if this is a custom channel + payment and the value transported in the HTLC is different from the BTC + amount in the HTLC. If this value is zero, then this is an old payment that + didn't have this value yet and can be ignored. + */ + int64 first_hop_amount_msat = 7; + + /* + Custom channel data that might be populated in custom channels. + */ + bytes custom_channel_data = 8; } message NodeInfoRequest { @@ -3922,6 +3986,11 @@ message InvoiceHTLC { // Details relevant to AMP HTLCs, only populated if this is an AMP HTLC. AMP amp = 11; + + /* + Custom channel data that might be populated in custom channels. + */ + bytes custom_channel_data = 12; } // Details specific to AMP HTLCs. @@ -4162,6 +4231,12 @@ message Payment { uint64 payment_index = 15; PaymentFailureReason failure_reason = 16; + + /* + The custom TLV records that were sent to the first hop as part of the HTLC + wire message for this payment. + */ + map first_hop_custom_records = 17; } message HTLCAttempt { diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/routerrpc/router.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/routerrpc/router.proto similarity index 89% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/routerrpc/router.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/routerrpc/router.proto index 1856bccbe..92da75192 100644 --- a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/routerrpc/router.proto +++ b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/routerrpc/router.proto @@ -176,6 +176,25 @@ service Router { */ rpc UpdateChanStatus (UpdateChanStatusRequest) returns (UpdateChanStatusResponse); + + /* + XAddLocalChanAliases is an experimental API that creates a set of new + channel SCID alias mappings. The final total set of aliases in the manager + after the add operation is returned. This is only a locally stored alias, + and will not be communicated to the channel peer via any message. Therefore, + routing over such an alias will only work if the peer also calls this same + RPC on their end. If an alias already exists, an error is returned + */ + rpc XAddLocalChanAliases (AddAliasesRequest) returns (AddAliasesResponse); + + /* + XDeleteLocalChanAliases is an experimental API that deletes a set of alias + mappings. The final total set of aliases in the manager after the delete + operation is returned. The deletion will not be communicated to the channel + peer via any message. + */ + rpc XDeleteLocalChanAliases (DeleteAliasesRequest) + returns (DeleteAliasesResponse); } message SendPaymentRequest { @@ -339,6 +358,15 @@ message SendPaymentRequest { being sent. */ bool cancelable = 24; + + /* + An optional field that can be used to pass an arbitrary set of TLV records + to the first hop peer of this payment. This can be used to pass application + specific data during the payment attempt. Record types are required to be in + the custom range >= 65536. When using REST, the values must be encoded as + base64. + */ + map first_hop_custom_records = 25; } message TrackPaymentRequest { @@ -432,6 +460,15 @@ message SendToRouteRequest { routes, incorrect payment details, or insufficient funds. */ bool skip_temp_err = 3; + + /* + An optional field that can be used to pass an arbitrary set of TLV records + to the first hop peer of this payment. This can be used to pass application + specific data during the payment attempt. Record types are required to be in + the custom range >= 65536. When using REST, the values must be encoded as + base64. + */ + map first_hop_custom_records = 4; } message SendToRouteResponse { @@ -707,6 +744,15 @@ message BuildRouteRequest { This is also called payment secret in specifications (e.g. BOLT 11). */ bytes payment_addr = 5; + + /* + An optional field that can be used to pass an arbitrary set of TLV records + to the first hop peer of this payment. This can be used to pass application + specific data during the payment attempt. Record types are required to be in + the custom range >= 65536. When using REST, the values must be encoded as + base64. + */ + map first_hop_custom_records = 6; } message BuildRouteResponse { @@ -963,12 +1009,17 @@ message ForwardHtlcInterceptRequest { // The block height at which this htlc will be auto-failed to prevent the // channel from force-closing. int32 auto_fail_height = 10; + + // The custom records of the peer's incoming p2p wire message. + map in_wire_custom_records = 11; } /** ForwardHtlcInterceptResponse enables the caller to resolve a previously hold forward. The caller can choose either to: - `Resume`: Execute the default behavior (usually forward). +- `ResumeModified`: Execute the default behavior (usually forward) with HTLC + field modifications. - `Reject`: Fail the htlc backwards. - `Settle`: Settle this htlc with a given preimage. */ @@ -999,12 +1050,36 @@ message ForwardHtlcInterceptResponse { // For backwards-compatibility reasons, TEMPORARY_CHANNEL_FAILURE is the // default value for this field. lnrpc.Failure.FailureCode failure_code = 5; + + // The amount that was set on the p2p wire message of the incoming HTLC. + // This field is ignored if the action is not RESUME_MODIFIED or the amount + // is zero. + uint64 in_amount_msat = 6; + + // The amount to set on the p2p wire message of the resumed HTLC. This field + // is ignored if the action is not RESUME_MODIFIED or the amount is zero. + uint64 out_amount_msat = 7; + + // Any custom records that should be set on the p2p wire message message of + // the resumed HTLC. This field is ignored if the action is not + // RESUME_MODIFIED. + map out_wire_custom_records = 8; } enum ResolveHoldForwardAction { + // SETTLE is an action that is used to settle an HTLC instead of forwarding + // it. SETTLE = 0; + + // FAIL is an action that is used to fail an HTLC backwards. FAIL = 1; + + // RESUME is an action that is used to resume a forward HTLC. RESUME = 2; + + // RESUME_MODIFIED is an action that is used to resume a hold forward HTLC + // with modifications specified during interception. + RESUME_MODIFIED = 3; } message UpdateChanStatusRequest { @@ -1021,3 +1096,19 @@ enum ChanStatusAction { message UpdateChanStatusResponse { } + +message AddAliasesRequest { + repeated lnrpc.AliasMap alias_maps = 1; +} + +message AddAliasesResponse { + repeated lnrpc.AliasMap alias_maps = 1; +} + +message DeleteAliasesRequest { + repeated lnrpc.AliasMap alias_maps = 1; +} + +message DeleteAliasesResponse { + repeated lnrpc.AliasMap alias_maps = 1; +} \ No newline at end of file diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/signrpc/signer.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/signrpc/signer.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/signrpc/signer.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/signrpc/signer.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/walletrpc/walletkit.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/walletrpc/walletkit.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/walletrpc/walletkit.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/walletrpc/walletkit.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/walletunlocker.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/walletunlocker.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/walletunlocker.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/walletunlocker.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/watchtowerrpc/watchtower.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/watchtowerrpc/watchtower.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/watchtowerrpc/watchtower.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/watchtowerrpc/watchtower.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/wtclientrpc/wtclient.proto b/zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/wtclientrpc/wtclient.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.3-beta/wtclientrpc/wtclient.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/lnd/v0.18.4-beta/wtclientrpc/wtclient.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/client.proto b/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/client.proto similarity index 75% rename from zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/client.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/client.proto index 24c5df3ea..78677826e 100644 --- a/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/client.proto +++ b/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/client.proto @@ -89,6 +89,12 @@ service SwapClient { */ rpc GetLsatTokens (TokensRequest) returns (TokensResponse); + /* loop: `fetchl402` + FetchL402Token fetches an L402 token from the server, this is required in + order to receive reservation notifications from the server. + */ + rpc FetchL402Token (FetchL402TokenRequest) returns (FetchL402TokenResponse); + /* loop: `getinfo` GetInfo gets basic information about the loop daemon. */ @@ -143,6 +149,51 @@ service SwapClient { */ rpc ListInstantOuts (ListInstantOutsRequest) returns (ListInstantOutsResponse); + + /* loop: `static newstaticaddress` + NewStaticAddress requests a new static address for loop-ins from the server. + */ + rpc NewStaticAddress (NewStaticAddressRequest) + returns (NewStaticAddressResponse); + + /* loop: `static listunspentdeposits` + ListUnspentDeposits returns a list of utxos deposited at a static address. + */ + rpc ListUnspentDeposits (ListUnspentDepositsRequest) + returns (ListUnspentDepositsResponse); + + /* loop:`static withdraw` + WithdrawDeposits withdraws a selection or all deposits of a static address. + */ + rpc WithdrawDeposits (WithdrawDepositsRequest) + returns (WithdrawDepositsResponse); + + /* loop:`listdeposits` + ListStaticAddressDeposits returns a list of filtered static address + deposits. + */ + rpc ListStaticAddressDeposits (ListStaticAddressDepositsRequest) + returns (ListStaticAddressDepositsResponse); + + /* loop:`listswaps` + ListStaticAddressSwaps returns a list of filtered static address + swaps. + */ + rpc ListStaticAddressSwaps (ListStaticAddressSwapsRequest) + returns (ListStaticAddressSwapsResponse); + + /* loop:`static summary` + GetStaticAddressSummary returns a summary of static address related + statistics. + */ + rpc GetStaticAddressSummary (StaticAddressSummaryRequest) + returns (StaticAddressSummaryResponse); + + /* loop:`static` + StaticAddressLoopIn initiates a static address loop-in swap. + */ + rpc StaticAddressLoopIn (StaticAddressLoopInRequest) + returns (StaticAddressLoopInResponse); } message LoopOutRequest { @@ -735,6 +786,13 @@ message QuoteRequest { probing and payment. */ bool private = 7; + + /* + Static address deposit outpoints that will be quoted for. This option only + pertains to loop in swaps. Either this or the amt parameter can be set at + the same time. + */ + repeated string deposit_outpoints = 8; } message InQuoteResponse { @@ -830,6 +888,12 @@ message TokensResponse { repeated L402Token tokens = 1; } +message FetchL402TokenRequest { +} + +message FetchL402TokenResponse { +} + message L402Token { /* The base macaroon that was baked by the auth server. @@ -1326,20 +1390,24 @@ message ClientReservation { The state the reservation is in. */ string state = 2; + /* - The amount that the reservation is for. + The amount that the reservation is for. */ uint64 amount = 3; + /* - The transaction id of the reservation. + The transaction id of the reservation. */ string tx_id = 4; + /* - The vout of the reservation. + The vout of the reservation. */ uint32 vout = 5; + /* - The expiry of the reservation. + The expiry of the reservation. */ uint32 expiry = 6; } @@ -1369,10 +1437,12 @@ message InstantOutResponse { The hash of the swap preimage. */ bytes instant_out_hash = 1; + /* The transaction id of the sweep transaction. */ string sweep_tx_id = 2; + /* The state of the swap. */ @@ -1440,3 +1510,493 @@ message InstantOut { */ string sweep_tx_id = 5; } + +message NewStaticAddressRequest { + /* + The client's public key for the 2-of-2 MuSig2 taproot static address. + */ + bytes client_key = 1; +} + +message NewStaticAddressResponse { + /* + The taproot static address. + */ + string address = 1; + + /* + The CSV expiry of the static address. + */ + uint32 expiry = 2; +} + +message ListUnspentDepositsRequest { + /* + The number of minimum confirmations a utxo must have to be listed. + */ + int32 min_confs = 1; + + /* + The number of maximum confirmations a utxo may have to be listed. A zero + value indicates that there is no maximum. + */ + int32 max_confs = 2; +} + +message ListUnspentDepositsResponse { + /* + A list of utxos behind the static address. + */ + repeated Utxo utxos = 1; +} + +message Utxo { + /* + The static address of the utxo. + */ + string static_address = 1; + + /* + The value of the unspent coin in satoshis. + */ + int64 amount_sat = 2; + + /* + The outpoint in the form txid:index. + */ + string outpoint = 3; + + /* + The number of confirmations for the Utxo. + */ + int64 confirmations = 4; +} + +message WithdrawDepositsRequest { + /* + The outpoints of the deposits to withdraw. + */ + repeated OutPoint outpoints = 1; + + /* + If set to true, all deposits will be withdrawn. + */ + bool all = 2; + + /* + The address to withdraw the funds to. + */ + string dest_addr = 3; + + /* + The fee rate in sat/vbyte to use for the withdrawal transaction. + */ + int64 sat_per_vbyte = 4; +} + +message WithdrawDepositsResponse { + /* + The transaction hash of the withdrawal transaction. + */ + string withdrawal_tx_hash = 1; + + /* + The pkscript of the withdrawal transaction. + */ + string pk_script = 2; +} + +message OutPoint { + /* + Raw bytes representing the transaction id. + */ + bytes txid_bytes = 1; + + /* + Reversed, hex-encoded string representing the transaction id. + */ + string txid_str = 2; + + /* + The index of the output on the transaction. + */ + uint32 output_index = 3; +} + +message ListStaticAddressDepositsRequest { + /* + Filters the list of all stored deposits by deposit state. + */ + DepositState state_filter = 1; + + /* + Filters the list of all stored deposits by the outpoint. + */ + repeated string outpoints = 2; +} + +message ListStaticAddressDepositsResponse { + /* + A list of all deposits that match the filtered state. + */ + repeated Deposit filtered_deposits = 1; +} + +message ListStaticAddressSwapsRequest { +} + +message ListStaticAddressSwapsResponse { + /* + A list of all swaps known static address loop-in swaps. + */ + repeated StaticAddressLoopInSwap swaps = 1; +} + +message StaticAddressSummaryRequest { +} + +message StaticAddressSummaryResponse { + /* + The static address of the client. + */ + string static_address = 1; + + /* + The CSV expiry of the static address. + */ + uint64 relative_expiry_blocks = 2; + + /* + The total number of deposits. + */ + uint32 total_num_deposits = 3; + + /* + The total value of unconfirmed deposits. + */ + int64 value_unconfirmed_satoshis = 4; + + /* + The total value of confirmed deposits. + */ + int64 value_deposited_satoshis = 5; + + /* + The total value of all expired deposits. + */ + int64 value_expired_satoshis = 6; + + /* + The total value of all deposits that have been withdrawn. + */ + int64 value_withdrawn_satoshis = 7; + + /* + The total value of all loop-ins that have been finalized. + */ + int64 value_looped_in_satoshis = 8; + + /* + The total value of all htlc timeout sweeps that the client swept. + */ + int64 value_htlc_timeout_sweeps_satoshis = 9; +} + +enum DepositState { + /* + UNKNOWN_STATE is the default state of a deposit. + */ + UNKNOWN_STATE = 0; + + /* + DEPOSITED indicates that the deposit has been sufficiently confirmed on + chain. + */ + DEPOSITED = 1; + + /* + WITHDRAWING indicates that the deposit is currently being withdrawn. It + flips to WITHDRAWN once the withdrawal transaction has been sufficiently + confirmed. + */ + WITHDRAWING = 2; + + /* + WITHDRAWN indicates that the deposit has been withdrawn. + */ + WITHDRAWN = 3; + + /* + LOOPING_IN indicates that the deposit is currently being used in a static + address loop-in swap. + */ + LOOPING_IN = 4; + + /* + LOOPED_IN indicates that the deposit was used in a static address loop-in + swap. + */ + LOOPED_IN = 5; + + /* + SWEEP_HTLC_TIMEOUT indicates that the deposit is part of an active loop-in + of which the respective htlc was published by the server and the timeout + path has opened up for the client to sweep. + */ + SWEEP_HTLC_TIMEOUT = 6; + + /* + HTLC_TIMEOUT_SWEPT indicates that the timeout path of the htlc has been + swept by the client. + */ + HTLC_TIMEOUT_SWEPT = 7; + + /* + PUBLISH_EXPIRED indicates that the deposit has expired and the sweep + transaction has been published. + */ + PUBLISH_EXPIRED = 8; + + /* + WAIT_FOR_EXPIRY_SWEEP indicates that the deposit has expired and the sweep + transaction has not yet been sufficiently confirmed. + */ + WAIT_FOR_EXPIRY_SWEEP = 9; + + /* + EXPIRED indicates that the deposit has expired and the sweep transaction + has been sufficiently confirmed. + */ + EXPIRED = 10; +} + +message Deposit { + /* + The identifier of the deposit. + */ + bytes id = 1; + + /* + The state of the deposit. + */ + DepositState state = 2; + + /* + The outpoint of the deposit in format txid:index. + */ + string outpoint = 3; + + /* + The value of the deposit in satoshis. + */ + int64 value = 4; + + /* + The block height at which the deposit was confirmed. + */ + int64 confirmation_height = 5; + + /* + The number of blocks that are left until the deposit cannot be used for a + loop-in swap anymore. + */ + int64 blocks_until_expiry = 6; +} + +message StaticAddressLoopInSwap { + /* + The swap hash of the swap. It represents the unique identifier of the swap. + */ + bytes swap_hash = 1; + + /* + */ + repeated string deposit_outpoints = 2; + + /* + */ + StaticAddressLoopInSwapState state = 3; + + /* + The swap amount of the swap. It is the sum of the values of the deposit + outpoints that were used for this swap. + */ + int64 swap_amount_satoshis = 4; + + /* + The invoiced swap amount. It is the swap amount minus the quoted server + fees. + */ + int64 payment_request_amount_satoshis = 5; +} + +enum StaticAddressLoopInSwapState { + /* + */ + UNKNOWN_STATIC_ADDRESS_SWAP_STATE = 0; + + /* + */ + INIT_HTLC = 1; + + /* + */ + SIGN_HTLC_TX = 2; + + /* + */ + MONITOR_INVOICE_HTLC_TX = 3; + + /* + */ + PAYMENT_RECEIVED = 4; + + /* + */ + SWEEP_STATIC_ADDRESS_HTLC_TIMEOUT = 5; + + /* + */ + MONITOR_HTLC_TIMEOUT_SWEEP = 6; + + /* + */ + HTLC_STATIC_ADDRESS_TIMEOUT_SWEPT = 7; + + /* + */ + SUCCEEDED = 8; + + /* + */ + SUCCEEDED_TRANSITIONING_FAILED = 9; + + /* + */ + UNLOCK_DEPOSITS = 10; + + /* + */ + FAILED_STATIC_ADDRESS_SWAP = 11; +} + +message StaticAddressLoopInRequest { + /* + The outpoints of the deposits to loop-in. + */ + repeated string outpoints = 1; + + /* + Maximum satoshis we are willing to pay the server for the swap. This value + is not disclosed in the swap initiation call, but if the server asks for a + higher fee, we abort the swap. Typically this value is taken from the + response of the GetQuote call. + */ + int64 max_swap_fee_satoshis = 2; + + /* + Optionally the client can specify the last hop pubkey when requesting a + loop-in quote. This is useful to get better off-chain routing fee from the + server. + */ + bytes last_hop = 3; + + /* + An optional label for this swap. This field is limited to 500 characters and + may not be one of the reserved values in loop/labels Reserved list. + */ + string label = 4; + + /* + An optional identification string that will be appended to the user agent + string sent to the server to give information about the usage of loop. This + initiator part is meant for user interfaces to add their name to give the + full picture of the binary used (loopd, LiT) and the method used for + triggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI). + */ + string initiator = 5; + + /* + Optional route hints to reach the destination through private channels. + */ + repeated looprpc.RouteHint route_hints = 6; + + /* + Private indicates whether the destination node should be considered private. + In which case, loop will generate hop hints to assist with probing and + payment. + */ + bool private = 7; + + /* + The swap payment timeout allows the user to specify an upper limit for the + amount of time the server is allowed to take to fulfill the off-chain swap + payment. If the timeout is reached the swap will be aborted on the server + side and the client can retry the swap with different parameters. + */ + uint32 payment_timeout_seconds = 8; +} + +message StaticAddressLoopInResponse { + /* + The swap hash that identifies this swap. + */ + bytes swap_hash = 1; + + /* + The state the swap is in. + */ + string state = 2; + + /* + The amount of the swap. + */ + uint64 amount = 3; + + /* + The htlc cltv expiry height of the swap. + */ + int32 htlc_cltv = 4; + + /* + The quoted swap fee in satoshis. + */ + int64 quoted_swap_fee_satoshis = 5; + + /* + The maximum total swap fee the client is willing to pay for the swap. + */ + int64 max_swap_fee_satoshis = 6; + + /* + The block height at which the swap was initiated. + */ + uint32 initiation_height = 7; + + /* + The static address protocol version. + */ + string protocol_version = 8; + + /* + An optional label for this swap. + */ + string label = 9; + + /* + An optional identification string that will be appended to the user agent + string sent to the server to give information about the usage of loop. This + initiator part is meant for user interfaces to add their name to give the + full picture of the binary used (loopd, LiT) and the method used for + triggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI). + */ + string initiator = 10; + + /* + The swap payment timeout allows the user to specify an upper limit for the + amount of time the server is allowed to take to fulfill the off-chain swap + payment. If the timeout is reached the swap will be aborted on the server + side and the client can retry the swap with different parameters. + */ + uint32 payment_timeout_seconds = 11; +} diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/debug.proto b/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/debug.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/debug.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/debug.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/swapserverrpc/common.proto b/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/swapserverrpc/common.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/swapserverrpc/common.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/swapserverrpc/common.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/swapserverrpc/server.proto b/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/swapserverrpc/server.proto similarity index 92% rename from zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/swapserverrpc/server.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/swapserverrpc/server.proto index 9362b8804..23195a874 100644 --- a/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.28.5-beta/swapserverrpc/server.proto +++ b/zeus_modules/@lightninglabs/lnc-core/protos/loop/v0.29.0-beta/swapserverrpc/server.proto @@ -6,6 +6,7 @@ syntax = "proto3"; // different golang and RPC package names to fix protobuf namespace conflicts. package looprpc; import "common.proto"; +import "reservation.proto"; option go_package = "github.com/lightninglabs/loop/swapserverrpc"; @@ -50,6 +51,9 @@ service SwapServer { // FetchL402 is a simple non-l402-allowlisted request that is required // in order to force the creation of an l402. rpc FetchL402 (FetchL402Request) returns (FetchL402Response); + + rpc SubscribeNotifications (SubscribeNotificationsRequest) + returns (stream SubscribeNotificationsResponse); } /** @@ -284,6 +288,12 @@ message ServerLoopInQuoteRequest { // loopd/v0.10.0-beta/commit=3b635821 // litd/v0.2.0-alpha/commit=326d754 string user_agent = 6; + + // The number of static address deposits the client wants to quote for. + // If the number of deposits exceeds one the server will apply a per-input + // service fee. This is to cover for the increased on-chain fee the server + // has to pay when the sweeping transaction is broadcast. + uint32 num_static_address_deposits = 7; } message ServerLoopInQuoteResponse { @@ -514,6 +524,7 @@ message ServerProbeRequest { // The protocol version that the client adheres to. ProtocolVersion protocol_version = 1; + // The probe amount. uint64 amt = 2; // The target node for the probe. @@ -638,18 +649,41 @@ message ServerPushKeyRes { } // FetchL402Request is an empty request sent from the client to the server to -// fetch the lnd l402. +// fetch the lnd L402. message FetchL402Request { } // FetchL402Response is an empty response sent from the server to the client to -// confirm the lnd l402. +// confirm the lnd L402. message FetchL402Response { } -// StaticAddressProtocolVersion represents the static address protocol version -// the client adheres to. -enum StaticAddressProtocolVersion { - // V0 is the initially released static address protocol version. - V0 = 0; -} \ No newline at end of file +// SubscribeNotificationsRequest is a request to subscribe to notifications. +message SubscribeNotificationsRequest { +} + +// SubscribeNotificationsResponse is a response to a +// SubscribeNotificationsRequest. +message SubscribeNotificationsResponse { + oneof notification { + ServerReservationNotification reservation_notification = 1; + ServerStaticLoopInSweepNotification static_loop_in_sweep = 2; + } +} + +// ServerStaticLoopInSweepNotification is a request from the server to the +// client to cosign a transaction that contains deposits from a finished static +// loop ins. +message ServerStaticLoopInSweepNotification { + // The psbt of the sweep transaction. + bytes sweep_tx_psbt = 1; + + // The swap hash the deposits are associated with. + bytes swap_hash = 2; + + // The map of deposit txid:idx to the nonce used by the server. + map deposit_to_nonces = 3; + + // The prevout information of the sweep txn. + repeated PrevoutInfo prevout_info = 4; +} diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.5-beta/auctioneerrpc/auctioneer.proto b/zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.4-beta/auctioneerrpc/auctioneer.proto similarity index 99% rename from zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.5-beta/auctioneerrpc/auctioneer.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.4-beta/auctioneerrpc/auctioneer.proto index dae9d6bf7..a753511ef 100644 --- a/zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.5-beta/auctioneerrpc/auctioneer.proto +++ b/zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.4-beta/auctioneerrpc/auctioneer.proto @@ -373,11 +373,6 @@ enum ChannelType { outputs that pay directly to the channel initiator (the seller). */ SCRIPT_ENFORCED_LEASE = 2; - - /* - A channel type that uses a Pay-to-Taproot output for the funding output. - */ - SIMPLE_TAPROOT = 3; } message ChannelInfo { @@ -902,11 +897,6 @@ enum OrderChannelType { channel initiator/seller. */ ORDER_CHANNEL_TYPE_SCRIPT_ENFORCED = 2; - - /* - A channel type that uses a Pay-to-Taproot output for the funding output. - */ - ORDER_CHANNEL_TYPE_SIMPLE_TAPROOT = 3; } enum AuctionType { diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.5-beta/auctioneerrpc/hashmail.proto b/zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.4-beta/auctioneerrpc/hashmail.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.5-beta/auctioneerrpc/hashmail.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.4-beta/auctioneerrpc/hashmail.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.5-beta/trader.proto b/zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.4-beta/trader.proto similarity index 100% rename from zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.5-beta/trader.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/pool/v0.6.4-beta/trader.proto diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/assetwalletrpc/assetwallet.proto b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/assetwalletrpc/assetwallet.proto deleted file mode 100644 index c73240d76..000000000 --- a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/assetwalletrpc/assetwallet.proto +++ /dev/null @@ -1,213 +0,0 @@ -syntax = "proto3"; - -import "taprootassets.proto"; - -package assetwalletrpc; - -option go_package = "github.com/lightninglabs/taproot-assets/taprpc/assetwalletrpc"; - -service AssetWallet { - /* - FundVirtualPsbt selects inputs from the available asset commitments to fund - a virtual transaction matching the template. - */ - rpc FundVirtualPsbt (FundVirtualPsbtRequest) - returns (FundVirtualPsbtResponse); - - /* - SignVirtualPsbt signs the inputs of a virtual transaction and prepares the - commitments of the inputs and outputs. - */ - rpc SignVirtualPsbt (SignVirtualPsbtRequest) - returns (SignVirtualPsbtResponse); - - /* - AnchorVirtualPsbts merges and then commits multiple virtual transactions in - a single BTC level anchor transaction. - - TODO(guggero): Actually implement accepting and merging multiple - transactions. - */ - rpc AnchorVirtualPsbts (AnchorVirtualPsbtsRequest) - returns (taprpc.SendAssetResponse); - - /* - NextInternalKey derives the next internal key for the given key family and - stores it as an internal key in the database to make sure it is identified - as a local key later on when importing proofs. While an internal key can - also be used as the internal key of a script key, it is recommended to use - the NextScriptKey RPC instead, to make sure the tweaked Taproot output key - is also recognized as a local key. - */ - rpc NextInternalKey (NextInternalKeyRequest) - returns (NextInternalKeyResponse); - - /* - NextScriptKey derives the next script key (and its corresponding internal - key) and stores them both in the database to make sure they are identified - as local keys later on when importing proofs. - */ - rpc NextScriptKey (NextScriptKeyRequest) returns (NextScriptKeyResponse); - - /* tapcli: `proofs proveownership` - ProveAssetOwnership creates an ownership proof embedded in an asset - transition proof. That ownership proof is a signed virtual transaction - spending the asset with a valid witness to prove the prover owns the keys - that can spend the asset. - */ - rpc ProveAssetOwnership (ProveAssetOwnershipRequest) - returns (ProveAssetOwnershipResponse); - - /* tapcli: `proofs verifyownership` - VerifyAssetOwnership verifies the asset ownership proof embedded in the - given transition proof of an asset and returns true if the proof is valid. - */ - rpc VerifyAssetOwnership (VerifyAssetOwnershipRequest) - returns (VerifyAssetOwnershipResponse); - - /* - RemoveUTXOLease removes the lease/lock/reservation of the given managed - UTXO. - */ - rpc RemoveUTXOLease (RemoveUTXOLeaseRequest) - returns (RemoveUTXOLeaseResponse); -} - -message FundVirtualPsbtRequest { - oneof template { - /* - Use an existing PSBT packet as the template for the funded PSBT. - - TODO(guggero): Actually implement this. We can't use the "reserved" - keyword here because we're in a oneof, so we add the field but implement - it later. - */ - bytes psbt = 1; - - /* - Use the asset outputs and optional asset inputs from this raw template. - */ - TxTemplate raw = 2; - } -} - -message FundVirtualPsbtResponse { - /* - The funded but not yet signed PSBT packet. - */ - bytes funded_psbt = 1; - - /* - The index of the added change output or -1 if no change was left over. - */ - int32 change_output_index = 2; -} - -message TxTemplate { - /* - An optional list of inputs to use. Every input must be an asset UTXO known - to the wallet. The sum of all inputs must be greater than or equal to the - sum of all outputs. - - If no inputs are specified, asset coin selection will be performed instead - and inputs of sufficient value will be added to the resulting PSBT. - */ - repeated PrevId inputs = 1; - - /* - A map of all Taproot Asset addresses mapped to the anchor transaction's - output index that should be sent to. - */ - map recipients = 2; -} - -message PrevId { - /* - The bitcoin anchor output on chain that contains the input asset. - */ - taprpc.OutPoint outpoint = 1; - - /* - The asset ID of the previous asset tree. - */ - bytes id = 2; - - /* - The tweaked Taproot output key committing to the possible spending - conditions of the asset. - */ - bytes script_key = 3; -} - -message SignVirtualPsbtRequest { - /* - The PSBT of the virtual transaction that should be signed. The PSBT must - contain all required inputs, outputs, UTXO data and custom fields required - to identify the signing key. - */ - bytes funded_psbt = 1; -} - -message SignVirtualPsbtResponse { - /* - The signed virtual transaction in PSBT format. - */ - bytes signed_psbt = 1; - - /* - The indices of signed inputs. - */ - repeated uint32 signed_inputs = 2; -} - -message AnchorVirtualPsbtsRequest { - /* - The list of virtual transactions that should be merged and committed to in - the BTC level anchor transaction. - */ - repeated bytes virtual_psbts = 1; -} - -message NextInternalKeyRequest { - uint32 key_family = 1; -} - -message NextInternalKeyResponse { - taprpc.KeyDescriptor internal_key = 1; -} - -message NextScriptKeyRequest { - uint32 key_family = 1; -} - -message NextScriptKeyResponse { - taprpc.ScriptKey script_key = 1; -} - -message ProveAssetOwnershipRequest { - bytes asset_id = 1; - - bytes script_key = 2; - - taprpc.OutPoint outpoint = 3; -} - -message ProveAssetOwnershipResponse { - bytes proof_with_witness = 1; -} - -message VerifyAssetOwnershipRequest { - bytes proof_with_witness = 1; -} - -message VerifyAssetOwnershipResponse { - bool valid_proof = 1; -} - -message RemoveUTXOLeaseRequest { - // The outpoint of the UTXO to remove the lease for. - taprpc.OutPoint outpoint = 1; -} - -message RemoveUTXOLeaseResponse { -} diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/mintrpc/mint.proto b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/mintrpc/mint.proto deleted file mode 100644 index d632e02e9..000000000 --- a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/mintrpc/mint.proto +++ /dev/null @@ -1,210 +0,0 @@ -syntax = "proto3"; - -import "taprootassets.proto"; - -package mintrpc; - -option go_package = "github.com/lightninglabs/taproot-assets/taprpc/mintrpc"; - -service Mint { - /* tapcli: `assets mint` - MintAsset will attempt to mint the set of assets (async by default to - ensure proper batching) specified in the request. The pending batch is - returned that shows the other pending assets that are part of the next - batch. This call will block until the operation succeeds (asset is staged - in the batch) or fails. - */ - rpc MintAsset (MintAssetRequest) returns (MintAssetResponse); - - /* tapcli: `assets mint finalize` - FinalizeBatch will attempt to finalize the current pending batch. - */ - rpc FinalizeBatch (FinalizeBatchRequest) returns (FinalizeBatchResponse); - - /* tapcli: `assets mint cancel` - CancelBatch will attempt to cancel the current pending batch. - */ - rpc CancelBatch (CancelBatchRequest) returns (CancelBatchResponse); - - /* tapcli: `assets mint batches` - ListBatches lists the set of batches submitted to the daemon, including - pending and cancelled batches. - */ - rpc ListBatches (ListBatchRequest) returns (ListBatchResponse); -} - -message PendingAsset { - // The version of asset to mint. - taprpc.AssetVersion asset_version = 1; - - // The type of the asset to be created. - taprpc.AssetType asset_type = 2; - - // The name, or "tag" of the asset. This will affect the final asset ID. - string name = 3; - - /* - A blob that resents metadata related to the asset. This will affect the - final asset ID. - */ - taprpc.AssetMeta asset_meta = 4; - - /* - The total amount of units of the new asset that should be created. If the - AssetType is Collectible, then this field cannot be set. - */ - uint64 amount = 5; - - /* - If true, then the asset will be created with a new group key, which allows - for future asset issuance. - */ - bool new_grouped_asset = 6; - - // The specific group key this asset should be minted with. - bytes group_key = 7; - - /* - The name of the asset in the batch that will anchor a new asset group. - This asset will be minted with the same group key as the anchor asset. - */ - string group_anchor = 8; -} - -message MintAsset { - // The version of asset to mint. - taprpc.AssetVersion asset_version = 1; - - // The type of the asset to be created. - taprpc.AssetType asset_type = 2; - - // The name, or "tag" of the asset. This will affect the final asset ID. - string name = 3; - - /* - A blob that resents metadata related to the asset. This will affect the - final asset ID. - */ - taprpc.AssetMeta asset_meta = 4; - - /* - The total amount of units of the new asset that should be created. If the - AssetType is Collectible, then this field cannot be set. - */ - uint64 amount = 5; - - /* - If true, then the asset will be created with a group key, which allows for - future asset issuance. - */ - bool new_grouped_asset = 6; - - /* - If true, then a group key or group anchor can be set to mint this asset into - an existing asset group. - */ - bool grouped_asset = 7; - - // The specific group key this asset should be minted with. - bytes group_key = 8; - - /* - The name of the asset in the batch that will anchor a new asset group. - This asset will be minted with the same group key as the anchor asset. - */ - string group_anchor = 9; -} - -message MintAssetRequest { - /* - The asset to be minted. - */ - MintAsset asset = 1; - - /* - If true, then the assets currently in the batch won't be returned in the - response. This is mainly to avoid a lot of data being transmitted and - possibly printed on the command line in the case of a very large batch. - */ - bool short_response = 2; -} - -message MintAssetResponse { - // The pending batch the asset was added to. - MintingBatch pending_batch = 1; -} - -message MintingBatch { - /* - A public key serialized in compressed format that can be used to uniquely - identify a pending minting batch. Responses that share the same key will be - batched into the same minting transaction. - */ - bytes batch_key = 1; - - /* - The transaction ID of the batch. Only populated if the batch has been - committed. - */ - string batch_txid = 2; - - // The state of the batch. - BatchState state = 3; - - // The assets that are part of the batch. - repeated PendingAsset assets = 4; -} - -enum BatchState { - BATCH_STATE_UNKNOWN = 0; - BATCH_STATE_PENDING = 1; - BATCH_STATE_FROZEN = 2; - BATCH_STATE_COMMITTED = 3; - BATCH_STATE_BROADCAST = 4; - BATCH_STATE_CONFIRMED = 5; - BATCH_STATE_FINALIZED = 6; - BATCH_STATE_SEEDLING_CANCELLED = 7; - BATCH_STATE_SPROUT_CANCELLED = 8; -} - -message FinalizeBatchRequest { - /* - If true, then the assets currently in the batch won't be returned in the - response. This is mainly to avoid a lot of data being transmitted and - possibly printed on the command line in the case of a very large batch. - */ - bool short_response = 1; - - // The optional fee rate to use for the minting transaction, in sat/kw. - uint32 fee_rate = 2; -} - -message FinalizeBatchResponse { - // The finalized batch. - MintingBatch batch = 1; -} - -message CancelBatchRequest { -} - -message CancelBatchResponse { - // The internal public key of the batch. - bytes batch_key = 1; -} - -message ListBatchRequest { - // The optional batch key of the batch to list. - oneof filter { - // The optional batch key of the batch to list, specified as raw bytes - // (gRPC only). - bytes batch_key = 1; - - // The optional batch key of the batch to list, specified as a hex - // encoded string (use this for REST). - string batch_key_str = 2; - } -} - -message ListBatchResponse { - repeated MintingBatch batches = 1; -} diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/assetwalletrpc/assetwallet.proto b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/assetwalletrpc/assetwallet.proto new file mode 100644 index 000000000..1fac8a5dd --- /dev/null +++ b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/assetwalletrpc/assetwallet.proto @@ -0,0 +1,480 @@ +syntax = "proto3"; + +import "taprootassets.proto"; + +package assetwalletrpc; + +option go_package = "github.com/lightninglabs/taproot-assets/taprpc/assetwalletrpc"; + +service AssetWallet { + /* + FundVirtualPsbt selects inputs from the available asset commitments to fund + a virtual transaction matching the template. + */ + rpc FundVirtualPsbt (FundVirtualPsbtRequest) + returns (FundVirtualPsbtResponse); + + /* + SignVirtualPsbt signs the inputs of a virtual transaction and prepares the + commitments of the inputs and outputs. + */ + rpc SignVirtualPsbt (SignVirtualPsbtRequest) + returns (SignVirtualPsbtResponse); + + /* + AnchorVirtualPsbts merges and then commits multiple virtual transactions in + a single BTC level anchor transaction. This RPC should be used if the BTC + level anchor transaction of the assets to be spent are encumbered by a + normal key and don't require any special spending conditions. For any custom + spending conditions on the BTC level, the two RPCs CommitVirtualPsbts and + PublishAndLogTransfer should be used instead (which in combination do the + same as this RPC but allow for more flexibility). + */ + rpc AnchorVirtualPsbts (AnchorVirtualPsbtsRequest) + returns (taprpc.SendAssetResponse); + + /* + CommitVirtualPsbts creates the output commitments and proofs for the given + virtual transactions by committing them to the BTC level anchor transaction. + In addition, the BTC level anchor transaction is funded and prepared up to + the point where it is ready to be signed. + */ + rpc CommitVirtualPsbts (CommitVirtualPsbtsRequest) + returns (CommitVirtualPsbtsResponse); + + /* + PublishAndLogTransfer accepts a fully committed and signed anchor + transaction and publishes it to the Bitcoin network. It also logs the + transfer of the given active and passive assets in the database and ships + any outgoing proofs to the counterparties. + */ + rpc PublishAndLogTransfer (PublishAndLogRequest) + returns (taprpc.SendAssetResponse); + + /* + NextInternalKey derives the next internal key for the given key family and + stores it as an internal key in the database to make sure it is identified + as a local key later on when importing proofs. While an internal key can + also be used as the internal key of a script key, it is recommended to use + the NextScriptKey RPC instead, to make sure the tweaked Taproot output key + is also recognized as a local key. + */ + rpc NextInternalKey (NextInternalKeyRequest) + returns (NextInternalKeyResponse); + + /* + NextScriptKey derives the next script key (and its corresponding internal + key) and stores them both in the database to make sure they are identified + as local keys later on when importing proofs. + */ + rpc NextScriptKey (NextScriptKeyRequest) returns (NextScriptKeyResponse); + + /* + QueryInternalKey returns the key descriptor for the given internal key. + */ + rpc QueryInternalKey (QueryInternalKeyRequest) + returns (QueryInternalKeyResponse); + + /* + QueryScriptKey returns the full script key descriptor for the given tweaked + script key. + */ + rpc QueryScriptKey (QueryScriptKeyRequest) returns (QueryScriptKeyResponse); + + /* tapcli: `proofs proveownership` + ProveAssetOwnership creates an ownership proof embedded in an asset + transition proof. That ownership proof is a signed virtual transaction + spending the asset with a valid witness to prove the prover owns the keys + that can spend the asset. + */ + rpc ProveAssetOwnership (ProveAssetOwnershipRequest) + returns (ProveAssetOwnershipResponse); + + /* tapcli: `proofs verifyownership` + VerifyAssetOwnership verifies the asset ownership proof embedded in the + given transition proof of an asset and returns true if the proof is valid. + */ + rpc VerifyAssetOwnership (VerifyAssetOwnershipRequest) + returns (VerifyAssetOwnershipResponse); + + /* + RemoveUTXOLease removes the lease/lock/reservation of the given managed + UTXO. + */ + rpc RemoveUTXOLease (RemoveUTXOLeaseRequest) + returns (RemoveUTXOLeaseResponse); + + /* + DeclareScriptKey declares a new script key to the wallet. This is useful + when the script key contains scripts, which would mean it wouldn't be + recognized by the wallet automatically. Declaring a script key will make any + assets sent to the script key be recognized as being local assets. + */ + rpc DeclareScriptKey (DeclareScriptKeyRequest) + returns (DeclareScriptKeyResponse); +} + +enum CoinSelectType { + /* + Use the default coin selection type, which currently allows script keys and + key spend paths. + */ + COIN_SELECT_DEFAULT = 0; + + /* + Explicitly only select inputs that are known to be BIP-086 compliant (have + a key-spend path only and no script tree). + */ + COIN_SELECT_BIP86_ONLY = 1; + + /* + Allow the selection of inputs that have a script tree spend path as well as + a key spend path. + */ + COIN_SELECT_SCRIPT_TREES_ALLOWED = 2; +} + +message FundVirtualPsbtRequest { + oneof template { + /* + Use an existing PSBT packet as the template for the funded PSBT. + */ + bytes psbt = 1; + + /* + Use the asset outputs and optional asset inputs from this raw template. + */ + TxTemplate raw = 2; + } + + /* + Specify the type of coins that should be selected. Defaults to allowing both + script trees and BIP-086 compliant inputs. + */ + CoinSelectType coin_select_type = 3; +} + +message FundVirtualPsbtResponse { + /* + The funded but not yet signed virtual PSBT packet. + */ + bytes funded_psbt = 1; + + /* + The index of the added change output or -1 if no change was left over. + */ + int32 change_output_index = 2; + + /* + The list of passive virtual transactions that are anchored in the same BTC + level anchor transaction inputs as the funded "active" asset above. These + assets can be ignored when using the AnchorVirtualPsbts RPC, since they are + retrieved, signed and committed automatically in that method. But the + passive assets have to be included in the CommitVirtualPsbts RPC which is + used when custom BTC level anchor transactions are created. + The main difference to the "active" asset above is that the passive assets + will not get their own entry in the transfer table of the database, since + they are just carried along and not directly affected by the direct user + action. + */ + repeated bytes passive_asset_psbts = 3; +} + +message TxTemplate { + /* + An optional list of inputs to use. Every input must be an asset UTXO known + to the wallet. The sum of all inputs must be greater than or equal to the + sum of all outputs. + + If no inputs are specified, asset coin selection will be performed instead + and inputs of sufficient value will be added to the resulting PSBT. + */ + repeated PrevId inputs = 1; + + /* + A map of all Taproot Asset addresses mapped to the anchor transaction's + output index that should be sent to. + */ + map recipients = 2; +} + +message PrevId { + /* + The bitcoin anchor output on chain that contains the input asset. + */ + taprpc.OutPoint outpoint = 1; + + /* + The asset ID of the previous asset tree. + */ + bytes id = 2; + + /* + The tweaked Taproot output key committing to the possible spending + conditions of the asset. + */ + bytes script_key = 3; +} + +message SignVirtualPsbtRequest { + /* + The PSBT of the virtual transaction that should be signed. The PSBT must + contain all required inputs, outputs, UTXO data and custom fields required + to identify the signing key. + */ + bytes funded_psbt = 1; +} + +message SignVirtualPsbtResponse { + /* + The signed virtual transaction in PSBT format. + */ + bytes signed_psbt = 1; + + /* + The indices of signed inputs. + */ + repeated uint32 signed_inputs = 2; +} + +message AnchorVirtualPsbtsRequest { + /* + The list of virtual transactions that should be merged and committed to in + the BTC level anchor transaction. + */ + repeated bytes virtual_psbts = 1; +} + +message CommitVirtualPsbtsRequest { + /* + The list of virtual transactions that should be mapped to the given BTC + level anchor transaction template. The virtual transactions are expected to + be signed (or use ASSET_VERSION_V1 with segregated witness to allow for + signing after committing) and ready to be committed to the anchor + transaction. + */ + repeated bytes virtual_psbts = 1; + + /* + The list of passive virtual transactions that are anchored in the same BTC + level anchor transaction inputs as the "active" assets above. These can be + obtained by calling FundVirtualPsbt and using the passive assets returned. + The virtual transactions are expected to be signed (or use ASSET_VERSION_V1 + with segregated witness to allow for signing after committing) and ready to + be committed to the anchor transaction. + The main difference to the "active" assets above is that the passive assets + will not get their own entry in the transfer table of the database, since + they are just carried along and not directly affected by the direct user + action. + */ + repeated bytes passive_asset_psbts = 2; + + /* + The template of the BTC level anchor transaction that the virtual + transactions should be mapped to. The template is expected to already + contain all asset related inputs and outputs corresponding to the virtual + transactions given above. This can be achieved by using + tapfreighter.PrepareAnchoringTemplate for example. + */ + bytes anchor_psbt = 3; + + oneof anchor_change_output { + /* + Use the existing output within the anchor PSBT with the specified + index as the change output. Any leftover change will be added to the + already specified amount of that output. To add a new change output to + the PSBT, set the "add" field below instead. + */ + int32 existing_output_index = 4; + + /* + Add a new P2TR change output to the PSBT if required. + */ + bool add = 5; + } + + oneof fees { + /* + The target number of blocks that the transaction should be confirmed in. + */ + uint32 target_conf = 6; + + /* + The fee rate, expressed in sat/vbyte, that should be used to fund the + BTC level anchor transaction. + */ + uint64 sat_per_vbyte = 7; + } +} + +message CommitVirtualPsbtsResponse { + /* + The funded BTC level anchor transaction with all outputs updated to commit + to the virtual transactions given. The transaction is ready to be signed, + unless some of the asset inputs don't belong to this daemon, in which case + the anchor input derivation info must be added to those inputs first. + */ + bytes anchor_psbt = 1; + + /* + The updated virtual transactions that now contain the state transition + proofs for being committed to the BTC level anchor transaction above. If the + assets in the virtual transaction outputs are ASSET_VERSION_V1 and not yet + signed, then the proofs need to be updated to include the witness before + they become fully valid. + */ + repeated bytes virtual_psbts = 2; + + /* + The updated passive virtual transactions that were committed to the same BTC + level anchor transaction as the "active" virtual transactions given. If the + assets in the virtual transaction outputs are ASSET_VERSION_V1 and not yet + signed, then the proofs need to be updated to include the witness before + they become fully valid. + */ + repeated bytes passive_asset_psbts = 4; + + /* + The index of the (added) change output or -1 if no change was left over. + */ + int32 change_output_index = 5; + + /* + The list of UTXO lock leases that were acquired for the inputs in the funded + PSBT packet from lnd. Only inputs added to the PSBT by this RPC are locked, + inputs that were already present in the PSBT are not locked. + */ + repeated taprpc.OutPoint lnd_locked_utxos = 6; +} + +message PublishAndLogRequest { + /* + The funded BTC level anchor transaction with all outputs updated to commit + to the virtual transactions given. The transaction is ready to be signed, + unless some of the asset inputs don't belong to this daemon, in which case + the anchor input derivation info must be added to those inputs first. + */ + bytes anchor_psbt = 1; + + /* + The updated virtual transactions that contain the state transition proofs + of being committed to the BTC level anchor transaction above. + */ + repeated bytes virtual_psbts = 2; + + /* + The updated passive virtual transactions that contain the state transition + proofs of being committed to the BTC level anchor transaction above. + */ + repeated bytes passive_asset_psbts = 3; + + /* + The index of the (added) change output or -1 if no change was left over. + */ + int32 change_output_index = 4; + + /* + The list of UTXO lock leases that were acquired for the inputs in the funded + PSBT packet from lnd. Only inputs added to the PSBT by this RPC are locked, + inputs that were already present in the PSBT are not locked. + */ + repeated taprpc.OutPoint lnd_locked_utxos = 5; +} + +message NextInternalKeyRequest { + uint32 key_family = 1; +} + +message NextInternalKeyResponse { + taprpc.KeyDescriptor internal_key = 1; +} + +message NextScriptKeyRequest { + uint32 key_family = 1; +} + +message NextScriptKeyResponse { + taprpc.ScriptKey script_key = 1; +} + +message QueryInternalKeyRequest { + // The internal key to look for. This can either be the 32-byte x-only raw + // internal key or the 33-byte raw internal key with the parity byte. + bytes internal_key = 1; +} + +message QueryInternalKeyResponse { + taprpc.KeyDescriptor internal_key = 1; +} + +message QueryScriptKeyRequest { + // The tweaked script key to look for. This can either be the 32-byte + // x-only tweaked script key or the 33-byte tweaked script key with the + // parity byte. + bytes tweaked_script_key = 1; +} + +message QueryScriptKeyResponse { + taprpc.ScriptKey script_key = 1; +} + +message ProveAssetOwnershipRequest { + bytes asset_id = 1; + + bytes script_key = 2; + + taprpc.OutPoint outpoint = 3; + + // An optional 32-byte challenge that may be used to bind the generated + // proof. This challenge needs to be also presented on the + // VerifyAssetOwnership RPC in order to check the proof against it. + bytes challenge = 4; +} + +message ProveAssetOwnershipResponse { + bytes proof_with_witness = 1; +} + +message VerifyAssetOwnershipRequest { + bytes proof_with_witness = 1; + + // An optional 32-byte challenge that may be used to check the ownership + // proof against. This challenge must match the one that the prover used + // on the ProveAssetOwnership RPC. + bytes challenge = 2; +} + +message VerifyAssetOwnershipResponse { + bool valid_proof = 1; + + // The outpoint the proof commits to. + taprpc.OutPoint outpoint = 2; + + // The outpoint in the human-readable form "hash:index". + string outpoint_str = 3; + + // The block hash the output is part of. + bytes block_hash = 4; + + // The block hash as hexadecimal string of the byte-reversed hash. + string block_hash_str = 5; + + // The block height of the block the output is part of. + uint32 block_height = 6; +} + +message RemoveUTXOLeaseRequest { + // The outpoint of the UTXO to remove the lease for. + taprpc.OutPoint outpoint = 1; +} + +message RemoveUTXOLeaseResponse { +} + +message DeclareScriptKeyRequest { + taprpc.ScriptKey script_key = 1; +} + +message DeclareScriptKeyResponse { + taprpc.ScriptKey script_key = 1; +} \ No newline at end of file diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/mintrpc/mint.proto b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/mintrpc/mint.proto new file mode 100644 index 000000000..abc446bf7 --- /dev/null +++ b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/mintrpc/mint.proto @@ -0,0 +1,411 @@ +syntax = "proto3"; + +import "taprootassets.proto"; + +package mintrpc; + +option go_package = "github.com/lightninglabs/taproot-assets/taprpc/mintrpc"; + +service Mint { + /* tapcli: `assets mint` + MintAsset will attempt to mint the set of assets (async by default to + ensure proper batching) specified in the request. The pending batch is + returned that shows the other pending assets that are part of the next + batch. This call will block until the operation succeeds (asset is staged + in the batch) or fails. + */ + rpc MintAsset (MintAssetRequest) returns (MintAssetResponse); + + /* tapcli `assets mint fund` + FundBatch will attempt to fund the current pending batch with a genesis + input, or create a new funded batch if no batch exists yet. This RPC is only + needed if a custom witness is needed to finalize the batch. Otherwise, + FinalizeBatch can be called directly. + */ + rpc FundBatch (FundBatchRequest) returns (FundBatchResponse); + + /* tapcli `assets mint seal` + SealBatch will attempt to seal the current pending batch by creating and + validating asset group witness for all assets in the batch. If a witness + is not provided, a signature will be derived to serve as the witness. This + RPC is only needed if any assets in the batch have a custom asset group key + that require an external signer. Otherwise, FinalizeBatch can be called + directly. + */ + rpc SealBatch (SealBatchRequest) returns (SealBatchResponse); + + /* tapcli: `assets mint finalize` + FinalizeBatch will attempt to finalize the current pending batch. + */ + rpc FinalizeBatch (FinalizeBatchRequest) returns (FinalizeBatchResponse); + + /* tapcli: `assets mint cancel` + CancelBatch will attempt to cancel the current pending batch. + */ + rpc CancelBatch (CancelBatchRequest) returns (CancelBatchResponse); + + /* tapcli: `assets mint batches` + ListBatches lists the set of batches submitted to the daemon, including + pending and cancelled batches. + */ + rpc ListBatches (ListBatchRequest) returns (ListBatchResponse); + + /* tapcli: `events mint` + SubscribeMintEvents allows a caller to subscribe to mint events for asset + creation batches. + */ + rpc SubscribeMintEvents (SubscribeMintEventsRequest) + returns (stream MintEvent); +} + +message PendingAsset { + // The version of asset to mint. + taprpc.AssetVersion asset_version = 1; + + // The type of the asset to be created. + taprpc.AssetType asset_type = 2; + + // The name, or "tag" of the asset. This will affect the final asset ID. + string name = 3; + + /* + A blob that resents metadata related to the asset. This will affect the + final asset ID. + */ + taprpc.AssetMeta asset_meta = 4; + + /* + The total amount of units of the new asset that should be created. If the + AssetType is Collectible, then this field cannot be set. + */ + uint64 amount = 5; + + /* + If true, then the asset will be created with a new group key, which allows + for future asset issuance. + */ + bool new_grouped_asset = 6; + + // The specific existing group key this asset should be minted with. + bytes group_key = 7; + + /* + The name of the asset in the batch that will anchor a new asset group. + This asset will be minted with the same group key as the anchor asset. + */ + string group_anchor = 8; + + /* + The optional key that will be used as the internal key for an asset group + created with this asset. + */ + taprpc.KeyDescriptor group_internal_key = 9; + + /* + The optional root of a tapscript tree that will be used when constructing a + new asset group key. This enables future issuance authorized with a script + witness. + */ + bytes group_tapscript_root = 10; + + /* + The optional script key to use for the new asset. If no script key is given, + a BIP-86 key will be derived from the underlying wallet. + */ + taprpc.ScriptKey script_key = 11; +} + +message UnsealedAsset { + // The pending asset with an unsealed asset group. + PendingAsset asset = 1; + + // The group key request for the asset. + taprpc.GroupKeyRequest group_key_request = 2; + + // The group virtual transaction for the asset. + taprpc.GroupVirtualTx group_virtual_tx = 3; +} + +message MintAsset { + // The version of asset to mint. + taprpc.AssetVersion asset_version = 1; + + // The type of the asset to be created. + taprpc.AssetType asset_type = 2; + + // The name, or "tag" of the asset. This will affect the final asset ID. + string name = 3; + + /* + A blob that resents metadata related to the asset. This will affect the + final asset ID. + */ + taprpc.AssetMeta asset_meta = 4; + + /* + The total amount of units of the new asset that should be created. If the + AssetType is Collectible, then this field cannot be set. + */ + uint64 amount = 5; + + /* + If true, then the asset will be created with a group key, which allows for + future asset issuance. + */ + bool new_grouped_asset = 6; + + /* + If true, then a group key or group anchor can be set to mint this asset into + an existing asset group. + */ + bool grouped_asset = 7; + + // The specific existing group key this asset should be minted with. + bytes group_key = 8; + + /* + The name of the asset in the batch that will anchor a new asset group. + This asset will be minted with the same group key as the anchor asset. + */ + string group_anchor = 9; + + /* + The optional key that will be used as the internal key for an asset group + created with this asset. + */ + taprpc.KeyDescriptor group_internal_key = 10; + + /* + The optional root of a tapscript tree that will be used when constructing a + new asset group key. This enables future issuance authorized with a script + witness. + */ + bytes group_tapscript_root = 11; + + /* + The optional script key to use for the new asset. If no script key is given, + a BIP-86 key will be derived from the underlying wallet. + */ + taprpc.ScriptKey script_key = 12; + + /* + Decimal display dictates the number of decimal places to shift the amount to + the left converting from Taproot Asset integer representation to a + UX-recognizable fractional quantity. + + For example, if the decimal_display value is 2 and there's 100 of those + assets, then a wallet would display the amount as "1.00". This field is + intended as information for wallets that display balances and has no impact + on the behavior of the daemon or any other part of the protocol. This value + is encoded in the MetaData field as a JSON field, therefore it is only + compatible with assets that have a JSON MetaData field. + */ + uint32 decimal_display = 13; +} + +message MintAssetRequest { + /* + The asset to be minted. + */ + MintAsset asset = 1; + + /* + If true, then the assets currently in the batch won't be returned in the + response. This is mainly to avoid a lot of data being transmitted and + possibly printed on the command line in the case of a very large batch. + */ + bool short_response = 2; +} + +message MintAssetResponse { + // The pending batch the asset was added to. + MintingBatch pending_batch = 1; +} + +message MintingBatch { + /* + A public key serialized in compressed format that can be used to uniquely + identify a pending minting batch. Responses that share the same key will be + batched into the same minting transaction. + */ + bytes batch_key = 1; + + /* + The transaction ID of the batch. Only populated if the batch has been + committed. + */ + string batch_txid = 2; + + // The state of the batch. + BatchState state = 3; + + // The assets that are part of the batch. + repeated PendingAsset assets = 4; + + // The time the batch was created as a Unix timestamp (in seconds). + int64 created_at = 5; + + // The current height of the block chain at the time of the batch creation. + uint32 height_hint = 6; + + // The genesis transaction as a PSBT packet. Only populated if the batch has + // been committed. + bytes batch_psbt = 7; +} + +message VerboseBatch { + // The minting batch, without any assets. + MintingBatch batch = 1; + + // The assets that are part of the batch. + repeated UnsealedAsset unsealed_assets = 2; +} + +enum BatchState { + BATCH_STATE_UNKNOWN = 0; + BATCH_STATE_PENDING = 1; + BATCH_STATE_FROZEN = 2; + BATCH_STATE_COMMITTED = 3; + BATCH_STATE_BROADCAST = 4; + BATCH_STATE_CONFIRMED = 5; + BATCH_STATE_FINALIZED = 6; + BATCH_STATE_SEEDLING_CANCELLED = 7; + BATCH_STATE_SPROUT_CANCELLED = 8; +} + +message FundBatchRequest { + /* + If true, then the assets currently in the batch won't be returned in the + response. This is mainly to avoid a lot of data being transmitted and + possibly printed on the command line in the case of a very large batch. + */ + bool short_response = 1; + + // The optional fee rate to use for the minting transaction, in sat/kw. + uint32 fee_rate = 2; + + /* + The optional tapscript sibling that will be used when deriving the genesis + output for the batch. This sibling is a tapscript tree, which allows the + minter to encumber future transfers of assets in the batch with Tapscript. + */ + oneof batch_sibling { + /* + An ordered list of TapLeafs, which will be used to construct a + Tapscript tree. + */ + taprpc.TapscriptFullTree full_tree = 3; + + // A TapBranch that represents a Tapscript tree managed externally. + taprpc.TapBranch branch = 4; + } +} + +message FundBatchResponse { + // The funded batch. + MintingBatch batch = 1; +} + +message SealBatchRequest { + /* + If true, then the assets currently in the batch won't be returned in the + response. This is mainly to avoid a lot of data being transmitted and + possibly printed on the command line in the case of a very large batch. + */ + bool short_response = 1; + + // The assetID, witness pairs that authorize asset membership in a group. + repeated taprpc.GroupWitness group_witnesses = 2; +} + +message SealBatchResponse { + // The sealed batch. + MintingBatch batch = 1; +} + +message FinalizeBatchRequest { + /* + If true, then the assets currently in the batch won't be returned in the + response. This is mainly to avoid a lot of data being transmitted and + possibly printed on the command line in the case of a very large batch. + */ + bool short_response = 1; + + // The optional fee rate to use for the minting transaction, in sat/kw. + uint32 fee_rate = 2; + + /* + The optional tapscript sibling that will be used when deriving the genesis + output for the batch. This sibling is a tapscript tree, which allows the + minter to encumber future transfers of assets in the batch with Tapscript. + */ + oneof batch_sibling { + /* + An ordered list of TapLeafs, which will be used to construct a + Tapscript tree. + */ + taprpc.TapscriptFullTree full_tree = 3; + + // A TapBranch that represents a Tapscript tree managed externally. + taprpc.TapBranch branch = 4; + } +} + +message FinalizeBatchResponse { + // The finalized batch. + MintingBatch batch = 1; +} + +message CancelBatchRequest { +} + +message CancelBatchResponse { + // The internal public key of the batch. + bytes batch_key = 1; +} + +message ListBatchRequest { + // The optional batch key of the batch to list. + oneof filter { + // The optional batch key of the batch to list, specified as raw bytes + // (gRPC only). + bytes batch_key = 1; + + // The optional batch key of the batch to list, specified as a hex + // encoded string (use this for REST). + string batch_key_str = 2; + } + + // If true, pending asset group information will be shown for the pending + // batch. + bool verbose = 3; +} + +message ListBatchResponse { + repeated VerboseBatch batches = 1; +} + +message SubscribeMintEventsRequest { + /* + If true, then the assets currently in the batch won't be returned in the + event's batch. This is mainly to avoid a lot of data being transmitted and + possibly printed on the command line in the case of a very large batch. + */ + bool short_response = 1; +} + +message MintEvent { + // Execute timestamp (Unix timestamp in microseconds). + int64 timestamp = 1; + + // The last state of the batch that was successfully executed. If error + // below is set, then the batch_state is the state that lead to the error + // during its execution. + BatchState batch_state = 2; + + // The batch that the event is for. + MintingBatch batch = 3; + + // An optional error, indicating that executing the batch_state failed. + string error = 4; +} diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/taprootassets.proto b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/taprootassets.proto similarity index 63% rename from zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/taprootassets.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/taprootassets.proto index 18ec0311a..84d54e767 100644 --- a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/taprootassets.proto +++ b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/taprootassets.proto @@ -104,30 +104,37 @@ service TaprootAssets { */ rpc BurnAsset (BurnAssetRequest) returns (BurnAssetResponse); + /* tapcli: `assets listburns` + ListBurns lists the asset burns that this wallet has performed. These assets + are not recoverable in any way. Filters may be applied to return more + specific results. + */ + rpc ListBurns (ListBurnsRequest) returns (ListBurnsResponse); + /* tapcli: `getinfo` GetInfo returns the information for the node. */ rpc GetInfo (GetInfoRequest) returns (GetInfoResponse); - /* - SubscribeSendAssetEventNtfns registers a subscription to the event - notification stream which relates to the asset sending process. - */ - rpc SubscribeSendAssetEventNtfns (SubscribeSendAssetEventNtfnsRequest) - returns (stream SendAssetEvent); - - /* - SubscribeReceiveAssetEventNtfns registers a subscription to the event - notification stream which relates to the asset receive process. - */ - rpc SubscribeReceiveAssetEventNtfns (SubscribeReceiveAssetEventNtfnsRequest) - returns (stream ReceiveAssetEvent); - /* tapcli: `assets meta` FetchAssetMeta allows a caller to fetch the reveal meta data for an asset either by the asset ID for that asset, or a meta hash. */ rpc FetchAssetMeta (FetchAssetMetaRequest) returns (AssetMeta); + + /* tapcli: `events receive` + SubscribeReceiveEvents allows a caller to subscribe to receive events for + incoming asset transfers. + */ + rpc SubscribeReceiveEvents (SubscribeReceiveEventsRequest) + returns (stream ReceiveEvent); + + /* tapcli: `events send` + SubscribeSendEvents allows a caller to subscribe to send events for outgoing + asset transfers. + */ + rpc SubscribeSendEvents (SubscribeSendEventsRequest) + returns (stream SendEvent); } enum AssetType { @@ -152,6 +159,12 @@ enum AssetMetaType { should be interpreted as opaque blobs. */ META_TYPE_OPAQUE = 0; + + /* + JSON is used for asset meta blobs that are to be interpreted as valid JSON + strings. + */ + META_TYPE_JSON = 1; } message AssetMeta { @@ -176,6 +189,13 @@ message ListAssetRequest { bool with_witness = 1; bool include_spent = 2; bool include_leased = 3; + + // List assets that aren't confirmed yet. Only freshly minted assets will + // show in the asset list with a block height of 0. All other forms of + // unconfirmed assets will not appear in the list until the transaction is + // confirmed (check either transfers or receives for unconfirmed outbound or + // inbound assets). + bool include_unconfirmed_mints = 4; } message AnchorInfo { @@ -233,9 +253,77 @@ message GenesisInfo { the genesis transaction. */ uint32 output_index = 6; +} + +message GroupKeyRequest { + // The internal key for the asset group before any tweaks have been applied. + KeyDescriptor raw_key = 1; + + /* + The genesis of the group anchor asset, which is used to derive the single + tweak for the group key. For a new group key, this will be the genesis of + new_asset. + */ + GenesisInfo anchor_genesis = 2; + + /* + The optional root of a tapscript tree that will be used when constructing a + new asset group key. This enables future issuance authorized with a script + witness. + */ + bytes tapscript_root = 3; - // The version of the Taproot Asset commitment that created this asset. - int32 version = 7; + /* + The serialized asset which we are requesting group membership for. A + successful request will produce a witness that authorizes this asset to be a + member of this asset group. + */ + bytes new_asset = 4; +} + +message TxOut { + // The value of the output being spent. + int64 value = 1; + + // The script of the output being spent. + bytes pk_script = 2; +} + +message GroupVirtualTx { + /* + The virtual transaction that represents the genesis state transition of a + grouped asset. + */ + bytes transaction = 1; + + /* + The transaction output that represents a grouped asset. The tweaked + group key is set as the PkScript of this output. This is used in combination + with Tx to produce an asset group witness. + */ + TxOut prev_out = 2; + + /* + The asset ID of the grouped asset in a GroupKeyRequest. This ID is + needed to construct a sign descriptor, as it is the single tweak for the + group internal key. + */ + bytes genesis_id = 3; + + /* + The tweaked group key for a specific GroupKeyRequest. This is used to + construct a complete group key after producing an asset group witness. + */ + bytes tweaked_key = 4; +} + +message GroupWitness { + // The asset ID of the pending asset that should be assigned this asset + // group witness. + bytes genesis_id = 1; + + // The serialized witness stack for the asset group. + repeated bytes witness = 2; } message AssetGroup { @@ -254,7 +342,11 @@ message AssetGroup { */ bytes asset_witness = 3; - // TODO(jhb): update to include tapscript_root + /* + The root hash of a tapscript tree, which enables future issuance authorized + with a script witness. + */ + bytes tapscript_root = 4; } message GroupKeyReveal { @@ -270,6 +362,22 @@ message GenesisReveal { GenesisInfo genesis_base_reveal = 1; } +message DecimalDisplay { + /* + Decimal display dictates the number of decimal places to shift the amount to + the left converting from Taproot Asset integer representation to a + UX-recognizable fractional quantity. + + For example, if the decimal_display value is 2 and there's 100 of those + assets, then a wallet would display the amount as "1.00". This field is + intended as information for wallets that display balances and has no impact + on the behavior of the daemon or any other part of the protocol. This value + is encoded in the MetaData field as a JSON field, therefore it is only + compatible with assets that have a JSON MetaData field. + */ + uint32 decimal_display = 1; +} + enum AssetVersion { // ASSET_VERSION_V0 is the default asset version. This version will include // the witness vector in the leaf for a tap commitment. @@ -328,6 +436,29 @@ message Asset { // Indicates whether this transfer was an asset burn. If true, the number of // assets in this output are destroyed and can no longer be spent. bool is_burn = 17; + + // Indicates whether this script key has either been derived by the local + // wallet or was explicitly declared to be known by using the + // DeclareScriptKey RPC. Knowing the key conceptually means the key belongs + // to the local wallet or is at least known by a software that operates on + // the local wallet. The flag is never serialized in proofs, so this is + // never explicitly set for keys foreign to the local wallet. Therefore, if + // this method returns true for a script key, it means the asset with the + // script key will be shown in the wallet balance. + bool script_key_declared_known = 18; + + // Indicates whether the script key is known to have a Tapscript spend path, + // meaning that the Taproot merkle root tweak is not empty. This will only + // ever be true if either script_key_is_local or script_key_internals_known + // is true as well, since the presence of a Tapscript spend path cannot be + // determined for script keys that aren't known to the wallet of the local + // tapd node. + bool script_key_has_script_path = 19; + + // This field defines a decimal display value that may be present. If this + // field is null, it means the presence of a decimal display field is + // unknown in the current context. + DecimalDisplay decimal_display = 20; } message PrevWitness { @@ -344,6 +475,15 @@ message SplitCommitment { message ListAssetResponse { repeated Asset assets = 1; + + // This is a count of unconfirmed outgoing transfers. Unconfirmed transfers + // do not appear as assets in this endpoint response. + uint64 unconfirmed_transfers = 2; + + // This is a count of freshly minted assets that haven't been confirmed on + // chain yet. These assets will appear in the asset list with a block height + // of 0 if include_unconfirmed_mints is set to true in the request. + uint64 unconfirmed_mints = 3; } message ListUtxosRequest { @@ -372,6 +512,13 @@ message ManagedUtxo { // The assets held at this UTXO. repeated Asset assets = 6; + + // The lease owner for this UTXO. If blank the UTXO isn't leased. + bytes lease_owner = 7; + + // The expiry time as a unix time stamp for this lease. If blank the utxo + // isn't leased. + int64 lease_expiry_unix = 8; } message ListUtxosResponse { @@ -435,6 +582,9 @@ message ListBalancesRequest { // group key filter may be provided to query the balance of a specific // asset group. bytes group_key_filter = 4; + + // An option to include previous leased assets in the balances. + bool include_leased = 5; } message AssetBalance { @@ -460,6 +610,10 @@ message ListBalancesResponse { } message ListTransfersRequest { + // anchor_txid specifies the hexadecimal encoded txid string of the anchor + // transaction for which to retrieve transfers. An empty value indicates + // that this parameter should be disregarded in transfer selection. + string anchor_txid = 1; } message ListTransfersResponse { @@ -467,6 +621,28 @@ message ListTransfersResponse { repeated AssetTransfer transfers = 1; } +// ChainHash represents a hash value, typically a double SHA-256 of some data. +// Common examples include block hashes and transaction hashes. +// +// This versatile message type is used in various Bitcoin-related messages and +// structures, providing two different formats of the same hash to accommodate +// both developer and user needs. +message ChainHash { + // The raw hash value in byte format. + // + // This format is optimized for programmatic use, particularly for Go + // developers, enabling easy integration with other RPC calls or binary + // operations. + bytes hash = 1; + + // The byte-reversed hash value as a hexadecimal string. + // + // This format is intended for human interaction, making it easy to copy, + // paste, and use in contexts like command-line arguments or configuration + // files. + string hash_str = 2; +} + message AssetTransfer { int64 transfer_timestamp = 1; @@ -483,6 +659,11 @@ message AssetTransfer { // Describes the set of newly created asset outputs. repeated TransferOutput outputs = 6; + + // The block hash of the blockchain block that contains the anchor + // transaction. If this value is unset, the anchor transaction is + // unconfirmed. + ChainHash anchor_tx_block_hash = 7; } message TransferInput { @@ -529,24 +710,26 @@ enum OutputType { // output. In either case, the asset of this output has a tx witness. OUTPUT_TYPE_SPLIT_ROOT = 1; - // OUTPUT_TYPE_PASSIVE_ASSETS_ONLY indicates that this output only carries - // passive assets and therefore the asset in this output is nil. The passive - // assets themselves are signed in their own virtual transactions and - // are not present in this packet. - OUTPUT_TYPE_PASSIVE_ASSETS_ONLY = 2; + reserved 2; - // OUTPUT_TYPE_PASSIVE_SPLIT_ROOT is a split root output that carries the - // change from a split or a tombstone from a non-interactive full value send - // output, as well as passive assets. - OUTPUT_TYPE_PASSIVE_SPLIT_ROOT = 3; + reserved 3; - // OUTPUT_TYPE_SIMPLE_PASSIVE_ASSETS is a plain full-value interactive send - // output that also carries passive assets. This is a special case where we - // send the full value of a single asset in a commitment to a new script - // key, but also carry passive assets in the same output. This is useful for - // key rotation (send-to-self) scenarios or asset burns where we burn the - // full supply of a single asset within a commitment. - OUTPUT_TYPE_SIMPLE_PASSIVE_ASSETS = 4; + reserved 4; +} + +// ProofDeliveryStatus is an enum that describes the status of the delivery of +// a proof associated with an asset transfer output. +enum ProofDeliveryStatus { + // Delivery is not applicable; the proof will not be delivered. + PROOF_DELIVERY_STATUS_NOT_APPLICABLE = 0; + + // The proof has been successfully delivered. + PROOF_DELIVERY_STATUS_COMPLETE = 1; + + // The proof is pending delivery. This status indicates that the proof has + // not yet been delivered successfully. One or more attempts at proof + // delivery may have been made. + PROOF_DELIVERY_STATUS_PENDING = 2; } message TransferOutput { @@ -567,6 +750,13 @@ message TransferOutput { OutputType output_type = 7; AssetVersion asset_version = 8; + + uint64 lock_time = 9; + + uint64 relative_lock_time = 10; + + // The delivery status of the proof associated with this output. + ProofDeliveryStatus proof_delivery_status = 11; } message StopRequest { @@ -585,6 +775,19 @@ message DebugLevelResponse { string sub_systems = 1; } +enum AddrVersion { + // ADDR_VERSION_UNSPECIFIED is the default value for an address version in + // an RPC message. It is unmarshalled to the latest address version. + ADDR_VERSION_UNSPECIFIED = 0; + + // ADDR_VERSION_V0 is the initial address version. + ADDR_VERSION_V0 = 1; + + // ADDR_VERSION_V1 is the address version that uses V2 Taproot Asset + // commitments. + ADDR_VERSION_V1 = 2; +} + message Addr { // The bech32 encoded Taproot Asset address. string encoded = 1; @@ -630,6 +833,9 @@ message Addr { // The asset version of the address. AssetVersion asset_version = 11; + + // The version of the address. + AddrVersion address_version = 12; } message QueryAddrRequest { @@ -699,6 +905,11 @@ message NewAddrRequest { The asset version to use when sending/receiving to/from this address. */ AssetVersion asset_version = 7; + + /* + The version of this address. + */ + AddrVersion address_version = 8; } message ScriptKey { @@ -745,6 +956,26 @@ message KeyDescriptor { KeyLocator key_loc = 2; } +message TapscriptFullTree { + /* + The complete, ordered list of all tap leaves of the tree. + */ + repeated TapLeaf all_leaves = 1; +} + +message TapLeaf { + // The script of the tap leaf. + bytes script = 2; +} + +message TapBranch { + // The TapHash of the left child of the root hash of a Tapscript tree. + bytes left_taphash = 1; + + // The TapHash of the right child of the root hash of a Tapscript tree. + bytes right_taphash = 2; +} + message DecodeAddrRequest { string addr = 1; } @@ -947,83 +1178,6 @@ message GetInfoResponse { bool sync_to_chain = 8; } -message SubscribeSendAssetEventNtfnsRequest { -} - -message SendAssetEvent { - oneof event { - // An event which indicates that a send state is about to be executed. - ExecuteSendStateEvent execute_send_state_event = 1; - - // An event which indicates that the proof transfer backoff wait period - // will start imminently. - ProofTransferBackoffWaitEvent proof_transfer_backoff_wait_event = 2; - } -} - -message ExecuteSendStateEvent { - // Execute timestamp (microseconds). - int64 timestamp = 1; - - // The send state that is about to be executed. - string send_state = 2; -} - -// ProofTransferType is the type of proof transfer attempt. The transfer is -// either a proof delivery to the transfer counterparty or receiving a proof -// from the transfer counterparty. Note that the transfer counterparty is -// usually the proof courier service. -enum ProofTransferType { - // This value indicates that the proof transfer attempt is a delivery to the - // transfer counterparty. - PROOF_TRANSFER_TYPE_SEND = 0; - - // This value indicates that the proof transfer attempt is a receive from - // the transfer counterparty. - PROOF_TRANSFER_TYPE_RECEIVE = 1; -} - -message ProofTransferBackoffWaitEvent { - // Transfer attempt timestamp (microseconds). - int64 timestamp = 1; - - // Backoff is the active backoff wait duration. - int64 backoff = 2; - - // Tries counter is the number of tries we've made so far during the - // course of the current backoff procedure to deliver the proof to the - // receiver. - int64 tries_counter = 3; - - // The type of proof transfer attempt. - ProofTransferType transfer_type = 4; -} - -message SubscribeReceiveAssetEventNtfnsRequest { -} - -message AssetReceiveCompleteEvent { - // Event creation timestamp. - int64 timestamp = 1; - - // The address that received the asset. - Addr address = 2; - - // The outpoint of the transaction that was used to receive the asset. - string outpoint = 3; -} - -message ReceiveAssetEvent { - oneof event { - // An event which indicates that the proof transfer backoff wait period - // will start imminently. - ProofTransferBackoffWaitEvent proof_transfer_backoff_wait_event = 1; - - // An event which indicates that an asset receive process has finished. - AssetReceiveCompleteEvent asset_receive_complete_event = 2; - } -} - message FetchAssetMetaRequest { oneof asset { // The asset ID of the asset to fetch the meta for. @@ -1055,6 +1209,9 @@ message BurnAssetRequest { // the burn. This needs to be set to the value "assets will be destroyed" // for the burn to succeed. string confirmation_text = 4; + + // A note that may contain user defined metadata related to this burn. + string note = 5; } message BurnAssetResponse { @@ -1065,6 +1222,38 @@ message BurnAssetResponse { DecodedProof burn_proof = 2; } +message ListBurnsRequest { + // The asset id of the burnt asset. + bytes asset_id = 1; + + // The tweaked group key of the group this asset belongs to. + bytes tweaked_group_key = 3; + + // The txid of the transaction that the burn was anchored to. + bytes anchor_txid = 4; +} + +message AssetBurn { + // A note that may contain user defined metadata related to this burn. + string note = 1; + + // The asset id of the burnt asset. + bytes asset_id = 2; + + // The tweaked group key of the group this asset belongs to. + bytes tweaked_group_key = 3; + + // The amount of burnt assets. + uint64 amount = 4; + + // The txid of the transaction that the burn was anchored to. + bytes anchor_txid = 5; +} + +message ListBurnsResponse { + repeated AssetBurn burns = 1; +} + message OutPoint { /* Raw bytes representing the transaction id. @@ -1076,3 +1265,168 @@ message OutPoint { */ uint32 output_index = 2; } + +message SubscribeReceiveEventsRequest { + // Filter receives by a specific address. Leave empty to get all receive + // events for all addresses. + string filter_addr = 1; + + // The start time as a Unix timestamp in microseconds. If not set (default + // value 0), the daemon will start streaming events from the current time. + int64 start_timestamp = 2; +} + +message ReceiveEvent { + // Event creation timestamp (Unix timestamp in microseconds). + int64 timestamp = 1; + + // The address that received the asset. + taprpc.Addr address = 2; + + // The outpoint of the transaction that was used to receive the asset. + string outpoint = 3; + + // The status of the event. If error below is set, then the status is the + // state that lead to the error during its execution. + AddrEventStatus status = 4; + + // The height of the block the asset receive transaction was mined in. This + // is only set if the status is ADDR_EVENT_STATUS_TRANSACTION_CONFIRMED or + // later. + uint32 confirmation_height = 5; + + // An optional error, indicating that executing the status above failed. + string error = 6; +} + +message SubscribeSendEventsRequest { + // Filter send events by a specific recipient script key. Leave empty to get + // all receive events for all parcels. + bytes filter_script_key = 1; +} + +enum SendState { + // Input coin selection to pick out which asset inputs should be spent is + // executed during this state. + SEND_STATE_VIRTUAL_INPUT_SELECT = 0; + + // The virtual transaction is signed during this state. + SEND_STATE_VIRTUAL_SIGN = 1; + + // The Bitcoin anchor transaction is signed during this state. + SEND_STATE_ANCHOR_SIGN = 2; + + // The outbound packet is written to the database during this state, + // including the partial proof suffixes. Only parcels that complete this + // state can be resumed on restart. + SEND_STATE_LOG_COMMITMENT = 3; + + // The Bitcoin anchor transaction is broadcast to the network during this + // state. + SEND_STATE_BROADCAST = 4; + + // The on-chain anchor transaction needs to reach at least 1 confirmation. + // This state waits for the confirmation. + SEND_STATE_WAIT_CONFIRMATION = 5; + + // The anchor transaction was confirmed in a block and the full proofs can + // now be constructed during this stage. + SEND_STATE_STORE_PROOFS = 6; + + // The full proofs are sent to the recipient(s) with the proof courier + // service during this state. + SEND_STATE_TRANSFER_PROOFS = 7; + + // The send state machine has completed the send process. + SEND_STATE_COMPLETED = 8; +} + +enum ParcelType { + // The parcel is an address parcel. + PARCEL_TYPE_ADDRESS = 0; + + // The parcel type is a pre-signed parcel where the virtual transactions are + // signed outside of the send state machine. Parcels of this type will only + // get send states starting from SEND_STATE_ANCHOR_SIGN. + PARCEL_TYPE_PRE_SIGNED = 1; + + // The parcel is pending and was resumed on the latest restart of the + // daemon. The original parcel type (address or pre-signed) is not known + // anymore, as it's not relevant for the remaining steps. Parcels of this + // type will only get send states starting from SEND_STATE_BROADCAST. + PARCEL_TYPE_PENDING = 2; + + // The parcel type is a pre-anchored parcel where the full anchor + // transaction and all proofs are already available. Parcels of this type + // will only get send states starting from SEND_STATE_LOG_COMMITMENT. + PARCEL_TYPE_PRE_ANCHORED = 3; +} + +message SendEvent { + // Execute timestamp (Unix timestamp in microseconds). + int64 timestamp = 1; + + // The send state that was executed successfully. If error below is set, + // then the send_state is the state that lead to the error during its + // execution. + string send_state = 2; + + // The type of the outbound send parcel. + ParcelType parcel_type = 3; + + // The list of addresses the parcel sends to (recipient addresses only, not + // including change going back to own wallet). This is only set for parcels + // of type PARCEL_TYPE_ADDRESS. + repeated taprpc.Addr addresses = 4; + + // The virtual packets that are part of the parcel. + repeated bytes virtual_packets = 5; + + // The passive virtual packets that are carried along with the parcel. This + // is empty if there were no other assets in the input commitment that is + // being spent with the "active" virtual packets above. + repeated bytes passive_virtual_packets = 6; + + // The Bitcoin on-chain anchor transaction that commits the sent assets + // on-chain. This is only set after the send state SEND_STATE_ANCHOR_SIGN. + AnchorTransaction anchor_transaction = 7; + + // The final transfer as it will be stored in the database. This is only set + // after the send state SEND_STATE_LOG_COMMITMENT. + AssetTransfer transfer = 8; + + // An optional error, indicating that executing the send_state failed. + string error = 9; +} + +message AnchorTransaction { + bytes anchor_psbt = 1; + + /* + The index of the (added) change output or -1 if no change was left over. + */ + int32 change_output_index = 2; + + /* + The total number of satoshis in on-chain fees paid by the anchor + transaction. + */ + int64 chain_fees_sats = 3; + + /* + The fee rate in sat/kWU that was targeted by the anchor transaction. + */ + int32 target_fee_rate_sat_kw = 4; + + /* + The list of UTXO lock leases that were acquired for the inputs in the funded + PSBT packet from lnd. Only inputs added to the PSBT by this RPC are locked, + inputs that were already present in the PSBT are not locked. + */ + repeated taprpc.OutPoint lnd_locked_utxos = 5; + + /* + The final, signed anchor transaction that was broadcast to the network. + */ + bytes final_tx = 6; +} diff --git a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/universerpc/universe.proto b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/universerpc/universe.proto similarity index 91% rename from zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/universerpc/universe.proto rename to zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/universerpc/universe.proto index 20db15825..f719fb9f2 100644 --- a/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0-3-3-lnd-18/universerpc/universe.proto +++ b/zeus_modules/@lightninglabs/lnc-core/protos/tapd/v0.5.0-rc2/universerpc/universe.proto @@ -7,6 +7,13 @@ package universerpc; option go_package = "github.com/lightninglabs/taproot-assets/taprpc/universerpc"; service Universe { + /* tapcli: `universe multiverse` + MultiverseRoot returns the root of the multiverse tree. This is useful to + determine the equality of two multiverse trees, since the root can directly + be compared to another multiverse root to find out if a sync is required. + */ + rpc MultiverseRoot (MultiverseRootRequest) returns (MultiverseRootResponse); + /* tapcli: `universe roots` AssetRoots queries for the known Universe roots associated with each known asset. These roots represent the supply/audit state for each known asset. @@ -65,6 +72,13 @@ service Universe { */ rpc InsertProof (AssetProof) returns (AssetProofResponse); + /* tapcli: `universe proofs push` + PushProof attempts to query the local universe for a proof specified by a + UniverseKey. If found, a connection is made to a remote Universe server to + attempt to upload the asset leaf. + */ + rpc PushProof (PushProofRequest) returns (PushProofResponse); + // TODO(roasbeef): rename resp to UniverseStateUpdate? ^ /* tapcli: `universe info` @@ -142,6 +156,22 @@ service Universe { returns (QueryFederationSyncConfigResponse); } +message MultiverseRootRequest { + // The proof type to calculate the multiverse root for. + ProofType proof_type = 1; + + // An optional list of universe IDs to include in the multiverse root. If + // none are specified, then all known universes of the given proof type are + // included. NOTE: The proof type within the IDs must either be unspecified + // or match the proof type above. + repeated ID specific_ids = 2; +} + +message MultiverseRootResponse { + // The root of the multiverse tree. + MerkleSumNode multiverse_root = 1; +} + message AssetRootRequest { // If true, then the response will include the amounts for each asset ID // of grouped assets. @@ -317,7 +347,7 @@ message UniverseKey { } message AssetProofResponse { - // The request original request for the issuance proof. + // The original request for the issuance proof. UniverseKey req = 1; // The Universe root that includes this asset leaf. @@ -347,6 +377,19 @@ message AssetProof { AssetLeaf asset_leaf = 4; } +message PushProofRequest { + // The ID of the asset to push the proof for. + UniverseKey key = 1; + + // The universe server to push the proof to. + UniverseFederationServer server = 2; +} + +message PushProofResponse { + // The ID of the asset a push was requested for. + UniverseKey key = 1; +} + message InfoRequest { }