diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 445d2f697d..239d8c9d86 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -45,6 +45,7 @@ Remote - [ ] Core Lightning (CLNRest) - [ ] Nostr Wallet Connect - [ ] LndHub +- [ ] LDK Server ### Locales - [ ] I’ve added new locale text that requires translations diff --git a/README.md b/README.md index 8850619dc8..b6a0514296 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

screenshots3

-ZEUS is a mobile Bitcoin/Lightning wallet and remote node manager for LND and Core Lightning. ⚡️ +ZEUS is a mobile Bitcoin/Lightning wallet and remote node manager for LND, Core Lightning, and LDK Server. ⚡️ ZEUS is built on TypeScript and React Native. It runs on both Android and iOS. @@ -40,7 +40,7 @@ and - [x] Self-custodial - [x] No KYC - [x] Fully open source (AGPLv3) -- [x] [Connect to LND or Core Lightning remote node](https://docs.zeusln.app/category/remote-connections) +- [x] [Connect to LND, Core Lightning, or LDK Server remote node](https://docs.zeusln.app/category/remote-connections) - [x] Manage multiple lightning nodes at once - [x] Connect via LNDHub instances - [x] Lightning accounts diff --git a/backends/LdkServer.ts b/backends/LdkServer.ts new file mode 100644 index 0000000000..215341d7c5 --- /dev/null +++ b/backends/LdkServer.ts @@ -0,0 +1,1509 @@ +import ReactNativeBlobUtil from 'react-native-blob-util'; +import BigNumber from 'bignumber.js'; +import { createHmac } from 'crypto'; +import Long from 'long'; + +import { api, events, types } from '../proto/ldkserver'; +import { settingsStore } from '../stores/Stores'; +import Base64Utils from '../utils/Base64Utils'; +import OpenChannelRequest from '../models/OpenChannelRequest'; + +const SERVICE_PREFIX = '/api.LightningNode/'; +const DEFAULT_PORT = '3536'; +const REQUEST_TIMEOUT_MS = 30000; + +const toPlainObject = (message: any, response: any) => + response.toObject(message, { + longs: String, + enums: String, + bytes: String, + defaults: false + }); + +const msatToSat = (msat: any) => + new BigNumber(msat || 0) + .dividedBy(1000) + .integerValue(BigNumber.ROUND_FLOOR) + .toString(); + +const toUInt64 = (value: any) => Long.fromString(String(value), true); + +const satsToMsatLong = (sats: any) => + Long.fromString(new BigNumber(sats || 0).times(1000).toFixed(0), true); + +const headerValue = (headers: any, key: string) => { + const foundKey = Object.keys(headers || {}).find( + (header) => header.toLowerCase() === key.toLowerCase() + ); + return foundKey ? headers[foundKey] : undefined; +}; + +type EventCallback = (event: any) => void; + +export default class LdkServer { + private eventLoopRunning = false; + private eventCallbacks: EventCallback[] = []; + private eventErrorCallbacks: EventCallback[] = []; + private eventAbortController: any = null; + private eventStreamingUnavailable = false; + + private encodeGrpcFrame = (message: Uint8Array): Uint8Array => { + const frame = new Uint8Array(message.length + 5); + frame[0] = 0; + frame[1] = (message.length >>> 24) & 0xff; + frame[2] = (message.length >>> 16) & 0xff; + frame[3] = (message.length >>> 8) & 0xff; + frame[4] = message.length & 0xff; + frame.set(message, 5); + return frame; + }; + + private decodeGrpcFrame = (body: Uint8Array): Uint8Array => { + if (body.length < 5) { + throw new Error('Invalid ldk-server gRPC response'); + } + const length = + (body[1] << 24) | (body[2] << 16) | (body[3] << 8) | body[4]; + return body.slice(5, 5 + length); + }; + + private decodeGrpcFrames = ( + buffer: Uint8Array + ): { messages: Uint8Array[]; remainder: Uint8Array } => { + const messages: Uint8Array[] = []; + let offset = 0; + + while (buffer.length - offset >= 5) { + const compressed = buffer[offset]; + const length = + (buffer[offset + 1] << 24) | + (buffer[offset + 2] << 16) | + (buffer[offset + 3] << 8) | + buffer[offset + 4]; + + if (compressed) { + throw new Error('Compressed ldk-server events are unsupported'); + } + + if (buffer.length - offset - 5 < length) break; + + messages.push(buffer.slice(offset + 5, offset + 5 + length)); + offset += 5 + length; + } + + return { messages, remainder: buffer.slice(offset) }; + }; + + private appendBytes = (left: Uint8Array, right: Uint8Array): Uint8Array => { + if (!left.length) return right; + const combined = new Uint8Array(left.length + right.length); + combined.set(left); + combined.set(right, left.length); + return combined; + }; + + private getBaseUrl = () => { + const { host, port } = settingsStore; + const hostPath = host?.includes('://') ? host : `https://${host}`; + const url = new URL(hostPath); + if (!url.port) { + url.port = port || DEFAULT_PORT; + } + return url.toString().replace(/\/$/, ''); + }; + + private getAuthHeader = (body: Uint8Array): string => { + const timestamp = Math.floor(Date.now() / 1000); + const timestampBytes = Buffer.alloc(8); + timestampBytes.writeUInt32BE(Math.floor(timestamp / 0x100000000), 0); + timestampBytes.writeUInt32BE(timestamp >>> 0, 4); + const hmac = createHmac('sha256', settingsStore.accessKey || ''); + hmac.update(timestampBytes); + hmac.update(Buffer.from(body)); + return `HMAC ${timestamp}:${hmac.digest('hex')}`; + }; + + private responseBytes = async (response: any): Promise => { + if (typeof response.base64 === 'function') { + const base64 = await response.base64(); + return Base64Utils.base64ToBytes(base64); + } + if (response.data && typeof response.data === 'string') { + return Uint8Array.from(Buffer.from(response.data, 'binary')); + } + return new Uint8Array(); + }; + + private grpcUnary = async ({ + method, + request, + response, + data + }: { + method: string; + request: { create: (data: Req) => any; encode: (data: any) => any }; + response: { decode: (data: Uint8Array) => Res; toObject: any }; + data: Req; + }): Promise => { + const instance = request.create(data); + const requestBody = this.encodeGrpcFrame( + request.encode(instance).finish() + ); + const url = `${this.getBaseUrl()}${SERVICE_PREFIX}${method}`; + const headers = { + 'Content-Type': 'application/grpc+proto', + Accept: 'application/grpc+proto', + 'RNFB-Response': 'base64', + 'x-auth': this.getAuthHeader(requestBody), + te: 'trailers', + 'grpc-timeout': `${REQUEST_TIMEOUT_MS}m` + }; + + const requestBodyPath = `${ + ReactNativeBlobUtil.fs.dirs.CacheDir + }/ldk-server-${Date.now()}-${Math.random().toString(36).slice(2)}.grpc`; + try { + await ReactNativeBlobUtil.fs.writeFile( + requestBodyPath, + Base64Utils.bytesToBase64(requestBody), + 'base64' + ); + const res = await ReactNativeBlobUtil.config({ + trusty: !settingsStore.certVerification, + binaryContentTypes: ['application/grpc+proto'], + timeout: REQUEST_TIMEOUT_MS + } as any).fetch( + 'POST', + url, + headers, + ReactNativeBlobUtil.wrap(requestBodyPath) + ); + const status = res.info().status; + const responseHeaders = res.info().headers || {}; + const grpcStatus = headerValue(responseHeaders, 'grpc-status'); + const grpcMessage = headerValue(responseHeaders, 'grpc-message'); + if (status >= 300) { + throw new Error( + res.data || `ldk-server HTTP ${status} calling ${method}` + ); + } + if (grpcStatus && grpcStatus !== '0') { + throw new Error( + grpcMessage + ? decodeURIComponent(grpcMessage) + : `ldk-server gRPC status ${grpcStatus}` + ); + } + const bytes = await this.responseBytes(res); + if (!bytes.length) { + throw new Error( + `Empty ldk-server response from ${method}${ + grpcStatus ? `, grpc-status ${grpcStatus}` : '' + }` + ); + } + const message = response.decode(this.decodeGrpcFrame(bytes)); + return toPlainObject(message, response); + } catch (error: any) { + throw new Error( + `ldk-server ${method} failed: ${ + error?.message || error?.toString() || error + }` + ); + } finally { + ReactNativeBlobUtil.fs.unlink(requestBodyPath).catch(() => { + // Best-effort cleanup for the temporary gRPC request body. + }); + } + }; + + private rpc = (method: string, request: any, response: any, data = {}) => + this.grpcUnary({ method, request, response, data }); + + subscribeToEvents = (callback: EventCallback): (() => void) => { + this.eventCallbacks.push(callback); + + if (!this.eventLoopRunning && !this.eventStreamingUnavailable) { + this.startEventLoop(); + } + + return () => { + const index = this.eventCallbacks.indexOf(callback); + if (index > -1) this.eventCallbacks.splice(index, 1); + if (!this.eventCallbacks.length) this.stopEventLoop(); + }; + }; + + private onEventStreamError = (callback: EventCallback): (() => void) => { + this.eventErrorCallbacks.push(callback); + return () => { + const index = this.eventErrorCallbacks.indexOf(callback); + if (index > -1) this.eventErrorCallbacks.splice(index, 1); + }; + }; + + private startEventLoop = async (): Promise => { + if (this.eventLoopRunning) return; + this.eventLoopRunning = true; + + while (this.eventLoopRunning && this.eventCallbacks.length) { + try { + await this.streamEvents(); + } catch (e) { + if (!this.eventLoopRunning) break; + if (this.eventStreamingUnavailable) { + this.eventErrorCallbacks.forEach((callback) => callback(e)); + break; + } + console.error('[LDK Server] Error in event stream:', e); + await new Promise((resolve) => setTimeout(resolve, 1000)); + } + } + + this.eventLoopRunning = false; + }; + + private stopEventLoop = (): void => { + this.eventLoopRunning = false; + if (this.eventAbortController) { + this.eventAbortController.abort(); + this.eventAbortController = null; + } + }; + + private streamEvents = async (): Promise => { + const Fetch = (globalThis as any).fetch; + const AbortController = (globalThis as any).AbortController; + if (!Fetch || !AbortController) { + this.eventStreamingUnavailable = true; + throw new Error('Streaming fetch is unavailable'); + } + + const instance = api.SubscribeEventsRequest.create({}); + const requestBody = this.encodeGrpcFrame( + api.SubscribeEventsRequest.encode(instance).finish() + ); + const headers = { + 'Content-Type': 'application/grpc+proto', + Accept: 'application/grpc+proto', + 'x-auth': this.getAuthHeader(requestBody), + te: 'trailers' + }; + const controller = new AbortController(); + this.eventAbortController = controller; + + const response = await Fetch( + `${this.getBaseUrl()}${SERVICE_PREFIX}SubscribeEvents`, + { + method: 'POST', + headers, + body: requestBody, + signal: controller.signal + } + ); + + if (!response.ok) { + throw new Error( + `ldk-server HTTP ${response.status} streaming events` + ); + } + if (!response.body || typeof response.body.getReader !== 'function') { + this.eventStreamingUnavailable = true; + throw new Error('Streaming response bodies are unavailable'); + } + + const reader = response.body.getReader(); + let pending = new Uint8Array(); + + while (this.eventLoopRunning && this.eventCallbacks.length) { + const { done, value } = await reader.read(); + if (done) break; + if (!value) continue; + + pending = this.appendBytes(pending, value); + const decoded = this.decodeGrpcFrames(pending); + pending = decoded.remainder; + + for (const messageBytes of decoded.messages) { + const message = events.EventEnvelope.decode(messageBytes); + const event = toPlainObject(message, events.EventEnvelope); + for (const callback of [...this.eventCallbacks]) { + try { + callback(event); + } catch (e) { + console.error( + '[LDK Server] Error in event callback:', + e + ); + } + } + } + } + }; + + private listPayments = async (): Promise => { + const payments: any[] = []; + let page_token: any; + do { + const res = await this.rpc( + 'ListPayments', + api.ListPaymentsRequest, + api.ListPaymentsResponse, + page_token ? { page_token } : {} + ); + payments.push(...(res.payments || [])); + page_token = res.next_page_token; + } while (page_token); + return payments; + }; + + getMyNodeInfo = async (): Promise => { + const info = await this.rpc( + 'GetNodeInfo', + api.GetNodeInfoRequest, + api.GetNodeInfoResponse + ); + const network = info.network; + return { + identity_pubkey: info.node_id, + alias: info.node_alias || '', + block_height: info.current_best_block?.height || 0, + block_hash: info.current_best_block?.block_hash || '', + synced_to_chain: !!info.latest_onchain_wallet_sync_timestamp, + synced_to_graph: !!info.latest_rgs_snapshot_timestamp, + version: 'ldk-server', + testnet: network === 'TESTNET' || network === 'TESTNET4', + regtest: network === 'REGTEST', + signet: network === 'SIGNET', + uris: info.node_uris || [] + }; + }; + + getNetworkInfo = async (): Promise => { + const [channels, nodes] = await Promise.all([ + this.rpc( + 'GraphListChannels', + api.GraphListChannelsRequest, + api.GraphListChannelsResponse + ), + this.rpc( + 'GraphListNodes', + api.GraphListNodesRequest, + api.GraphListNodesResponse + ) + ]); + return { + num_channels: (channels.short_channel_ids || []).length, + num_nodes: (nodes.node_ids || []).length + }; + }; + + getNodeInfo = async (urlParams?: Array): Promise => { + const nodeId = (urlParams && urlParams[0]) || ''; + const res = await this.rpc( + 'GraphGetNode', + api.GraphGetNodeRequest, + api.GraphGetNodeResponse, + { node_id: nodeId } + ); + const announcement = res.node?.announcement_info || {}; + + return { + node: { + pub_key: nodeId, + alias: announcement.alias || '', + color: announcement.rgb || '', + addresses: announcement.addresses || [] + }, + num_channels: (res.node?.channels || []).length, + total_capacity: '0' + }; + }; + + getBlockchainBalance = async (): Promise => { + const balances = await this.rpc( + 'GetBalances', + api.GetBalancesRequest, + api.GetBalancesResponse + ); + const unconfirmedBalance = BigNumber.maximum( + new BigNumber(balances.total_onchain_balance_sats || 0) + .minus(balances.spendable_onchain_balance_sats || 0) + .minus(balances.total_anchor_channels_reserve_sats || 0), + 0 + ); + return { + total_balance: balances.total_onchain_balance_sats || '0', + confirmed_balance: balances.spendable_onchain_balance_sats || '0', + unconfirmed_balance: unconfirmedBalance.toString() + }; + }; + + getLightningBalance = async (): Promise => { + const [channelsResponse, balances, info] = await Promise.all([ + this.rpc( + 'ListChannels', + api.ListChannelsRequest, + api.ListChannelsResponse + ), + this.rpc( + 'GetBalances', + api.GetBalancesRequest, + api.GetBalancesResponse + ), + this.rpc( + 'GetNodeInfo', + api.GetNodeInfoRequest, + api.GetNodeInfoResponse + ) + ]); + const currentBlockHeight = Number(info.current_best_block?.height || 0); + const channels = channelsResponse.channels || []; + const activeChannelIds = new Set( + channels.map((channel: any) => channel.channel_id) + ); + let localBalance = new BigNumber(0); + let remoteBalance = new BigNumber(0); + let pendingOpenBalance = new BigNumber(0); + let pendingCloseBalance = new BigNumber(0); + + for (const channel of channels) { + if (channel.is_channel_ready) { + const balances = this.channelBalances(channel); + const local = balances.localBalanceSats; + const remote = balances.remoteBalanceSats; + localBalance = localBalance.plus(local); + remoteBalance = remoteBalance.plus(remote); + } else if (channel.is_outbound) { + const pendingLocalBalance = new BigNumber( + channel.channel_value_sats || 0 + ).minus( + channel.counterparty_unspendable_punishment_reserve || 0 + ); + pendingOpenBalance = pendingOpenBalance.plus( + BigNumber.maximum(pendingLocalBalance, 0) + ); + } + } + + for (const balance of balances.lightning_balances || []) { + const details = this.lightningBalanceDetails(balance); + if (!details || details.type === 'claimable_on_channel_close') { + continue; + } + if ( + details.balance.channel_id && + activeChannelIds.has(details.balance.channel_id) + ) { + continue; + } + pendingCloseBalance = pendingCloseBalance.plus( + details.balance.amount_satoshis || 0 + ); + } + + for (const sweep of balances.pending_balances_from_channel_closures || + []) { + const details = this.pendingSweepDetails(sweep); + if (!details) continue; + if ( + details.balance.channel_id && + activeChannelIds.has(details.balance.channel_id) + ) { + continue; + } + if ( + details.type === 'awaiting_threshold_confirmations' && + details.balance.confirmation_height != null && + Number(details.balance.confirmation_height) <= + currentBlockHeight + ) { + continue; + } + pendingCloseBalance = pendingCloseBalance.plus( + details.balance.amount_satoshis || 0 + ); + } + + const totalPendingBalance = + pendingOpenBalance.plus(pendingCloseBalance); + + return { + balance: localBalance.toString(), + local_balance: { + sat: localBalance.toString(), + msat: localBalance.times(1000).toString() + }, + remote_balance: { + sat: remoteBalance.toString(), + msat: remoteBalance.times(1000).toString() + }, + pending_open_balance: totalPendingBalance.toString(), + pending_open_local_balance: { + sat: totalPendingBalance.toString(), + msat: totalPendingBalance.times(1000).toString() + } + }; + }; + + getChannels = async (): Promise => { + const res = await this.rpc( + 'ListChannels', + api.ListChannelsRequest, + api.ListChannelsResponse + ); + return { + channels: (res.channels || []) + .filter((channel: any) => channel.is_channel_ready) + .map(this.formatChannel) + }; + }; + + getPendingChannels = async (): Promise => { + const [res, balances, info] = await Promise.all([ + this.rpc( + 'ListChannels', + api.ListChannelsRequest, + api.ListChannelsResponse + ), + this.rpc( + 'GetBalances', + api.GetBalancesRequest, + api.GetBalancesResponse + ), + this.rpc( + 'GetNodeInfo', + api.GetNodeInfoRequest, + api.GetNodeInfoResponse + ) + ]); + const channels = res.channels || []; + const currentBlockHeight = Number(info.current_best_block?.height || 0); + const activeChannelIds = new Set( + channels.map((channel: any) => channel.channel_id) + ); + const reconstructed = this.reconstructClosingChannelsFromBalances( + balances, + activeChannelIds, + currentBlockHeight + ); + + return { + pending_open_channels: channels + .filter((channel: any) => !channel.is_channel_ready) + .map((channel: any) => ({ + channel: this.formatChannel(channel) + })), + pending_closing_channels: reconstructed.pendingClosing, + pending_force_closing_channels: reconstructed.pendingForceClosing, + waiting_close_channels: reconstructed.waitingClose + }; + }; + + getClosedChannels = async () => { + const [channelsResponse, balances, info] = await Promise.all([ + this.rpc( + 'ListChannels', + api.ListChannelsRequest, + api.ListChannelsResponse + ), + this.rpc( + 'GetBalances', + api.GetBalancesRequest, + api.GetBalancesResponse + ), + this.rpc( + 'GetNodeInfo', + api.GetNodeInfoRequest, + api.GetNodeInfoResponse + ) + ]); + const currentBlockHeight = Number(info.current_best_block?.height || 0); + const activeChannelIds = new Set( + (channelsResponse.channels || []).map( + (channel: any) => channel.channel_id + ) + ); + const reconstructed = this.reconstructClosingChannelsFromBalances( + balances, + activeChannelIds, + currentBlockHeight + ); + + return { channels: reconstructed.closed }; + }; + + getNewAddress = async (): Promise => { + const res = await this.rpc( + 'OnchainReceive', + api.OnchainReceiveRequest, + api.OnchainReceiveResponse + ); + return { address: res.address }; + }; + + sendCoins = async (data: any): Promise => { + const res = await this.rpc( + 'OnchainSend', + api.OnchainSendRequest, + api.OnchainSendResponse, + { + address: data.addr, + amount_sats: data.send_all ? undefined : toUInt64(data.amount), + send_all: data.send_all || undefined, + fee_rate_sat_per_vb: data.sat_per_vbyte + ? toUInt64(data.sat_per_vbyte) + : undefined + } + ); + return { txid: res.txid }; + }; + + createInvoice = async (data: any): Promise => { + const amount_msat = data.value_msat + ? toUInt64(data.value_msat) + : data.value + ? satsToMsatLong(data.value) + : undefined; + const res = await this.rpc( + 'Bolt11Receive', + api.Bolt11ReceiveRequest, + api.Bolt11ReceiveResponse, + { + amount_msat, + description: { direct: data.memo || '' }, + expiry_secs: Number(data.expiry_seconds) || 3600 + } + ); + return { + payment_request: res.invoice, + r_hash: res.payment_hash, + add_index: '' + }; + }; + + getInvoices = async (params?: { + limit?: number; + reversed?: boolean; + }): Promise => { + const payments = await this.listPayments(); + const limit = Number(params?.limit); + const invoicePayments = payments.filter( + (p) => p.direction === 'INBOUND' && p.kind?.kind !== 'onchain' + ); + const sortedInvoicePayments = params + ? invoicePayments.sort((a, b) => { + if (params?.reversed === false) { + return ( + Number(a.latest_update_timestamp || 0) - + Number(b.latest_update_timestamp || 0) + ); + } + return ( + Number(b.latest_update_timestamp || 0) - + Number(a.latest_update_timestamp || 0) + ); + }) + : invoicePayments; + const invoices = sortedInvoicePayments + .slice(0, Number.isFinite(limit) && limit > 0 ? limit : undefined) + .map(this.formatPaymentAsInvoice); + + return { invoices }; + }; + + lookupInvoice = async (data: { r_hash: string }): Promise => { + const payments = await this.listPayments(); + const payment = data?.r_hash + ? payments.find((p) => this.paymentHash(p) === data.r_hash) + : undefined; + + if (payment && payment.direction === 'INBOUND') { + return this.formatPaymentAsInvoice(payment); + } + + throw new Error('Invoice not found'); + }; + + getPayments = async (): Promise => { + const payments = await this.listPayments(); + return { + payments: payments + .filter( + (p) => + p.direction === 'OUTBOUND' && p.kind?.kind !== 'onchain' + ) + .map(this.formatPayment) + }; + }; + + getTransactions = async (): Promise => { + const [payments, info] = await Promise.all([ + this.listPayments(), + this.rpc( + 'GetNodeInfo', + api.GetNodeInfoRequest, + api.GetNodeInfoResponse + ) + ]); + const bestBlockHeight = Number(info.current_best_block?.height || 0); + return { + transactions: payments + .filter((p) => p.kind?.kind === 'onchain') + .map((payment) => + this.formatOnchainTransaction(payment, bestBlockHeight) + ) + }; + }; + + payLightningInvoice = async (data: any): Promise => { + const route_parameters = this.routeParameters(data); + const res = await this.rpc( + 'Bolt11Send', + api.Bolt11SendRequest, + api.Bolt11SendResponse, + { + invoice: data.payment_request, + amount_msat: data.amt ? satsToMsatLong(data.amt) : undefined, + route_parameters + } + ); + const payment = await this.awaitPaymentCompletion(res.payment_id); + return { + payment_hash: this.paymentHash(payment) || res.payment_id, + payment_preimage: this.paymentPreimage(payment), + payment_route: {}, + status: 'SUCCEEDED' + }; + }; + + sendKeysend = async (data: any): Promise => { + const res = await this.rpc( + 'SpontaneousSend', + api.SpontaneousSendRequest, + api.SpontaneousSendResponse, + { + node_id: data.pubkey, + amount_msat: satsToMsatLong(data.amt), + route_parameters: this.routeParameters(data) + } + ); + const payment = await this.awaitPaymentCompletion(res.payment_id); + return { + payment_hash: this.paymentHash(payment) || res.payment_id, + payment_preimage: this.paymentPreimage(payment), + payment_route: {}, + status: 'SUCCEEDED' + }; + }; + + decodePaymentRequest = async (urlParams?: Array): Promise => { + const invoice = (urlParams && urlParams[0]) || ''; + const res = await this.rpc( + 'DecodeInvoice', + api.DecodeInvoiceRequest, + api.DecodeInvoiceResponse, + { invoice } + ); + return { + ...res, + num_satoshis: res.amount_msat ? msatToSat(res.amount_msat) : '0', + num_msat: res.amount_msat || '0', + cltv_expiry: res.min_final_cltv_expiry_delta + }; + }; + + openChannelSync = async (data: OpenChannelRequest): Promise => { + const res = await this.rpc( + 'OpenChannel', + api.OpenChannelRequest, + api.OpenChannelResponse, + { + node_pubkey: data.node_pubkey_string, + address: data.host || '', + channel_amount_sats: toUInt64(data.local_funding_amount), + push_to_counterparty_msat: data.push_sat + ? satsToMsatLong(data.push_sat) + : undefined, + announce_channel: !data.privateChannel + } + ); + return await this.awaitChannelOpenEvent(res.user_channel_id); + }; + + closeChannel = async (urlParams?: Array): Promise => { + const fundingTxid = (urlParams && urlParams[0]) || ''; + const forceClose = !!(urlParams && urlParams[2]); + const res = await this.rpc( + 'ListChannels', + api.ListChannelsRequest, + api.ListChannelsResponse + ); + const channel = (res.channels || []).find( + (c: any) => c.funding_txo?.txid === fundingTxid + ); + if (!channel) throw new Error(`Channel not found: ${fundingTxid}`); + + await this.rpc( + forceClose ? 'ForceCloseChannel' : 'CloseChannel', + forceClose ? api.ForceCloseChannelRequest : api.CloseChannelRequest, + forceClose + ? api.ForceCloseChannelResponse + : api.CloseChannelResponse, + { + user_channel_id: channel.user_channel_id, + counterparty_node_id: channel.counterparty_node_id + } + ); + return { success: true }; + }; + + connectPeer = async (data: any): Promise => { + await this.rpc( + 'ConnectPeer', + api.ConnectPeerRequest, + api.ConnectPeerResponse, + { + node_pubkey: data.addr.pubkey, + address: data.addr.host, + persist: data.perm !== false + } + ); + return {}; + }; + + disconnectPeer = async (pubkey: string): Promise => { + await this.rpc( + 'DisconnectPeer', + api.DisconnectPeerRequest, + api.DisconnectPeerResponse, + { node_pubkey: pubkey } + ); + return true; + }; + + listPeers = async (): Promise => { + const res = await this.rpc( + 'ListPeers', + api.ListPeersRequest, + api.ListPeersResponse + ); + return (res.peers || []).map((peer: any) => ({ + pub_key: peer.node_id, + address: peer.address, + inbound: false, + sync_type: peer.is_connected ? 'ACTIVE_SYNC' : 'UNKNOWN_SYNC' + })); + }; + + signMessage = async (msg: string) => { + const res = await this.rpc( + 'SignMessage', + api.SignMessageRequest, + api.SignMessageResponse, + { message: Base64Utils.utf8ToBytes(msg) } + ); + return { signature: res.signature }; + }; + + verifyMessage = async (data: { + msg: string; + signature: string; + pubkey: string; + }) => { + const res = await this.rpc( + 'VerifySignature', + api.VerifySignatureRequest, + api.VerifySignatureResponse, + { + message: Base64Utils.utf8ToBytes(data.msg), + signature: data.signature, + public_key: data.pubkey + } + ); + return { valid: res.valid, pubkey: data.pubkey }; + }; + + createOffer = async ({ + description, + singleUse + }: { + description?: string; + singleUse?: boolean; + }): Promise => { + const res = await this.rpc( + 'Bolt12Receive', + api.Bolt12ReceiveRequest, + api.Bolt12ReceiveResponse, + { description: description || '' } + ); + return { + bolt12: res.offer, + offer_id: res.offer_id, + active: true, + single_use: singleUse || false, + used: false + }; + }; + + fetchInvoiceFromOffer = async ( + bolt12: string, + amountSatoshis: string + ): Promise => { + const res = await this.rpc( + 'Bolt12Send', + api.Bolt12SendRequest, + api.Bolt12SendResponse, + { + offer: bolt12, + amount_msat: satsToMsatLong(amountSatoshis) + } + ); + const payment = await this.awaitPaymentCompletion(res.payment_id); + return { + payment_hash: this.paymentHash(payment) || res.payment_id, + payment_preimage: this.paymentPreimage(payment), + status: 'SUCCEEDED' + }; + }; + + private awaitPaymentCompletion = async ( + paymentId: string + ): Promise => { + let eventPayment: any; + let paymentFailed = false; + const unsubscribe = this.subscribeToEvents((event: any) => { + const failedPayment = event.payment_failed?.payment; + const successfulPayment = event.payment_successful?.payment; + if (failedPayment?.id === paymentId) { + eventPayment = failedPayment; + paymentFailed = true; + } else if (successfulPayment?.id === paymentId) { + eventPayment = successfulPayment; + } + }); + + try { + for (let i = 0; i < 60; i++) { + if (eventPayment?.status === 'SUCCEEDED') return eventPayment; + if (paymentFailed || eventPayment?.status === 'FAILED') { + throw new Error('Payment failed'); + } + + const payment = await this.getPaymentDetails(paymentId); + if (payment?.status === 'SUCCEEDED') return payment; + if (payment?.status === 'FAILED') + throw new Error('Payment failed'); + await new Promise((resolve) => setTimeout(resolve, 1000)); + } + } finally { + unsubscribe(); + } + + throw new Error('Payment timed out'); + }; + + private getPaymentDetails = async (paymentId: string): Promise => { + const res = await this.rpc( + 'GetPaymentDetails', + api.GetPaymentDetailsRequest, + api.GetPaymentDetailsResponse, + { payment_id: paymentId } + ); + return res.payment; + }; + + private awaitChannelOpenEvent = async (userChannelId: string) => { + const fallback = { user_channel_id: userChannelId }; + + if (this.eventStreamingUnavailable) return fallback; + + return await new Promise((resolve, reject) => { + const cleanup = () => { + clearTimeout(timeout); + unsubscribe(); + unsubscribeStreamError(); + }; + + const timeout = setTimeout(() => { + cleanup(); + resolve(fallback); + }, 60000); + + const unsubscribeStreamError = this.onEventStreamError(() => { + cleanup(); + resolve(fallback); + }); + + const unsubscribe = this.subscribeToEvents((event: any) => { + const channelEvent = event.channel_state_changed; + if (channelEvent?.user_channel_id !== userChannelId) return; + + if ( + channelEvent.state === 'CHANNEL_STATE_PENDING' || + channelEvent.state === 'CHANNEL_STATE_READY' + ) { + cleanup(); + resolve({ + ...fallback, + ...this.fundingTxoResponse(channelEvent.funding_txo) + }); + } else if ( + channelEvent.state === 'CHANNEL_STATE_OPEN_FAILED' || + channelEvent.state === 'CHANNEL_STATE_CLOSED' + ) { + cleanup(); + reject( + new Error( + channelEvent.reason?.message || + `Channel open failed: ${userChannelId}` + ) + ); + } + }); + }); + }; + + private fundingTxoResponse = (fundingTxo?: string | null) => { + if (!fundingTxo) return {}; + const [funding_txid_str, outputIndex] = fundingTxo.split(':'); + return { + funding_txid_str, + output_index: + outputIndex !== undefined ? Number(outputIndex) : undefined + }; + }; + + private routeParameters = ( + data: any + ): types.IRouteParametersConfig | undefined => { + if (!data.fee_limit_sat && !data.max_parts) return undefined; + return { + max_total_routing_fee_msat: data.fee_limit_sat + ? satsToMsatLong(data.fee_limit_sat) + : undefined, + max_path_count: data.max_parts ? Number(data.max_parts) : undefined + }; + }; + + private paymentHash = (payment: any) => + payment?.kind?.bolt11?.hash || + payment?.kind?.bolt11_jit?.hash || + payment?.kind?.spontaneous?.hash || + payment?.kind?.bolt12_offer?.hash || + payment?.id || + ''; + + private paymentPreimage = (payment: any) => + payment?.kind?.bolt11?.preimage || + payment?.kind?.bolt11_jit?.preimage || + payment?.kind?.spontaneous?.preimage || + payment?.kind?.bolt12_offer?.preimage || + ''; + + private channelBalances = (channel: any) => { + const localReserveSats = channel.unspendable_punishment_reserve || 0; + const remoteReserveSats = + channel.counterparty_unspendable_punishment_reserve || 0; + const outboundSats = new BigNumber( + channel.outbound_capacity_msat || 0 + ).dividedBy(1000); + const inboundSats = new BigNumber( + channel.inbound_capacity_msat || 0 + ).dividedBy(1000); + + let localBalanceSats: BigNumber; + if (outboundSats.gt(0)) { + localBalanceSats = outboundSats.plus(localReserveSats); + } else { + localBalanceSats = new BigNumber(channel.channel_value_sats || 0) + .minus(inboundSats) + .minus(remoteReserveSats) + .minus(660); + if (localBalanceSats.lt(0)) localBalanceSats = new BigNumber(0); + } + + const remoteBalanceSats = new BigNumber( + channel.channel_value_sats || 0 + ).minus(localBalanceSats); + + return { localBalanceSats, remoteBalanceSats }; + }; + + private lightningBalanceDetails = ( + balance: any + ): { type: string; balance: any } | null => { + const types = [ + 'claimable_on_channel_close', + 'claimable_awaiting_confirmations', + 'contentious_claimable', + 'maybe_timeout_claimable_htlc', + 'maybe_preimage_claimable_htlc', + 'counterparty_revoked_output_claimable' + ]; + const type = types.find((key) => balance?.[key]); + return type ? { type, balance: balance[type] } : null; + }; + + private pendingSweepDetails = ( + balance: any + ): { type: string; balance: any } | null => { + const types = [ + 'pending_broadcast', + 'broadcast_awaiting_confirmation', + 'awaiting_threshold_confirmations' + ]; + const type = types.find((key) => balance?.[key]); + return type ? { type, balance: balance[type] } : null; + }; + + private reconstructClosingChannelsFromBalances = ( + balances: any, + activeChannelIds: Set, + currentBlockHeight: number + ) => { + const lightningByChannel = new Map(); + const sweepsByChannel = new Map(); + const confirmedSweepsByChannel = new Map(); + + for (const balance of balances.lightning_balances || []) { + const details = this.lightningBalanceDetails(balance); + if (!details || details.type === 'claimable_on_channel_close') { + continue; + } + const channelId = details.balance.channel_id || ''; + if (channelId && activeChannelIds.has(channelId)) continue; + const key = channelId || `lightning-${lightningByChannel.size}`; + const list = lightningByChannel.get(key) || []; + list.push(details); + lightningByChannel.set(key, list); + } + + for (const sweep of balances.pending_balances_from_channel_closures || + []) { + const details = this.pendingSweepDetails(sweep); + if (!details) continue; + const channelId = details.balance.channel_id || ''; + if (channelId && activeChannelIds.has(channelId)) continue; + const key = + channelId || + details.balance.latest_spending_txid || + `sweep-${sweepsByChannel.size}`; + + if ( + details.type === 'awaiting_threshold_confirmations' && + details.balance.confirmation_height != null && + Number(details.balance.confirmation_height) <= + currentBlockHeight + ) { + const list = confirmedSweepsByChannel.get(key) || []; + list.push(details); + confirmedSweepsByChannel.set(key, list); + continue; + } + + const list = sweepsByChannel.get(key) || []; + list.push(details); + sweepsByChannel.set(key, list); + } + + const pendingClosing: any[] = []; + const pendingForceClosing: any[] = []; + const waitingClose: any[] = []; + const closed: any[] = []; + + lightningByChannel.forEach((entries, channelId) => { + if (confirmedSweepsByChannel.has(channelId)) return; + + const totalSats = this.sumBalanceEntries(entries); + const channel = this.reconstructedChannel(entries, totalSats); + const sweeps = sweepsByChannel.get(channelId) || []; + const closingTxid = this.latestSweepTxid(sweeps); + + if (entries.every((entry) => this.isCoopCloseBalance(entry))) { + pendingClosing.push({ + channel, + closing_txid: closingTxid + }); + return; + } + + pendingForceClosing.push({ + channel: { ...channel, pendingClose: true }, + blocks_til_maturity: this.maxBlocksTilMaturity( + entries, + currentBlockHeight + ), + closing_txid: closingTxid + }); + }); + + sweepsByChannel.forEach((entries, channelId) => { + if (lightningByChannel.has(channelId)) return; + + const totalSats = this.sumBalanceEntries(entries); + const channel = this.reconstructedChannel(entries, totalSats); + const closingTxid = this.latestSweepTxid(entries); + + if (entries.every((entry) => entry.type === 'pending_broadcast')) { + waitingClose.push({ + channel: { ...channel, pendingClose: true } + }); + } else { + pendingForceClosing.push({ + channel: { ...channel, pendingClose: true }, + blocks_til_maturity: 0, + closing_txid: closingTxid + }); + } + }); + + confirmedSweepsByChannel.forEach((entries, channelId) => { + if ( + lightningByChannel.has(channelId) || + sweepsByChannel.has(channelId) + ) { + return; + } + + const totalSats = this.sumBalanceEntries(entries); + const closingTxid = this.latestSweepTxid(entries); + const channel = this.reconstructedChannel(entries, totalSats); + + closed.push({ + ...channel, + settled_balance: totalSats.toString(), + close_type: 'FORCE_CLOSE', + closing_txid: closingTxid, + closing_tx_hash: closingTxid, + forceClose: false, + blocks_til_maturity: 0, + time_locked_balance: '0' + }); + }); + + return { + pendingClosing, + pendingForceClosing, + waitingClose, + closed + }; + }; + + private sumBalanceEntries = (entries: any[]): BigNumber => + entries.reduce( + (sum, entry) => sum.plus(entry.balance.amount_satoshis || 0), + new BigNumber(0) + ); + + private reconstructedChannel = (entries: any[], totalSats: BigNumber) => { + const counterparty = entries.find( + (entry) => entry.balance.counterparty_node_id + )?.balance.counterparty_node_id; + const channelId = entries.find((entry) => entry.balance.channel_id) + ?.balance.channel_id; + + return { + active: false, + remote_pubkey: counterparty || '', + channel_point: '', + chan_id: '', + channel_id: channelId || '', + capacity: totalSats.toString(), + local_balance: totalSats.toString(), + remote_balance: '0', + commit_fee: '0', + commit_weight: '0', + fee_per_kw: '0', + unsettled_balance: '0', + total_satoshis_sent: '0', + total_satoshis_received: '0', + num_updates: '0', + pending_htlcs: [] + }; + }; + + private isCoopCloseBalance = (entry: any): boolean => + entry.type === 'claimable_awaiting_confirmations' && + entry.balance.source === 'COOP_CLOSE'; + + private maxBlocksTilMaturity = ( + entries: any[], + currentBlockHeight: number + ): number => + entries.reduce((max, entry) => { + const height = Number(entry.balance.confirmation_height || 0); + if (!height) return max; + return Math.max(max, height - currentBlockHeight); + }, 0); + + private latestSweepTxid = (entries: any[]): string => + entries.find((entry) => entry.balance.latest_spending_txid)?.balance + .latest_spending_txid || ''; + + private formatChannel = (channel: any): any => { + const { localBalanceSats, remoteBalanceSats } = + this.channelBalances(channel); + return { + active: channel.is_usable, + remote_pubkey: channel.counterparty_node_id, + channel_point: channel.funding_txo + ? `${channel.funding_txo.txid}:${channel.funding_txo.vout}` + : '', + chan_id: channel.short_channel_id || '', + channel_id: channel.channel_id, + capacity: channel.channel_value_sats || '0', + local_balance: localBalanceSats.toString(), + remote_balance: remoteBalanceSats.toString(), + commit_fee: '0', + commit_weight: '0', + fee_per_kw: channel.feerate_sat_per_1000_weight || '0', + unsettled_balance: '0', + total_satoshis_sent: '0', + total_satoshis_received: '0', + num_updates: '0', + pending_htlcs: [], + csv_delay: channel.force_close_spend_delay || 0, + private: !channel.is_announced, + initiator: channel.is_outbound, + local_chan_reserve_sat: channel.unspendable_punishment_reserve, + remote_chan_reserve_sat: + channel.counterparty_unspendable_punishment_reserve, + user_channel_id: channel.user_channel_id, + is_channel_ready: channel.is_channel_ready, + is_usable: channel.is_usable, + confirmations: channel.confirmations, + confirmations_required: channel.confirmations_required + }; + }; + + private formatPayment = (payment: any): any => { + const feeMsat = payment.fee_paid_msat || 0; + return { + payment_hash: this.paymentHash(payment), + value: msatToSat(payment.amount_msat), + value_sat: msatToSat(payment.amount_msat), + value_msat: payment.amount_msat || '0', + creation_date: payment.latest_update_timestamp || '0', + fee: msatToSat(feeMsat), + fee_sat: new BigNumber(feeMsat).dividedBy(1000).toFixed(0), + fee_msat: feeMsat, + payment_preimage: this.paymentPreimage(payment), + status: + payment.status === 'SUCCEEDED' + ? 'SUCCEEDED' + : payment.status === 'PENDING' + ? 'IN_FLIGHT' + : 'FAILED', + failure_reason: + payment.status === 'FAILED' ? 'FAILURE_REASON_ERROR' : '' + }; + }; + + private formatPaymentAsInvoice = (payment: any): any => { + const settled = payment.status === 'SUCCEEDED'; + return { + memo: '', + r_preimage: this.paymentPreimage(payment), + r_hash: this.paymentHash(payment), + value: msatToSat(payment.amount_msat), + value_msat: payment.amount_msat || '0', + settled, + creation_date: payment.latest_update_timestamp || '0', + settle_date: settled ? payment.latest_update_timestamp || '0' : '0', + payment_request: '', + expiry: '3600', + cltv_expiry: '40', + private: false, + add_index: '', + settle_index: '', + amt_paid: msatToSat(payment.amount_msat), + amt_paid_sat: msatToSat(payment.amount_msat), + amt_paid_msat: payment.amount_msat || '0', + state: settled + ? 'SETTLED' + : payment.status === 'PENDING' + ? 'OPEN' + : 'CANCELED' + }; + }; + + private formatOnchainTransaction = ( + payment: any, + bestBlockHeight: number + ): any => { + const kind = payment.kind?.onchain || {}; + const isInbound = payment.direction === 'INBOUND'; + const amount = msatToSat(payment.amount_msat); + const confirmationHeight = Number(kind.status?.confirmed?.height || 0); + const numConfirmations = + confirmationHeight && bestBlockHeight >= confirmationHeight + ? bestBlockHeight - confirmationHeight + 1 + : 0; + return { + tx_hash: kind.txid || payment.id, + amount: isInbound ? amount : `-${amount}`, + num_confirmations: numConfirmations, + block_height: confirmationHeight, + time_stamp: + kind.status?.confirmed?.timestamp || + payment.latest_update_timestamp || + '0', + dest_addresses: [], + total_fees: '0', + status: kind.status?.confirmed ? 'confirmed' : 'pending' + }; + }; + + supportsMessageSigning = () => true; + supportsMessageVerification = () => true; + supportsLnurlAuth = () => false; + supportsOnchainBalance = () => true; + supportsOnchainSends = () => true; + supportsOnchainReceiving = () => true; + supportsLightningSends = () => true; + supportsKeysend = () => true; + supportsChannelManagement = () => true; + supportsCircularRebalancing = () => false; + supportsForceClose = () => true; + supportsPendingChannels = () => true; + supportsClosedChannels = () => true; + supportsMPP = () => true; + supportsAMP = () => false; + supportsCoinControl = () => false; + supportsChannelCoinControl = () => false; + supportsHopPicking = () => false; + supportsAccounts = () => false; + supportsRouting = () => false; + supportsNodeInfo = () => true; + supportsAddressTypeSelection = () => false; + supportsNestedSegWit = () => false; + supportsTaproot = () => true; + supportsBumpFee = () => false; + supportsFlowLSP = () => false; + supportsNetworkInfo = () => true; + supportsSimpleTaprootChannels = () => false; + supportsCustomPreimages = () => false; + supportsSweep = () => false; + supportsOnchainSendMax = () => true; + supportsOnchainBatching = () => false; + supportsChannelBatching = () => false; + supportsChannelFundMax = () => false; + supportsLSPScustomMessage = () => false; + supportsLSPS1rest = () => false; + supportsLSPS1native = () => false; + supportsLSPS7native = () => false; + supportsOffers = () => true; + supportsListingOffers = () => false; + supportsBolt12Address = () => false; + supportsBolt11BlindedRoutes = () => false; + supportsAddressesWithDerivationPaths = () => false; + supportsCustomFeeLimit = () => true; + supportsForwardingHistory = () => false; + supportsCashuWallet = () => false; + supportsAddressMessageSigning = () => false; + supportsSettingInvoiceExpiration = () => true; + supportsWatchtowerClient = () => false; + supportsPeers = () => true; + supportsNostrWalletConnectService = () => false; +} diff --git a/docs/RemoteConnections.md b/docs/RemoteConnections.md index e29a9d59b1..0c29e33bee 100644 --- a/docs/RemoteConnections.md +++ b/docs/RemoteConnections.md @@ -4,11 +4,23 @@ For the most up-to-date guides on connecting ZEUS to your node, please visit our ## Connecting ZEUS to your node -You can connect ZEUS to a remote Bitcoin Lightning node running [Lightning Network Daemon (lnd)](https://github.com/LightningNetwork/lnd) or [Core Lightning](https://github.com/ElementsProject/lightning). +You can connect ZEUS to a remote Bitcoin Lightning node running [Lightning Network Daemon (lnd)](https://github.com/LightningNetwork/lnd), [Core Lightning](https://github.com/ElementsProject/lightning), or LDK Server. You must provide ZEUS with your node's hostname, port number, and the macaroon you choose to use in **hex format**. If you need help converting your macaroon to hex format we wrote up a Node.js script that can use [here](https://github.com/ZeusLN/lnd-hex-macaroon-generator/). Alternatively, if you're running a Unix-based operating system (eg. macOS, Linux) you can run `xxd -ps -u -c 1000 /path/to/admin.macaroon` to generate your macaroon in hex format. +### LDK Server + +LDK Server connections use the remote connection fields in ZEUS: + +* **Host**: the host name or full `https://` URL for your LDK Server. +* **Port**: the LDK Server API port. ZEUS defaults to `3536` if no port is set. +* **Access key**: the LDK Server API key used to generate the `x-auth` HMAC request header. + +LDK Server uses gRPC over HTTPS. If your server uses its generated self-signed TLS certificate, disable certificate verification for that node unless the certificate is trusted by your device. + +Current ZEUS support covers node info, balances, invoices, payments, on-chain receive/send, Lightning sends, keysend, BOLT 12 offers and offer payments, peers, message signing and verification, channel open/close, pending channels, and basic network graph counts. Features that depend on APIs not exposed by LDK Server, or data not currently present in its responses, remain unavailable in ZEUS for this backend. These include closed channel history, forwarding history time windows, coin control, batch opens, fee bumping, LSP/LSPS flows, Nostr Wallet Connect service hosting, and watchtower client management. + ### Tor Connection Guides ZEUS has support for connecting to you node entirely over the Tor network. You can refer to these guides to set up a Tor hidden service on your lnd node. The instructions are generally interchangeable and typically only require you to change your Tor path. diff --git a/locales/en.json b/locales/en.json index 698176114c..adf735c2e1 100644 --- a/locales/en.json +++ b/locales/en.json @@ -359,6 +359,7 @@ "views.Settings.AddEditNode.nickname": "Nickname (optional)", "views.Settings.AddEditNode.serverAddress": "Server address", "views.Settings.AddEditNode.accessKey": "Access Key", + "views.Settings.AddEditNode.ldkServerApiKey": "ldk-server API key", "views.Settings.AddEditNode.restPort": "REST Port", "views.Settings.AddEditNode.macaroon": "Macaroon (Hex format)", "views.Settings.AddEditNode.rune": "Rune", diff --git a/proto/ldkserver.d.ts b/proto/ldkserver.d.ts new file mode 100644 index 0000000000..b47a859a88 --- /dev/null +++ b/proto/ldkserver.d.ts @@ -0,0 +1,17924 @@ +import * as $protobuf from 'protobufjs'; +import Long = require('long'); +/** Namespace api. */ +export namespace api { + /** Properties of a GetNodeInfoRequest. */ + interface IGetNodeInfoRequest {} + + /** Represents a GetNodeInfoRequest. */ + class GetNodeInfoRequest implements IGetNodeInfoRequest { + /** + * Constructs a new GetNodeInfoRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGetNodeInfoRequest); + + /** + * Creates a new GetNodeInfoRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNodeInfoRequest instance + */ + public static create( + properties?: api.IGetNodeInfoRequest + ): api.GetNodeInfoRequest; + + /** + * Encodes the specified GetNodeInfoRequest message. Does not implicitly {@link api.GetNodeInfoRequest.verify|verify} messages. + * @param message GetNodeInfoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGetNodeInfoRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GetNodeInfoRequest message, length delimited. Does not implicitly {@link api.GetNodeInfoRequest.verify|verify} messages. + * @param message GetNodeInfoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGetNodeInfoRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GetNodeInfoRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNodeInfoRequest + * @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 + ): api.GetNodeInfoRequest; + + /** + * Decodes a GetNodeInfoRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNodeInfoRequest + * @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 + ): api.GetNodeInfoRequest; + + /** + * Verifies a GetNodeInfoRequest 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 GetNodeInfoRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNodeInfoRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.GetNodeInfoRequest; + + /** + * Creates a plain object from a GetNodeInfoRequest message. Also converts values to other types if specified. + * @param message GetNodeInfoRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GetNodeInfoRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GetNodeInfoRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetNodeInfoRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetNodeInfoResponse. */ + interface IGetNodeInfoResponse { + /** GetNodeInfoResponse node_id */ + node_id?: string | null; + + /** GetNodeInfoResponse current_best_block */ + current_best_block?: types.IBestBlock | null; + + /** GetNodeInfoResponse latest_lightning_wallet_sync_timestamp */ + latest_lightning_wallet_sync_timestamp?: Long | null; + + /** GetNodeInfoResponse latest_onchain_wallet_sync_timestamp */ + latest_onchain_wallet_sync_timestamp?: Long | null; + + /** GetNodeInfoResponse latest_fee_rate_cache_update_timestamp */ + latest_fee_rate_cache_update_timestamp?: Long | null; + + /** GetNodeInfoResponse latest_rgs_snapshot_timestamp */ + latest_rgs_snapshot_timestamp?: Long | null; + + /** GetNodeInfoResponse latest_node_announcement_broadcast_timestamp */ + latest_node_announcement_broadcast_timestamp?: Long | null; + + /** GetNodeInfoResponse listening_addresses */ + listening_addresses?: string[] | null; + + /** GetNodeInfoResponse announcement_addresses */ + announcement_addresses?: string[] | null; + + /** GetNodeInfoResponse node_alias */ + node_alias?: string | null; + + /** GetNodeInfoResponse node_uris */ + node_uris?: string[] | null; + + /** GetNodeInfoResponse network */ + network?: types.Network | null; + } + + /** Represents a GetNodeInfoResponse. */ + class GetNodeInfoResponse implements IGetNodeInfoResponse { + /** + * Constructs a new GetNodeInfoResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGetNodeInfoResponse); + + /** GetNodeInfoResponse node_id. */ + public node_id: string; + + /** GetNodeInfoResponse current_best_block. */ + public current_best_block?: types.IBestBlock | null; + + /** GetNodeInfoResponse latest_lightning_wallet_sync_timestamp. */ + public latest_lightning_wallet_sync_timestamp?: Long | null; + + /** GetNodeInfoResponse latest_onchain_wallet_sync_timestamp. */ + public latest_onchain_wallet_sync_timestamp?: Long | null; + + /** GetNodeInfoResponse latest_fee_rate_cache_update_timestamp. */ + public latest_fee_rate_cache_update_timestamp?: Long | null; + + /** GetNodeInfoResponse latest_rgs_snapshot_timestamp. */ + public latest_rgs_snapshot_timestamp?: Long | null; + + /** GetNodeInfoResponse latest_node_announcement_broadcast_timestamp. */ + public latest_node_announcement_broadcast_timestamp?: Long | null; + + /** GetNodeInfoResponse listening_addresses. */ + public listening_addresses: string[]; + + /** GetNodeInfoResponse announcement_addresses. */ + public announcement_addresses: string[]; + + /** GetNodeInfoResponse node_alias. */ + public node_alias?: string | null; + + /** GetNodeInfoResponse node_uris. */ + public node_uris: string[]; + + /** GetNodeInfoResponse network. */ + public network: types.Network; + + /** + * Creates a new GetNodeInfoResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNodeInfoResponse instance + */ + public static create( + properties?: api.IGetNodeInfoResponse + ): api.GetNodeInfoResponse; + + /** + * Encodes the specified GetNodeInfoResponse message. Does not implicitly {@link api.GetNodeInfoResponse.verify|verify} messages. + * @param message GetNodeInfoResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGetNodeInfoResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GetNodeInfoResponse message, length delimited. Does not implicitly {@link api.GetNodeInfoResponse.verify|verify} messages. + * @param message GetNodeInfoResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGetNodeInfoResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GetNodeInfoResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNodeInfoResponse + * @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 + ): api.GetNodeInfoResponse; + + /** + * Decodes a GetNodeInfoResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNodeInfoResponse + * @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 + ): api.GetNodeInfoResponse; + + /** + * Verifies a GetNodeInfoResponse 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 GetNodeInfoResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNodeInfoResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.GetNodeInfoResponse; + + /** + * Creates a plain object from a GetNodeInfoResponse message. Also converts values to other types if specified. + * @param message GetNodeInfoResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GetNodeInfoResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GetNodeInfoResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetNodeInfoResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OnchainReceiveRequest. */ + interface IOnchainReceiveRequest {} + + /** Represents an OnchainReceiveRequest. */ + class OnchainReceiveRequest implements IOnchainReceiveRequest { + /** + * Constructs a new OnchainReceiveRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IOnchainReceiveRequest); + + /** + * Creates a new OnchainReceiveRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns OnchainReceiveRequest instance + */ + public static create( + properties?: api.IOnchainReceiveRequest + ): api.OnchainReceiveRequest; + + /** + * Encodes the specified OnchainReceiveRequest message. Does not implicitly {@link api.OnchainReceiveRequest.verify|verify} messages. + * @param message OnchainReceiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IOnchainReceiveRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified OnchainReceiveRequest message, length delimited. Does not implicitly {@link api.OnchainReceiveRequest.verify|verify} messages. + * @param message OnchainReceiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IOnchainReceiveRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an OnchainReceiveRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OnchainReceiveRequest + * @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 + ): api.OnchainReceiveRequest; + + /** + * Decodes an OnchainReceiveRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OnchainReceiveRequest + * @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 + ): api.OnchainReceiveRequest; + + /** + * Verifies an OnchainReceiveRequest 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 OnchainReceiveRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OnchainReceiveRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.OnchainReceiveRequest; + + /** + * Creates a plain object from an OnchainReceiveRequest message. Also converts values to other types if specified. + * @param message OnchainReceiveRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.OnchainReceiveRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this OnchainReceiveRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OnchainReceiveRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OnchainReceiveResponse. */ + interface IOnchainReceiveResponse { + /** OnchainReceiveResponse address */ + address?: string | null; + } + + /** Represents an OnchainReceiveResponse. */ + class OnchainReceiveResponse implements IOnchainReceiveResponse { + /** + * Constructs a new OnchainReceiveResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IOnchainReceiveResponse); + + /** OnchainReceiveResponse address. */ + public address: string; + + /** + * Creates a new OnchainReceiveResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns OnchainReceiveResponse instance + */ + public static create( + properties?: api.IOnchainReceiveResponse + ): api.OnchainReceiveResponse; + + /** + * Encodes the specified OnchainReceiveResponse message. Does not implicitly {@link api.OnchainReceiveResponse.verify|verify} messages. + * @param message OnchainReceiveResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IOnchainReceiveResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified OnchainReceiveResponse message, length delimited. Does not implicitly {@link api.OnchainReceiveResponse.verify|verify} messages. + * @param message OnchainReceiveResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IOnchainReceiveResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an OnchainReceiveResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OnchainReceiveResponse + * @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 + ): api.OnchainReceiveResponse; + + /** + * Decodes an OnchainReceiveResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OnchainReceiveResponse + * @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 + ): api.OnchainReceiveResponse; + + /** + * Verifies an OnchainReceiveResponse 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 OnchainReceiveResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OnchainReceiveResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.OnchainReceiveResponse; + + /** + * Creates a plain object from an OnchainReceiveResponse message. Also converts values to other types if specified. + * @param message OnchainReceiveResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.OnchainReceiveResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this OnchainReceiveResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OnchainReceiveResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OnchainSendRequest. */ + interface IOnchainSendRequest { + /** OnchainSendRequest address */ + address?: string | null; + + /** OnchainSendRequest amount_sats */ + amount_sats?: Long | null; + + /** OnchainSendRequest send_all */ + send_all?: boolean | null; + + /** OnchainSendRequest fee_rate_sat_per_vb */ + fee_rate_sat_per_vb?: Long | null; + } + + /** Represents an OnchainSendRequest. */ + class OnchainSendRequest implements IOnchainSendRequest { + /** + * Constructs a new OnchainSendRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IOnchainSendRequest); + + /** OnchainSendRequest address. */ + public address: string; + + /** OnchainSendRequest amount_sats. */ + public amount_sats?: Long | null; + + /** OnchainSendRequest send_all. */ + public send_all?: boolean | null; + + /** OnchainSendRequest fee_rate_sat_per_vb. */ + public fee_rate_sat_per_vb?: Long | null; + + /** + * Creates a new OnchainSendRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns OnchainSendRequest instance + */ + public static create( + properties?: api.IOnchainSendRequest + ): api.OnchainSendRequest; + + /** + * Encodes the specified OnchainSendRequest message. Does not implicitly {@link api.OnchainSendRequest.verify|verify} messages. + * @param message OnchainSendRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IOnchainSendRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified OnchainSendRequest message, length delimited. Does not implicitly {@link api.OnchainSendRequest.verify|verify} messages. + * @param message OnchainSendRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IOnchainSendRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an OnchainSendRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OnchainSendRequest + * @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 + ): api.OnchainSendRequest; + + /** + * Decodes an OnchainSendRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OnchainSendRequest + * @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 + ): api.OnchainSendRequest; + + /** + * Verifies an OnchainSendRequest 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 OnchainSendRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OnchainSendRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.OnchainSendRequest; + + /** + * Creates a plain object from an OnchainSendRequest message. Also converts values to other types if specified. + * @param message OnchainSendRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.OnchainSendRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this OnchainSendRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OnchainSendRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OnchainSendResponse. */ + interface IOnchainSendResponse { + /** OnchainSendResponse txid */ + txid?: string | null; + } + + /** Represents an OnchainSendResponse. */ + class OnchainSendResponse implements IOnchainSendResponse { + /** + * Constructs a new OnchainSendResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IOnchainSendResponse); + + /** OnchainSendResponse txid. */ + public txid: string; + + /** + * Creates a new OnchainSendResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns OnchainSendResponse instance + */ + public static create( + properties?: api.IOnchainSendResponse + ): api.OnchainSendResponse; + + /** + * Encodes the specified OnchainSendResponse message. Does not implicitly {@link api.OnchainSendResponse.verify|verify} messages. + * @param message OnchainSendResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IOnchainSendResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified OnchainSendResponse message, length delimited. Does not implicitly {@link api.OnchainSendResponse.verify|verify} messages. + * @param message OnchainSendResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IOnchainSendResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an OnchainSendResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OnchainSendResponse + * @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 + ): api.OnchainSendResponse; + + /** + * Decodes an OnchainSendResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OnchainSendResponse + * @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 + ): api.OnchainSendResponse; + + /** + * Verifies an OnchainSendResponse 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 OnchainSendResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OnchainSendResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.OnchainSendResponse; + + /** + * Creates a plain object from an OnchainSendResponse message. Also converts values to other types if specified. + * @param message OnchainSendResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.OnchainSendResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this OnchainSendResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OnchainSendResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ReceiveRequest. */ + interface IBolt11ReceiveRequest { + /** Bolt11ReceiveRequest amount_msat */ + amount_msat?: Long | null; + + /** Bolt11ReceiveRequest description */ + description?: types.IBolt11InvoiceDescription | null; + + /** Bolt11ReceiveRequest expiry_secs */ + expiry_secs?: number | null; + } + + /** Represents a Bolt11ReceiveRequest. */ + class Bolt11ReceiveRequest implements IBolt11ReceiveRequest { + /** + * Constructs a new Bolt11ReceiveRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11ReceiveRequest); + + /** Bolt11ReceiveRequest amount_msat. */ + public amount_msat?: Long | null; + + /** Bolt11ReceiveRequest description. */ + public description?: types.IBolt11InvoiceDescription | null; + + /** Bolt11ReceiveRequest expiry_secs. */ + public expiry_secs: number; + + /** + * Creates a new Bolt11ReceiveRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11ReceiveRequest instance + */ + public static create( + properties?: api.IBolt11ReceiveRequest + ): api.Bolt11ReceiveRequest; + + /** + * Encodes the specified Bolt11ReceiveRequest message. Does not implicitly {@link api.Bolt11ReceiveRequest.verify|verify} messages. + * @param message Bolt11ReceiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11ReceiveRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11ReceiveRequest message, length delimited. Does not implicitly {@link api.Bolt11ReceiveRequest.verify|verify} messages. + * @param message Bolt11ReceiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11ReceiveRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11ReceiveRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11ReceiveRequest + * @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 + ): api.Bolt11ReceiveRequest; + + /** + * Decodes a Bolt11ReceiveRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11ReceiveRequest + * @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 + ): api.Bolt11ReceiveRequest; + + /** + * Verifies a Bolt11ReceiveRequest 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 Bolt11ReceiveRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11ReceiveRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11ReceiveRequest; + + /** + * Creates a plain object from a Bolt11ReceiveRequest message. Also converts values to other types if specified. + * @param message Bolt11ReceiveRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11ReceiveRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11ReceiveRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11ReceiveRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ReceiveResponse. */ + interface IBolt11ReceiveResponse { + /** Bolt11ReceiveResponse invoice */ + invoice?: string | null; + + /** Bolt11ReceiveResponse payment_hash */ + payment_hash?: string | null; + + /** Bolt11ReceiveResponse payment_secret */ + payment_secret?: string | null; + } + + /** Represents a Bolt11ReceiveResponse. */ + class Bolt11ReceiveResponse implements IBolt11ReceiveResponse { + /** + * Constructs a new Bolt11ReceiveResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11ReceiveResponse); + + /** Bolt11ReceiveResponse invoice. */ + public invoice: string; + + /** Bolt11ReceiveResponse payment_hash. */ + public payment_hash: string; + + /** Bolt11ReceiveResponse payment_secret. */ + public payment_secret: string; + + /** + * Creates a new Bolt11ReceiveResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11ReceiveResponse instance + */ + public static create( + properties?: api.IBolt11ReceiveResponse + ): api.Bolt11ReceiveResponse; + + /** + * Encodes the specified Bolt11ReceiveResponse message. Does not implicitly {@link api.Bolt11ReceiveResponse.verify|verify} messages. + * @param message Bolt11ReceiveResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11ReceiveResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11ReceiveResponse message, length delimited. Does not implicitly {@link api.Bolt11ReceiveResponse.verify|verify} messages. + * @param message Bolt11ReceiveResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11ReceiveResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11ReceiveResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11ReceiveResponse + * @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 + ): api.Bolt11ReceiveResponse; + + /** + * Decodes a Bolt11ReceiveResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11ReceiveResponse + * @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 + ): api.Bolt11ReceiveResponse; + + /** + * Verifies a Bolt11ReceiveResponse 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 Bolt11ReceiveResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11ReceiveResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11ReceiveResponse; + + /** + * Creates a plain object from a Bolt11ReceiveResponse message. Also converts values to other types if specified. + * @param message Bolt11ReceiveResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11ReceiveResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11ReceiveResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11ReceiveResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ReceiveForHashRequest. */ + interface IBolt11ReceiveForHashRequest { + /** Bolt11ReceiveForHashRequest amount_msat */ + amount_msat?: Long | null; + + /** Bolt11ReceiveForHashRequest description */ + description?: types.IBolt11InvoiceDescription | null; + + /** Bolt11ReceiveForHashRequest expiry_secs */ + expiry_secs?: number | null; + + /** Bolt11ReceiveForHashRequest payment_hash */ + payment_hash?: string | null; + } + + /** Represents a Bolt11ReceiveForHashRequest. */ + class Bolt11ReceiveForHashRequest implements IBolt11ReceiveForHashRequest { + /** + * Constructs a new Bolt11ReceiveForHashRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11ReceiveForHashRequest); + + /** Bolt11ReceiveForHashRequest amount_msat. */ + public amount_msat?: Long | null; + + /** Bolt11ReceiveForHashRequest description. */ + public description?: types.IBolt11InvoiceDescription | null; + + /** Bolt11ReceiveForHashRequest expiry_secs. */ + public expiry_secs: number; + + /** Bolt11ReceiveForHashRequest payment_hash. */ + public payment_hash: string; + + /** + * Creates a new Bolt11ReceiveForHashRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11ReceiveForHashRequest instance + */ + public static create( + properties?: api.IBolt11ReceiveForHashRequest + ): api.Bolt11ReceiveForHashRequest; + + /** + * Encodes the specified Bolt11ReceiveForHashRequest message. Does not implicitly {@link api.Bolt11ReceiveForHashRequest.verify|verify} messages. + * @param message Bolt11ReceiveForHashRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11ReceiveForHashRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11ReceiveForHashRequest message, length delimited. Does not implicitly {@link api.Bolt11ReceiveForHashRequest.verify|verify} messages. + * @param message Bolt11ReceiveForHashRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11ReceiveForHashRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11ReceiveForHashRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11ReceiveForHashRequest + * @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 + ): api.Bolt11ReceiveForHashRequest; + + /** + * Decodes a Bolt11ReceiveForHashRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11ReceiveForHashRequest + * @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 + ): api.Bolt11ReceiveForHashRequest; + + /** + * Verifies a Bolt11ReceiveForHashRequest 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 Bolt11ReceiveForHashRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11ReceiveForHashRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11ReceiveForHashRequest; + + /** + * Creates a plain object from a Bolt11ReceiveForHashRequest message. Also converts values to other types if specified. + * @param message Bolt11ReceiveForHashRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11ReceiveForHashRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11ReceiveForHashRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11ReceiveForHashRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ReceiveForHashResponse. */ + interface IBolt11ReceiveForHashResponse { + /** Bolt11ReceiveForHashResponse invoice */ + invoice?: string | null; + } + + /** Represents a Bolt11ReceiveForHashResponse. */ + class Bolt11ReceiveForHashResponse + implements IBolt11ReceiveForHashResponse + { + /** + * Constructs a new Bolt11ReceiveForHashResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11ReceiveForHashResponse); + + /** Bolt11ReceiveForHashResponse invoice. */ + public invoice: string; + + /** + * Creates a new Bolt11ReceiveForHashResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11ReceiveForHashResponse instance + */ + public static create( + properties?: api.IBolt11ReceiveForHashResponse + ): api.Bolt11ReceiveForHashResponse; + + /** + * Encodes the specified Bolt11ReceiveForHashResponse message. Does not implicitly {@link api.Bolt11ReceiveForHashResponse.verify|verify} messages. + * @param message Bolt11ReceiveForHashResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11ReceiveForHashResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11ReceiveForHashResponse message, length delimited. Does not implicitly {@link api.Bolt11ReceiveForHashResponse.verify|verify} messages. + * @param message Bolt11ReceiveForHashResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11ReceiveForHashResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11ReceiveForHashResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11ReceiveForHashResponse + * @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 + ): api.Bolt11ReceiveForHashResponse; + + /** + * Decodes a Bolt11ReceiveForHashResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11ReceiveForHashResponse + * @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 + ): api.Bolt11ReceiveForHashResponse; + + /** + * Verifies a Bolt11ReceiveForHashResponse 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 Bolt11ReceiveForHashResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11ReceiveForHashResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11ReceiveForHashResponse; + + /** + * Creates a plain object from a Bolt11ReceiveForHashResponse message. Also converts values to other types if specified. + * @param message Bolt11ReceiveForHashResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11ReceiveForHashResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11ReceiveForHashResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11ReceiveForHashResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ClaimForHashRequest. */ + interface IBolt11ClaimForHashRequest { + /** Bolt11ClaimForHashRequest payment_hash */ + payment_hash?: string | null; + + /** Bolt11ClaimForHashRequest claimable_amount_msat */ + claimable_amount_msat?: Long | null; + + /** Bolt11ClaimForHashRequest preimage */ + preimage?: string | null; + } + + /** Represents a Bolt11ClaimForHashRequest. */ + class Bolt11ClaimForHashRequest implements IBolt11ClaimForHashRequest { + /** + * Constructs a new Bolt11ClaimForHashRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11ClaimForHashRequest); + + /** Bolt11ClaimForHashRequest payment_hash. */ + public payment_hash?: string | null; + + /** Bolt11ClaimForHashRequest claimable_amount_msat. */ + public claimable_amount_msat?: Long | null; + + /** Bolt11ClaimForHashRequest preimage. */ + public preimage: string; + + /** + * Creates a new Bolt11ClaimForHashRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11ClaimForHashRequest instance + */ + public static create( + properties?: api.IBolt11ClaimForHashRequest + ): api.Bolt11ClaimForHashRequest; + + /** + * Encodes the specified Bolt11ClaimForHashRequest message. Does not implicitly {@link api.Bolt11ClaimForHashRequest.verify|verify} messages. + * @param message Bolt11ClaimForHashRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11ClaimForHashRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11ClaimForHashRequest message, length delimited. Does not implicitly {@link api.Bolt11ClaimForHashRequest.verify|verify} messages. + * @param message Bolt11ClaimForHashRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11ClaimForHashRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11ClaimForHashRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11ClaimForHashRequest + * @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 + ): api.Bolt11ClaimForHashRequest; + + /** + * Decodes a Bolt11ClaimForHashRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11ClaimForHashRequest + * @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 + ): api.Bolt11ClaimForHashRequest; + + /** + * Verifies a Bolt11ClaimForHashRequest 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 Bolt11ClaimForHashRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11ClaimForHashRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11ClaimForHashRequest; + + /** + * Creates a plain object from a Bolt11ClaimForHashRequest message. Also converts values to other types if specified. + * @param message Bolt11ClaimForHashRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11ClaimForHashRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11ClaimForHashRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11ClaimForHashRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ClaimForHashResponse. */ + interface IBolt11ClaimForHashResponse {} + + /** Represents a Bolt11ClaimForHashResponse. */ + class Bolt11ClaimForHashResponse implements IBolt11ClaimForHashResponse { + /** + * Constructs a new Bolt11ClaimForHashResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11ClaimForHashResponse); + + /** + * Creates a new Bolt11ClaimForHashResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11ClaimForHashResponse instance + */ + public static create( + properties?: api.IBolt11ClaimForHashResponse + ): api.Bolt11ClaimForHashResponse; + + /** + * Encodes the specified Bolt11ClaimForHashResponse message. Does not implicitly {@link api.Bolt11ClaimForHashResponse.verify|verify} messages. + * @param message Bolt11ClaimForHashResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11ClaimForHashResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11ClaimForHashResponse message, length delimited. Does not implicitly {@link api.Bolt11ClaimForHashResponse.verify|verify} messages. + * @param message Bolt11ClaimForHashResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11ClaimForHashResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11ClaimForHashResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11ClaimForHashResponse + * @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 + ): api.Bolt11ClaimForHashResponse; + + /** + * Decodes a Bolt11ClaimForHashResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11ClaimForHashResponse + * @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 + ): api.Bolt11ClaimForHashResponse; + + /** + * Verifies a Bolt11ClaimForHashResponse 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 Bolt11ClaimForHashResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11ClaimForHashResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11ClaimForHashResponse; + + /** + * Creates a plain object from a Bolt11ClaimForHashResponse message. Also converts values to other types if specified. + * @param message Bolt11ClaimForHashResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11ClaimForHashResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11ClaimForHashResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11ClaimForHashResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11FailForHashRequest. */ + interface IBolt11FailForHashRequest { + /** Bolt11FailForHashRequest payment_hash */ + payment_hash?: string | null; + } + + /** Represents a Bolt11FailForHashRequest. */ + class Bolt11FailForHashRequest implements IBolt11FailForHashRequest { + /** + * Constructs a new Bolt11FailForHashRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11FailForHashRequest); + + /** Bolt11FailForHashRequest payment_hash. */ + public payment_hash: string; + + /** + * Creates a new Bolt11FailForHashRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11FailForHashRequest instance + */ + public static create( + properties?: api.IBolt11FailForHashRequest + ): api.Bolt11FailForHashRequest; + + /** + * Encodes the specified Bolt11FailForHashRequest message. Does not implicitly {@link api.Bolt11FailForHashRequest.verify|verify} messages. + * @param message Bolt11FailForHashRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11FailForHashRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11FailForHashRequest message, length delimited. Does not implicitly {@link api.Bolt11FailForHashRequest.verify|verify} messages. + * @param message Bolt11FailForHashRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11FailForHashRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11FailForHashRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11FailForHashRequest + * @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 + ): api.Bolt11FailForHashRequest; + + /** + * Decodes a Bolt11FailForHashRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11FailForHashRequest + * @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 + ): api.Bolt11FailForHashRequest; + + /** + * Verifies a Bolt11FailForHashRequest 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 Bolt11FailForHashRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11FailForHashRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11FailForHashRequest; + + /** + * Creates a plain object from a Bolt11FailForHashRequest message. Also converts values to other types if specified. + * @param message Bolt11FailForHashRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11FailForHashRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11FailForHashRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11FailForHashRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11FailForHashResponse. */ + interface IBolt11FailForHashResponse {} + + /** Represents a Bolt11FailForHashResponse. */ + class Bolt11FailForHashResponse implements IBolt11FailForHashResponse { + /** + * Constructs a new Bolt11FailForHashResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11FailForHashResponse); + + /** + * Creates a new Bolt11FailForHashResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11FailForHashResponse instance + */ + public static create( + properties?: api.IBolt11FailForHashResponse + ): api.Bolt11FailForHashResponse; + + /** + * Encodes the specified Bolt11FailForHashResponse message. Does not implicitly {@link api.Bolt11FailForHashResponse.verify|verify} messages. + * @param message Bolt11FailForHashResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11FailForHashResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11FailForHashResponse message, length delimited. Does not implicitly {@link api.Bolt11FailForHashResponse.verify|verify} messages. + * @param message Bolt11FailForHashResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11FailForHashResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11FailForHashResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11FailForHashResponse + * @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 + ): api.Bolt11FailForHashResponse; + + /** + * Decodes a Bolt11FailForHashResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11FailForHashResponse + * @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 + ): api.Bolt11FailForHashResponse; + + /** + * Verifies a Bolt11FailForHashResponse 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 Bolt11FailForHashResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11FailForHashResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11FailForHashResponse; + + /** + * Creates a plain object from a Bolt11FailForHashResponse message. Also converts values to other types if specified. + * @param message Bolt11FailForHashResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11FailForHashResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11FailForHashResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11FailForHashResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ReceiveViaJitChannelRequest. */ + interface IBolt11ReceiveViaJitChannelRequest { + /** Bolt11ReceiveViaJitChannelRequest amount_msat */ + amount_msat?: Long | null; + + /** Bolt11ReceiveViaJitChannelRequest description */ + description?: types.IBolt11InvoiceDescription | null; + + /** Bolt11ReceiveViaJitChannelRequest expiry_secs */ + expiry_secs?: number | null; + + /** Bolt11ReceiveViaJitChannelRequest max_total_lsp_fee_limit_msat */ + max_total_lsp_fee_limit_msat?: Long | null; + } + + /** Represents a Bolt11ReceiveViaJitChannelRequest. */ + class Bolt11ReceiveViaJitChannelRequest + implements IBolt11ReceiveViaJitChannelRequest + { + /** + * Constructs a new Bolt11ReceiveViaJitChannelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11ReceiveViaJitChannelRequest); + + /** Bolt11ReceiveViaJitChannelRequest amount_msat. */ + public amount_msat: Long; + + /** Bolt11ReceiveViaJitChannelRequest description. */ + public description?: types.IBolt11InvoiceDescription | null; + + /** Bolt11ReceiveViaJitChannelRequest expiry_secs. */ + public expiry_secs: number; + + /** Bolt11ReceiveViaJitChannelRequest max_total_lsp_fee_limit_msat. */ + public max_total_lsp_fee_limit_msat?: Long | null; + + /** + * Creates a new Bolt11ReceiveViaJitChannelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11ReceiveViaJitChannelRequest instance + */ + public static create( + properties?: api.IBolt11ReceiveViaJitChannelRequest + ): api.Bolt11ReceiveViaJitChannelRequest; + + /** + * Encodes the specified Bolt11ReceiveViaJitChannelRequest message. Does not implicitly {@link api.Bolt11ReceiveViaJitChannelRequest.verify|verify} messages. + * @param message Bolt11ReceiveViaJitChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11ReceiveViaJitChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11ReceiveViaJitChannelRequest message, length delimited. Does not implicitly {@link api.Bolt11ReceiveViaJitChannelRequest.verify|verify} messages. + * @param message Bolt11ReceiveViaJitChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11ReceiveViaJitChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11ReceiveViaJitChannelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11ReceiveViaJitChannelRequest + * @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 + ): api.Bolt11ReceiveViaJitChannelRequest; + + /** + * Decodes a Bolt11ReceiveViaJitChannelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11ReceiveViaJitChannelRequest + * @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 + ): api.Bolt11ReceiveViaJitChannelRequest; + + /** + * Verifies a Bolt11ReceiveViaJitChannelRequest 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 Bolt11ReceiveViaJitChannelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11ReceiveViaJitChannelRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11ReceiveViaJitChannelRequest; + + /** + * Creates a plain object from a Bolt11ReceiveViaJitChannelRequest message. Also converts values to other types if specified. + * @param message Bolt11ReceiveViaJitChannelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11ReceiveViaJitChannelRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11ReceiveViaJitChannelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11ReceiveViaJitChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ReceiveViaJitChannelResponse. */ + interface IBolt11ReceiveViaJitChannelResponse { + /** Bolt11ReceiveViaJitChannelResponse invoice */ + invoice?: string | null; + } + + /** Represents a Bolt11ReceiveViaJitChannelResponse. */ + class Bolt11ReceiveViaJitChannelResponse + implements IBolt11ReceiveViaJitChannelResponse + { + /** + * Constructs a new Bolt11ReceiveViaJitChannelResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11ReceiveViaJitChannelResponse); + + /** Bolt11ReceiveViaJitChannelResponse invoice. */ + public invoice: string; + + /** + * Creates a new Bolt11ReceiveViaJitChannelResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11ReceiveViaJitChannelResponse instance + */ + public static create( + properties?: api.IBolt11ReceiveViaJitChannelResponse + ): api.Bolt11ReceiveViaJitChannelResponse; + + /** + * Encodes the specified Bolt11ReceiveViaJitChannelResponse message. Does not implicitly {@link api.Bolt11ReceiveViaJitChannelResponse.verify|verify} messages. + * @param message Bolt11ReceiveViaJitChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11ReceiveViaJitChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11ReceiveViaJitChannelResponse message, length delimited. Does not implicitly {@link api.Bolt11ReceiveViaJitChannelResponse.verify|verify} messages. + * @param message Bolt11ReceiveViaJitChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11ReceiveViaJitChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11ReceiveViaJitChannelResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11ReceiveViaJitChannelResponse + * @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 + ): api.Bolt11ReceiveViaJitChannelResponse; + + /** + * Decodes a Bolt11ReceiveViaJitChannelResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11ReceiveViaJitChannelResponse + * @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 + ): api.Bolt11ReceiveViaJitChannelResponse; + + /** + * Verifies a Bolt11ReceiveViaJitChannelResponse 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 Bolt11ReceiveViaJitChannelResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11ReceiveViaJitChannelResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11ReceiveViaJitChannelResponse; + + /** + * Creates a plain object from a Bolt11ReceiveViaJitChannelResponse message. Also converts values to other types if specified. + * @param message Bolt11ReceiveViaJitChannelResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11ReceiveViaJitChannelResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11ReceiveViaJitChannelResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11ReceiveViaJitChannelResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ReceiveVariableAmountViaJitChannelRequest. */ + interface IBolt11ReceiveVariableAmountViaJitChannelRequest { + /** Bolt11ReceiveVariableAmountViaJitChannelRequest description */ + description?: types.IBolt11InvoiceDescription | null; + + /** Bolt11ReceiveVariableAmountViaJitChannelRequest expiry_secs */ + expiry_secs?: number | null; + + /** Bolt11ReceiveVariableAmountViaJitChannelRequest max_proportional_lsp_fee_limit_ppm_msat */ + max_proportional_lsp_fee_limit_ppm_msat?: Long | null; + } + + /** Represents a Bolt11ReceiveVariableAmountViaJitChannelRequest. */ + class Bolt11ReceiveVariableAmountViaJitChannelRequest + implements IBolt11ReceiveVariableAmountViaJitChannelRequest + { + /** + * Constructs a new Bolt11ReceiveVariableAmountViaJitChannelRequest. + * @param [properties] Properties to set + */ + constructor( + properties?: api.IBolt11ReceiveVariableAmountViaJitChannelRequest + ); + + /** Bolt11ReceiveVariableAmountViaJitChannelRequest description. */ + public description?: types.IBolt11InvoiceDescription | null; + + /** Bolt11ReceiveVariableAmountViaJitChannelRequest expiry_secs. */ + public expiry_secs: number; + + /** Bolt11ReceiveVariableAmountViaJitChannelRequest max_proportional_lsp_fee_limit_ppm_msat. */ + public max_proportional_lsp_fee_limit_ppm_msat?: Long | null; + + /** + * Creates a new Bolt11ReceiveVariableAmountViaJitChannelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11ReceiveVariableAmountViaJitChannelRequest instance + */ + public static create( + properties?: api.IBolt11ReceiveVariableAmountViaJitChannelRequest + ): api.Bolt11ReceiveVariableAmountViaJitChannelRequest; + + /** + * Encodes the specified Bolt11ReceiveVariableAmountViaJitChannelRequest message. Does not implicitly {@link api.Bolt11ReceiveVariableAmountViaJitChannelRequest.verify|verify} messages. + * @param message Bolt11ReceiveVariableAmountViaJitChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11ReceiveVariableAmountViaJitChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11ReceiveVariableAmountViaJitChannelRequest message, length delimited. Does not implicitly {@link api.Bolt11ReceiveVariableAmountViaJitChannelRequest.verify|verify} messages. + * @param message Bolt11ReceiveVariableAmountViaJitChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11ReceiveVariableAmountViaJitChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11ReceiveVariableAmountViaJitChannelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11ReceiveVariableAmountViaJitChannelRequest + * @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 + ): api.Bolt11ReceiveVariableAmountViaJitChannelRequest; + + /** + * Decodes a Bolt11ReceiveVariableAmountViaJitChannelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11ReceiveVariableAmountViaJitChannelRequest + * @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 + ): api.Bolt11ReceiveVariableAmountViaJitChannelRequest; + + /** + * Verifies a Bolt11ReceiveVariableAmountViaJitChannelRequest 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 Bolt11ReceiveVariableAmountViaJitChannelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11ReceiveVariableAmountViaJitChannelRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11ReceiveVariableAmountViaJitChannelRequest; + + /** + * Creates a plain object from a Bolt11ReceiveVariableAmountViaJitChannelRequest message. Also converts values to other types if specified. + * @param message Bolt11ReceiveVariableAmountViaJitChannelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11ReceiveVariableAmountViaJitChannelRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11ReceiveVariableAmountViaJitChannelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11ReceiveVariableAmountViaJitChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ReceiveVariableAmountViaJitChannelResponse. */ + interface IBolt11ReceiveVariableAmountViaJitChannelResponse { + /** Bolt11ReceiveVariableAmountViaJitChannelResponse invoice */ + invoice?: string | null; + } + + /** Represents a Bolt11ReceiveVariableAmountViaJitChannelResponse. */ + class Bolt11ReceiveVariableAmountViaJitChannelResponse + implements IBolt11ReceiveVariableAmountViaJitChannelResponse + { + /** + * Constructs a new Bolt11ReceiveVariableAmountViaJitChannelResponse. + * @param [properties] Properties to set + */ + constructor( + properties?: api.IBolt11ReceiveVariableAmountViaJitChannelResponse + ); + + /** Bolt11ReceiveVariableAmountViaJitChannelResponse invoice. */ + public invoice: string; + + /** + * Creates a new Bolt11ReceiveVariableAmountViaJitChannelResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11ReceiveVariableAmountViaJitChannelResponse instance + */ + public static create( + properties?: api.IBolt11ReceiveVariableAmountViaJitChannelResponse + ): api.Bolt11ReceiveVariableAmountViaJitChannelResponse; + + /** + * Encodes the specified Bolt11ReceiveVariableAmountViaJitChannelResponse message. Does not implicitly {@link api.Bolt11ReceiveVariableAmountViaJitChannelResponse.verify|verify} messages. + * @param message Bolt11ReceiveVariableAmountViaJitChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11ReceiveVariableAmountViaJitChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11ReceiveVariableAmountViaJitChannelResponse message, length delimited. Does not implicitly {@link api.Bolt11ReceiveVariableAmountViaJitChannelResponse.verify|verify} messages. + * @param message Bolt11ReceiveVariableAmountViaJitChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11ReceiveVariableAmountViaJitChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11ReceiveVariableAmountViaJitChannelResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11ReceiveVariableAmountViaJitChannelResponse + * @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 + ): api.Bolt11ReceiveVariableAmountViaJitChannelResponse; + + /** + * Decodes a Bolt11ReceiveVariableAmountViaJitChannelResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11ReceiveVariableAmountViaJitChannelResponse + * @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 + ): api.Bolt11ReceiveVariableAmountViaJitChannelResponse; + + /** + * Verifies a Bolt11ReceiveVariableAmountViaJitChannelResponse 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 Bolt11ReceiveVariableAmountViaJitChannelResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11ReceiveVariableAmountViaJitChannelResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11ReceiveVariableAmountViaJitChannelResponse; + + /** + * Creates a plain object from a Bolt11ReceiveVariableAmountViaJitChannelResponse message. Also converts values to other types if specified. + * @param message Bolt11ReceiveVariableAmountViaJitChannelResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11ReceiveVariableAmountViaJitChannelResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11ReceiveVariableAmountViaJitChannelResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11ReceiveVariableAmountViaJitChannelResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11SendRequest. */ + interface IBolt11SendRequest { + /** Bolt11SendRequest invoice */ + invoice?: string | null; + + /** Bolt11SendRequest amount_msat */ + amount_msat?: Long | null; + + /** Bolt11SendRequest route_parameters */ + route_parameters?: types.IRouteParametersConfig | null; + } + + /** Represents a Bolt11SendRequest. */ + class Bolt11SendRequest implements IBolt11SendRequest { + /** + * Constructs a new Bolt11SendRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11SendRequest); + + /** Bolt11SendRequest invoice. */ + public invoice: string; + + /** Bolt11SendRequest amount_msat. */ + public amount_msat?: Long | null; + + /** Bolt11SendRequest route_parameters. */ + public route_parameters?: types.IRouteParametersConfig | null; + + /** + * Creates a new Bolt11SendRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11SendRequest instance + */ + public static create( + properties?: api.IBolt11SendRequest + ): api.Bolt11SendRequest; + + /** + * Encodes the specified Bolt11SendRequest message. Does not implicitly {@link api.Bolt11SendRequest.verify|verify} messages. + * @param message Bolt11SendRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11SendRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11SendRequest message, length delimited. Does not implicitly {@link api.Bolt11SendRequest.verify|verify} messages. + * @param message Bolt11SendRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11SendRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11SendRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11SendRequest + * @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 + ): api.Bolt11SendRequest; + + /** + * Decodes a Bolt11SendRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11SendRequest + * @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 + ): api.Bolt11SendRequest; + + /** + * Verifies a Bolt11SendRequest 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 Bolt11SendRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11SendRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11SendRequest; + + /** + * Creates a plain object from a Bolt11SendRequest message. Also converts values to other types if specified. + * @param message Bolt11SendRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11SendRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11SendRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11SendRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11SendResponse. */ + interface IBolt11SendResponse { + /** Bolt11SendResponse payment_id */ + payment_id?: string | null; + } + + /** Represents a Bolt11SendResponse. */ + class Bolt11SendResponse implements IBolt11SendResponse { + /** + * Constructs a new Bolt11SendResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11SendResponse); + + /** Bolt11SendResponse payment_id. */ + public payment_id: string; + + /** + * Creates a new Bolt11SendResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11SendResponse instance + */ + public static create( + properties?: api.IBolt11SendResponse + ): api.Bolt11SendResponse; + + /** + * Encodes the specified Bolt11SendResponse message. Does not implicitly {@link api.Bolt11SendResponse.verify|verify} messages. + * @param message Bolt11SendResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11SendResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11SendResponse message, length delimited. Does not implicitly {@link api.Bolt11SendResponse.verify|verify} messages. + * @param message Bolt11SendResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11SendResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11SendResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11SendResponse + * @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 + ): api.Bolt11SendResponse; + + /** + * Decodes a Bolt11SendResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11SendResponse + * @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 + ): api.Bolt11SendResponse; + + /** + * Verifies a Bolt11SendResponse 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 Bolt11SendResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11SendResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11SendResponse; + + /** + * Creates a plain object from a Bolt11SendResponse message. Also converts values to other types if specified. + * @param message Bolt11SendResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11SendResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11SendResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11SendResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt12ReceiveRequest. */ + interface IBolt12ReceiveRequest { + /** Bolt12ReceiveRequest description */ + description?: string | null; + + /** Bolt12ReceiveRequest amount_msat */ + amount_msat?: Long | null; + + /** Bolt12ReceiveRequest expiry_secs */ + expiry_secs?: number | null; + + /** Bolt12ReceiveRequest quantity */ + quantity?: Long | null; + } + + /** Represents a Bolt12ReceiveRequest. */ + class Bolt12ReceiveRequest implements IBolt12ReceiveRequest { + /** + * Constructs a new Bolt12ReceiveRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt12ReceiveRequest); + + /** Bolt12ReceiveRequest description. */ + public description: string; + + /** Bolt12ReceiveRequest amount_msat. */ + public amount_msat?: Long | null; + + /** Bolt12ReceiveRequest expiry_secs. */ + public expiry_secs?: number | null; + + /** Bolt12ReceiveRequest quantity. */ + public quantity?: Long | null; + + /** + * Creates a new Bolt12ReceiveRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt12ReceiveRequest instance + */ + public static create( + properties?: api.IBolt12ReceiveRequest + ): api.Bolt12ReceiveRequest; + + /** + * Encodes the specified Bolt12ReceiveRequest message. Does not implicitly {@link api.Bolt12ReceiveRequest.verify|verify} messages. + * @param message Bolt12ReceiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt12ReceiveRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt12ReceiveRequest message, length delimited. Does not implicitly {@link api.Bolt12ReceiveRequest.verify|verify} messages. + * @param message Bolt12ReceiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt12ReceiveRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt12ReceiveRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt12ReceiveRequest + * @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 + ): api.Bolt12ReceiveRequest; + + /** + * Decodes a Bolt12ReceiveRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt12ReceiveRequest + * @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 + ): api.Bolt12ReceiveRequest; + + /** + * Verifies a Bolt12ReceiveRequest 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 Bolt12ReceiveRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt12ReceiveRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt12ReceiveRequest; + + /** + * Creates a plain object from a Bolt12ReceiveRequest message. Also converts values to other types if specified. + * @param message Bolt12ReceiveRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt12ReceiveRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt12ReceiveRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt12ReceiveRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt12ReceiveResponse. */ + interface IBolt12ReceiveResponse { + /** Bolt12ReceiveResponse offer */ + offer?: string | null; + + /** Bolt12ReceiveResponse offer_id */ + offer_id?: string | null; + } + + /** Represents a Bolt12ReceiveResponse. */ + class Bolt12ReceiveResponse implements IBolt12ReceiveResponse { + /** + * Constructs a new Bolt12ReceiveResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt12ReceiveResponse); + + /** Bolt12ReceiveResponse offer. */ + public offer: string; + + /** Bolt12ReceiveResponse offer_id. */ + public offer_id: string; + + /** + * Creates a new Bolt12ReceiveResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt12ReceiveResponse instance + */ + public static create( + properties?: api.IBolt12ReceiveResponse + ): api.Bolt12ReceiveResponse; + + /** + * Encodes the specified Bolt12ReceiveResponse message. Does not implicitly {@link api.Bolt12ReceiveResponse.verify|verify} messages. + * @param message Bolt12ReceiveResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt12ReceiveResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt12ReceiveResponse message, length delimited. Does not implicitly {@link api.Bolt12ReceiveResponse.verify|verify} messages. + * @param message Bolt12ReceiveResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt12ReceiveResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt12ReceiveResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt12ReceiveResponse + * @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 + ): api.Bolt12ReceiveResponse; + + /** + * Decodes a Bolt12ReceiveResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt12ReceiveResponse + * @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 + ): api.Bolt12ReceiveResponse; + + /** + * Verifies a Bolt12ReceiveResponse 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 Bolt12ReceiveResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt12ReceiveResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt12ReceiveResponse; + + /** + * Creates a plain object from a Bolt12ReceiveResponse message. Also converts values to other types if specified. + * @param message Bolt12ReceiveResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt12ReceiveResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt12ReceiveResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt12ReceiveResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt12SendRequest. */ + interface IBolt12SendRequest { + /** Bolt12SendRequest offer */ + offer?: string | null; + + /** Bolt12SendRequest amount_msat */ + amount_msat?: Long | null; + + /** Bolt12SendRequest quantity */ + quantity?: Long | null; + + /** Bolt12SendRequest payer_note */ + payer_note?: string | null; + + /** Bolt12SendRequest route_parameters */ + route_parameters?: types.IRouteParametersConfig | null; + } + + /** Represents a Bolt12SendRequest. */ + class Bolt12SendRequest implements IBolt12SendRequest { + /** + * Constructs a new Bolt12SendRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt12SendRequest); + + /** Bolt12SendRequest offer. */ + public offer: string; + + /** Bolt12SendRequest amount_msat. */ + public amount_msat?: Long | null; + + /** Bolt12SendRequest quantity. */ + public quantity?: Long | null; + + /** Bolt12SendRequest payer_note. */ + public payer_note?: string | null; + + /** Bolt12SendRequest route_parameters. */ + public route_parameters?: types.IRouteParametersConfig | null; + + /** + * Creates a new Bolt12SendRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt12SendRequest instance + */ + public static create( + properties?: api.IBolt12SendRequest + ): api.Bolt12SendRequest; + + /** + * Encodes the specified Bolt12SendRequest message. Does not implicitly {@link api.Bolt12SendRequest.verify|verify} messages. + * @param message Bolt12SendRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt12SendRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt12SendRequest message, length delimited. Does not implicitly {@link api.Bolt12SendRequest.verify|verify} messages. + * @param message Bolt12SendRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt12SendRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt12SendRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt12SendRequest + * @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 + ): api.Bolt12SendRequest; + + /** + * Decodes a Bolt12SendRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt12SendRequest + * @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 + ): api.Bolt12SendRequest; + + /** + * Verifies a Bolt12SendRequest 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 Bolt12SendRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt12SendRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt12SendRequest; + + /** + * Creates a plain object from a Bolt12SendRequest message. Also converts values to other types if specified. + * @param message Bolt12SendRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt12SendRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt12SendRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt12SendRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt12SendResponse. */ + interface IBolt12SendResponse { + /** Bolt12SendResponse payment_id */ + payment_id?: string | null; + } + + /** Represents a Bolt12SendResponse. */ + class Bolt12SendResponse implements IBolt12SendResponse { + /** + * Constructs a new Bolt12SendResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt12SendResponse); + + /** Bolt12SendResponse payment_id. */ + public payment_id: string; + + /** + * Creates a new Bolt12SendResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt12SendResponse instance + */ + public static create( + properties?: api.IBolt12SendResponse + ): api.Bolt12SendResponse; + + /** + * Encodes the specified Bolt12SendResponse message. Does not implicitly {@link api.Bolt12SendResponse.verify|verify} messages. + * @param message Bolt12SendResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt12SendResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt12SendResponse message, length delimited. Does not implicitly {@link api.Bolt12SendResponse.verify|verify} messages. + * @param message Bolt12SendResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt12SendResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt12SendResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt12SendResponse + * @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 + ): api.Bolt12SendResponse; + + /** + * Decodes a Bolt12SendResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt12SendResponse + * @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 + ): api.Bolt12SendResponse; + + /** + * Verifies a Bolt12SendResponse 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 Bolt12SendResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt12SendResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt12SendResponse; + + /** + * Creates a plain object from a Bolt12SendResponse message. Also converts values to other types if specified. + * @param message Bolt12SendResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt12SendResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt12SendResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt12SendResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpontaneousSendRequest. */ + interface ISpontaneousSendRequest { + /** SpontaneousSendRequest amount_msat */ + amount_msat?: Long | null; + + /** SpontaneousSendRequest node_id */ + node_id?: string | null; + + /** SpontaneousSendRequest route_parameters */ + route_parameters?: types.IRouteParametersConfig | null; + } + + /** Represents a SpontaneousSendRequest. */ + class SpontaneousSendRequest implements ISpontaneousSendRequest { + /** + * Constructs a new SpontaneousSendRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.ISpontaneousSendRequest); + + /** SpontaneousSendRequest amount_msat. */ + public amount_msat: Long; + + /** SpontaneousSendRequest node_id. */ + public node_id: string; + + /** SpontaneousSendRequest route_parameters. */ + public route_parameters?: types.IRouteParametersConfig | null; + + /** + * Creates a new SpontaneousSendRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SpontaneousSendRequest instance + */ + public static create( + properties?: api.ISpontaneousSendRequest + ): api.SpontaneousSendRequest; + + /** + * Encodes the specified SpontaneousSendRequest message. Does not implicitly {@link api.SpontaneousSendRequest.verify|verify} messages. + * @param message SpontaneousSendRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.ISpontaneousSendRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified SpontaneousSendRequest message, length delimited. Does not implicitly {@link api.SpontaneousSendRequest.verify|verify} messages. + * @param message SpontaneousSendRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.ISpontaneousSendRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a SpontaneousSendRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpontaneousSendRequest + * @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 + ): api.SpontaneousSendRequest; + + /** + * Decodes a SpontaneousSendRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpontaneousSendRequest + * @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 + ): api.SpontaneousSendRequest; + + /** + * Verifies a SpontaneousSendRequest 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 SpontaneousSendRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpontaneousSendRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.SpontaneousSendRequest; + + /** + * Creates a plain object from a SpontaneousSendRequest message. Also converts values to other types if specified. + * @param message SpontaneousSendRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.SpontaneousSendRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this SpontaneousSendRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpontaneousSendRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpontaneousSendResponse. */ + interface ISpontaneousSendResponse { + /** SpontaneousSendResponse payment_id */ + payment_id?: string | null; + } + + /** Represents a SpontaneousSendResponse. */ + class SpontaneousSendResponse implements ISpontaneousSendResponse { + /** + * Constructs a new SpontaneousSendResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.ISpontaneousSendResponse); + + /** SpontaneousSendResponse payment_id. */ + public payment_id: string; + + /** + * Creates a new SpontaneousSendResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SpontaneousSendResponse instance + */ + public static create( + properties?: api.ISpontaneousSendResponse + ): api.SpontaneousSendResponse; + + /** + * Encodes the specified SpontaneousSendResponse message. Does not implicitly {@link api.SpontaneousSendResponse.verify|verify} messages. + * @param message SpontaneousSendResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.ISpontaneousSendResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified SpontaneousSendResponse message, length delimited. Does not implicitly {@link api.SpontaneousSendResponse.verify|verify} messages. + * @param message SpontaneousSendResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.ISpontaneousSendResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a SpontaneousSendResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpontaneousSendResponse + * @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 + ): api.SpontaneousSendResponse; + + /** + * Decodes a SpontaneousSendResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpontaneousSendResponse + * @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 + ): api.SpontaneousSendResponse; + + /** + * Verifies a SpontaneousSendResponse 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 SpontaneousSendResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpontaneousSendResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.SpontaneousSendResponse; + + /** + * Creates a plain object from a SpontaneousSendResponse message. Also converts values to other types if specified. + * @param message SpontaneousSendResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.SpontaneousSendResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this SpontaneousSendResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpontaneousSendResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OpenChannelRequest. */ + interface IOpenChannelRequest { + /** OpenChannelRequest node_pubkey */ + node_pubkey?: string | null; + + /** OpenChannelRequest address */ + address?: string | null; + + /** OpenChannelRequest channel_amount_sats */ + channel_amount_sats?: Long | null; + + /** OpenChannelRequest push_to_counterparty_msat */ + push_to_counterparty_msat?: Long | null; + + /** OpenChannelRequest channel_config */ + channel_config?: types.IChannelConfig | null; + + /** OpenChannelRequest announce_channel */ + announce_channel?: boolean | null; + + /** OpenChannelRequest disable_counterparty_reserve */ + disable_counterparty_reserve?: boolean | null; + } + + /** Represents an OpenChannelRequest. */ + class OpenChannelRequest implements IOpenChannelRequest { + /** + * Constructs a new OpenChannelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IOpenChannelRequest); + + /** OpenChannelRequest node_pubkey. */ + public node_pubkey: string; + + /** OpenChannelRequest address. */ + public address: string; + + /** OpenChannelRequest channel_amount_sats. */ + public channel_amount_sats: Long; + + /** OpenChannelRequest push_to_counterparty_msat. */ + public push_to_counterparty_msat?: Long | null; + + /** OpenChannelRequest channel_config. */ + public channel_config?: types.IChannelConfig | null; + + /** OpenChannelRequest announce_channel. */ + public announce_channel: boolean; + + /** OpenChannelRequest disable_counterparty_reserve. */ + public disable_counterparty_reserve: boolean; + + /** + * Creates a new OpenChannelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenChannelRequest instance + */ + public static create( + properties?: api.IOpenChannelRequest + ): api.OpenChannelRequest; + + /** + * Encodes the specified OpenChannelRequest message. Does not implicitly {@link api.OpenChannelRequest.verify|verify} messages. + * @param message OpenChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IOpenChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified OpenChannelRequest message, length delimited. Does not implicitly {@link api.OpenChannelRequest.verify|verify} messages. + * @param message OpenChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IOpenChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an OpenChannelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenChannelRequest + * @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 + ): api.OpenChannelRequest; + + /** + * Decodes an OpenChannelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenChannelRequest + * @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 + ): api.OpenChannelRequest; + + /** + * Verifies an OpenChannelRequest 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 OpenChannelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenChannelRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.OpenChannelRequest; + + /** + * Creates a plain object from an OpenChannelRequest message. Also converts values to other types if specified. + * @param message OpenChannelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.OpenChannelRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this OpenChannelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OpenChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OpenChannelResponse. */ + interface IOpenChannelResponse { + /** OpenChannelResponse user_channel_id */ + user_channel_id?: string | null; + } + + /** Represents an OpenChannelResponse. */ + class OpenChannelResponse implements IOpenChannelResponse { + /** + * Constructs a new OpenChannelResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IOpenChannelResponse); + + /** OpenChannelResponse user_channel_id. */ + public user_channel_id: string; + + /** + * Creates a new OpenChannelResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenChannelResponse instance + */ + public static create( + properties?: api.IOpenChannelResponse + ): api.OpenChannelResponse; + + /** + * Encodes the specified OpenChannelResponse message. Does not implicitly {@link api.OpenChannelResponse.verify|verify} messages. + * @param message OpenChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IOpenChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified OpenChannelResponse message, length delimited. Does not implicitly {@link api.OpenChannelResponse.verify|verify} messages. + * @param message OpenChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IOpenChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an OpenChannelResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenChannelResponse + * @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 + ): api.OpenChannelResponse; + + /** + * Decodes an OpenChannelResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenChannelResponse + * @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 + ): api.OpenChannelResponse; + + /** + * Verifies an OpenChannelResponse 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 OpenChannelResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenChannelResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.OpenChannelResponse; + + /** + * Creates a plain object from an OpenChannelResponse message. Also converts values to other types if specified. + * @param message OpenChannelResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.OpenChannelResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this OpenChannelResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OpenChannelResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpliceInRequest. */ + interface ISpliceInRequest { + /** SpliceInRequest user_channel_id */ + user_channel_id?: string | null; + + /** SpliceInRequest counterparty_node_id */ + counterparty_node_id?: string | null; + + /** SpliceInRequest splice_amount_sats */ + splice_amount_sats?: Long | null; + } + + /** Represents a SpliceInRequest. */ + class SpliceInRequest implements ISpliceInRequest { + /** + * Constructs a new SpliceInRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.ISpliceInRequest); + + /** SpliceInRequest user_channel_id. */ + public user_channel_id: string; + + /** SpliceInRequest counterparty_node_id. */ + public counterparty_node_id: string; + + /** SpliceInRequest splice_amount_sats. */ + public splice_amount_sats: Long; + + /** + * Creates a new SpliceInRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SpliceInRequest instance + */ + public static create( + properties?: api.ISpliceInRequest + ): api.SpliceInRequest; + + /** + * Encodes the specified SpliceInRequest message. Does not implicitly {@link api.SpliceInRequest.verify|verify} messages. + * @param message SpliceInRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.ISpliceInRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified SpliceInRequest message, length delimited. Does not implicitly {@link api.SpliceInRequest.verify|verify} messages. + * @param message SpliceInRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.ISpliceInRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a SpliceInRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpliceInRequest + * @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 + ): api.SpliceInRequest; + + /** + * Decodes a SpliceInRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpliceInRequest + * @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 + ): api.SpliceInRequest; + + /** + * Verifies a SpliceInRequest 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 SpliceInRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpliceInRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.SpliceInRequest; + + /** + * Creates a plain object from a SpliceInRequest message. Also converts values to other types if specified. + * @param message SpliceInRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.SpliceInRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this SpliceInRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpliceInRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpliceInResponse. */ + interface ISpliceInResponse {} + + /** Represents a SpliceInResponse. */ + class SpliceInResponse implements ISpliceInResponse { + /** + * Constructs a new SpliceInResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.ISpliceInResponse); + + /** + * Creates a new SpliceInResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SpliceInResponse instance + */ + public static create( + properties?: api.ISpliceInResponse + ): api.SpliceInResponse; + + /** + * Encodes the specified SpliceInResponse message. Does not implicitly {@link api.SpliceInResponse.verify|verify} messages. + * @param message SpliceInResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.ISpliceInResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified SpliceInResponse message, length delimited. Does not implicitly {@link api.SpliceInResponse.verify|verify} messages. + * @param message SpliceInResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.ISpliceInResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a SpliceInResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpliceInResponse + * @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 + ): api.SpliceInResponse; + + /** + * Decodes a SpliceInResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpliceInResponse + * @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 + ): api.SpliceInResponse; + + /** + * Verifies a SpliceInResponse 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 SpliceInResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpliceInResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.SpliceInResponse; + + /** + * Creates a plain object from a SpliceInResponse message. Also converts values to other types if specified. + * @param message SpliceInResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.SpliceInResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this SpliceInResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpliceInResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpliceOutRequest. */ + interface ISpliceOutRequest { + /** SpliceOutRequest user_channel_id */ + user_channel_id?: string | null; + + /** SpliceOutRequest counterparty_node_id */ + counterparty_node_id?: string | null; + + /** SpliceOutRequest address */ + address?: string | null; + + /** SpliceOutRequest splice_amount_sats */ + splice_amount_sats?: Long | null; + } + + /** Represents a SpliceOutRequest. */ + class SpliceOutRequest implements ISpliceOutRequest { + /** + * Constructs a new SpliceOutRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.ISpliceOutRequest); + + /** SpliceOutRequest user_channel_id. */ + public user_channel_id: string; + + /** SpliceOutRequest counterparty_node_id. */ + public counterparty_node_id: string; + + /** SpliceOutRequest address. */ + public address?: string | null; + + /** SpliceOutRequest splice_amount_sats. */ + public splice_amount_sats: Long; + + /** + * Creates a new SpliceOutRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SpliceOutRequest instance + */ + public static create( + properties?: api.ISpliceOutRequest + ): api.SpliceOutRequest; + + /** + * Encodes the specified SpliceOutRequest message. Does not implicitly {@link api.SpliceOutRequest.verify|verify} messages. + * @param message SpliceOutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.ISpliceOutRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified SpliceOutRequest message, length delimited. Does not implicitly {@link api.SpliceOutRequest.verify|verify} messages. + * @param message SpliceOutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.ISpliceOutRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a SpliceOutRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpliceOutRequest + * @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 + ): api.SpliceOutRequest; + + /** + * Decodes a SpliceOutRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpliceOutRequest + * @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 + ): api.SpliceOutRequest; + + /** + * Verifies a SpliceOutRequest 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 SpliceOutRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpliceOutRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.SpliceOutRequest; + + /** + * Creates a plain object from a SpliceOutRequest message. Also converts values to other types if specified. + * @param message SpliceOutRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.SpliceOutRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this SpliceOutRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpliceOutRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpliceOutResponse. */ + interface ISpliceOutResponse { + /** SpliceOutResponse address */ + address?: string | null; + } + + /** Represents a SpliceOutResponse. */ + class SpliceOutResponse implements ISpliceOutResponse { + /** + * Constructs a new SpliceOutResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.ISpliceOutResponse); + + /** SpliceOutResponse address. */ + public address: string; + + /** + * Creates a new SpliceOutResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SpliceOutResponse instance + */ + public static create( + properties?: api.ISpliceOutResponse + ): api.SpliceOutResponse; + + /** + * Encodes the specified SpliceOutResponse message. Does not implicitly {@link api.SpliceOutResponse.verify|verify} messages. + * @param message SpliceOutResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.ISpliceOutResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified SpliceOutResponse message, length delimited. Does not implicitly {@link api.SpliceOutResponse.verify|verify} messages. + * @param message SpliceOutResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.ISpliceOutResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a SpliceOutResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpliceOutResponse + * @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 + ): api.SpliceOutResponse; + + /** + * Decodes a SpliceOutResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpliceOutResponse + * @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 + ): api.SpliceOutResponse; + + /** + * Verifies a SpliceOutResponse 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 SpliceOutResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpliceOutResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.SpliceOutResponse; + + /** + * Creates a plain object from a SpliceOutResponse message. Also converts values to other types if specified. + * @param message SpliceOutResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.SpliceOutResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this SpliceOutResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpliceOutResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateChannelConfigRequest. */ + interface IUpdateChannelConfigRequest { + /** UpdateChannelConfigRequest user_channel_id */ + user_channel_id?: string | null; + + /** UpdateChannelConfigRequest counterparty_node_id */ + counterparty_node_id?: string | null; + + /** UpdateChannelConfigRequest channel_config */ + channel_config?: types.IChannelConfig | null; + } + + /** Represents an UpdateChannelConfigRequest. */ + class UpdateChannelConfigRequest implements IUpdateChannelConfigRequest { + /** + * Constructs a new UpdateChannelConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IUpdateChannelConfigRequest); + + /** UpdateChannelConfigRequest user_channel_id. */ + public user_channel_id: string; + + /** UpdateChannelConfigRequest counterparty_node_id. */ + public counterparty_node_id: string; + + /** UpdateChannelConfigRequest channel_config. */ + public channel_config?: types.IChannelConfig | null; + + /** + * Creates a new UpdateChannelConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateChannelConfigRequest instance + */ + public static create( + properties?: api.IUpdateChannelConfigRequest + ): api.UpdateChannelConfigRequest; + + /** + * Encodes the specified UpdateChannelConfigRequest message. Does not implicitly {@link api.UpdateChannelConfigRequest.verify|verify} messages. + * @param message UpdateChannelConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IUpdateChannelConfigRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified UpdateChannelConfigRequest message, length delimited. Does not implicitly {@link api.UpdateChannelConfigRequest.verify|verify} messages. + * @param message UpdateChannelConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IUpdateChannelConfigRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an UpdateChannelConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateChannelConfigRequest + * @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 + ): api.UpdateChannelConfigRequest; + + /** + * Decodes an UpdateChannelConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateChannelConfigRequest + * @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 + ): api.UpdateChannelConfigRequest; + + /** + * Verifies an UpdateChannelConfigRequest 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 UpdateChannelConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateChannelConfigRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.UpdateChannelConfigRequest; + + /** + * Creates a plain object from an UpdateChannelConfigRequest message. Also converts values to other types if specified. + * @param message UpdateChannelConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.UpdateChannelConfigRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this UpdateChannelConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateChannelConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateChannelConfigResponse. */ + interface IUpdateChannelConfigResponse {} + + /** Represents an UpdateChannelConfigResponse. */ + class UpdateChannelConfigResponse implements IUpdateChannelConfigResponse { + /** + * Constructs a new UpdateChannelConfigResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IUpdateChannelConfigResponse); + + /** + * Creates a new UpdateChannelConfigResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateChannelConfigResponse instance + */ + public static create( + properties?: api.IUpdateChannelConfigResponse + ): api.UpdateChannelConfigResponse; + + /** + * Encodes the specified UpdateChannelConfigResponse message. Does not implicitly {@link api.UpdateChannelConfigResponse.verify|verify} messages. + * @param message UpdateChannelConfigResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IUpdateChannelConfigResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified UpdateChannelConfigResponse message, length delimited. Does not implicitly {@link api.UpdateChannelConfigResponse.verify|verify} messages. + * @param message UpdateChannelConfigResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IUpdateChannelConfigResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an UpdateChannelConfigResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateChannelConfigResponse + * @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 + ): api.UpdateChannelConfigResponse; + + /** + * Decodes an UpdateChannelConfigResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateChannelConfigResponse + * @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 + ): api.UpdateChannelConfigResponse; + + /** + * Verifies an UpdateChannelConfigResponse 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 UpdateChannelConfigResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateChannelConfigResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.UpdateChannelConfigResponse; + + /** + * Creates a plain object from an UpdateChannelConfigResponse message. Also converts values to other types if specified. + * @param message UpdateChannelConfigResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.UpdateChannelConfigResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this UpdateChannelConfigResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateChannelConfigResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloseChannelRequest. */ + interface ICloseChannelRequest { + /** CloseChannelRequest user_channel_id */ + user_channel_id?: string | null; + + /** CloseChannelRequest counterparty_node_id */ + counterparty_node_id?: string | null; + } + + /** Represents a CloseChannelRequest. */ + class CloseChannelRequest implements ICloseChannelRequest { + /** + * Constructs a new CloseChannelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.ICloseChannelRequest); + + /** CloseChannelRequest user_channel_id. */ + public user_channel_id: string; + + /** CloseChannelRequest counterparty_node_id. */ + public counterparty_node_id: string; + + /** + * Creates a new CloseChannelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CloseChannelRequest instance + */ + public static create( + properties?: api.ICloseChannelRequest + ): api.CloseChannelRequest; + + /** + * Encodes the specified CloseChannelRequest message. Does not implicitly {@link api.CloseChannelRequest.verify|verify} messages. + * @param message CloseChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.ICloseChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified CloseChannelRequest message, length delimited. Does not implicitly {@link api.CloseChannelRequest.verify|verify} messages. + * @param message CloseChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.ICloseChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a CloseChannelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloseChannelRequest + * @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 + ): api.CloseChannelRequest; + + /** + * Decodes a CloseChannelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloseChannelRequest + * @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 + ): api.CloseChannelRequest; + + /** + * Verifies a CloseChannelRequest 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 CloseChannelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloseChannelRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.CloseChannelRequest; + + /** + * Creates a plain object from a CloseChannelRequest message. Also converts values to other types if specified. + * @param message CloseChannelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.CloseChannelRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this CloseChannelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloseChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloseChannelResponse. */ + interface ICloseChannelResponse {} + + /** Represents a CloseChannelResponse. */ + class CloseChannelResponse implements ICloseChannelResponse { + /** + * Constructs a new CloseChannelResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.ICloseChannelResponse); + + /** + * Creates a new CloseChannelResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CloseChannelResponse instance + */ + public static create( + properties?: api.ICloseChannelResponse + ): api.CloseChannelResponse; + + /** + * Encodes the specified CloseChannelResponse message. Does not implicitly {@link api.CloseChannelResponse.verify|verify} messages. + * @param message CloseChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.ICloseChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified CloseChannelResponse message, length delimited. Does not implicitly {@link api.CloseChannelResponse.verify|verify} messages. + * @param message CloseChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.ICloseChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a CloseChannelResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloseChannelResponse + * @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 + ): api.CloseChannelResponse; + + /** + * Decodes a CloseChannelResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloseChannelResponse + * @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 + ): api.CloseChannelResponse; + + /** + * Verifies a CloseChannelResponse 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 CloseChannelResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloseChannelResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.CloseChannelResponse; + + /** + * Creates a plain object from a CloseChannelResponse message. Also converts values to other types if specified. + * @param message CloseChannelResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.CloseChannelResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this CloseChannelResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloseChannelResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ForceCloseChannelRequest. */ + interface IForceCloseChannelRequest { + /** ForceCloseChannelRequest user_channel_id */ + user_channel_id?: string | null; + + /** ForceCloseChannelRequest counterparty_node_id */ + counterparty_node_id?: string | null; + + /** ForceCloseChannelRequest force_close_reason */ + force_close_reason?: string | null; + } + + /** Represents a ForceCloseChannelRequest. */ + class ForceCloseChannelRequest implements IForceCloseChannelRequest { + /** + * Constructs a new ForceCloseChannelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IForceCloseChannelRequest); + + /** ForceCloseChannelRequest user_channel_id. */ + public user_channel_id: string; + + /** ForceCloseChannelRequest counterparty_node_id. */ + public counterparty_node_id: string; + + /** ForceCloseChannelRequest force_close_reason. */ + public force_close_reason?: string | null; + + /** + * Creates a new ForceCloseChannelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ForceCloseChannelRequest instance + */ + public static create( + properties?: api.IForceCloseChannelRequest + ): api.ForceCloseChannelRequest; + + /** + * Encodes the specified ForceCloseChannelRequest message. Does not implicitly {@link api.ForceCloseChannelRequest.verify|verify} messages. + * @param message ForceCloseChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IForceCloseChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ForceCloseChannelRequest message, length delimited. Does not implicitly {@link api.ForceCloseChannelRequest.verify|verify} messages. + * @param message ForceCloseChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IForceCloseChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ForceCloseChannelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForceCloseChannelRequest + * @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 + ): api.ForceCloseChannelRequest; + + /** + * Decodes a ForceCloseChannelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForceCloseChannelRequest + * @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 + ): api.ForceCloseChannelRequest; + + /** + * Verifies a ForceCloseChannelRequest 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 ForceCloseChannelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForceCloseChannelRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.ForceCloseChannelRequest; + + /** + * Creates a plain object from a ForceCloseChannelRequest message. Also converts values to other types if specified. + * @param message ForceCloseChannelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ForceCloseChannelRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ForceCloseChannelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ForceCloseChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ForceCloseChannelResponse. */ + interface IForceCloseChannelResponse {} + + /** Represents a ForceCloseChannelResponse. */ + class ForceCloseChannelResponse implements IForceCloseChannelResponse { + /** + * Constructs a new ForceCloseChannelResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IForceCloseChannelResponse); + + /** + * Creates a new ForceCloseChannelResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ForceCloseChannelResponse instance + */ + public static create( + properties?: api.IForceCloseChannelResponse + ): api.ForceCloseChannelResponse; + + /** + * Encodes the specified ForceCloseChannelResponse message. Does not implicitly {@link api.ForceCloseChannelResponse.verify|verify} messages. + * @param message ForceCloseChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IForceCloseChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ForceCloseChannelResponse message, length delimited. Does not implicitly {@link api.ForceCloseChannelResponse.verify|verify} messages. + * @param message ForceCloseChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IForceCloseChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ForceCloseChannelResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForceCloseChannelResponse + * @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 + ): api.ForceCloseChannelResponse; + + /** + * Decodes a ForceCloseChannelResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForceCloseChannelResponse + * @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 + ): api.ForceCloseChannelResponse; + + /** + * Verifies a ForceCloseChannelResponse 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 ForceCloseChannelResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForceCloseChannelResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.ForceCloseChannelResponse; + + /** + * Creates a plain object from a ForceCloseChannelResponse message. Also converts values to other types if specified. + * @param message ForceCloseChannelResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ForceCloseChannelResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ForceCloseChannelResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ForceCloseChannelResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListChannelsRequest. */ + interface IListChannelsRequest {} + + /** Represents a ListChannelsRequest. */ + class ListChannelsRequest implements IListChannelsRequest { + /** + * Constructs a new ListChannelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IListChannelsRequest); + + /** + * Creates a new ListChannelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChannelsRequest instance + */ + public static create( + properties?: api.IListChannelsRequest + ): api.ListChannelsRequest; + + /** + * Encodes the specified ListChannelsRequest message. Does not implicitly {@link api.ListChannelsRequest.verify|verify} messages. + * @param message ListChannelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IListChannelsRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ListChannelsRequest message, length delimited. Does not implicitly {@link api.ListChannelsRequest.verify|verify} messages. + * @param message ListChannelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IListChannelsRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ListChannelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChannelsRequest + * @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 + ): api.ListChannelsRequest; + + /** + * Decodes a ListChannelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChannelsRequest + * @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 + ): api.ListChannelsRequest; + + /** + * Verifies a ListChannelsRequest 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 ListChannelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChannelsRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.ListChannelsRequest; + + /** + * Creates a plain object from a ListChannelsRequest message. Also converts values to other types if specified. + * @param message ListChannelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ListChannelsRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ListChannelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChannelsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListChannelsResponse. */ + interface IListChannelsResponse { + /** ListChannelsResponse channels */ + channels?: types.IChannel[] | null; + } + + /** Represents a ListChannelsResponse. */ + class ListChannelsResponse implements IListChannelsResponse { + /** + * Constructs a new ListChannelsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IListChannelsResponse); + + /** ListChannelsResponse channels. */ + public channels: types.IChannel[]; + + /** + * Creates a new ListChannelsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChannelsResponse instance + */ + public static create( + properties?: api.IListChannelsResponse + ): api.ListChannelsResponse; + + /** + * Encodes the specified ListChannelsResponse message. Does not implicitly {@link api.ListChannelsResponse.verify|verify} messages. + * @param message ListChannelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IListChannelsResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ListChannelsResponse message, length delimited. Does not implicitly {@link api.ListChannelsResponse.verify|verify} messages. + * @param message ListChannelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IListChannelsResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ListChannelsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChannelsResponse + * @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 + ): api.ListChannelsResponse; + + /** + * Decodes a ListChannelsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChannelsResponse + * @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 + ): api.ListChannelsResponse; + + /** + * Verifies a ListChannelsResponse 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 ListChannelsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChannelsResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.ListChannelsResponse; + + /** + * Creates a plain object from a ListChannelsResponse message. Also converts values to other types if specified. + * @param message ListChannelsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ListChannelsResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ListChannelsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChannelsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPaymentDetailsRequest. */ + interface IGetPaymentDetailsRequest { + /** GetPaymentDetailsRequest payment_id */ + payment_id?: string | null; + } + + /** Represents a GetPaymentDetailsRequest. */ + class GetPaymentDetailsRequest implements IGetPaymentDetailsRequest { + /** + * Constructs a new GetPaymentDetailsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGetPaymentDetailsRequest); + + /** GetPaymentDetailsRequest payment_id. */ + public payment_id: string; + + /** + * Creates a new GetPaymentDetailsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPaymentDetailsRequest instance + */ + public static create( + properties?: api.IGetPaymentDetailsRequest + ): api.GetPaymentDetailsRequest; + + /** + * Encodes the specified GetPaymentDetailsRequest message. Does not implicitly {@link api.GetPaymentDetailsRequest.verify|verify} messages. + * @param message GetPaymentDetailsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGetPaymentDetailsRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GetPaymentDetailsRequest message, length delimited. Does not implicitly {@link api.GetPaymentDetailsRequest.verify|verify} messages. + * @param message GetPaymentDetailsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGetPaymentDetailsRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GetPaymentDetailsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPaymentDetailsRequest + * @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 + ): api.GetPaymentDetailsRequest; + + /** + * Decodes a GetPaymentDetailsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPaymentDetailsRequest + * @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 + ): api.GetPaymentDetailsRequest; + + /** + * Verifies a GetPaymentDetailsRequest 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 GetPaymentDetailsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPaymentDetailsRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.GetPaymentDetailsRequest; + + /** + * Creates a plain object from a GetPaymentDetailsRequest message. Also converts values to other types if specified. + * @param message GetPaymentDetailsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GetPaymentDetailsRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GetPaymentDetailsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPaymentDetailsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPaymentDetailsResponse. */ + interface IGetPaymentDetailsResponse { + /** GetPaymentDetailsResponse payment */ + payment?: types.IPayment | null; + } + + /** Represents a GetPaymentDetailsResponse. */ + class GetPaymentDetailsResponse implements IGetPaymentDetailsResponse { + /** + * Constructs a new GetPaymentDetailsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGetPaymentDetailsResponse); + + /** GetPaymentDetailsResponse payment. */ + public payment?: types.IPayment | null; + + /** + * Creates a new GetPaymentDetailsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPaymentDetailsResponse instance + */ + public static create( + properties?: api.IGetPaymentDetailsResponse + ): api.GetPaymentDetailsResponse; + + /** + * Encodes the specified GetPaymentDetailsResponse message. Does not implicitly {@link api.GetPaymentDetailsResponse.verify|verify} messages. + * @param message GetPaymentDetailsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGetPaymentDetailsResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GetPaymentDetailsResponse message, length delimited. Does not implicitly {@link api.GetPaymentDetailsResponse.verify|verify} messages. + * @param message GetPaymentDetailsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGetPaymentDetailsResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GetPaymentDetailsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPaymentDetailsResponse + * @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 + ): api.GetPaymentDetailsResponse; + + /** + * Decodes a GetPaymentDetailsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPaymentDetailsResponse + * @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 + ): api.GetPaymentDetailsResponse; + + /** + * Verifies a GetPaymentDetailsResponse 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 GetPaymentDetailsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPaymentDetailsResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.GetPaymentDetailsResponse; + + /** + * Creates a plain object from a GetPaymentDetailsResponse message. Also converts values to other types if specified. + * @param message GetPaymentDetailsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GetPaymentDetailsResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GetPaymentDetailsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPaymentDetailsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPaymentsRequest. */ + interface IListPaymentsRequest { + /** ListPaymentsRequest page_token */ + page_token?: types.IPageToken | null; + } + + /** Represents a ListPaymentsRequest. */ + class ListPaymentsRequest implements IListPaymentsRequest { + /** + * Constructs a new ListPaymentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IListPaymentsRequest); + + /** ListPaymentsRequest page_token. */ + public page_token?: types.IPageToken | null; + + /** + * Creates a new ListPaymentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPaymentsRequest instance + */ + public static create( + properties?: api.IListPaymentsRequest + ): api.ListPaymentsRequest; + + /** + * Encodes the specified ListPaymentsRequest message. Does not implicitly {@link api.ListPaymentsRequest.verify|verify} messages. + * @param message ListPaymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IListPaymentsRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ListPaymentsRequest message, length delimited. Does not implicitly {@link api.ListPaymentsRequest.verify|verify} messages. + * @param message ListPaymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IListPaymentsRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ListPaymentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPaymentsRequest + * @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 + ): api.ListPaymentsRequest; + + /** + * Decodes a ListPaymentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPaymentsRequest + * @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 + ): api.ListPaymentsRequest; + + /** + * Verifies a ListPaymentsRequest 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 ListPaymentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPaymentsRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.ListPaymentsRequest; + + /** + * Creates a plain object from a ListPaymentsRequest message. Also converts values to other types if specified. + * @param message ListPaymentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ListPaymentsRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ListPaymentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPaymentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPaymentsResponse. */ + interface IListPaymentsResponse { + /** ListPaymentsResponse payments */ + payments?: types.IPayment[] | null; + + /** ListPaymentsResponse next_page_token */ + next_page_token?: types.IPageToken | null; + } + + /** Represents a ListPaymentsResponse. */ + class ListPaymentsResponse implements IListPaymentsResponse { + /** + * Constructs a new ListPaymentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IListPaymentsResponse); + + /** ListPaymentsResponse payments. */ + public payments: types.IPayment[]; + + /** ListPaymentsResponse next_page_token. */ + public next_page_token?: types.IPageToken | null; + + /** + * Creates a new ListPaymentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPaymentsResponse instance + */ + public static create( + properties?: api.IListPaymentsResponse + ): api.ListPaymentsResponse; + + /** + * Encodes the specified ListPaymentsResponse message. Does not implicitly {@link api.ListPaymentsResponse.verify|verify} messages. + * @param message ListPaymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IListPaymentsResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ListPaymentsResponse message, length delimited. Does not implicitly {@link api.ListPaymentsResponse.verify|verify} messages. + * @param message ListPaymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IListPaymentsResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ListPaymentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPaymentsResponse + * @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 + ): api.ListPaymentsResponse; + + /** + * Decodes a ListPaymentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPaymentsResponse + * @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 + ): api.ListPaymentsResponse; + + /** + * Verifies a ListPaymentsResponse 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 ListPaymentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPaymentsResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.ListPaymentsResponse; + + /** + * Creates a plain object from a ListPaymentsResponse message. Also converts values to other types if specified. + * @param message ListPaymentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ListPaymentsResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ListPaymentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPaymentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListForwardedPaymentsRequest. */ + interface IListForwardedPaymentsRequest { + /** ListForwardedPaymentsRequest page_token */ + page_token?: types.IPageToken | null; + } + + /** Represents a ListForwardedPaymentsRequest. */ + class ListForwardedPaymentsRequest + implements IListForwardedPaymentsRequest + { + /** + * Constructs a new ListForwardedPaymentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IListForwardedPaymentsRequest); + + /** ListForwardedPaymentsRequest page_token. */ + public page_token?: types.IPageToken | null; + + /** + * Creates a new ListForwardedPaymentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListForwardedPaymentsRequest instance + */ + public static create( + properties?: api.IListForwardedPaymentsRequest + ): api.ListForwardedPaymentsRequest; + + /** + * Encodes the specified ListForwardedPaymentsRequest message. Does not implicitly {@link api.ListForwardedPaymentsRequest.verify|verify} messages. + * @param message ListForwardedPaymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IListForwardedPaymentsRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ListForwardedPaymentsRequest message, length delimited. Does not implicitly {@link api.ListForwardedPaymentsRequest.verify|verify} messages. + * @param message ListForwardedPaymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IListForwardedPaymentsRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ListForwardedPaymentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListForwardedPaymentsRequest + * @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 + ): api.ListForwardedPaymentsRequest; + + /** + * Decodes a ListForwardedPaymentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListForwardedPaymentsRequest + * @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 + ): api.ListForwardedPaymentsRequest; + + /** + * Verifies a ListForwardedPaymentsRequest 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 ListForwardedPaymentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListForwardedPaymentsRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.ListForwardedPaymentsRequest; + + /** + * Creates a plain object from a ListForwardedPaymentsRequest message. Also converts values to other types if specified. + * @param message ListForwardedPaymentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ListForwardedPaymentsRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ListForwardedPaymentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListForwardedPaymentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListForwardedPaymentsResponse. */ + interface IListForwardedPaymentsResponse { + /** ListForwardedPaymentsResponse forwarded_payments */ + forwarded_payments?: types.IForwardedPayment[] | null; + + /** ListForwardedPaymentsResponse next_page_token */ + next_page_token?: types.IPageToken | null; + } + + /** Represents a ListForwardedPaymentsResponse. */ + class ListForwardedPaymentsResponse + implements IListForwardedPaymentsResponse + { + /** + * Constructs a new ListForwardedPaymentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IListForwardedPaymentsResponse); + + /** ListForwardedPaymentsResponse forwarded_payments. */ + public forwarded_payments: types.IForwardedPayment[]; + + /** ListForwardedPaymentsResponse next_page_token. */ + public next_page_token?: types.IPageToken | null; + + /** + * Creates a new ListForwardedPaymentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListForwardedPaymentsResponse instance + */ + public static create( + properties?: api.IListForwardedPaymentsResponse + ): api.ListForwardedPaymentsResponse; + + /** + * Encodes the specified ListForwardedPaymentsResponse message. Does not implicitly {@link api.ListForwardedPaymentsResponse.verify|verify} messages. + * @param message ListForwardedPaymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IListForwardedPaymentsResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ListForwardedPaymentsResponse message, length delimited. Does not implicitly {@link api.ListForwardedPaymentsResponse.verify|verify} messages. + * @param message ListForwardedPaymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IListForwardedPaymentsResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ListForwardedPaymentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListForwardedPaymentsResponse + * @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 + ): api.ListForwardedPaymentsResponse; + + /** + * Decodes a ListForwardedPaymentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListForwardedPaymentsResponse + * @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 + ): api.ListForwardedPaymentsResponse; + + /** + * Verifies a ListForwardedPaymentsResponse 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 ListForwardedPaymentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListForwardedPaymentsResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.ListForwardedPaymentsResponse; + + /** + * Creates a plain object from a ListForwardedPaymentsResponse message. Also converts values to other types if specified. + * @param message ListForwardedPaymentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ListForwardedPaymentsResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ListForwardedPaymentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListForwardedPaymentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignMessageRequest. */ + interface ISignMessageRequest { + /** SignMessageRequest message */ + message?: Uint8Array | null; + } + + /** Represents a SignMessageRequest. */ + class SignMessageRequest implements ISignMessageRequest { + /** + * Constructs a new SignMessageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.ISignMessageRequest); + + /** SignMessageRequest message. */ + public message: Uint8Array; + + /** + * Creates a new SignMessageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SignMessageRequest instance + */ + public static create( + properties?: api.ISignMessageRequest + ): api.SignMessageRequest; + + /** + * Encodes the specified SignMessageRequest message. Does not implicitly {@link api.SignMessageRequest.verify|verify} messages. + * @param message SignMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.ISignMessageRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified SignMessageRequest message, length delimited. Does not implicitly {@link api.SignMessageRequest.verify|verify} messages. + * @param message SignMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.ISignMessageRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a SignMessageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SignMessageRequest + * @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 + ): api.SignMessageRequest; + + /** + * Decodes a SignMessageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SignMessageRequest + * @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 + ): api.SignMessageRequest; + + /** + * Verifies a SignMessageRequest 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 SignMessageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SignMessageRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.SignMessageRequest; + + /** + * Creates a plain object from a SignMessageRequest message. Also converts values to other types if specified. + * @param message SignMessageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.SignMessageRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this SignMessageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SignMessageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignMessageResponse. */ + interface ISignMessageResponse { + /** SignMessageResponse signature */ + signature?: string | null; + } + + /** Represents a SignMessageResponse. */ + class SignMessageResponse implements ISignMessageResponse { + /** + * Constructs a new SignMessageResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.ISignMessageResponse); + + /** SignMessageResponse signature. */ + public signature: string; + + /** + * Creates a new SignMessageResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SignMessageResponse instance + */ + public static create( + properties?: api.ISignMessageResponse + ): api.SignMessageResponse; + + /** + * Encodes the specified SignMessageResponse message. Does not implicitly {@link api.SignMessageResponse.verify|verify} messages. + * @param message SignMessageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.ISignMessageResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified SignMessageResponse message, length delimited. Does not implicitly {@link api.SignMessageResponse.verify|verify} messages. + * @param message SignMessageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.ISignMessageResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a SignMessageResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SignMessageResponse + * @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 + ): api.SignMessageResponse; + + /** + * Decodes a SignMessageResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SignMessageResponse + * @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 + ): api.SignMessageResponse; + + /** + * Verifies a SignMessageResponse 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 SignMessageResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SignMessageResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.SignMessageResponse; + + /** + * Creates a plain object from a SignMessageResponse message. Also converts values to other types if specified. + * @param message SignMessageResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.SignMessageResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this SignMessageResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SignMessageResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VerifySignatureRequest. */ + interface IVerifySignatureRequest { + /** VerifySignatureRequest message */ + message?: Uint8Array | null; + + /** VerifySignatureRequest signature */ + signature?: string | null; + + /** VerifySignatureRequest public_key */ + public_key?: string | null; + } + + /** Represents a VerifySignatureRequest. */ + class VerifySignatureRequest implements IVerifySignatureRequest { + /** + * Constructs a new VerifySignatureRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IVerifySignatureRequest); + + /** VerifySignatureRequest message. */ + public message: Uint8Array; + + /** VerifySignatureRequest signature. */ + public signature: string; + + /** VerifySignatureRequest public_key. */ + public public_key: string; + + /** + * Creates a new VerifySignatureRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns VerifySignatureRequest instance + */ + public static create( + properties?: api.IVerifySignatureRequest + ): api.VerifySignatureRequest; + + /** + * Encodes the specified VerifySignatureRequest message. Does not implicitly {@link api.VerifySignatureRequest.verify|verify} messages. + * @param message VerifySignatureRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IVerifySignatureRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified VerifySignatureRequest message, length delimited. Does not implicitly {@link api.VerifySignatureRequest.verify|verify} messages. + * @param message VerifySignatureRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IVerifySignatureRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a VerifySignatureRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VerifySignatureRequest + * @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 + ): api.VerifySignatureRequest; + + /** + * Decodes a VerifySignatureRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VerifySignatureRequest + * @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 + ): api.VerifySignatureRequest; + + /** + * Verifies a VerifySignatureRequest 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 VerifySignatureRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VerifySignatureRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.VerifySignatureRequest; + + /** + * Creates a plain object from a VerifySignatureRequest message. Also converts values to other types if specified. + * @param message VerifySignatureRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.VerifySignatureRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this VerifySignatureRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VerifySignatureRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VerifySignatureResponse. */ + interface IVerifySignatureResponse { + /** VerifySignatureResponse valid */ + valid?: boolean | null; + } + + /** Represents a VerifySignatureResponse. */ + class VerifySignatureResponse implements IVerifySignatureResponse { + /** + * Constructs a new VerifySignatureResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IVerifySignatureResponse); + + /** VerifySignatureResponse valid. */ + public valid: boolean; + + /** + * Creates a new VerifySignatureResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns VerifySignatureResponse instance + */ + public static create( + properties?: api.IVerifySignatureResponse + ): api.VerifySignatureResponse; + + /** + * Encodes the specified VerifySignatureResponse message. Does not implicitly {@link api.VerifySignatureResponse.verify|verify} messages. + * @param message VerifySignatureResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IVerifySignatureResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified VerifySignatureResponse message, length delimited. Does not implicitly {@link api.VerifySignatureResponse.verify|verify} messages. + * @param message VerifySignatureResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IVerifySignatureResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a VerifySignatureResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VerifySignatureResponse + * @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 + ): api.VerifySignatureResponse; + + /** + * Decodes a VerifySignatureResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VerifySignatureResponse + * @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 + ): api.VerifySignatureResponse; + + /** + * Verifies a VerifySignatureResponse 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 VerifySignatureResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VerifySignatureResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.VerifySignatureResponse; + + /** + * Creates a plain object from a VerifySignatureResponse message. Also converts values to other types if specified. + * @param message VerifySignatureResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.VerifySignatureResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this VerifySignatureResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VerifySignatureResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportPathfindingScoresRequest. */ + interface IExportPathfindingScoresRequest {} + + /** Represents an ExportPathfindingScoresRequest. */ + class ExportPathfindingScoresRequest + implements IExportPathfindingScoresRequest + { + /** + * Constructs a new ExportPathfindingScoresRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IExportPathfindingScoresRequest); + + /** + * Creates a new ExportPathfindingScoresRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportPathfindingScoresRequest instance + */ + public static create( + properties?: api.IExportPathfindingScoresRequest + ): api.ExportPathfindingScoresRequest; + + /** + * Encodes the specified ExportPathfindingScoresRequest message. Does not implicitly {@link api.ExportPathfindingScoresRequest.verify|verify} messages. + * @param message ExportPathfindingScoresRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IExportPathfindingScoresRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ExportPathfindingScoresRequest message, length delimited. Does not implicitly {@link api.ExportPathfindingScoresRequest.verify|verify} messages. + * @param message ExportPathfindingScoresRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IExportPathfindingScoresRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an ExportPathfindingScoresRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportPathfindingScoresRequest + * @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 + ): api.ExportPathfindingScoresRequest; + + /** + * Decodes an ExportPathfindingScoresRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportPathfindingScoresRequest + * @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 + ): api.ExportPathfindingScoresRequest; + + /** + * Verifies an ExportPathfindingScoresRequest 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 ExportPathfindingScoresRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportPathfindingScoresRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.ExportPathfindingScoresRequest; + + /** + * Creates a plain object from an ExportPathfindingScoresRequest message. Also converts values to other types if specified. + * @param message ExportPathfindingScoresRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ExportPathfindingScoresRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ExportPathfindingScoresRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportPathfindingScoresRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportPathfindingScoresResponse. */ + interface IExportPathfindingScoresResponse { + /** ExportPathfindingScoresResponse scores */ + scores?: Uint8Array | null; + } + + /** Represents an ExportPathfindingScoresResponse. */ + class ExportPathfindingScoresResponse + implements IExportPathfindingScoresResponse + { + /** + * Constructs a new ExportPathfindingScoresResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IExportPathfindingScoresResponse); + + /** ExportPathfindingScoresResponse scores. */ + public scores: Uint8Array; + + /** + * Creates a new ExportPathfindingScoresResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportPathfindingScoresResponse instance + */ + public static create( + properties?: api.IExportPathfindingScoresResponse + ): api.ExportPathfindingScoresResponse; + + /** + * Encodes the specified ExportPathfindingScoresResponse message. Does not implicitly {@link api.ExportPathfindingScoresResponse.verify|verify} messages. + * @param message ExportPathfindingScoresResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IExportPathfindingScoresResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ExportPathfindingScoresResponse message, length delimited. Does not implicitly {@link api.ExportPathfindingScoresResponse.verify|verify} messages. + * @param message ExportPathfindingScoresResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IExportPathfindingScoresResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an ExportPathfindingScoresResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportPathfindingScoresResponse + * @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 + ): api.ExportPathfindingScoresResponse; + + /** + * Decodes an ExportPathfindingScoresResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportPathfindingScoresResponse + * @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 + ): api.ExportPathfindingScoresResponse; + + /** + * Verifies an ExportPathfindingScoresResponse 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 ExportPathfindingScoresResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportPathfindingScoresResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.ExportPathfindingScoresResponse; + + /** + * Creates a plain object from an ExportPathfindingScoresResponse message. Also converts values to other types if specified. + * @param message ExportPathfindingScoresResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ExportPathfindingScoresResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ExportPathfindingScoresResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportPathfindingScoresResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBalancesRequest. */ + interface IGetBalancesRequest {} + + /** Represents a GetBalancesRequest. */ + class GetBalancesRequest implements IGetBalancesRequest { + /** + * Constructs a new GetBalancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGetBalancesRequest); + + /** + * Creates a new GetBalancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBalancesRequest instance + */ + public static create( + properties?: api.IGetBalancesRequest + ): api.GetBalancesRequest; + + /** + * Encodes the specified GetBalancesRequest message. Does not implicitly {@link api.GetBalancesRequest.verify|verify} messages. + * @param message GetBalancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGetBalancesRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GetBalancesRequest message, length delimited. Does not implicitly {@link api.GetBalancesRequest.verify|verify} messages. + * @param message GetBalancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGetBalancesRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GetBalancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBalancesRequest + * @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 + ): api.GetBalancesRequest; + + /** + * Decodes a GetBalancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBalancesRequest + * @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 + ): api.GetBalancesRequest; + + /** + * Verifies a GetBalancesRequest 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 GetBalancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBalancesRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.GetBalancesRequest; + + /** + * Creates a plain object from a GetBalancesRequest message. Also converts values to other types if specified. + * @param message GetBalancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GetBalancesRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GetBalancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBalancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBalancesResponse. */ + interface IGetBalancesResponse { + /** GetBalancesResponse total_onchain_balance_sats */ + total_onchain_balance_sats?: Long | null; + + /** GetBalancesResponse spendable_onchain_balance_sats */ + spendable_onchain_balance_sats?: Long | null; + + /** GetBalancesResponse total_anchor_channels_reserve_sats */ + total_anchor_channels_reserve_sats?: Long | null; + + /** GetBalancesResponse total_lightning_balance_sats */ + total_lightning_balance_sats?: Long | null; + + /** GetBalancesResponse lightning_balances */ + lightning_balances?: types.ILightningBalance[] | null; + + /** GetBalancesResponse pending_balances_from_channel_closures */ + pending_balances_from_channel_closures?: + | types.IPendingSweepBalance[] + | null; + } + + /** Represents a GetBalancesResponse. */ + class GetBalancesResponse implements IGetBalancesResponse { + /** + * Constructs a new GetBalancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGetBalancesResponse); + + /** GetBalancesResponse total_onchain_balance_sats. */ + public total_onchain_balance_sats: Long; + + /** GetBalancesResponse spendable_onchain_balance_sats. */ + public spendable_onchain_balance_sats: Long; + + /** GetBalancesResponse total_anchor_channels_reserve_sats. */ + public total_anchor_channels_reserve_sats: Long; + + /** GetBalancesResponse total_lightning_balance_sats. */ + public total_lightning_balance_sats: Long; + + /** GetBalancesResponse lightning_balances. */ + public lightning_balances: types.ILightningBalance[]; + + /** GetBalancesResponse pending_balances_from_channel_closures. */ + public pending_balances_from_channel_closures: types.IPendingSweepBalance[]; + + /** + * Creates a new GetBalancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBalancesResponse instance + */ + public static create( + properties?: api.IGetBalancesResponse + ): api.GetBalancesResponse; + + /** + * Encodes the specified GetBalancesResponse message. Does not implicitly {@link api.GetBalancesResponse.verify|verify} messages. + * @param message GetBalancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGetBalancesResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GetBalancesResponse message, length delimited. Does not implicitly {@link api.GetBalancesResponse.verify|verify} messages. + * @param message GetBalancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGetBalancesResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GetBalancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBalancesResponse + * @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 + ): api.GetBalancesResponse; + + /** + * Decodes a GetBalancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBalancesResponse + * @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 + ): api.GetBalancesResponse; + + /** + * Verifies a GetBalancesResponse 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 GetBalancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBalancesResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.GetBalancesResponse; + + /** + * Creates a plain object from a GetBalancesResponse message. Also converts values to other types if specified. + * @param message GetBalancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GetBalancesResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GetBalancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBalancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConnectPeerRequest. */ + interface IConnectPeerRequest { + /** ConnectPeerRequest node_pubkey */ + node_pubkey?: string | null; + + /** ConnectPeerRequest address */ + address?: string | null; + + /** ConnectPeerRequest persist */ + persist?: boolean | null; + } + + /** Represents a ConnectPeerRequest. */ + class ConnectPeerRequest implements IConnectPeerRequest { + /** + * Constructs a new ConnectPeerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IConnectPeerRequest); + + /** ConnectPeerRequest node_pubkey. */ + public node_pubkey: string; + + /** ConnectPeerRequest address. */ + public address: string; + + /** ConnectPeerRequest persist. */ + public persist: boolean; + + /** + * Creates a new ConnectPeerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectPeerRequest instance + */ + public static create( + properties?: api.IConnectPeerRequest + ): api.ConnectPeerRequest; + + /** + * Encodes the specified ConnectPeerRequest message. Does not implicitly {@link api.ConnectPeerRequest.verify|verify} messages. + * @param message ConnectPeerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IConnectPeerRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ConnectPeerRequest message, length delimited. Does not implicitly {@link api.ConnectPeerRequest.verify|verify} messages. + * @param message ConnectPeerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IConnectPeerRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ConnectPeerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectPeerRequest + * @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 + ): api.ConnectPeerRequest; + + /** + * Decodes a ConnectPeerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectPeerRequest + * @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 + ): api.ConnectPeerRequest; + + /** + * Verifies a ConnectPeerRequest 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 ConnectPeerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectPeerRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.ConnectPeerRequest; + + /** + * Creates a plain object from a ConnectPeerRequest message. Also converts values to other types if specified. + * @param message ConnectPeerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ConnectPeerRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ConnectPeerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectPeerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConnectPeerResponse. */ + interface IConnectPeerResponse {} + + /** Represents a ConnectPeerResponse. */ + class ConnectPeerResponse implements IConnectPeerResponse { + /** + * Constructs a new ConnectPeerResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IConnectPeerResponse); + + /** + * Creates a new ConnectPeerResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectPeerResponse instance + */ + public static create( + properties?: api.IConnectPeerResponse + ): api.ConnectPeerResponse; + + /** + * Encodes the specified ConnectPeerResponse message. Does not implicitly {@link api.ConnectPeerResponse.verify|verify} messages. + * @param message ConnectPeerResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IConnectPeerResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ConnectPeerResponse message, length delimited. Does not implicitly {@link api.ConnectPeerResponse.verify|verify} messages. + * @param message ConnectPeerResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IConnectPeerResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ConnectPeerResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectPeerResponse + * @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 + ): api.ConnectPeerResponse; + + /** + * Decodes a ConnectPeerResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectPeerResponse + * @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 + ): api.ConnectPeerResponse; + + /** + * Verifies a ConnectPeerResponse 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 ConnectPeerResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectPeerResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.ConnectPeerResponse; + + /** + * Creates a plain object from a ConnectPeerResponse message. Also converts values to other types if specified. + * @param message ConnectPeerResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ConnectPeerResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ConnectPeerResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectPeerResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisconnectPeerRequest. */ + interface IDisconnectPeerRequest { + /** DisconnectPeerRequest node_pubkey */ + node_pubkey?: string | null; + } + + /** Represents a DisconnectPeerRequest. */ + class DisconnectPeerRequest implements IDisconnectPeerRequest { + /** + * Constructs a new DisconnectPeerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IDisconnectPeerRequest); + + /** DisconnectPeerRequest node_pubkey. */ + public node_pubkey: string; + + /** + * Creates a new DisconnectPeerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DisconnectPeerRequest instance + */ + public static create( + properties?: api.IDisconnectPeerRequest + ): api.DisconnectPeerRequest; + + /** + * Encodes the specified DisconnectPeerRequest message. Does not implicitly {@link api.DisconnectPeerRequest.verify|verify} messages. + * @param message DisconnectPeerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IDisconnectPeerRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified DisconnectPeerRequest message, length delimited. Does not implicitly {@link api.DisconnectPeerRequest.verify|verify} messages. + * @param message DisconnectPeerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IDisconnectPeerRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a DisconnectPeerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisconnectPeerRequest + * @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 + ): api.DisconnectPeerRequest; + + /** + * Decodes a DisconnectPeerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisconnectPeerRequest + * @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 + ): api.DisconnectPeerRequest; + + /** + * Verifies a DisconnectPeerRequest 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 DisconnectPeerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisconnectPeerRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.DisconnectPeerRequest; + + /** + * Creates a plain object from a DisconnectPeerRequest message. Also converts values to other types if specified. + * @param message DisconnectPeerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.DisconnectPeerRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this DisconnectPeerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisconnectPeerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisconnectPeerResponse. */ + interface IDisconnectPeerResponse {} + + /** Represents a DisconnectPeerResponse. */ + class DisconnectPeerResponse implements IDisconnectPeerResponse { + /** + * Constructs a new DisconnectPeerResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IDisconnectPeerResponse); + + /** + * Creates a new DisconnectPeerResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DisconnectPeerResponse instance + */ + public static create( + properties?: api.IDisconnectPeerResponse + ): api.DisconnectPeerResponse; + + /** + * Encodes the specified DisconnectPeerResponse message. Does not implicitly {@link api.DisconnectPeerResponse.verify|verify} messages. + * @param message DisconnectPeerResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IDisconnectPeerResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified DisconnectPeerResponse message, length delimited. Does not implicitly {@link api.DisconnectPeerResponse.verify|verify} messages. + * @param message DisconnectPeerResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IDisconnectPeerResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a DisconnectPeerResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisconnectPeerResponse + * @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 + ): api.DisconnectPeerResponse; + + /** + * Decodes a DisconnectPeerResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisconnectPeerResponse + * @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 + ): api.DisconnectPeerResponse; + + /** + * Verifies a DisconnectPeerResponse 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 DisconnectPeerResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisconnectPeerResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.DisconnectPeerResponse; + + /** + * Creates a plain object from a DisconnectPeerResponse message. Also converts values to other types if specified. + * @param message DisconnectPeerResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.DisconnectPeerResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this DisconnectPeerResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisconnectPeerResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPeersRequest. */ + interface IListPeersRequest {} + + /** Represents a ListPeersRequest. */ + class ListPeersRequest implements IListPeersRequest { + /** + * Constructs a new ListPeersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IListPeersRequest); + + /** + * Creates a new ListPeersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPeersRequest instance + */ + public static create( + properties?: api.IListPeersRequest + ): api.ListPeersRequest; + + /** + * Encodes the specified ListPeersRequest message. Does not implicitly {@link api.ListPeersRequest.verify|verify} messages. + * @param message ListPeersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IListPeersRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ListPeersRequest message, length delimited. Does not implicitly {@link api.ListPeersRequest.verify|verify} messages. + * @param message ListPeersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IListPeersRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ListPeersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPeersRequest + * @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 + ): api.ListPeersRequest; + + /** + * Decodes a ListPeersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPeersRequest + * @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 + ): api.ListPeersRequest; + + /** + * Verifies a ListPeersRequest 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 ListPeersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPeersRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.ListPeersRequest; + + /** + * Creates a plain object from a ListPeersRequest message. Also converts values to other types if specified. + * @param message ListPeersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ListPeersRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ListPeersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPeersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPeersResponse. */ + interface IListPeersResponse { + /** ListPeersResponse peers */ + peers?: types.IPeer[] | null; + } + + /** Represents a ListPeersResponse. */ + class ListPeersResponse implements IListPeersResponse { + /** + * Constructs a new ListPeersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IListPeersResponse); + + /** ListPeersResponse peers. */ + public peers: types.IPeer[]; + + /** + * Creates a new ListPeersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPeersResponse instance + */ + public static create( + properties?: api.IListPeersResponse + ): api.ListPeersResponse; + + /** + * Encodes the specified ListPeersResponse message. Does not implicitly {@link api.ListPeersResponse.verify|verify} messages. + * @param message ListPeersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IListPeersResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ListPeersResponse message, length delimited. Does not implicitly {@link api.ListPeersResponse.verify|verify} messages. + * @param message ListPeersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IListPeersResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ListPeersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPeersResponse + * @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 + ): api.ListPeersResponse; + + /** + * Decodes a ListPeersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPeersResponse + * @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 + ): api.ListPeersResponse; + + /** + * Verifies a ListPeersResponse 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 ListPeersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPeersResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.ListPeersResponse; + + /** + * Creates a plain object from a ListPeersResponse message. Also converts values to other types if specified. + * @param message ListPeersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ListPeersResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ListPeersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPeersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphListChannelsRequest. */ + interface IGraphListChannelsRequest {} + + /** Represents a GraphListChannelsRequest. */ + class GraphListChannelsRequest implements IGraphListChannelsRequest { + /** + * Constructs a new GraphListChannelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGraphListChannelsRequest); + + /** + * Creates a new GraphListChannelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphListChannelsRequest instance + */ + public static create( + properties?: api.IGraphListChannelsRequest + ): api.GraphListChannelsRequest; + + /** + * Encodes the specified GraphListChannelsRequest message. Does not implicitly {@link api.GraphListChannelsRequest.verify|verify} messages. + * @param message GraphListChannelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGraphListChannelsRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GraphListChannelsRequest message, length delimited. Does not implicitly {@link api.GraphListChannelsRequest.verify|verify} messages. + * @param message GraphListChannelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGraphListChannelsRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GraphListChannelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphListChannelsRequest + * @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 + ): api.GraphListChannelsRequest; + + /** + * Decodes a GraphListChannelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphListChannelsRequest + * @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 + ): api.GraphListChannelsRequest; + + /** + * Verifies a GraphListChannelsRequest 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 GraphListChannelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphListChannelsRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.GraphListChannelsRequest; + + /** + * Creates a plain object from a GraphListChannelsRequest message. Also converts values to other types if specified. + * @param message GraphListChannelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GraphListChannelsRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GraphListChannelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphListChannelsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphListChannelsResponse. */ + interface IGraphListChannelsResponse { + /** GraphListChannelsResponse short_channel_ids */ + short_channel_ids?: Long[] | null; + } + + /** Represents a GraphListChannelsResponse. */ + class GraphListChannelsResponse implements IGraphListChannelsResponse { + /** + * Constructs a new GraphListChannelsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGraphListChannelsResponse); + + /** GraphListChannelsResponse short_channel_ids. */ + public short_channel_ids: Long[]; + + /** + * Creates a new GraphListChannelsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphListChannelsResponse instance + */ + public static create( + properties?: api.IGraphListChannelsResponse + ): api.GraphListChannelsResponse; + + /** + * Encodes the specified GraphListChannelsResponse message. Does not implicitly {@link api.GraphListChannelsResponse.verify|verify} messages. + * @param message GraphListChannelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGraphListChannelsResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GraphListChannelsResponse message, length delimited. Does not implicitly {@link api.GraphListChannelsResponse.verify|verify} messages. + * @param message GraphListChannelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGraphListChannelsResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GraphListChannelsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphListChannelsResponse + * @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 + ): api.GraphListChannelsResponse; + + /** + * Decodes a GraphListChannelsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphListChannelsResponse + * @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 + ): api.GraphListChannelsResponse; + + /** + * Verifies a GraphListChannelsResponse 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 GraphListChannelsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphListChannelsResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.GraphListChannelsResponse; + + /** + * Creates a plain object from a GraphListChannelsResponse message. Also converts values to other types if specified. + * @param message GraphListChannelsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GraphListChannelsResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GraphListChannelsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphListChannelsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphGetChannelRequest. */ + interface IGraphGetChannelRequest { + /** GraphGetChannelRequest short_channel_id */ + short_channel_id?: Long | null; + } + + /** Represents a GraphGetChannelRequest. */ + class GraphGetChannelRequest implements IGraphGetChannelRequest { + /** + * Constructs a new GraphGetChannelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGraphGetChannelRequest); + + /** GraphGetChannelRequest short_channel_id. */ + public short_channel_id: Long; + + /** + * Creates a new GraphGetChannelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphGetChannelRequest instance + */ + public static create( + properties?: api.IGraphGetChannelRequest + ): api.GraphGetChannelRequest; + + /** + * Encodes the specified GraphGetChannelRequest message. Does not implicitly {@link api.GraphGetChannelRequest.verify|verify} messages. + * @param message GraphGetChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGraphGetChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GraphGetChannelRequest message, length delimited. Does not implicitly {@link api.GraphGetChannelRequest.verify|verify} messages. + * @param message GraphGetChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGraphGetChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GraphGetChannelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphGetChannelRequest + * @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 + ): api.GraphGetChannelRequest; + + /** + * Decodes a GraphGetChannelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphGetChannelRequest + * @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 + ): api.GraphGetChannelRequest; + + /** + * Verifies a GraphGetChannelRequest 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 GraphGetChannelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphGetChannelRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.GraphGetChannelRequest; + + /** + * Creates a plain object from a GraphGetChannelRequest message. Also converts values to other types if specified. + * @param message GraphGetChannelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GraphGetChannelRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GraphGetChannelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphGetChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphGetChannelResponse. */ + interface IGraphGetChannelResponse { + /** GraphGetChannelResponse channel */ + channel?: types.IGraphChannel | null; + } + + /** Represents a GraphGetChannelResponse. */ + class GraphGetChannelResponse implements IGraphGetChannelResponse { + /** + * Constructs a new GraphGetChannelResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGraphGetChannelResponse); + + /** GraphGetChannelResponse channel. */ + public channel?: types.IGraphChannel | null; + + /** + * Creates a new GraphGetChannelResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphGetChannelResponse instance + */ + public static create( + properties?: api.IGraphGetChannelResponse + ): api.GraphGetChannelResponse; + + /** + * Encodes the specified GraphGetChannelResponse message. Does not implicitly {@link api.GraphGetChannelResponse.verify|verify} messages. + * @param message GraphGetChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGraphGetChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GraphGetChannelResponse message, length delimited. Does not implicitly {@link api.GraphGetChannelResponse.verify|verify} messages. + * @param message GraphGetChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGraphGetChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GraphGetChannelResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphGetChannelResponse + * @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 + ): api.GraphGetChannelResponse; + + /** + * Decodes a GraphGetChannelResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphGetChannelResponse + * @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 + ): api.GraphGetChannelResponse; + + /** + * Verifies a GraphGetChannelResponse 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 GraphGetChannelResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphGetChannelResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.GraphGetChannelResponse; + + /** + * Creates a plain object from a GraphGetChannelResponse message. Also converts values to other types if specified. + * @param message GraphGetChannelResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GraphGetChannelResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GraphGetChannelResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphGetChannelResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphListNodesRequest. */ + interface IGraphListNodesRequest {} + + /** Represents a GraphListNodesRequest. */ + class GraphListNodesRequest implements IGraphListNodesRequest { + /** + * Constructs a new GraphListNodesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGraphListNodesRequest); + + /** + * Creates a new GraphListNodesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphListNodesRequest instance + */ + public static create( + properties?: api.IGraphListNodesRequest + ): api.GraphListNodesRequest; + + /** + * Encodes the specified GraphListNodesRequest message. Does not implicitly {@link api.GraphListNodesRequest.verify|verify} messages. + * @param message GraphListNodesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGraphListNodesRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GraphListNodesRequest message, length delimited. Does not implicitly {@link api.GraphListNodesRequest.verify|verify} messages. + * @param message GraphListNodesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGraphListNodesRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GraphListNodesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphListNodesRequest + * @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 + ): api.GraphListNodesRequest; + + /** + * Decodes a GraphListNodesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphListNodesRequest + * @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 + ): api.GraphListNodesRequest; + + /** + * Verifies a GraphListNodesRequest 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 GraphListNodesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphListNodesRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.GraphListNodesRequest; + + /** + * Creates a plain object from a GraphListNodesRequest message. Also converts values to other types if specified. + * @param message GraphListNodesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GraphListNodesRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GraphListNodesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphListNodesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphListNodesResponse. */ + interface IGraphListNodesResponse { + /** GraphListNodesResponse node_ids */ + node_ids?: string[] | null; + } + + /** Represents a GraphListNodesResponse. */ + class GraphListNodesResponse implements IGraphListNodesResponse { + /** + * Constructs a new GraphListNodesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGraphListNodesResponse); + + /** GraphListNodesResponse node_ids. */ + public node_ids: string[]; + + /** + * Creates a new GraphListNodesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphListNodesResponse instance + */ + public static create( + properties?: api.IGraphListNodesResponse + ): api.GraphListNodesResponse; + + /** + * Encodes the specified GraphListNodesResponse message. Does not implicitly {@link api.GraphListNodesResponse.verify|verify} messages. + * @param message GraphListNodesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGraphListNodesResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GraphListNodesResponse message, length delimited. Does not implicitly {@link api.GraphListNodesResponse.verify|verify} messages. + * @param message GraphListNodesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGraphListNodesResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GraphListNodesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphListNodesResponse + * @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 + ): api.GraphListNodesResponse; + + /** + * Decodes a GraphListNodesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphListNodesResponse + * @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 + ): api.GraphListNodesResponse; + + /** + * Verifies a GraphListNodesResponse 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 GraphListNodesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphListNodesResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.GraphListNodesResponse; + + /** + * Creates a plain object from a GraphListNodesResponse message. Also converts values to other types if specified. + * @param message GraphListNodesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GraphListNodesResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GraphListNodesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphListNodesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UnifiedSendRequest. */ + interface IUnifiedSendRequest { + /** UnifiedSendRequest uri */ + uri?: string | null; + + /** UnifiedSendRequest amount_msat */ + amount_msat?: Long | null; + + /** UnifiedSendRequest route_parameters */ + route_parameters?: types.IRouteParametersConfig | null; + } + + /** Represents an UnifiedSendRequest. */ + class UnifiedSendRequest implements IUnifiedSendRequest { + /** + * Constructs a new UnifiedSendRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IUnifiedSendRequest); + + /** UnifiedSendRequest uri. */ + public uri: string; + + /** UnifiedSendRequest amount_msat. */ + public amount_msat?: Long | null; + + /** UnifiedSendRequest route_parameters. */ + public route_parameters?: types.IRouteParametersConfig | null; + + /** + * Creates a new UnifiedSendRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UnifiedSendRequest instance + */ + public static create( + properties?: api.IUnifiedSendRequest + ): api.UnifiedSendRequest; + + /** + * Encodes the specified UnifiedSendRequest message. Does not implicitly {@link api.UnifiedSendRequest.verify|verify} messages. + * @param message UnifiedSendRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IUnifiedSendRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified UnifiedSendRequest message, length delimited. Does not implicitly {@link api.UnifiedSendRequest.verify|verify} messages. + * @param message UnifiedSendRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IUnifiedSendRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an UnifiedSendRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UnifiedSendRequest + * @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 + ): api.UnifiedSendRequest; + + /** + * Decodes an UnifiedSendRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UnifiedSendRequest + * @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 + ): api.UnifiedSendRequest; + + /** + * Verifies an UnifiedSendRequest 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 UnifiedSendRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UnifiedSendRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.UnifiedSendRequest; + + /** + * Creates a plain object from an UnifiedSendRequest message. Also converts values to other types if specified. + * @param message UnifiedSendRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.UnifiedSendRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this UnifiedSendRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UnifiedSendRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UnifiedSendResponse. */ + interface IUnifiedSendResponse { + /** UnifiedSendResponse txid */ + txid?: string | null; + + /** UnifiedSendResponse bolt11_payment_id */ + bolt11_payment_id?: string | null; + + /** UnifiedSendResponse bolt12_payment_id */ + bolt12_payment_id?: string | null; + } + + /** Represents an UnifiedSendResponse. */ + class UnifiedSendResponse implements IUnifiedSendResponse { + /** + * Constructs a new UnifiedSendResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IUnifiedSendResponse); + + /** UnifiedSendResponse txid. */ + public txid?: string | null; + + /** UnifiedSendResponse bolt11_payment_id. */ + public bolt11_payment_id?: string | null; + + /** UnifiedSendResponse bolt12_payment_id. */ + public bolt12_payment_id?: string | null; + + /** UnifiedSendResponse payment_result. */ + public payment_result?: + | 'txid' + | 'bolt11_payment_id' + | 'bolt12_payment_id'; + + /** + * Creates a new UnifiedSendResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UnifiedSendResponse instance + */ + public static create( + properties?: api.IUnifiedSendResponse + ): api.UnifiedSendResponse; + + /** + * Encodes the specified UnifiedSendResponse message. Does not implicitly {@link api.UnifiedSendResponse.verify|verify} messages. + * @param message UnifiedSendResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IUnifiedSendResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified UnifiedSendResponse message, length delimited. Does not implicitly {@link api.UnifiedSendResponse.verify|verify} messages. + * @param message UnifiedSendResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IUnifiedSendResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an UnifiedSendResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UnifiedSendResponse + * @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 + ): api.UnifiedSendResponse; + + /** + * Decodes an UnifiedSendResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UnifiedSendResponse + * @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 + ): api.UnifiedSendResponse; + + /** + * Verifies an UnifiedSendResponse 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 UnifiedSendResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UnifiedSendResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.UnifiedSendResponse; + + /** + * Creates a plain object from an UnifiedSendResponse message. Also converts values to other types if specified. + * @param message UnifiedSendResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.UnifiedSendResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this UnifiedSendResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UnifiedSendResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphGetNodeRequest. */ + interface IGraphGetNodeRequest { + /** GraphGetNodeRequest node_id */ + node_id?: string | null; + } + + /** Represents a GraphGetNodeRequest. */ + class GraphGetNodeRequest implements IGraphGetNodeRequest { + /** + * Constructs a new GraphGetNodeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGraphGetNodeRequest); + + /** GraphGetNodeRequest node_id. */ + public node_id: string; + + /** + * Creates a new GraphGetNodeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphGetNodeRequest instance + */ + public static create( + properties?: api.IGraphGetNodeRequest + ): api.GraphGetNodeRequest; + + /** + * Encodes the specified GraphGetNodeRequest message. Does not implicitly {@link api.GraphGetNodeRequest.verify|verify} messages. + * @param message GraphGetNodeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGraphGetNodeRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GraphGetNodeRequest message, length delimited. Does not implicitly {@link api.GraphGetNodeRequest.verify|verify} messages. + * @param message GraphGetNodeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGraphGetNodeRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GraphGetNodeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphGetNodeRequest + * @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 + ): api.GraphGetNodeRequest; + + /** + * Decodes a GraphGetNodeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphGetNodeRequest + * @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 + ): api.GraphGetNodeRequest; + + /** + * Verifies a GraphGetNodeRequest 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 GraphGetNodeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphGetNodeRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.GraphGetNodeRequest; + + /** + * Creates a plain object from a GraphGetNodeRequest message. Also converts values to other types if specified. + * @param message GraphGetNodeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GraphGetNodeRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GraphGetNodeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphGetNodeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphGetNodeResponse. */ + interface IGraphGetNodeResponse { + /** GraphGetNodeResponse node */ + node?: types.IGraphNode | null; + } + + /** Represents a GraphGetNodeResponse. */ + class GraphGetNodeResponse implements IGraphGetNodeResponse { + /** + * Constructs a new GraphGetNodeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGraphGetNodeResponse); + + /** GraphGetNodeResponse node. */ + public node?: types.IGraphNode | null; + + /** + * Creates a new GraphGetNodeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphGetNodeResponse instance + */ + public static create( + properties?: api.IGraphGetNodeResponse + ): api.GraphGetNodeResponse; + + /** + * Encodes the specified GraphGetNodeResponse message. Does not implicitly {@link api.GraphGetNodeResponse.verify|verify} messages. + * @param message GraphGetNodeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGraphGetNodeResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GraphGetNodeResponse message, length delimited. Does not implicitly {@link api.GraphGetNodeResponse.verify|verify} messages. + * @param message GraphGetNodeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGraphGetNodeResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GraphGetNodeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphGetNodeResponse + * @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 + ): api.GraphGetNodeResponse; + + /** + * Decodes a GraphGetNodeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphGetNodeResponse + * @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 + ): api.GraphGetNodeResponse; + + /** + * Verifies a GraphGetNodeResponse 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 GraphGetNodeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphGetNodeResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.GraphGetNodeResponse; + + /** + * Creates a plain object from a GraphGetNodeResponse message. Also converts values to other types if specified. + * @param message GraphGetNodeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GraphGetNodeResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GraphGetNodeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphGetNodeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DecodeInvoiceRequest. */ + interface IDecodeInvoiceRequest { + /** DecodeInvoiceRequest invoice */ + invoice?: string | null; + } + + /** Represents a DecodeInvoiceRequest. */ + class DecodeInvoiceRequest implements IDecodeInvoiceRequest { + /** + * Constructs a new DecodeInvoiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IDecodeInvoiceRequest); + + /** DecodeInvoiceRequest invoice. */ + public invoice: string; + + /** + * Creates a new DecodeInvoiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DecodeInvoiceRequest instance + */ + public static create( + properties?: api.IDecodeInvoiceRequest + ): api.DecodeInvoiceRequest; + + /** + * Encodes the specified DecodeInvoiceRequest message. Does not implicitly {@link api.DecodeInvoiceRequest.verify|verify} messages. + * @param message DecodeInvoiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IDecodeInvoiceRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified DecodeInvoiceRequest message, length delimited. Does not implicitly {@link api.DecodeInvoiceRequest.verify|verify} messages. + * @param message DecodeInvoiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IDecodeInvoiceRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a DecodeInvoiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DecodeInvoiceRequest + * @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 + ): api.DecodeInvoiceRequest; + + /** + * Decodes a DecodeInvoiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DecodeInvoiceRequest + * @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 + ): api.DecodeInvoiceRequest; + + /** + * Verifies a DecodeInvoiceRequest 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 DecodeInvoiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DecodeInvoiceRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.DecodeInvoiceRequest; + + /** + * Creates a plain object from a DecodeInvoiceRequest message. Also converts values to other types if specified. + * @param message DecodeInvoiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.DecodeInvoiceRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this DecodeInvoiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DecodeInvoiceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DecodeInvoiceResponse. */ + interface IDecodeInvoiceResponse { + /** DecodeInvoiceResponse destination */ + destination?: string | null; + + /** DecodeInvoiceResponse payment_hash */ + payment_hash?: string | null; + + /** DecodeInvoiceResponse amount_msat */ + amount_msat?: Long | null; + + /** DecodeInvoiceResponse timestamp */ + timestamp?: Long | null; + + /** DecodeInvoiceResponse expiry */ + expiry?: Long | null; + + /** DecodeInvoiceResponse description */ + description?: string | null; + + /** DecodeInvoiceResponse description_hash */ + description_hash?: string | null; + + /** DecodeInvoiceResponse fallback_address */ + fallback_address?: string | null; + + /** DecodeInvoiceResponse min_final_cltv_expiry_delta */ + min_final_cltv_expiry_delta?: Long | null; + + /** DecodeInvoiceResponse payment_secret */ + payment_secret?: string | null; + + /** DecodeInvoiceResponse route_hints */ + route_hints?: types.IBolt11RouteHint[] | null; + + /** DecodeInvoiceResponse features */ + features?: { [k: string]: types.IBolt11Feature } | null; + + /** DecodeInvoiceResponse currency */ + currency?: string | null; + + /** DecodeInvoiceResponse payment_metadata */ + payment_metadata?: string | null; + + /** DecodeInvoiceResponse is_expired */ + is_expired?: boolean | null; + } + + /** Represents a DecodeInvoiceResponse. */ + class DecodeInvoiceResponse implements IDecodeInvoiceResponse { + /** + * Constructs a new DecodeInvoiceResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IDecodeInvoiceResponse); + + /** DecodeInvoiceResponse destination. */ + public destination: string; + + /** DecodeInvoiceResponse payment_hash. */ + public payment_hash: string; + + /** DecodeInvoiceResponse amount_msat. */ + public amount_msat?: Long | null; + + /** DecodeInvoiceResponse timestamp. */ + public timestamp: Long; + + /** DecodeInvoiceResponse expiry. */ + public expiry: Long; + + /** DecodeInvoiceResponse description. */ + public description?: string | null; + + /** DecodeInvoiceResponse description_hash. */ + public description_hash?: string | null; + + /** DecodeInvoiceResponse fallback_address. */ + public fallback_address?: string | null; + + /** DecodeInvoiceResponse min_final_cltv_expiry_delta. */ + public min_final_cltv_expiry_delta: Long; + + /** DecodeInvoiceResponse payment_secret. */ + public payment_secret: string; + + /** DecodeInvoiceResponse route_hints. */ + public route_hints: types.IBolt11RouteHint[]; + + /** DecodeInvoiceResponse features. */ + public features: { [k: string]: types.IBolt11Feature }; + + /** DecodeInvoiceResponse currency. */ + public currency: string; + + /** DecodeInvoiceResponse payment_metadata. */ + public payment_metadata?: string | null; + + /** DecodeInvoiceResponse is_expired. */ + public is_expired: boolean; + + /** + * Creates a new DecodeInvoiceResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DecodeInvoiceResponse instance + */ + public static create( + properties?: api.IDecodeInvoiceResponse + ): api.DecodeInvoiceResponse; + + /** + * Encodes the specified DecodeInvoiceResponse message. Does not implicitly {@link api.DecodeInvoiceResponse.verify|verify} messages. + * @param message DecodeInvoiceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IDecodeInvoiceResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified DecodeInvoiceResponse message, length delimited. Does not implicitly {@link api.DecodeInvoiceResponse.verify|verify} messages. + * @param message DecodeInvoiceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IDecodeInvoiceResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a DecodeInvoiceResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DecodeInvoiceResponse + * @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 + ): api.DecodeInvoiceResponse; + + /** + * Decodes a DecodeInvoiceResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DecodeInvoiceResponse + * @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 + ): api.DecodeInvoiceResponse; + + /** + * Verifies a DecodeInvoiceResponse 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 DecodeInvoiceResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DecodeInvoiceResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.DecodeInvoiceResponse; + + /** + * Creates a plain object from a DecodeInvoiceResponse message. Also converts values to other types if specified. + * @param message DecodeInvoiceResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.DecodeInvoiceResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this DecodeInvoiceResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DecodeInvoiceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DecodeOfferRequest. */ + interface IDecodeOfferRequest { + /** DecodeOfferRequest offer */ + offer?: string | null; + } + + /** Represents a DecodeOfferRequest. */ + class DecodeOfferRequest implements IDecodeOfferRequest { + /** + * Constructs a new DecodeOfferRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IDecodeOfferRequest); + + /** DecodeOfferRequest offer. */ + public offer: string; + + /** + * Creates a new DecodeOfferRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DecodeOfferRequest instance + */ + public static create( + properties?: api.IDecodeOfferRequest + ): api.DecodeOfferRequest; + + /** + * Encodes the specified DecodeOfferRequest message. Does not implicitly {@link api.DecodeOfferRequest.verify|verify} messages. + * @param message DecodeOfferRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IDecodeOfferRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified DecodeOfferRequest message, length delimited. Does not implicitly {@link api.DecodeOfferRequest.verify|verify} messages. + * @param message DecodeOfferRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IDecodeOfferRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a DecodeOfferRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DecodeOfferRequest + * @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 + ): api.DecodeOfferRequest; + + /** + * Decodes a DecodeOfferRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DecodeOfferRequest + * @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 + ): api.DecodeOfferRequest; + + /** + * Verifies a DecodeOfferRequest 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 DecodeOfferRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DecodeOfferRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.DecodeOfferRequest; + + /** + * Creates a plain object from a DecodeOfferRequest message. Also converts values to other types if specified. + * @param message DecodeOfferRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.DecodeOfferRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this DecodeOfferRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DecodeOfferRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DecodeOfferResponse. */ + interface IDecodeOfferResponse { + /** DecodeOfferResponse offer_id */ + offer_id?: string | null; + + /** DecodeOfferResponse description */ + description?: string | null; + + /** DecodeOfferResponse issuer */ + issuer?: string | null; + + /** DecodeOfferResponse amount */ + amount?: types.IOfferAmount | null; + + /** DecodeOfferResponse issuer_signing_pubkey */ + issuer_signing_pubkey?: string | null; + + /** DecodeOfferResponse absolute_expiry */ + absolute_expiry?: Long | null; + + /** DecodeOfferResponse quantity */ + quantity?: types.IOfferQuantity | null; + + /** DecodeOfferResponse paths */ + paths?: types.IBlindedPath[] | null; + + /** DecodeOfferResponse features */ + features?: { [k: string]: types.IBolt11Feature } | null; + + /** DecodeOfferResponse chains */ + chains?: string[] | null; + + /** DecodeOfferResponse metadata */ + metadata?: string | null; + + /** DecodeOfferResponse is_expired */ + is_expired?: boolean | null; + } + + /** Represents a DecodeOfferResponse. */ + class DecodeOfferResponse implements IDecodeOfferResponse { + /** + * Constructs a new DecodeOfferResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IDecodeOfferResponse); + + /** DecodeOfferResponse offer_id. */ + public offer_id: string; + + /** DecodeOfferResponse description. */ + public description?: string | null; + + /** DecodeOfferResponse issuer. */ + public issuer?: string | null; + + /** DecodeOfferResponse amount. */ + public amount?: types.IOfferAmount | null; + + /** DecodeOfferResponse issuer_signing_pubkey. */ + public issuer_signing_pubkey?: string | null; + + /** DecodeOfferResponse absolute_expiry. */ + public absolute_expiry?: Long | null; + + /** DecodeOfferResponse quantity. */ + public quantity?: types.IOfferQuantity | null; + + /** DecodeOfferResponse paths. */ + public paths: types.IBlindedPath[]; + + /** DecodeOfferResponse features. */ + public features: { [k: string]: types.IBolt11Feature }; + + /** DecodeOfferResponse chains. */ + public chains: string[]; + + /** DecodeOfferResponse metadata. */ + public metadata?: string | null; + + /** DecodeOfferResponse is_expired. */ + public is_expired: boolean; + + /** + * Creates a new DecodeOfferResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DecodeOfferResponse instance + */ + public static create( + properties?: api.IDecodeOfferResponse + ): api.DecodeOfferResponse; + + /** + * Encodes the specified DecodeOfferResponse message. Does not implicitly {@link api.DecodeOfferResponse.verify|verify} messages. + * @param message DecodeOfferResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IDecodeOfferResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified DecodeOfferResponse message, length delimited. Does not implicitly {@link api.DecodeOfferResponse.verify|verify} messages. + * @param message DecodeOfferResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IDecodeOfferResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a DecodeOfferResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DecodeOfferResponse + * @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 + ): api.DecodeOfferResponse; + + /** + * Decodes a DecodeOfferResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DecodeOfferResponse + * @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 + ): api.DecodeOfferResponse; + + /** + * Verifies a DecodeOfferResponse 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 DecodeOfferResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DecodeOfferResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.DecodeOfferResponse; + + /** + * Creates a plain object from a DecodeOfferResponse message. Also converts values to other types if specified. + * @param message DecodeOfferResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.DecodeOfferResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this DecodeOfferResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DecodeOfferResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SubscribeEventsRequest. */ + interface ISubscribeEventsRequest {} + + /** Represents a SubscribeEventsRequest. */ + class SubscribeEventsRequest implements ISubscribeEventsRequest { + /** + * Constructs a new SubscribeEventsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.ISubscribeEventsRequest); + + /** + * Creates a new SubscribeEventsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SubscribeEventsRequest instance + */ + public static create( + properties?: api.ISubscribeEventsRequest + ): api.SubscribeEventsRequest; + + /** + * Encodes the specified SubscribeEventsRequest message. Does not implicitly {@link api.SubscribeEventsRequest.verify|verify} messages. + * @param message SubscribeEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.ISubscribeEventsRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified SubscribeEventsRequest message, length delimited. Does not implicitly {@link api.SubscribeEventsRequest.verify|verify} messages. + * @param message SubscribeEventsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.ISubscribeEventsRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a SubscribeEventsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubscribeEventsRequest + * @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 + ): api.SubscribeEventsRequest; + + /** + * Decodes a SubscribeEventsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubscribeEventsRequest + * @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 + ): api.SubscribeEventsRequest; + + /** + * Verifies a SubscribeEventsRequest 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 SubscribeEventsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubscribeEventsRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.SubscribeEventsRequest; + + /** + * Creates a plain object from a SubscribeEventsRequest message. Also converts values to other types if specified. + * @param message SubscribeEventsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.SubscribeEventsRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this SubscribeEventsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubscribeEventsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a LightningNode */ + class LightningNode extends $protobuf.rpc.Service { + /** + * Constructs a new LightningNode service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor( + rpcImpl: $protobuf.RPCImpl, + requestDelimited?: boolean, + responseDelimited?: boolean + ); + + /** + * Creates new LightningNode service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create( + rpcImpl: $protobuf.RPCImpl, + requestDelimited?: boolean, + responseDelimited?: boolean + ): LightningNode; + + /** + * Calls GetNodeInfo. + * @param request GetNodeInfoRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GetNodeInfoResponse + */ + public getNodeInfo( + request: api.IGetNodeInfoRequest, + callback: api.LightningNode.GetNodeInfoCallback + ): void; + + /** + * Calls GetNodeInfo. + * @param request GetNodeInfoRequest message or plain object + * @returns Promise + */ + public getNodeInfo( + request: api.IGetNodeInfoRequest + ): Promise; + + /** + * Calls GetBalances. + * @param request GetBalancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GetBalancesResponse + */ + public getBalances( + request: api.IGetBalancesRequest, + callback: api.LightningNode.GetBalancesCallback + ): void; + + /** + * Calls GetBalances. + * @param request GetBalancesRequest message or plain object + * @returns Promise + */ + public getBalances( + request: api.IGetBalancesRequest + ): Promise; + + /** + * Calls OnchainReceive. + * @param request OnchainReceiveRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OnchainReceiveResponse + */ + public onchainReceive( + request: api.IOnchainReceiveRequest, + callback: api.LightningNode.OnchainReceiveCallback + ): void; + + /** + * Calls OnchainReceive. + * @param request OnchainReceiveRequest message or plain object + * @returns Promise + */ + public onchainReceive( + request: api.IOnchainReceiveRequest + ): Promise; + + /** + * Calls OnchainSend. + * @param request OnchainSendRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OnchainSendResponse + */ + public onchainSend( + request: api.IOnchainSendRequest, + callback: api.LightningNode.OnchainSendCallback + ): void; + + /** + * Calls OnchainSend. + * @param request OnchainSendRequest message or plain object + * @returns Promise + */ + public onchainSend( + request: api.IOnchainSendRequest + ): Promise; + + /** + * Calls Bolt11Receive. + * @param request Bolt11ReceiveRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Bolt11ReceiveResponse + */ + public bolt11Receive( + request: api.IBolt11ReceiveRequest, + callback: api.LightningNode.Bolt11ReceiveCallback + ): void; + + /** + * Calls Bolt11Receive. + * @param request Bolt11ReceiveRequest message or plain object + * @returns Promise + */ + public bolt11Receive( + request: api.IBolt11ReceiveRequest + ): Promise; + + /** + * Calls Bolt11ReceiveForHash. + * @param request Bolt11ReceiveForHashRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Bolt11ReceiveForHashResponse + */ + public bolt11ReceiveForHash( + request: api.IBolt11ReceiveForHashRequest, + callback: api.LightningNode.Bolt11ReceiveForHashCallback + ): void; + + /** + * Calls Bolt11ReceiveForHash. + * @param request Bolt11ReceiveForHashRequest message or plain object + * @returns Promise + */ + public bolt11ReceiveForHash( + request: api.IBolt11ReceiveForHashRequest + ): Promise; + + /** + * Calls Bolt11ClaimForHash. + * @param request Bolt11ClaimForHashRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Bolt11ClaimForHashResponse + */ + public bolt11ClaimForHash( + request: api.IBolt11ClaimForHashRequest, + callback: api.LightningNode.Bolt11ClaimForHashCallback + ): void; + + /** + * Calls Bolt11ClaimForHash. + * @param request Bolt11ClaimForHashRequest message or plain object + * @returns Promise + */ + public bolt11ClaimForHash( + request: api.IBolt11ClaimForHashRequest + ): Promise; + + /** + * Calls Bolt11FailForHash. + * @param request Bolt11FailForHashRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Bolt11FailForHashResponse + */ + public bolt11FailForHash( + request: api.IBolt11FailForHashRequest, + callback: api.LightningNode.Bolt11FailForHashCallback + ): void; + + /** + * Calls Bolt11FailForHash. + * @param request Bolt11FailForHashRequest message or plain object + * @returns Promise + */ + public bolt11FailForHash( + request: api.IBolt11FailForHashRequest + ): Promise; + + /** + * Calls Bolt11ReceiveViaJitChannel. + * @param request Bolt11ReceiveViaJitChannelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Bolt11ReceiveViaJitChannelResponse + */ + public bolt11ReceiveViaJitChannel( + request: api.IBolt11ReceiveViaJitChannelRequest, + callback: api.LightningNode.Bolt11ReceiveViaJitChannelCallback + ): void; + + /** + * Calls Bolt11ReceiveViaJitChannel. + * @param request Bolt11ReceiveViaJitChannelRequest message or plain object + * @returns Promise + */ + public bolt11ReceiveViaJitChannel( + request: api.IBolt11ReceiveViaJitChannelRequest + ): Promise; + + /** + * Calls Bolt11ReceiveVariableAmountViaJitChannel. + * @param request Bolt11ReceiveVariableAmountViaJitChannelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Bolt11ReceiveVariableAmountViaJitChannelResponse + */ + public bolt11ReceiveVariableAmountViaJitChannel( + request: api.IBolt11ReceiveVariableAmountViaJitChannelRequest, + callback: api.LightningNode.Bolt11ReceiveVariableAmountViaJitChannelCallback + ): void; + + /** + * Calls Bolt11ReceiveVariableAmountViaJitChannel. + * @param request Bolt11ReceiveVariableAmountViaJitChannelRequest message or plain object + * @returns Promise + */ + public bolt11ReceiveVariableAmountViaJitChannel( + request: api.IBolt11ReceiveVariableAmountViaJitChannelRequest + ): Promise; + + /** + * Calls Bolt11Send. + * @param request Bolt11SendRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Bolt11SendResponse + */ + public bolt11Send( + request: api.IBolt11SendRequest, + callback: api.LightningNode.Bolt11SendCallback + ): void; + + /** + * Calls Bolt11Send. + * @param request Bolt11SendRequest message or plain object + * @returns Promise + */ + public bolt11Send( + request: api.IBolt11SendRequest + ): Promise; + + /** + * Calls Bolt12Receive. + * @param request Bolt12ReceiveRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Bolt12ReceiveResponse + */ + public bolt12Receive( + request: api.IBolt12ReceiveRequest, + callback: api.LightningNode.Bolt12ReceiveCallback + ): void; + + /** + * Calls Bolt12Receive. + * @param request Bolt12ReceiveRequest message or plain object + * @returns Promise + */ + public bolt12Receive( + request: api.IBolt12ReceiveRequest + ): Promise; + + /** + * Calls Bolt12Send. + * @param request Bolt12SendRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Bolt12SendResponse + */ + public bolt12Send( + request: api.IBolt12SendRequest, + callback: api.LightningNode.Bolt12SendCallback + ): void; + + /** + * Calls Bolt12Send. + * @param request Bolt12SendRequest message or plain object + * @returns Promise + */ + public bolt12Send( + request: api.IBolt12SendRequest + ): Promise; + + /** + * Calls SpontaneousSend. + * @param request SpontaneousSendRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SpontaneousSendResponse + */ + public spontaneousSend( + request: api.ISpontaneousSendRequest, + callback: api.LightningNode.SpontaneousSendCallback + ): void; + + /** + * Calls SpontaneousSend. + * @param request SpontaneousSendRequest message or plain object + * @returns Promise + */ + public spontaneousSend( + request: api.ISpontaneousSendRequest + ): Promise; + + /** + * Calls OpenChannel. + * @param request OpenChannelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OpenChannelResponse + */ + public openChannel( + request: api.IOpenChannelRequest, + callback: api.LightningNode.OpenChannelCallback + ): void; + + /** + * Calls OpenChannel. + * @param request OpenChannelRequest message or plain object + * @returns Promise + */ + public openChannel( + request: api.IOpenChannelRequest + ): Promise; + + /** + * Calls SpliceIn. + * @param request SpliceInRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SpliceInResponse + */ + public spliceIn( + request: api.ISpliceInRequest, + callback: api.LightningNode.SpliceInCallback + ): void; + + /** + * Calls SpliceIn. + * @param request SpliceInRequest message or plain object + * @returns Promise + */ + public spliceIn( + request: api.ISpliceInRequest + ): Promise; + + /** + * Calls SpliceOut. + * @param request SpliceOutRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SpliceOutResponse + */ + public spliceOut( + request: api.ISpliceOutRequest, + callback: api.LightningNode.SpliceOutCallback + ): void; + + /** + * Calls SpliceOut. + * @param request SpliceOutRequest message or plain object + * @returns Promise + */ + public spliceOut( + request: api.ISpliceOutRequest + ): Promise; + + /** + * Calls UpdateChannelConfig. + * @param request UpdateChannelConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UpdateChannelConfigResponse + */ + public updateChannelConfig( + request: api.IUpdateChannelConfigRequest, + callback: api.LightningNode.UpdateChannelConfigCallback + ): void; + + /** + * Calls UpdateChannelConfig. + * @param request UpdateChannelConfigRequest message or plain object + * @returns Promise + */ + public updateChannelConfig( + request: api.IUpdateChannelConfigRequest + ): Promise; + + /** + * Calls CloseChannel. + * @param request CloseChannelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CloseChannelResponse + */ + public closeChannel( + request: api.ICloseChannelRequest, + callback: api.LightningNode.CloseChannelCallback + ): void; + + /** + * Calls CloseChannel. + * @param request CloseChannelRequest message or plain object + * @returns Promise + */ + public closeChannel( + request: api.ICloseChannelRequest + ): Promise; + + /** + * Calls ForceCloseChannel. + * @param request ForceCloseChannelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ForceCloseChannelResponse + */ + public forceCloseChannel( + request: api.IForceCloseChannelRequest, + callback: api.LightningNode.ForceCloseChannelCallback + ): void; + + /** + * Calls ForceCloseChannel. + * @param request ForceCloseChannelRequest message or plain object + * @returns Promise + */ + public forceCloseChannel( + request: api.IForceCloseChannelRequest + ): Promise; + + /** + * Calls ListChannels. + * @param request ListChannelsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListChannelsResponse + */ + public listChannels( + request: api.IListChannelsRequest, + callback: api.LightningNode.ListChannelsCallback + ): void; + + /** + * Calls ListChannels. + * @param request ListChannelsRequest message or plain object + * @returns Promise + */ + public listChannels( + request: api.IListChannelsRequest + ): Promise; + + /** + * Calls GetPaymentDetails. + * @param request GetPaymentDetailsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GetPaymentDetailsResponse + */ + public getPaymentDetails( + request: api.IGetPaymentDetailsRequest, + callback: api.LightningNode.GetPaymentDetailsCallback + ): void; + + /** + * Calls GetPaymentDetails. + * @param request GetPaymentDetailsRequest message or plain object + * @returns Promise + */ + public getPaymentDetails( + request: api.IGetPaymentDetailsRequest + ): Promise; + + /** + * Calls ListPayments. + * @param request ListPaymentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPaymentsResponse + */ + public listPayments( + request: api.IListPaymentsRequest, + callback: api.LightningNode.ListPaymentsCallback + ): void; + + /** + * Calls ListPayments. + * @param request ListPaymentsRequest message or plain object + * @returns Promise + */ + public listPayments( + request: api.IListPaymentsRequest + ): Promise; + + /** + * Calls ListForwardedPayments. + * @param request ListForwardedPaymentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListForwardedPaymentsResponse + */ + public listForwardedPayments( + request: api.IListForwardedPaymentsRequest, + callback: api.LightningNode.ListForwardedPaymentsCallback + ): void; + + /** + * Calls ListForwardedPayments. + * @param request ListForwardedPaymentsRequest message or plain object + * @returns Promise + */ + public listForwardedPayments( + request: api.IListForwardedPaymentsRequest + ): Promise; + + /** + * Calls ConnectPeer. + * @param request ConnectPeerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConnectPeerResponse + */ + public connectPeer( + request: api.IConnectPeerRequest, + callback: api.LightningNode.ConnectPeerCallback + ): void; + + /** + * Calls ConnectPeer. + * @param request ConnectPeerRequest message or plain object + * @returns Promise + */ + public connectPeer( + request: api.IConnectPeerRequest + ): Promise; + + /** + * Calls DisconnectPeer. + * @param request DisconnectPeerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DisconnectPeerResponse + */ + public disconnectPeer( + request: api.IDisconnectPeerRequest, + callback: api.LightningNode.DisconnectPeerCallback + ): void; + + /** + * Calls DisconnectPeer. + * @param request DisconnectPeerRequest message or plain object + * @returns Promise + */ + public disconnectPeer( + request: api.IDisconnectPeerRequest + ): Promise; + + /** + * Calls ListPeers. + * @param request ListPeersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPeersResponse + */ + public listPeers( + request: api.IListPeersRequest, + callback: api.LightningNode.ListPeersCallback + ): void; + + /** + * Calls ListPeers. + * @param request ListPeersRequest message or plain object + * @returns Promise + */ + public listPeers( + request: api.IListPeersRequest + ): Promise; + + /** + * Calls SignMessage. + * @param request SignMessageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SignMessageResponse + */ + public signMessage( + request: api.ISignMessageRequest, + callback: api.LightningNode.SignMessageCallback + ): void; + + /** + * Calls SignMessage. + * @param request SignMessageRequest message or plain object + * @returns Promise + */ + public signMessage( + request: api.ISignMessageRequest + ): Promise; + + /** + * Calls VerifySignature. + * @param request VerifySignatureRequest message or plain object + * @param callback Node-style callback called with the error, if any, and VerifySignatureResponse + */ + public verifySignature( + request: api.IVerifySignatureRequest, + callback: api.LightningNode.VerifySignatureCallback + ): void; + + /** + * Calls VerifySignature. + * @param request VerifySignatureRequest message or plain object + * @returns Promise + */ + public verifySignature( + request: api.IVerifySignatureRequest + ): Promise; + + /** + * Calls ExportPathfindingScores. + * @param request ExportPathfindingScoresRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExportPathfindingScoresResponse + */ + public exportPathfindingScores( + request: api.IExportPathfindingScoresRequest, + callback: api.LightningNode.ExportPathfindingScoresCallback + ): void; + + /** + * Calls ExportPathfindingScores. + * @param request ExportPathfindingScoresRequest message or plain object + * @returns Promise + */ + public exportPathfindingScores( + request: api.IExportPathfindingScoresRequest + ): Promise; + + /** + * Calls UnifiedSend. + * @param request UnifiedSendRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UnifiedSendResponse + */ + public unifiedSend( + request: api.IUnifiedSendRequest, + callback: api.LightningNode.UnifiedSendCallback + ): void; + + /** + * Calls UnifiedSend. + * @param request UnifiedSendRequest message or plain object + * @returns Promise + */ + public unifiedSend( + request: api.IUnifiedSendRequest + ): Promise; + + /** + * Calls DecodeInvoice. + * @param request DecodeInvoiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DecodeInvoiceResponse + */ + public decodeInvoice( + request: api.IDecodeInvoiceRequest, + callback: api.LightningNode.DecodeInvoiceCallback + ): void; + + /** + * Calls DecodeInvoice. + * @param request DecodeInvoiceRequest message or plain object + * @returns Promise + */ + public decodeInvoice( + request: api.IDecodeInvoiceRequest + ): Promise; + + /** + * Calls DecodeOffer. + * @param request DecodeOfferRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DecodeOfferResponse + */ + public decodeOffer( + request: api.IDecodeOfferRequest, + callback: api.LightningNode.DecodeOfferCallback + ): void; + + /** + * Calls DecodeOffer. + * @param request DecodeOfferRequest message or plain object + * @returns Promise + */ + public decodeOffer( + request: api.IDecodeOfferRequest + ): Promise; + + /** + * Calls GraphListChannels. + * @param request GraphListChannelsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GraphListChannelsResponse + */ + public graphListChannels( + request: api.IGraphListChannelsRequest, + callback: api.LightningNode.GraphListChannelsCallback + ): void; + + /** + * Calls GraphListChannels. + * @param request GraphListChannelsRequest message or plain object + * @returns Promise + */ + public graphListChannels( + request: api.IGraphListChannelsRequest + ): Promise; + + /** + * Calls GraphGetChannel. + * @param request GraphGetChannelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GraphGetChannelResponse + */ + public graphGetChannel( + request: api.IGraphGetChannelRequest, + callback: api.LightningNode.GraphGetChannelCallback + ): void; + + /** + * Calls GraphGetChannel. + * @param request GraphGetChannelRequest message or plain object + * @returns Promise + */ + public graphGetChannel( + request: api.IGraphGetChannelRequest + ): Promise; + + /** + * Calls GraphListNodes. + * @param request GraphListNodesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GraphListNodesResponse + */ + public graphListNodes( + request: api.IGraphListNodesRequest, + callback: api.LightningNode.GraphListNodesCallback + ): void; + + /** + * Calls GraphListNodes. + * @param request GraphListNodesRequest message or plain object + * @returns Promise + */ + public graphListNodes( + request: api.IGraphListNodesRequest + ): Promise; + + /** + * Calls GraphGetNode. + * @param request GraphGetNodeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GraphGetNodeResponse + */ + public graphGetNode( + request: api.IGraphGetNodeRequest, + callback: api.LightningNode.GraphGetNodeCallback + ): void; + + /** + * Calls GraphGetNode. + * @param request GraphGetNodeRequest message or plain object + * @returns Promise + */ + public graphGetNode( + request: api.IGraphGetNodeRequest + ): Promise; + + /** + * Calls SubscribeEvents. + * @param request SubscribeEventsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EventEnvelope + */ + public subscribeEvents( + request: api.ISubscribeEventsRequest, + callback: api.LightningNode.SubscribeEventsCallback + ): void; + + /** + * Calls SubscribeEvents. + * @param request SubscribeEventsRequest message or plain object + * @returns Promise + */ + public subscribeEvents( + request: api.ISubscribeEventsRequest + ): Promise; + } + + namespace LightningNode { + /** + * Callback as used by {@link api.LightningNode#getNodeInfo}. + * @param error Error, if any + * @param [response] GetNodeInfoResponse + */ + type GetNodeInfoCallback = ( + error: Error | null, + response?: api.GetNodeInfoResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#getBalances}. + * @param error Error, if any + * @param [response] GetBalancesResponse + */ + type GetBalancesCallback = ( + error: Error | null, + response?: api.GetBalancesResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#onchainReceive}. + * @param error Error, if any + * @param [response] OnchainReceiveResponse + */ + type OnchainReceiveCallback = ( + error: Error | null, + response?: api.OnchainReceiveResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#onchainSend}. + * @param error Error, if any + * @param [response] OnchainSendResponse + */ + type OnchainSendCallback = ( + error: Error | null, + response?: api.OnchainSendResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#bolt11Receive}. + * @param error Error, if any + * @param [response] Bolt11ReceiveResponse + */ + type Bolt11ReceiveCallback = ( + error: Error | null, + response?: api.Bolt11ReceiveResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#bolt11ReceiveForHash}. + * @param error Error, if any + * @param [response] Bolt11ReceiveForHashResponse + */ + type Bolt11ReceiveForHashCallback = ( + error: Error | null, + response?: api.Bolt11ReceiveForHashResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#bolt11ClaimForHash}. + * @param error Error, if any + * @param [response] Bolt11ClaimForHashResponse + */ + type Bolt11ClaimForHashCallback = ( + error: Error | null, + response?: api.Bolt11ClaimForHashResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#bolt11FailForHash}. + * @param error Error, if any + * @param [response] Bolt11FailForHashResponse + */ + type Bolt11FailForHashCallback = ( + error: Error | null, + response?: api.Bolt11FailForHashResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#bolt11ReceiveViaJitChannel}. + * @param error Error, if any + * @param [response] Bolt11ReceiveViaJitChannelResponse + */ + type Bolt11ReceiveViaJitChannelCallback = ( + error: Error | null, + response?: api.Bolt11ReceiveViaJitChannelResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#bolt11ReceiveVariableAmountViaJitChannel}. + * @param error Error, if any + * @param [response] Bolt11ReceiveVariableAmountViaJitChannelResponse + */ + type Bolt11ReceiveVariableAmountViaJitChannelCallback = ( + error: Error | null, + response?: api.Bolt11ReceiveVariableAmountViaJitChannelResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#bolt11Send}. + * @param error Error, if any + * @param [response] Bolt11SendResponse + */ + type Bolt11SendCallback = ( + error: Error | null, + response?: api.Bolt11SendResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#bolt12Receive}. + * @param error Error, if any + * @param [response] Bolt12ReceiveResponse + */ + type Bolt12ReceiveCallback = ( + error: Error | null, + response?: api.Bolt12ReceiveResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#bolt12Send}. + * @param error Error, if any + * @param [response] Bolt12SendResponse + */ + type Bolt12SendCallback = ( + error: Error | null, + response?: api.Bolt12SendResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#spontaneousSend}. + * @param error Error, if any + * @param [response] SpontaneousSendResponse + */ + type SpontaneousSendCallback = ( + error: Error | null, + response?: api.SpontaneousSendResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#openChannel}. + * @param error Error, if any + * @param [response] OpenChannelResponse + */ + type OpenChannelCallback = ( + error: Error | null, + response?: api.OpenChannelResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#spliceIn}. + * @param error Error, if any + * @param [response] SpliceInResponse + */ + type SpliceInCallback = ( + error: Error | null, + response?: api.SpliceInResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#spliceOut}. + * @param error Error, if any + * @param [response] SpliceOutResponse + */ + type SpliceOutCallback = ( + error: Error | null, + response?: api.SpliceOutResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#updateChannelConfig}. + * @param error Error, if any + * @param [response] UpdateChannelConfigResponse + */ + type UpdateChannelConfigCallback = ( + error: Error | null, + response?: api.UpdateChannelConfigResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#closeChannel}. + * @param error Error, if any + * @param [response] CloseChannelResponse + */ + type CloseChannelCallback = ( + error: Error | null, + response?: api.CloseChannelResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#forceCloseChannel}. + * @param error Error, if any + * @param [response] ForceCloseChannelResponse + */ + type ForceCloseChannelCallback = ( + error: Error | null, + response?: api.ForceCloseChannelResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#listChannels}. + * @param error Error, if any + * @param [response] ListChannelsResponse + */ + type ListChannelsCallback = ( + error: Error | null, + response?: api.ListChannelsResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#getPaymentDetails}. + * @param error Error, if any + * @param [response] GetPaymentDetailsResponse + */ + type GetPaymentDetailsCallback = ( + error: Error | null, + response?: api.GetPaymentDetailsResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#listPayments}. + * @param error Error, if any + * @param [response] ListPaymentsResponse + */ + type ListPaymentsCallback = ( + error: Error | null, + response?: api.ListPaymentsResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#listForwardedPayments}. + * @param error Error, if any + * @param [response] ListForwardedPaymentsResponse + */ + type ListForwardedPaymentsCallback = ( + error: Error | null, + response?: api.ListForwardedPaymentsResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#connectPeer}. + * @param error Error, if any + * @param [response] ConnectPeerResponse + */ + type ConnectPeerCallback = ( + error: Error | null, + response?: api.ConnectPeerResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#disconnectPeer}. + * @param error Error, if any + * @param [response] DisconnectPeerResponse + */ + type DisconnectPeerCallback = ( + error: Error | null, + response?: api.DisconnectPeerResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#listPeers}. + * @param error Error, if any + * @param [response] ListPeersResponse + */ + type ListPeersCallback = ( + error: Error | null, + response?: api.ListPeersResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#signMessage}. + * @param error Error, if any + * @param [response] SignMessageResponse + */ + type SignMessageCallback = ( + error: Error | null, + response?: api.SignMessageResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#verifySignature}. + * @param error Error, if any + * @param [response] VerifySignatureResponse + */ + type VerifySignatureCallback = ( + error: Error | null, + response?: api.VerifySignatureResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#exportPathfindingScores}. + * @param error Error, if any + * @param [response] ExportPathfindingScoresResponse + */ + type ExportPathfindingScoresCallback = ( + error: Error | null, + response?: api.ExportPathfindingScoresResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#unifiedSend}. + * @param error Error, if any + * @param [response] UnifiedSendResponse + */ + type UnifiedSendCallback = ( + error: Error | null, + response?: api.UnifiedSendResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#decodeInvoice}. + * @param error Error, if any + * @param [response] DecodeInvoiceResponse + */ + type DecodeInvoiceCallback = ( + error: Error | null, + response?: api.DecodeInvoiceResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#decodeOffer}. + * @param error Error, if any + * @param [response] DecodeOfferResponse + */ + type DecodeOfferCallback = ( + error: Error | null, + response?: api.DecodeOfferResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#graphListChannels}. + * @param error Error, if any + * @param [response] GraphListChannelsResponse + */ + type GraphListChannelsCallback = ( + error: Error | null, + response?: api.GraphListChannelsResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#graphGetChannel}. + * @param error Error, if any + * @param [response] GraphGetChannelResponse + */ + type GraphGetChannelCallback = ( + error: Error | null, + response?: api.GraphGetChannelResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#graphListNodes}. + * @param error Error, if any + * @param [response] GraphListNodesResponse + */ + type GraphListNodesCallback = ( + error: Error | null, + response?: api.GraphListNodesResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#graphGetNode}. + * @param error Error, if any + * @param [response] GraphGetNodeResponse + */ + type GraphGetNodeCallback = ( + error: Error | null, + response?: api.GraphGetNodeResponse + ) => void; + + /** + * Callback as used by {@link api.LightningNode#subscribeEvents}. + * @param error Error, if any + * @param [response] EventEnvelope + */ + type SubscribeEventsCallback = ( + error: Error | null, + response?: events.EventEnvelope + ) => void; + } +} + +/** Namespace types. */ +export namespace types { + /** Properties of a Payment. */ + interface IPayment { + /** Payment id */ + id?: string | null; + + /** Payment kind */ + kind?: types.IPaymentKind | null; + + /** Payment amount_msat */ + amount_msat?: Long | null; + + /** Payment fee_paid_msat */ + fee_paid_msat?: Long | null; + + /** Payment direction */ + direction?: types.PaymentDirection | null; + + /** Payment status */ + status?: types.PaymentStatus | null; + + /** Payment latest_update_timestamp */ + latest_update_timestamp?: Long | null; + } + + /** Represents a Payment. */ + class Payment implements IPayment { + /** + * Constructs a new Payment. + * @param [properties] Properties to set + */ + constructor(properties?: types.IPayment); + + /** Payment id. */ + public id: string; + + /** Payment kind. */ + public kind?: types.IPaymentKind | null; + + /** Payment amount_msat. */ + public amount_msat?: Long | null; + + /** Payment fee_paid_msat. */ + public fee_paid_msat?: Long | null; + + /** Payment direction. */ + public direction: types.PaymentDirection; + + /** Payment status. */ + public status: types.PaymentStatus; + + /** Payment latest_update_timestamp. */ + public latest_update_timestamp: Long; + + /** + * Creates a new Payment instance using the specified properties. + * @param [properties] Properties to set + * @returns Payment instance + */ + public static create(properties?: types.IPayment): types.Payment; + + /** + * Encodes the specified Payment message. Does not implicitly {@link types.Payment.verify|verify} messages. + * @param message Payment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IPayment, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Payment message, length delimited. Does not implicitly {@link types.Payment.verify|verify} messages. + * @param message Payment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IPayment, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Payment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Payment + * @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 + ): types.Payment; + + /** + * Decodes a Payment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Payment + * @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 + ): types.Payment; + + /** + * Verifies a Payment 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 Payment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Payment + */ + public static fromObject(object: { [k: string]: any }): types.Payment; + + /** + * Creates a plain object from a Payment message. Also converts values to other types if specified. + * @param message Payment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Payment, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Payment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Payment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PaymentKind. */ + interface IPaymentKind { + /** PaymentKind onchain */ + onchain?: types.IOnchain | null; + + /** PaymentKind bolt11 */ + bolt11?: types.IBolt11 | null; + + /** PaymentKind bolt11_jit */ + bolt11_jit?: types.IBolt11Jit | null; + + /** PaymentKind bolt12_offer */ + bolt12_offer?: types.IBolt12Offer | null; + + /** PaymentKind bolt12_refund */ + bolt12_refund?: types.IBolt12Refund | null; + + /** PaymentKind spontaneous */ + spontaneous?: types.ISpontaneous | null; + } + + /** Represents a PaymentKind. */ + class PaymentKind implements IPaymentKind { + /** + * Constructs a new PaymentKind. + * @param [properties] Properties to set + */ + constructor(properties?: types.IPaymentKind); + + /** PaymentKind onchain. */ + public onchain?: types.IOnchain | null; + + /** PaymentKind bolt11. */ + public bolt11?: types.IBolt11 | null; + + /** PaymentKind bolt11_jit. */ + public bolt11_jit?: types.IBolt11Jit | null; + + /** PaymentKind bolt12_offer. */ + public bolt12_offer?: types.IBolt12Offer | null; + + /** PaymentKind bolt12_refund. */ + public bolt12_refund?: types.IBolt12Refund | null; + + /** PaymentKind spontaneous. */ + public spontaneous?: types.ISpontaneous | null; + + /** PaymentKind kind. */ + public kind?: + | 'onchain' + | 'bolt11' + | 'bolt11_jit' + | 'bolt12_offer' + | 'bolt12_refund' + | 'spontaneous'; + + /** + * Creates a new PaymentKind instance using the specified properties. + * @param [properties] Properties to set + * @returns PaymentKind instance + */ + public static create( + properties?: types.IPaymentKind + ): types.PaymentKind; + + /** + * Encodes the specified PaymentKind message. Does not implicitly {@link types.PaymentKind.verify|verify} messages. + * @param message PaymentKind message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IPaymentKind, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified PaymentKind message, length delimited. Does not implicitly {@link types.PaymentKind.verify|verify} messages. + * @param message PaymentKind message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IPaymentKind, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a PaymentKind message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PaymentKind + * @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 + ): types.PaymentKind; + + /** + * Decodes a PaymentKind message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PaymentKind + * @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 + ): types.PaymentKind; + + /** + * Verifies a PaymentKind 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 PaymentKind message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PaymentKind + */ + public static fromObject(object: { + [k: string]: any; + }): types.PaymentKind; + + /** + * Creates a plain object from a PaymentKind message. Also converts values to other types if specified. + * @param message PaymentKind + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.PaymentKind, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this PaymentKind to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PaymentKind + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Onchain. */ + interface IOnchain { + /** Onchain txid */ + txid?: string | null; + + /** Onchain status */ + status?: types.IConfirmationStatus | null; + } + + /** Represents an Onchain. */ + class Onchain implements IOnchain { + /** + * Constructs a new Onchain. + * @param [properties] Properties to set + */ + constructor(properties?: types.IOnchain); + + /** Onchain txid. */ + public txid: string; + + /** Onchain status. */ + public status?: types.IConfirmationStatus | null; + + /** + * Creates a new Onchain instance using the specified properties. + * @param [properties] Properties to set + * @returns Onchain instance + */ + public static create(properties?: types.IOnchain): types.Onchain; + + /** + * Encodes the specified Onchain message. Does not implicitly {@link types.Onchain.verify|verify} messages. + * @param message Onchain message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IOnchain, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Onchain message, length delimited. Does not implicitly {@link types.Onchain.verify|verify} messages. + * @param message Onchain message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IOnchain, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an Onchain message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Onchain + * @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 + ): types.Onchain; + + /** + * Decodes an Onchain message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Onchain + * @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 + ): types.Onchain; + + /** + * Verifies an Onchain 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 Onchain message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Onchain + */ + public static fromObject(object: { [k: string]: any }): types.Onchain; + + /** + * Creates a plain object from an Onchain message. Also converts values to other types if specified. + * @param message Onchain + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Onchain, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Onchain to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Onchain + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConfirmationStatus. */ + interface IConfirmationStatus { + /** ConfirmationStatus confirmed */ + confirmed?: types.IConfirmed | null; + + /** ConfirmationStatus unconfirmed */ + unconfirmed?: types.IUnconfirmed | null; + } + + /** Represents a ConfirmationStatus. */ + class ConfirmationStatus implements IConfirmationStatus { + /** + * Constructs a new ConfirmationStatus. + * @param [properties] Properties to set + */ + constructor(properties?: types.IConfirmationStatus); + + /** ConfirmationStatus confirmed. */ + public confirmed?: types.IConfirmed | null; + + /** ConfirmationStatus unconfirmed. */ + public unconfirmed?: types.IUnconfirmed | null; + + /** ConfirmationStatus status. */ + public status?: 'confirmed' | 'unconfirmed'; + + /** + * Creates a new ConfirmationStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfirmationStatus instance + */ + public static create( + properties?: types.IConfirmationStatus + ): types.ConfirmationStatus; + + /** + * Encodes the specified ConfirmationStatus message. Does not implicitly {@link types.ConfirmationStatus.verify|verify} messages. + * @param message ConfirmationStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IConfirmationStatus, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ConfirmationStatus message, length delimited. Does not implicitly {@link types.ConfirmationStatus.verify|verify} messages. + * @param message ConfirmationStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IConfirmationStatus, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ConfirmationStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfirmationStatus + * @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 + ): types.ConfirmationStatus; + + /** + * Decodes a ConfirmationStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfirmationStatus + * @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 + ): types.ConfirmationStatus; + + /** + * Verifies a ConfirmationStatus 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 ConfirmationStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfirmationStatus + */ + public static fromObject(object: { + [k: string]: any; + }): types.ConfirmationStatus; + + /** + * Creates a plain object from a ConfirmationStatus message. Also converts values to other types if specified. + * @param message ConfirmationStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.ConfirmationStatus, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ConfirmationStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfirmationStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Confirmed. */ + interface IConfirmed { + /** Confirmed block_hash */ + block_hash?: string | null; + + /** Confirmed height */ + height?: number | null; + + /** Confirmed timestamp */ + timestamp?: Long | null; + } + + /** Represents a Confirmed. */ + class Confirmed implements IConfirmed { + /** + * Constructs a new Confirmed. + * @param [properties] Properties to set + */ + constructor(properties?: types.IConfirmed); + + /** Confirmed block_hash. */ + public block_hash: string; + + /** Confirmed height. */ + public height: number; + + /** Confirmed timestamp. */ + public timestamp: Long; + + /** + * Creates a new Confirmed instance using the specified properties. + * @param [properties] Properties to set + * @returns Confirmed instance + */ + public static create(properties?: types.IConfirmed): types.Confirmed; + + /** + * Encodes the specified Confirmed message. Does not implicitly {@link types.Confirmed.verify|verify} messages. + * @param message Confirmed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IConfirmed, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Confirmed message, length delimited. Does not implicitly {@link types.Confirmed.verify|verify} messages. + * @param message Confirmed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IConfirmed, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Confirmed message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Confirmed + * @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 + ): types.Confirmed; + + /** + * Decodes a Confirmed message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Confirmed + * @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 + ): types.Confirmed; + + /** + * Verifies a Confirmed 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 Confirmed message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Confirmed + */ + public static fromObject(object: { [k: string]: any }): types.Confirmed; + + /** + * Creates a plain object from a Confirmed message. Also converts values to other types if specified. + * @param message Confirmed + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Confirmed, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Confirmed to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Confirmed + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Unconfirmed. */ + interface IUnconfirmed {} + + /** Represents an Unconfirmed. */ + class Unconfirmed implements IUnconfirmed { + /** + * Constructs a new Unconfirmed. + * @param [properties] Properties to set + */ + constructor(properties?: types.IUnconfirmed); + + /** + * Creates a new Unconfirmed instance using the specified properties. + * @param [properties] Properties to set + * @returns Unconfirmed instance + */ + public static create( + properties?: types.IUnconfirmed + ): types.Unconfirmed; + + /** + * Encodes the specified Unconfirmed message. Does not implicitly {@link types.Unconfirmed.verify|verify} messages. + * @param message Unconfirmed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IUnconfirmed, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Unconfirmed message, length delimited. Does not implicitly {@link types.Unconfirmed.verify|verify} messages. + * @param message Unconfirmed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IUnconfirmed, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an Unconfirmed message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Unconfirmed + * @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 + ): types.Unconfirmed; + + /** + * Decodes an Unconfirmed message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Unconfirmed + * @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 + ): types.Unconfirmed; + + /** + * Verifies an Unconfirmed 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 Unconfirmed message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Unconfirmed + */ + public static fromObject(object: { + [k: string]: any; + }): types.Unconfirmed; + + /** + * Creates a plain object from an Unconfirmed message. Also converts values to other types if specified. + * @param message Unconfirmed + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Unconfirmed, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Unconfirmed to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Unconfirmed + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11. */ + interface IBolt11 { + /** Bolt11 hash */ + hash?: string | null; + + /** Bolt11 preimage */ + preimage?: string | null; + + /** Bolt11 secret */ + secret?: Uint8Array | null; + } + + /** Represents a Bolt11. */ + class Bolt11 implements IBolt11 { + /** + * Constructs a new Bolt11. + * @param [properties] Properties to set + */ + constructor(properties?: types.IBolt11); + + /** Bolt11 hash. */ + public hash: string; + + /** Bolt11 preimage. */ + public preimage?: string | null; + + /** Bolt11 secret. */ + public secret?: Uint8Array | null; + + /** + * Creates a new Bolt11 instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11 instance + */ + public static create(properties?: types.IBolt11): types.Bolt11; + + /** + * Encodes the specified Bolt11 message. Does not implicitly {@link types.Bolt11.verify|verify} messages. + * @param message Bolt11 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IBolt11, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11 message, length delimited. Does not implicitly {@link types.Bolt11.verify|verify} messages. + * @param message Bolt11 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IBolt11, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11 + * @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 + ): types.Bolt11; + + /** + * Decodes a Bolt11 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11 + * @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 + ): types.Bolt11; + + /** + * Verifies a Bolt11 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 Bolt11 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11 + */ + public static fromObject(object: { [k: string]: any }): types.Bolt11; + + /** + * Creates a plain object from a Bolt11 message. Also converts values to other types if specified. + * @param message Bolt11 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Bolt11, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11Jit. */ + interface IBolt11Jit { + /** Bolt11Jit hash */ + hash?: string | null; + + /** Bolt11Jit preimage */ + preimage?: string | null; + + /** Bolt11Jit secret */ + secret?: Uint8Array | null; + + /** Bolt11Jit lsp_fee_limits */ + lsp_fee_limits?: types.ILSPFeeLimits | null; + + /** Bolt11Jit counterparty_skimmed_fee_msat */ + counterparty_skimmed_fee_msat?: Long | null; + } + + /** Represents a Bolt11Jit. */ + class Bolt11Jit implements IBolt11Jit { + /** + * Constructs a new Bolt11Jit. + * @param [properties] Properties to set + */ + constructor(properties?: types.IBolt11Jit); + + /** Bolt11Jit hash. */ + public hash: string; + + /** Bolt11Jit preimage. */ + public preimage?: string | null; + + /** Bolt11Jit secret. */ + public secret?: Uint8Array | null; + + /** Bolt11Jit lsp_fee_limits. */ + public lsp_fee_limits?: types.ILSPFeeLimits | null; + + /** Bolt11Jit counterparty_skimmed_fee_msat. */ + public counterparty_skimmed_fee_msat?: Long | null; + + /** + * Creates a new Bolt11Jit instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11Jit instance + */ + public static create(properties?: types.IBolt11Jit): types.Bolt11Jit; + + /** + * Encodes the specified Bolt11Jit message. Does not implicitly {@link types.Bolt11Jit.verify|verify} messages. + * @param message Bolt11Jit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IBolt11Jit, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11Jit message, length delimited. Does not implicitly {@link types.Bolt11Jit.verify|verify} messages. + * @param message Bolt11Jit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IBolt11Jit, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11Jit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11Jit + * @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 + ): types.Bolt11Jit; + + /** + * Decodes a Bolt11Jit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11Jit + * @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 + ): types.Bolt11Jit; + + /** + * Verifies a Bolt11Jit 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 Bolt11Jit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11Jit + */ + public static fromObject(object: { [k: string]: any }): types.Bolt11Jit; + + /** + * Creates a plain object from a Bolt11Jit message. Also converts values to other types if specified. + * @param message Bolt11Jit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Bolt11Jit, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11Jit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11Jit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt12Offer. */ + interface IBolt12Offer { + /** Bolt12Offer hash */ + hash?: string | null; + + /** Bolt12Offer preimage */ + preimage?: string | null; + + /** Bolt12Offer secret */ + secret?: Uint8Array | null; + + /** Bolt12Offer offer_id */ + offer_id?: string | null; + + /** Bolt12Offer payer_note */ + payer_note?: string | null; + + /** Bolt12Offer quantity */ + quantity?: Long | null; + } + + /** Represents a Bolt12Offer. */ + class Bolt12Offer implements IBolt12Offer { + /** + * Constructs a new Bolt12Offer. + * @param [properties] Properties to set + */ + constructor(properties?: types.IBolt12Offer); + + /** Bolt12Offer hash. */ + public hash?: string | null; + + /** Bolt12Offer preimage. */ + public preimage?: string | null; + + /** Bolt12Offer secret. */ + public secret?: Uint8Array | null; + + /** Bolt12Offer offer_id. */ + public offer_id: string; + + /** Bolt12Offer payer_note. */ + public payer_note?: string | null; + + /** Bolt12Offer quantity. */ + public quantity?: Long | null; + + /** + * Creates a new Bolt12Offer instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt12Offer instance + */ + public static create( + properties?: types.IBolt12Offer + ): types.Bolt12Offer; + + /** + * Encodes the specified Bolt12Offer message. Does not implicitly {@link types.Bolt12Offer.verify|verify} messages. + * @param message Bolt12Offer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IBolt12Offer, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt12Offer message, length delimited. Does not implicitly {@link types.Bolt12Offer.verify|verify} messages. + * @param message Bolt12Offer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IBolt12Offer, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt12Offer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt12Offer + * @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 + ): types.Bolt12Offer; + + /** + * Decodes a Bolt12Offer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt12Offer + * @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 + ): types.Bolt12Offer; + + /** + * Verifies a Bolt12Offer 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 Bolt12Offer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt12Offer + */ + public static fromObject(object: { + [k: string]: any; + }): types.Bolt12Offer; + + /** + * Creates a plain object from a Bolt12Offer message. Also converts values to other types if specified. + * @param message Bolt12Offer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Bolt12Offer, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt12Offer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt12Offer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt12Refund. */ + interface IBolt12Refund { + /** Bolt12Refund hash */ + hash?: string | null; + + /** Bolt12Refund preimage */ + preimage?: string | null; + + /** Bolt12Refund secret */ + secret?: Uint8Array | null; + + /** Bolt12Refund payer_note */ + payer_note?: string | null; + + /** Bolt12Refund quantity */ + quantity?: Long | null; + } + + /** Represents a Bolt12Refund. */ + class Bolt12Refund implements IBolt12Refund { + /** + * Constructs a new Bolt12Refund. + * @param [properties] Properties to set + */ + constructor(properties?: types.IBolt12Refund); + + /** Bolt12Refund hash. */ + public hash?: string | null; + + /** Bolt12Refund preimage. */ + public preimage?: string | null; + + /** Bolt12Refund secret. */ + public secret?: Uint8Array | null; + + /** Bolt12Refund payer_note. */ + public payer_note?: string | null; + + /** Bolt12Refund quantity. */ + public quantity?: Long | null; + + /** + * Creates a new Bolt12Refund instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt12Refund instance + */ + public static create( + properties?: types.IBolt12Refund + ): types.Bolt12Refund; + + /** + * Encodes the specified Bolt12Refund message. Does not implicitly {@link types.Bolt12Refund.verify|verify} messages. + * @param message Bolt12Refund message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IBolt12Refund, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt12Refund message, length delimited. Does not implicitly {@link types.Bolt12Refund.verify|verify} messages. + * @param message Bolt12Refund message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IBolt12Refund, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt12Refund message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt12Refund + * @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 + ): types.Bolt12Refund; + + /** + * Decodes a Bolt12Refund message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt12Refund + * @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 + ): types.Bolt12Refund; + + /** + * Verifies a Bolt12Refund 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 Bolt12Refund message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt12Refund + */ + public static fromObject(object: { + [k: string]: any; + }): types.Bolt12Refund; + + /** + * Creates a plain object from a Bolt12Refund message. Also converts values to other types if specified. + * @param message Bolt12Refund + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Bolt12Refund, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt12Refund to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt12Refund + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Spontaneous. */ + interface ISpontaneous { + /** Spontaneous hash */ + hash?: string | null; + + /** Spontaneous preimage */ + preimage?: string | null; + } + + /** Represents a Spontaneous. */ + class Spontaneous implements ISpontaneous { + /** + * Constructs a new Spontaneous. + * @param [properties] Properties to set + */ + constructor(properties?: types.ISpontaneous); + + /** Spontaneous hash. */ + public hash: string; + + /** Spontaneous preimage. */ + public preimage?: string | null; + + /** + * Creates a new Spontaneous instance using the specified properties. + * @param [properties] Properties to set + * @returns Spontaneous instance + */ + public static create( + properties?: types.ISpontaneous + ): types.Spontaneous; + + /** + * Encodes the specified Spontaneous message. Does not implicitly {@link types.Spontaneous.verify|verify} messages. + * @param message Spontaneous message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.ISpontaneous, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Spontaneous message, length delimited. Does not implicitly {@link types.Spontaneous.verify|verify} messages. + * @param message Spontaneous message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.ISpontaneous, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Spontaneous message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Spontaneous + * @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 + ): types.Spontaneous; + + /** + * Decodes a Spontaneous message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Spontaneous + * @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 + ): types.Spontaneous; + + /** + * Verifies a Spontaneous 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 Spontaneous message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Spontaneous + */ + public static fromObject(object: { + [k: string]: any; + }): types.Spontaneous; + + /** + * Creates a plain object from a Spontaneous message. Also converts values to other types if specified. + * @param message Spontaneous + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Spontaneous, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Spontaneous to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Spontaneous + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LSPFeeLimits. */ + interface ILSPFeeLimits { + /** LSPFeeLimits max_total_opening_fee_msat */ + max_total_opening_fee_msat?: Long | null; + + /** LSPFeeLimits max_proportional_opening_fee_ppm_msat */ + max_proportional_opening_fee_ppm_msat?: Long | null; + } + + /** Represents a LSPFeeLimits. */ + class LSPFeeLimits implements ILSPFeeLimits { + /** + * Constructs a new LSPFeeLimits. + * @param [properties] Properties to set + */ + constructor(properties?: types.ILSPFeeLimits); + + /** LSPFeeLimits max_total_opening_fee_msat. */ + public max_total_opening_fee_msat?: Long | null; + + /** LSPFeeLimits max_proportional_opening_fee_ppm_msat. */ + public max_proportional_opening_fee_ppm_msat?: Long | null; + + /** + * Creates a new LSPFeeLimits instance using the specified properties. + * @param [properties] Properties to set + * @returns LSPFeeLimits instance + */ + public static create( + properties?: types.ILSPFeeLimits + ): types.LSPFeeLimits; + + /** + * Encodes the specified LSPFeeLimits message. Does not implicitly {@link types.LSPFeeLimits.verify|verify} messages. + * @param message LSPFeeLimits message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.ILSPFeeLimits, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified LSPFeeLimits message, length delimited. Does not implicitly {@link types.LSPFeeLimits.verify|verify} messages. + * @param message LSPFeeLimits message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.ILSPFeeLimits, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a LSPFeeLimits message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LSPFeeLimits + * @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 + ): types.LSPFeeLimits; + + /** + * Decodes a LSPFeeLimits message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LSPFeeLimits + * @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 + ): types.LSPFeeLimits; + + /** + * Verifies a LSPFeeLimits 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 LSPFeeLimits message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LSPFeeLimits + */ + public static fromObject(object: { + [k: string]: any; + }): types.LSPFeeLimits; + + /** + * Creates a plain object from a LSPFeeLimits message. Also converts values to other types if specified. + * @param message LSPFeeLimits + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.LSPFeeLimits, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this LSPFeeLimits to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LSPFeeLimits + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** PaymentDirection enum. */ + enum PaymentDirection { + INBOUND = 0, + OUTBOUND = 1 + } + + /** PaymentStatus enum. */ + enum PaymentStatus { + PENDING = 0, + SUCCEEDED = 1, + FAILED = 2 + } + + /** Network enum. */ + enum Network { + BITCOIN = 0, + TESTNET = 1, + TESTNET4 = 2, + SIGNET = 3, + REGTEST = 4 + } + + /** Properties of a ForwardedPayment. */ + interface IForwardedPayment { + /** ForwardedPayment prev_channel_id */ + prev_channel_id?: string | null; + + /** ForwardedPayment next_channel_id */ + next_channel_id?: string | null; + + /** ForwardedPayment prev_user_channel_id */ + prev_user_channel_id?: string | null; + + /** ForwardedPayment prev_node_id */ + prev_node_id?: string | null; + + /** ForwardedPayment next_node_id */ + next_node_id?: string | null; + + /** ForwardedPayment next_user_channel_id */ + next_user_channel_id?: string | null; + + /** ForwardedPayment total_fee_earned_msat */ + total_fee_earned_msat?: Long | null; + + /** ForwardedPayment skimmed_fee_msat */ + skimmed_fee_msat?: Long | null; + + /** ForwardedPayment claim_from_onchain_tx */ + claim_from_onchain_tx?: boolean | null; + + /** ForwardedPayment outbound_amount_forwarded_msat */ + outbound_amount_forwarded_msat?: Long | null; + } + + /** Represents a ForwardedPayment. */ + class ForwardedPayment implements IForwardedPayment { + /** + * Constructs a new ForwardedPayment. + * @param [properties] Properties to set + */ + constructor(properties?: types.IForwardedPayment); + + /** ForwardedPayment prev_channel_id. */ + public prev_channel_id: string; + + /** ForwardedPayment next_channel_id. */ + public next_channel_id: string; + + /** ForwardedPayment prev_user_channel_id. */ + public prev_user_channel_id: string; + + /** ForwardedPayment prev_node_id. */ + public prev_node_id: string; + + /** ForwardedPayment next_node_id. */ + public next_node_id: string; + + /** ForwardedPayment next_user_channel_id. */ + public next_user_channel_id?: string | null; + + /** ForwardedPayment total_fee_earned_msat. */ + public total_fee_earned_msat?: Long | null; + + /** ForwardedPayment skimmed_fee_msat. */ + public skimmed_fee_msat?: Long | null; + + /** ForwardedPayment claim_from_onchain_tx. */ + public claim_from_onchain_tx: boolean; + + /** ForwardedPayment outbound_amount_forwarded_msat. */ + public outbound_amount_forwarded_msat?: Long | null; + + /** + * Creates a new ForwardedPayment instance using the specified properties. + * @param [properties] Properties to set + * @returns ForwardedPayment instance + */ + public static create( + properties?: types.IForwardedPayment + ): types.ForwardedPayment; + + /** + * Encodes the specified ForwardedPayment message. Does not implicitly {@link types.ForwardedPayment.verify|verify} messages. + * @param message ForwardedPayment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IForwardedPayment, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ForwardedPayment message, length delimited. Does not implicitly {@link types.ForwardedPayment.verify|verify} messages. + * @param message ForwardedPayment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IForwardedPayment, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ForwardedPayment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForwardedPayment + * @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 + ): types.ForwardedPayment; + + /** + * Decodes a ForwardedPayment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForwardedPayment + * @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 + ): types.ForwardedPayment; + + /** + * Verifies a ForwardedPayment 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 ForwardedPayment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForwardedPayment + */ + public static fromObject(object: { + [k: string]: any; + }): types.ForwardedPayment; + + /** + * Creates a plain object from a ForwardedPayment message. Also converts values to other types if specified. + * @param message ForwardedPayment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.ForwardedPayment, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ForwardedPayment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ForwardedPayment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Channel. */ + interface IChannel { + /** Channel channel_id */ + channel_id?: string | null; + + /** Channel counterparty_node_id */ + counterparty_node_id?: string | null; + + /** Channel funding_txo */ + funding_txo?: types.IOutPoint | null; + + /** Channel user_channel_id */ + user_channel_id?: string | null; + + /** Channel unspendable_punishment_reserve */ + unspendable_punishment_reserve?: Long | null; + + /** Channel channel_value_sats */ + channel_value_sats?: Long | null; + + /** Channel feerate_sat_per_1000_weight */ + feerate_sat_per_1000_weight?: number | null; + + /** Channel outbound_capacity_msat */ + outbound_capacity_msat?: Long | null; + + /** Channel inbound_capacity_msat */ + inbound_capacity_msat?: Long | null; + + /** Channel confirmations_required */ + confirmations_required?: number | null; + + /** Channel confirmations */ + confirmations?: number | null; + + /** Channel is_outbound */ + is_outbound?: boolean | null; + + /** Channel is_channel_ready */ + is_channel_ready?: boolean | null; + + /** Channel is_usable */ + is_usable?: boolean | null; + + /** Channel is_announced */ + is_announced?: boolean | null; + + /** Channel channel_config */ + channel_config?: types.IChannelConfig | null; + + /** Channel next_outbound_htlc_limit_msat */ + next_outbound_htlc_limit_msat?: Long | null; + + /** Channel next_outbound_htlc_minimum_msat */ + next_outbound_htlc_minimum_msat?: Long | null; + + /** Channel force_close_spend_delay */ + force_close_spend_delay?: number | null; + + /** Channel counterparty_outbound_htlc_minimum_msat */ + counterparty_outbound_htlc_minimum_msat?: Long | null; + + /** Channel counterparty_outbound_htlc_maximum_msat */ + counterparty_outbound_htlc_maximum_msat?: Long | null; + + /** Channel counterparty_unspendable_punishment_reserve */ + counterparty_unspendable_punishment_reserve?: Long | null; + + /** Channel counterparty_forwarding_info_fee_base_msat */ + counterparty_forwarding_info_fee_base_msat?: number | null; + + /** Channel counterparty_forwarding_info_fee_proportional_millionths */ + counterparty_forwarding_info_fee_proportional_millionths?: + | number + | null; + + /** Channel counterparty_forwarding_info_cltv_expiry_delta */ + counterparty_forwarding_info_cltv_expiry_delta?: number | null; + } + + /** Represents a Channel. */ + class Channel implements IChannel { + /** + * Constructs a new Channel. + * @param [properties] Properties to set + */ + constructor(properties?: types.IChannel); + + /** Channel channel_id. */ + public channel_id: string; + + /** Channel counterparty_node_id. */ + public counterparty_node_id: string; + + /** Channel funding_txo. */ + public funding_txo?: types.IOutPoint | null; + + /** Channel user_channel_id. */ + public user_channel_id: string; + + /** Channel unspendable_punishment_reserve. */ + public unspendable_punishment_reserve?: Long | null; + + /** Channel channel_value_sats. */ + public channel_value_sats: Long; + + /** Channel feerate_sat_per_1000_weight. */ + public feerate_sat_per_1000_weight: number; + + /** Channel outbound_capacity_msat. */ + public outbound_capacity_msat: Long; + + /** Channel inbound_capacity_msat. */ + public inbound_capacity_msat: Long; + + /** Channel confirmations_required. */ + public confirmations_required?: number | null; + + /** Channel confirmations. */ + public confirmations?: number | null; + + /** Channel is_outbound. */ + public is_outbound: boolean; + + /** Channel is_channel_ready. */ + public is_channel_ready: boolean; + + /** Channel is_usable. */ + public is_usable: boolean; + + /** Channel is_announced. */ + public is_announced: boolean; + + /** Channel channel_config. */ + public channel_config?: types.IChannelConfig | null; + + /** Channel next_outbound_htlc_limit_msat. */ + public next_outbound_htlc_limit_msat: Long; + + /** Channel next_outbound_htlc_minimum_msat. */ + public next_outbound_htlc_minimum_msat: Long; + + /** Channel force_close_spend_delay. */ + public force_close_spend_delay?: number | null; + + /** Channel counterparty_outbound_htlc_minimum_msat. */ + public counterparty_outbound_htlc_minimum_msat?: Long | null; + + /** Channel counterparty_outbound_htlc_maximum_msat. */ + public counterparty_outbound_htlc_maximum_msat?: Long | null; + + /** Channel counterparty_unspendable_punishment_reserve. */ + public counterparty_unspendable_punishment_reserve: Long; + + /** Channel counterparty_forwarding_info_fee_base_msat. */ + public counterparty_forwarding_info_fee_base_msat?: number | null; + + /** Channel counterparty_forwarding_info_fee_proportional_millionths. */ + public counterparty_forwarding_info_fee_proportional_millionths?: + | number + | null; + + /** Channel counterparty_forwarding_info_cltv_expiry_delta. */ + public counterparty_forwarding_info_cltv_expiry_delta?: number | null; + + /** + * Creates a new Channel instance using the specified properties. + * @param [properties] Properties to set + * @returns Channel instance + */ + public static create(properties?: types.IChannel): types.Channel; + + /** + * Encodes the specified Channel message. Does not implicitly {@link types.Channel.verify|verify} messages. + * @param message Channel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IChannel, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Channel message, length delimited. Does not implicitly {@link types.Channel.verify|verify} messages. + * @param message Channel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IChannel, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Channel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Channel + * @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 + ): types.Channel; + + /** + * Decodes a Channel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Channel + * @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 + ): types.Channel; + + /** + * Verifies a Channel 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 Channel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Channel + */ + public static fromObject(object: { [k: string]: any }): types.Channel; + + /** + * Creates a plain object from a Channel message. Also converts values to other types if specified. + * @param message Channel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Channel, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Channel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Channel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChannelConfig. */ + interface IChannelConfig { + /** ChannelConfig forwarding_fee_proportional_millionths */ + forwarding_fee_proportional_millionths?: number | null; + + /** ChannelConfig forwarding_fee_base_msat */ + forwarding_fee_base_msat?: number | null; + + /** ChannelConfig cltv_expiry_delta */ + cltv_expiry_delta?: number | null; + + /** ChannelConfig force_close_avoidance_max_fee_satoshis */ + force_close_avoidance_max_fee_satoshis?: Long | null; + + /** ChannelConfig accept_underpaying_htlcs */ + accept_underpaying_htlcs?: boolean | null; + + /** ChannelConfig fixed_limit_msat */ + fixed_limit_msat?: Long | null; + + /** ChannelConfig fee_rate_multiplier */ + fee_rate_multiplier?: Long | null; + } + + /** Represents a ChannelConfig. */ + class ChannelConfig implements IChannelConfig { + /** + * Constructs a new ChannelConfig. + * @param [properties] Properties to set + */ + constructor(properties?: types.IChannelConfig); + + /** ChannelConfig forwarding_fee_proportional_millionths. */ + public forwarding_fee_proportional_millionths?: number | null; + + /** ChannelConfig forwarding_fee_base_msat. */ + public forwarding_fee_base_msat?: number | null; + + /** ChannelConfig cltv_expiry_delta. */ + public cltv_expiry_delta?: number | null; + + /** ChannelConfig force_close_avoidance_max_fee_satoshis. */ + public force_close_avoidance_max_fee_satoshis?: Long | null; + + /** ChannelConfig accept_underpaying_htlcs. */ + public accept_underpaying_htlcs?: boolean | null; + + /** ChannelConfig fixed_limit_msat. */ + public fixed_limit_msat?: Long | null; + + /** ChannelConfig fee_rate_multiplier. */ + public fee_rate_multiplier?: Long | null; + + /** ChannelConfig max_dust_htlc_exposure. */ + public max_dust_htlc_exposure?: + | 'fixed_limit_msat' + | 'fee_rate_multiplier'; + + /** + * Creates a new ChannelConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ChannelConfig instance + */ + public static create( + properties?: types.IChannelConfig + ): types.ChannelConfig; + + /** + * Encodes the specified ChannelConfig message. Does not implicitly {@link types.ChannelConfig.verify|verify} messages. + * @param message ChannelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IChannelConfig, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ChannelConfig message, length delimited. Does not implicitly {@link types.ChannelConfig.verify|verify} messages. + * @param message ChannelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IChannelConfig, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ChannelConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChannelConfig + * @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 + ): types.ChannelConfig; + + /** + * Decodes a ChannelConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChannelConfig + * @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 + ): types.ChannelConfig; + + /** + * Verifies a ChannelConfig 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 ChannelConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChannelConfig + */ + public static fromObject(object: { + [k: string]: any; + }): types.ChannelConfig; + + /** + * Creates a plain object from a ChannelConfig message. Also converts values to other types if specified. + * @param message ChannelConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.ChannelConfig, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ChannelConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChannelConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutPoint. */ + interface IOutPoint { + /** OutPoint txid */ + txid?: string | null; + + /** OutPoint vout */ + vout?: number | null; + } + + /** Represents an OutPoint. */ + class OutPoint implements IOutPoint { + /** + * Constructs a new OutPoint. + * @param [properties] Properties to set + */ + constructor(properties?: types.IOutPoint); + + /** OutPoint txid. */ + public txid: string; + + /** OutPoint vout. */ + public vout: number; + + /** + * Creates a new OutPoint instance using the specified properties. + * @param [properties] Properties to set + * @returns OutPoint instance + */ + public static create(properties?: types.IOutPoint): types.OutPoint; + + /** + * Encodes the specified OutPoint message. Does not implicitly {@link types.OutPoint.verify|verify} messages. + * @param message OutPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IOutPoint, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified OutPoint message, length delimited. Does not implicitly {@link types.OutPoint.verify|verify} messages. + * @param message OutPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IOutPoint, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an OutPoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutPoint + * @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 + ): types.OutPoint; + + /** + * Decodes an OutPoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutPoint + * @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 + ): types.OutPoint; + + /** + * Verifies an OutPoint 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 OutPoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutPoint + */ + public static fromObject(object: { [k: string]: any }): types.OutPoint; + + /** + * Creates a plain object from an OutPoint message. Also converts values to other types if specified. + * @param message OutPoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.OutPoint, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this OutPoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutPoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BestBlock. */ + interface IBestBlock { + /** BestBlock block_hash */ + block_hash?: string | null; + + /** BestBlock height */ + height?: number | null; + } + + /** Represents a BestBlock. */ + class BestBlock implements IBestBlock { + /** + * Constructs a new BestBlock. + * @param [properties] Properties to set + */ + constructor(properties?: types.IBestBlock); + + /** BestBlock block_hash. */ + public block_hash: string; + + /** BestBlock height. */ + public height: number; + + /** + * Creates a new BestBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns BestBlock instance + */ + public static create(properties?: types.IBestBlock): types.BestBlock; + + /** + * Encodes the specified BestBlock message. Does not implicitly {@link types.BestBlock.verify|verify} messages. + * @param message BestBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IBestBlock, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified BestBlock message, length delimited. Does not implicitly {@link types.BestBlock.verify|verify} messages. + * @param message BestBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IBestBlock, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a BestBlock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BestBlock + * @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 + ): types.BestBlock; + + /** + * Decodes a BestBlock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BestBlock + * @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 + ): types.BestBlock; + + /** + * Verifies a BestBlock 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 BestBlock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BestBlock + */ + public static fromObject(object: { [k: string]: any }): types.BestBlock; + + /** + * Creates a plain object from a BestBlock message. Also converts values to other types if specified. + * @param message BestBlock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.BestBlock, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this BestBlock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BestBlock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LightningBalance. */ + interface ILightningBalance { + /** LightningBalance claimable_on_channel_close */ + claimable_on_channel_close?: types.IClaimableOnChannelClose | null; + + /** LightningBalance claimable_awaiting_confirmations */ + claimable_awaiting_confirmations?: types.IClaimableAwaitingConfirmations | null; + + /** LightningBalance contentious_claimable */ + contentious_claimable?: types.IContentiousClaimable | null; + + /** LightningBalance maybe_timeout_claimable_htlc */ + maybe_timeout_claimable_htlc?: types.IMaybeTimeoutClaimableHTLC | null; + + /** LightningBalance maybe_preimage_claimable_htlc */ + maybe_preimage_claimable_htlc?: types.IMaybePreimageClaimableHTLC | null; + + /** LightningBalance counterparty_revoked_output_claimable */ + counterparty_revoked_output_claimable?: types.ICounterpartyRevokedOutputClaimable | null; + } + + /** Represents a LightningBalance. */ + class LightningBalance implements ILightningBalance { + /** + * Constructs a new LightningBalance. + * @param [properties] Properties to set + */ + constructor(properties?: types.ILightningBalance); + + /** LightningBalance claimable_on_channel_close. */ + public claimable_on_channel_close?: types.IClaimableOnChannelClose | null; + + /** LightningBalance claimable_awaiting_confirmations. */ + public claimable_awaiting_confirmations?: types.IClaimableAwaitingConfirmations | null; + + /** LightningBalance contentious_claimable. */ + public contentious_claimable?: types.IContentiousClaimable | null; + + /** LightningBalance maybe_timeout_claimable_htlc. */ + public maybe_timeout_claimable_htlc?: types.IMaybeTimeoutClaimableHTLC | null; + + /** LightningBalance maybe_preimage_claimable_htlc. */ + public maybe_preimage_claimable_htlc?: types.IMaybePreimageClaimableHTLC | null; + + /** LightningBalance counterparty_revoked_output_claimable. */ + public counterparty_revoked_output_claimable?: types.ICounterpartyRevokedOutputClaimable | null; + + /** LightningBalance balance_type. */ + public balance_type?: + | 'claimable_on_channel_close' + | 'claimable_awaiting_confirmations' + | 'contentious_claimable' + | 'maybe_timeout_claimable_htlc' + | 'maybe_preimage_claimable_htlc' + | 'counterparty_revoked_output_claimable'; + + /** + * Creates a new LightningBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns LightningBalance instance + */ + public static create( + properties?: types.ILightningBalance + ): types.LightningBalance; + + /** + * Encodes the specified LightningBalance message. Does not implicitly {@link types.LightningBalance.verify|verify} messages. + * @param message LightningBalance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.ILightningBalance, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified LightningBalance message, length delimited. Does not implicitly {@link types.LightningBalance.verify|verify} messages. + * @param message LightningBalance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.ILightningBalance, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a LightningBalance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LightningBalance + * @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 + ): types.LightningBalance; + + /** + * Decodes a LightningBalance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LightningBalance + * @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 + ): types.LightningBalance; + + /** + * Verifies a LightningBalance 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 LightningBalance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LightningBalance + */ + public static fromObject(object: { + [k: string]: any; + }): types.LightningBalance; + + /** + * Creates a plain object from a LightningBalance message. Also converts values to other types if specified. + * @param message LightningBalance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.LightningBalance, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this LightningBalance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LightningBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClaimableOnChannelClose. */ + interface IClaimableOnChannelClose { + /** ClaimableOnChannelClose channel_id */ + channel_id?: string | null; + + /** ClaimableOnChannelClose counterparty_node_id */ + counterparty_node_id?: string | null; + + /** ClaimableOnChannelClose amount_satoshis */ + amount_satoshis?: Long | null; + + /** ClaimableOnChannelClose transaction_fee_satoshis */ + transaction_fee_satoshis?: Long | null; + + /** ClaimableOnChannelClose outbound_payment_htlc_rounded_msat */ + outbound_payment_htlc_rounded_msat?: Long | null; + + /** ClaimableOnChannelClose outbound_forwarded_htlc_rounded_msat */ + outbound_forwarded_htlc_rounded_msat?: Long | null; + + /** ClaimableOnChannelClose inbound_claiming_htlc_rounded_msat */ + inbound_claiming_htlc_rounded_msat?: Long | null; + + /** ClaimableOnChannelClose inbound_htlc_rounded_msat */ + inbound_htlc_rounded_msat?: Long | null; + } + + /** Represents a ClaimableOnChannelClose. */ + class ClaimableOnChannelClose implements IClaimableOnChannelClose { + /** + * Constructs a new ClaimableOnChannelClose. + * @param [properties] Properties to set + */ + constructor(properties?: types.IClaimableOnChannelClose); + + /** ClaimableOnChannelClose channel_id. */ + public channel_id: string; + + /** ClaimableOnChannelClose counterparty_node_id. */ + public counterparty_node_id: string; + + /** ClaimableOnChannelClose amount_satoshis. */ + public amount_satoshis: Long; + + /** ClaimableOnChannelClose transaction_fee_satoshis. */ + public transaction_fee_satoshis: Long; + + /** ClaimableOnChannelClose outbound_payment_htlc_rounded_msat. */ + public outbound_payment_htlc_rounded_msat: Long; + + /** ClaimableOnChannelClose outbound_forwarded_htlc_rounded_msat. */ + public outbound_forwarded_htlc_rounded_msat: Long; + + /** ClaimableOnChannelClose inbound_claiming_htlc_rounded_msat. */ + public inbound_claiming_htlc_rounded_msat: Long; + + /** ClaimableOnChannelClose inbound_htlc_rounded_msat. */ + public inbound_htlc_rounded_msat: Long; + + /** + * Creates a new ClaimableOnChannelClose instance using the specified properties. + * @param [properties] Properties to set + * @returns ClaimableOnChannelClose instance + */ + public static create( + properties?: types.IClaimableOnChannelClose + ): types.ClaimableOnChannelClose; + + /** + * Encodes the specified ClaimableOnChannelClose message. Does not implicitly {@link types.ClaimableOnChannelClose.verify|verify} messages. + * @param message ClaimableOnChannelClose message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IClaimableOnChannelClose, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ClaimableOnChannelClose message, length delimited. Does not implicitly {@link types.ClaimableOnChannelClose.verify|verify} messages. + * @param message ClaimableOnChannelClose message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IClaimableOnChannelClose, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ClaimableOnChannelClose message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClaimableOnChannelClose + * @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 + ): types.ClaimableOnChannelClose; + + /** + * Decodes a ClaimableOnChannelClose message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClaimableOnChannelClose + * @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 + ): types.ClaimableOnChannelClose; + + /** + * Verifies a ClaimableOnChannelClose 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 ClaimableOnChannelClose message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClaimableOnChannelClose + */ + public static fromObject(object: { + [k: string]: any; + }): types.ClaimableOnChannelClose; + + /** + * Creates a plain object from a ClaimableOnChannelClose message. Also converts values to other types if specified. + * @param message ClaimableOnChannelClose + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.ClaimableOnChannelClose, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ClaimableOnChannelClose to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClaimableOnChannelClose + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClaimableAwaitingConfirmations. */ + interface IClaimableAwaitingConfirmations { + /** ClaimableAwaitingConfirmations channel_id */ + channel_id?: string | null; + + /** ClaimableAwaitingConfirmations counterparty_node_id */ + counterparty_node_id?: string | null; + + /** ClaimableAwaitingConfirmations amount_satoshis */ + amount_satoshis?: Long | null; + + /** ClaimableAwaitingConfirmations confirmation_height */ + confirmation_height?: number | null; + + /** ClaimableAwaitingConfirmations source */ + source?: types.BalanceSource | null; + } + + /** Represents a ClaimableAwaitingConfirmations. */ + class ClaimableAwaitingConfirmations + implements IClaimableAwaitingConfirmations + { + /** + * Constructs a new ClaimableAwaitingConfirmations. + * @param [properties] Properties to set + */ + constructor(properties?: types.IClaimableAwaitingConfirmations); + + /** ClaimableAwaitingConfirmations channel_id. */ + public channel_id: string; + + /** ClaimableAwaitingConfirmations counterparty_node_id. */ + public counterparty_node_id: string; + + /** ClaimableAwaitingConfirmations amount_satoshis. */ + public amount_satoshis: Long; + + /** ClaimableAwaitingConfirmations confirmation_height. */ + public confirmation_height: number; + + /** ClaimableAwaitingConfirmations source. */ + public source: types.BalanceSource; + + /** + * Creates a new ClaimableAwaitingConfirmations instance using the specified properties. + * @param [properties] Properties to set + * @returns ClaimableAwaitingConfirmations instance + */ + public static create( + properties?: types.IClaimableAwaitingConfirmations + ): types.ClaimableAwaitingConfirmations; + + /** + * Encodes the specified ClaimableAwaitingConfirmations message. Does not implicitly {@link types.ClaimableAwaitingConfirmations.verify|verify} messages. + * @param message ClaimableAwaitingConfirmations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IClaimableAwaitingConfirmations, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ClaimableAwaitingConfirmations message, length delimited. Does not implicitly {@link types.ClaimableAwaitingConfirmations.verify|verify} messages. + * @param message ClaimableAwaitingConfirmations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IClaimableAwaitingConfirmations, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ClaimableAwaitingConfirmations message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClaimableAwaitingConfirmations + * @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 + ): types.ClaimableAwaitingConfirmations; + + /** + * Decodes a ClaimableAwaitingConfirmations message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClaimableAwaitingConfirmations + * @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 + ): types.ClaimableAwaitingConfirmations; + + /** + * Verifies a ClaimableAwaitingConfirmations 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 ClaimableAwaitingConfirmations message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClaimableAwaitingConfirmations + */ + public static fromObject(object: { + [k: string]: any; + }): types.ClaimableAwaitingConfirmations; + + /** + * Creates a plain object from a ClaimableAwaitingConfirmations message. Also converts values to other types if specified. + * @param message ClaimableAwaitingConfirmations + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.ClaimableAwaitingConfirmations, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ClaimableAwaitingConfirmations to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClaimableAwaitingConfirmations + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** BalanceSource enum. */ + enum BalanceSource { + HOLDER_FORCE_CLOSED = 0, + COUNTERPARTY_FORCE_CLOSED = 1, + COOP_CLOSE = 2, + HTLC = 3 + } + + /** Properties of a ContentiousClaimable. */ + interface IContentiousClaimable { + /** ContentiousClaimable channel_id */ + channel_id?: string | null; + + /** ContentiousClaimable counterparty_node_id */ + counterparty_node_id?: string | null; + + /** ContentiousClaimable amount_satoshis */ + amount_satoshis?: Long | null; + + /** ContentiousClaimable timeout_height */ + timeout_height?: number | null; + + /** ContentiousClaimable payment_hash */ + payment_hash?: string | null; + + /** ContentiousClaimable payment_preimage */ + payment_preimage?: string | null; + } + + /** Represents a ContentiousClaimable. */ + class ContentiousClaimable implements IContentiousClaimable { + /** + * Constructs a new ContentiousClaimable. + * @param [properties] Properties to set + */ + constructor(properties?: types.IContentiousClaimable); + + /** ContentiousClaimable channel_id. */ + public channel_id: string; + + /** ContentiousClaimable counterparty_node_id. */ + public counterparty_node_id: string; + + /** ContentiousClaimable amount_satoshis. */ + public amount_satoshis: Long; + + /** ContentiousClaimable timeout_height. */ + public timeout_height: number; + + /** ContentiousClaimable payment_hash. */ + public payment_hash: string; + + /** ContentiousClaimable payment_preimage. */ + public payment_preimage: string; + + /** + * Creates a new ContentiousClaimable instance using the specified properties. + * @param [properties] Properties to set + * @returns ContentiousClaimable instance + */ + public static create( + properties?: types.IContentiousClaimable + ): types.ContentiousClaimable; + + /** + * Encodes the specified ContentiousClaimable message. Does not implicitly {@link types.ContentiousClaimable.verify|verify} messages. + * @param message ContentiousClaimable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IContentiousClaimable, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ContentiousClaimable message, length delimited. Does not implicitly {@link types.ContentiousClaimable.verify|verify} messages. + * @param message ContentiousClaimable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IContentiousClaimable, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ContentiousClaimable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContentiousClaimable + * @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 + ): types.ContentiousClaimable; + + /** + * Decodes a ContentiousClaimable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContentiousClaimable + * @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 + ): types.ContentiousClaimable; + + /** + * Verifies a ContentiousClaimable 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 ContentiousClaimable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContentiousClaimable + */ + public static fromObject(object: { + [k: string]: any; + }): types.ContentiousClaimable; + + /** + * Creates a plain object from a ContentiousClaimable message. Also converts values to other types if specified. + * @param message ContentiousClaimable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.ContentiousClaimable, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ContentiousClaimable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContentiousClaimable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MaybeTimeoutClaimableHTLC. */ + interface IMaybeTimeoutClaimableHTLC { + /** MaybeTimeoutClaimableHTLC channel_id */ + channel_id?: string | null; + + /** MaybeTimeoutClaimableHTLC counterparty_node_id */ + counterparty_node_id?: string | null; + + /** MaybeTimeoutClaimableHTLC amount_satoshis */ + amount_satoshis?: Long | null; + + /** MaybeTimeoutClaimableHTLC claimable_height */ + claimable_height?: number | null; + + /** MaybeTimeoutClaimableHTLC payment_hash */ + payment_hash?: string | null; + + /** MaybeTimeoutClaimableHTLC outbound_payment */ + outbound_payment?: boolean | null; + } + + /** Represents a MaybeTimeoutClaimableHTLC. */ + class MaybeTimeoutClaimableHTLC implements IMaybeTimeoutClaimableHTLC { + /** + * Constructs a new MaybeTimeoutClaimableHTLC. + * @param [properties] Properties to set + */ + constructor(properties?: types.IMaybeTimeoutClaimableHTLC); + + /** MaybeTimeoutClaimableHTLC channel_id. */ + public channel_id: string; + + /** MaybeTimeoutClaimableHTLC counterparty_node_id. */ + public counterparty_node_id: string; + + /** MaybeTimeoutClaimableHTLC amount_satoshis. */ + public amount_satoshis: Long; + + /** MaybeTimeoutClaimableHTLC claimable_height. */ + public claimable_height: number; + + /** MaybeTimeoutClaimableHTLC payment_hash. */ + public payment_hash: string; + + /** MaybeTimeoutClaimableHTLC outbound_payment. */ + public outbound_payment: boolean; + + /** + * Creates a new MaybeTimeoutClaimableHTLC instance using the specified properties. + * @param [properties] Properties to set + * @returns MaybeTimeoutClaimableHTLC instance + */ + public static create( + properties?: types.IMaybeTimeoutClaimableHTLC + ): types.MaybeTimeoutClaimableHTLC; + + /** + * Encodes the specified MaybeTimeoutClaimableHTLC message. Does not implicitly {@link types.MaybeTimeoutClaimableHTLC.verify|verify} messages. + * @param message MaybeTimeoutClaimableHTLC message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IMaybeTimeoutClaimableHTLC, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified MaybeTimeoutClaimableHTLC message, length delimited. Does not implicitly {@link types.MaybeTimeoutClaimableHTLC.verify|verify} messages. + * @param message MaybeTimeoutClaimableHTLC message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IMaybeTimeoutClaimableHTLC, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a MaybeTimeoutClaimableHTLC message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaybeTimeoutClaimableHTLC + * @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 + ): types.MaybeTimeoutClaimableHTLC; + + /** + * Decodes a MaybeTimeoutClaimableHTLC message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaybeTimeoutClaimableHTLC + * @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 + ): types.MaybeTimeoutClaimableHTLC; + + /** + * Verifies a MaybeTimeoutClaimableHTLC 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 MaybeTimeoutClaimableHTLC message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaybeTimeoutClaimableHTLC + */ + public static fromObject(object: { + [k: string]: any; + }): types.MaybeTimeoutClaimableHTLC; + + /** + * Creates a plain object from a MaybeTimeoutClaimableHTLC message. Also converts values to other types if specified. + * @param message MaybeTimeoutClaimableHTLC + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.MaybeTimeoutClaimableHTLC, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this MaybeTimeoutClaimableHTLC to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaybeTimeoutClaimableHTLC + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MaybePreimageClaimableHTLC. */ + interface IMaybePreimageClaimableHTLC { + /** MaybePreimageClaimableHTLC channel_id */ + channel_id?: string | null; + + /** MaybePreimageClaimableHTLC counterparty_node_id */ + counterparty_node_id?: string | null; + + /** MaybePreimageClaimableHTLC amount_satoshis */ + amount_satoshis?: Long | null; + + /** MaybePreimageClaimableHTLC expiry_height */ + expiry_height?: number | null; + + /** MaybePreimageClaimableHTLC payment_hash */ + payment_hash?: string | null; + } + + /** Represents a MaybePreimageClaimableHTLC. */ + class MaybePreimageClaimableHTLC implements IMaybePreimageClaimableHTLC { + /** + * Constructs a new MaybePreimageClaimableHTLC. + * @param [properties] Properties to set + */ + constructor(properties?: types.IMaybePreimageClaimableHTLC); + + /** MaybePreimageClaimableHTLC channel_id. */ + public channel_id: string; + + /** MaybePreimageClaimableHTLC counterparty_node_id. */ + public counterparty_node_id: string; + + /** MaybePreimageClaimableHTLC amount_satoshis. */ + public amount_satoshis: Long; + + /** MaybePreimageClaimableHTLC expiry_height. */ + public expiry_height: number; + + /** MaybePreimageClaimableHTLC payment_hash. */ + public payment_hash: string; + + /** + * Creates a new MaybePreimageClaimableHTLC instance using the specified properties. + * @param [properties] Properties to set + * @returns MaybePreimageClaimableHTLC instance + */ + public static create( + properties?: types.IMaybePreimageClaimableHTLC + ): types.MaybePreimageClaimableHTLC; + + /** + * Encodes the specified MaybePreimageClaimableHTLC message. Does not implicitly {@link types.MaybePreimageClaimableHTLC.verify|verify} messages. + * @param message MaybePreimageClaimableHTLC message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IMaybePreimageClaimableHTLC, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified MaybePreimageClaimableHTLC message, length delimited. Does not implicitly {@link types.MaybePreimageClaimableHTLC.verify|verify} messages. + * @param message MaybePreimageClaimableHTLC message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IMaybePreimageClaimableHTLC, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a MaybePreimageClaimableHTLC message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MaybePreimageClaimableHTLC + * @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 + ): types.MaybePreimageClaimableHTLC; + + /** + * Decodes a MaybePreimageClaimableHTLC message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MaybePreimageClaimableHTLC + * @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 + ): types.MaybePreimageClaimableHTLC; + + /** + * Verifies a MaybePreimageClaimableHTLC 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 MaybePreimageClaimableHTLC message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MaybePreimageClaimableHTLC + */ + public static fromObject(object: { + [k: string]: any; + }): types.MaybePreimageClaimableHTLC; + + /** + * Creates a plain object from a MaybePreimageClaimableHTLC message. Also converts values to other types if specified. + * @param message MaybePreimageClaimableHTLC + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.MaybePreimageClaimableHTLC, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this MaybePreimageClaimableHTLC to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MaybePreimageClaimableHTLC + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CounterpartyRevokedOutputClaimable. */ + interface ICounterpartyRevokedOutputClaimable { + /** CounterpartyRevokedOutputClaimable channel_id */ + channel_id?: string | null; + + /** CounterpartyRevokedOutputClaimable counterparty_node_id */ + counterparty_node_id?: string | null; + + /** CounterpartyRevokedOutputClaimable amount_satoshis */ + amount_satoshis?: Long | null; + } + + /** Represents a CounterpartyRevokedOutputClaimable. */ + class CounterpartyRevokedOutputClaimable + implements ICounterpartyRevokedOutputClaimable + { + /** + * Constructs a new CounterpartyRevokedOutputClaimable. + * @param [properties] Properties to set + */ + constructor(properties?: types.ICounterpartyRevokedOutputClaimable); + + /** CounterpartyRevokedOutputClaimable channel_id. */ + public channel_id: string; + + /** CounterpartyRevokedOutputClaimable counterparty_node_id. */ + public counterparty_node_id: string; + + /** CounterpartyRevokedOutputClaimable amount_satoshis. */ + public amount_satoshis: Long; + + /** + * Creates a new CounterpartyRevokedOutputClaimable instance using the specified properties. + * @param [properties] Properties to set + * @returns CounterpartyRevokedOutputClaimable instance + */ + public static create( + properties?: types.ICounterpartyRevokedOutputClaimable + ): types.CounterpartyRevokedOutputClaimable; + + /** + * Encodes the specified CounterpartyRevokedOutputClaimable message. Does not implicitly {@link types.CounterpartyRevokedOutputClaimable.verify|verify} messages. + * @param message CounterpartyRevokedOutputClaimable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.ICounterpartyRevokedOutputClaimable, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified CounterpartyRevokedOutputClaimable message, length delimited. Does not implicitly {@link types.CounterpartyRevokedOutputClaimable.verify|verify} messages. + * @param message CounterpartyRevokedOutputClaimable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.ICounterpartyRevokedOutputClaimable, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a CounterpartyRevokedOutputClaimable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CounterpartyRevokedOutputClaimable + * @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 + ): types.CounterpartyRevokedOutputClaimable; + + /** + * Decodes a CounterpartyRevokedOutputClaimable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CounterpartyRevokedOutputClaimable + * @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 + ): types.CounterpartyRevokedOutputClaimable; + + /** + * Verifies a CounterpartyRevokedOutputClaimable 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 CounterpartyRevokedOutputClaimable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CounterpartyRevokedOutputClaimable + */ + public static fromObject(object: { + [k: string]: any; + }): types.CounterpartyRevokedOutputClaimable; + + /** + * Creates a plain object from a CounterpartyRevokedOutputClaimable message. Also converts values to other types if specified. + * @param message CounterpartyRevokedOutputClaimable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.CounterpartyRevokedOutputClaimable, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this CounterpartyRevokedOutputClaimable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CounterpartyRevokedOutputClaimable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingSweepBalance. */ + interface IPendingSweepBalance { + /** PendingSweepBalance pending_broadcast */ + pending_broadcast?: types.IPendingBroadcast | null; + + /** PendingSweepBalance broadcast_awaiting_confirmation */ + broadcast_awaiting_confirmation?: types.IBroadcastAwaitingConfirmation | null; + + /** PendingSweepBalance awaiting_threshold_confirmations */ + awaiting_threshold_confirmations?: types.IAwaitingThresholdConfirmations | null; + } + + /** Represents a PendingSweepBalance. */ + class PendingSweepBalance implements IPendingSweepBalance { + /** + * Constructs a new PendingSweepBalance. + * @param [properties] Properties to set + */ + constructor(properties?: types.IPendingSweepBalance); + + /** PendingSweepBalance pending_broadcast. */ + public pending_broadcast?: types.IPendingBroadcast | null; + + /** PendingSweepBalance broadcast_awaiting_confirmation. */ + public broadcast_awaiting_confirmation?: types.IBroadcastAwaitingConfirmation | null; + + /** PendingSweepBalance awaiting_threshold_confirmations. */ + public awaiting_threshold_confirmations?: types.IAwaitingThresholdConfirmations | null; + + /** PendingSweepBalance balance_type. */ + public balance_type?: + | 'pending_broadcast' + | 'broadcast_awaiting_confirmation' + | 'awaiting_threshold_confirmations'; + + /** + * Creates a new PendingSweepBalance instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingSweepBalance instance + */ + public static create( + properties?: types.IPendingSweepBalance + ): types.PendingSweepBalance; + + /** + * Encodes the specified PendingSweepBalance message. Does not implicitly {@link types.PendingSweepBalance.verify|verify} messages. + * @param message PendingSweepBalance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IPendingSweepBalance, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified PendingSweepBalance message, length delimited. Does not implicitly {@link types.PendingSweepBalance.verify|verify} messages. + * @param message PendingSweepBalance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IPendingSweepBalance, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a PendingSweepBalance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PendingSweepBalance + * @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 + ): types.PendingSweepBalance; + + /** + * Decodes a PendingSweepBalance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PendingSweepBalance + * @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 + ): types.PendingSweepBalance; + + /** + * Verifies a PendingSweepBalance 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 PendingSweepBalance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PendingSweepBalance + */ + public static fromObject(object: { + [k: string]: any; + }): types.PendingSweepBalance; + + /** + * Creates a plain object from a PendingSweepBalance message. Also converts values to other types if specified. + * @param message PendingSweepBalance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.PendingSweepBalance, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this PendingSweepBalance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PendingSweepBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingBroadcast. */ + interface IPendingBroadcast { + /** PendingBroadcast channel_id */ + channel_id?: string | null; + + /** PendingBroadcast amount_satoshis */ + amount_satoshis?: Long | null; + } + + /** Represents a PendingBroadcast. */ + class PendingBroadcast implements IPendingBroadcast { + /** + * Constructs a new PendingBroadcast. + * @param [properties] Properties to set + */ + constructor(properties?: types.IPendingBroadcast); + + /** PendingBroadcast channel_id. */ + public channel_id?: string | null; + + /** PendingBroadcast amount_satoshis. */ + public amount_satoshis: Long; + + /** + * Creates a new PendingBroadcast instance using the specified properties. + * @param [properties] Properties to set + * @returns PendingBroadcast instance + */ + public static create( + properties?: types.IPendingBroadcast + ): types.PendingBroadcast; + + /** + * Encodes the specified PendingBroadcast message. Does not implicitly {@link types.PendingBroadcast.verify|verify} messages. + * @param message PendingBroadcast message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IPendingBroadcast, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified PendingBroadcast message, length delimited. Does not implicitly {@link types.PendingBroadcast.verify|verify} messages. + * @param message PendingBroadcast message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IPendingBroadcast, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a PendingBroadcast message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PendingBroadcast + * @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 + ): types.PendingBroadcast; + + /** + * Decodes a PendingBroadcast message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PendingBroadcast + * @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 + ): types.PendingBroadcast; + + /** + * Verifies a PendingBroadcast 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 PendingBroadcast message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PendingBroadcast + */ + public static fromObject(object: { + [k: string]: any; + }): types.PendingBroadcast; + + /** + * Creates a plain object from a PendingBroadcast message. Also converts values to other types if specified. + * @param message PendingBroadcast + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.PendingBroadcast, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this PendingBroadcast to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PendingBroadcast + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BroadcastAwaitingConfirmation. */ + interface IBroadcastAwaitingConfirmation { + /** BroadcastAwaitingConfirmation channel_id */ + channel_id?: string | null; + + /** BroadcastAwaitingConfirmation latest_broadcast_height */ + latest_broadcast_height?: number | null; + + /** BroadcastAwaitingConfirmation latest_spending_txid */ + latest_spending_txid?: string | null; + + /** BroadcastAwaitingConfirmation amount_satoshis */ + amount_satoshis?: Long | null; + } + + /** Represents a BroadcastAwaitingConfirmation. */ + class BroadcastAwaitingConfirmation + implements IBroadcastAwaitingConfirmation + { + /** + * Constructs a new BroadcastAwaitingConfirmation. + * @param [properties] Properties to set + */ + constructor(properties?: types.IBroadcastAwaitingConfirmation); + + /** BroadcastAwaitingConfirmation channel_id. */ + public channel_id?: string | null; + + /** BroadcastAwaitingConfirmation latest_broadcast_height. */ + public latest_broadcast_height: number; + + /** BroadcastAwaitingConfirmation latest_spending_txid. */ + public latest_spending_txid: string; + + /** BroadcastAwaitingConfirmation amount_satoshis. */ + public amount_satoshis: Long; + + /** + * Creates a new BroadcastAwaitingConfirmation instance using the specified properties. + * @param [properties] Properties to set + * @returns BroadcastAwaitingConfirmation instance + */ + public static create( + properties?: types.IBroadcastAwaitingConfirmation + ): types.BroadcastAwaitingConfirmation; + + /** + * Encodes the specified BroadcastAwaitingConfirmation message. Does not implicitly {@link types.BroadcastAwaitingConfirmation.verify|verify} messages. + * @param message BroadcastAwaitingConfirmation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IBroadcastAwaitingConfirmation, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified BroadcastAwaitingConfirmation message, length delimited. Does not implicitly {@link types.BroadcastAwaitingConfirmation.verify|verify} messages. + * @param message BroadcastAwaitingConfirmation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IBroadcastAwaitingConfirmation, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a BroadcastAwaitingConfirmation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BroadcastAwaitingConfirmation + * @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 + ): types.BroadcastAwaitingConfirmation; + + /** + * Decodes a BroadcastAwaitingConfirmation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BroadcastAwaitingConfirmation + * @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 + ): types.BroadcastAwaitingConfirmation; + + /** + * Verifies a BroadcastAwaitingConfirmation 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 BroadcastAwaitingConfirmation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BroadcastAwaitingConfirmation + */ + public static fromObject(object: { + [k: string]: any; + }): types.BroadcastAwaitingConfirmation; + + /** + * Creates a plain object from a BroadcastAwaitingConfirmation message. Also converts values to other types if specified. + * @param message BroadcastAwaitingConfirmation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.BroadcastAwaitingConfirmation, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this BroadcastAwaitingConfirmation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BroadcastAwaitingConfirmation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AwaitingThresholdConfirmations. */ + interface IAwaitingThresholdConfirmations { + /** AwaitingThresholdConfirmations channel_id */ + channel_id?: string | null; + + /** AwaitingThresholdConfirmations latest_spending_txid */ + latest_spending_txid?: string | null; + + /** AwaitingThresholdConfirmations confirmation_hash */ + confirmation_hash?: string | null; + + /** AwaitingThresholdConfirmations confirmation_height */ + confirmation_height?: number | null; + + /** AwaitingThresholdConfirmations amount_satoshis */ + amount_satoshis?: Long | null; + } + + /** Represents an AwaitingThresholdConfirmations. */ + class AwaitingThresholdConfirmations + implements IAwaitingThresholdConfirmations + { + /** + * Constructs a new AwaitingThresholdConfirmations. + * @param [properties] Properties to set + */ + constructor(properties?: types.IAwaitingThresholdConfirmations); + + /** AwaitingThresholdConfirmations channel_id. */ + public channel_id?: string | null; + + /** AwaitingThresholdConfirmations latest_spending_txid. */ + public latest_spending_txid: string; + + /** AwaitingThresholdConfirmations confirmation_hash. */ + public confirmation_hash: string; + + /** AwaitingThresholdConfirmations confirmation_height. */ + public confirmation_height: number; + + /** AwaitingThresholdConfirmations amount_satoshis. */ + public amount_satoshis: Long; + + /** + * Creates a new AwaitingThresholdConfirmations instance using the specified properties. + * @param [properties] Properties to set + * @returns AwaitingThresholdConfirmations instance + */ + public static create( + properties?: types.IAwaitingThresholdConfirmations + ): types.AwaitingThresholdConfirmations; + + /** + * Encodes the specified AwaitingThresholdConfirmations message. Does not implicitly {@link types.AwaitingThresholdConfirmations.verify|verify} messages. + * @param message AwaitingThresholdConfirmations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IAwaitingThresholdConfirmations, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified AwaitingThresholdConfirmations message, length delimited. Does not implicitly {@link types.AwaitingThresholdConfirmations.verify|verify} messages. + * @param message AwaitingThresholdConfirmations message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IAwaitingThresholdConfirmations, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an AwaitingThresholdConfirmations message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AwaitingThresholdConfirmations + * @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 + ): types.AwaitingThresholdConfirmations; + + /** + * Decodes an AwaitingThresholdConfirmations message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AwaitingThresholdConfirmations + * @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 + ): types.AwaitingThresholdConfirmations; + + /** + * Verifies an AwaitingThresholdConfirmations 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 AwaitingThresholdConfirmations message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AwaitingThresholdConfirmations + */ + public static fromObject(object: { + [k: string]: any; + }): types.AwaitingThresholdConfirmations; + + /** + * Creates a plain object from an AwaitingThresholdConfirmations message. Also converts values to other types if specified. + * @param message AwaitingThresholdConfirmations + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.AwaitingThresholdConfirmations, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this AwaitingThresholdConfirmations to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AwaitingThresholdConfirmations + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PageToken. */ + interface IPageToken { + /** PageToken token */ + token?: string | null; + + /** PageToken index */ + index?: Long | null; + } + + /** Represents a PageToken. */ + class PageToken implements IPageToken { + /** + * Constructs a new PageToken. + * @param [properties] Properties to set + */ + constructor(properties?: types.IPageToken); + + /** PageToken token. */ + public token: string; + + /** PageToken index. */ + public index: Long; + + /** + * Creates a new PageToken instance using the specified properties. + * @param [properties] Properties to set + * @returns PageToken instance + */ + public static create(properties?: types.IPageToken): types.PageToken; + + /** + * Encodes the specified PageToken message. Does not implicitly {@link types.PageToken.verify|verify} messages. + * @param message PageToken message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IPageToken, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified PageToken message, length delimited. Does not implicitly {@link types.PageToken.verify|verify} messages. + * @param message PageToken message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IPageToken, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a PageToken message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PageToken + * @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 + ): types.PageToken; + + /** + * Decodes a PageToken message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PageToken + * @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 + ): types.PageToken; + + /** + * Verifies a PageToken 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 PageToken message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PageToken + */ + public static fromObject(object: { [k: string]: any }): types.PageToken; + + /** + * Creates a plain object from a PageToken message. Also converts values to other types if specified. + * @param message PageToken + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.PageToken, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this PageToken to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PageToken + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11InvoiceDescription. */ + interface IBolt11InvoiceDescription { + /** Bolt11InvoiceDescription direct */ + direct?: string | null; + + /** Bolt11InvoiceDescription hash */ + hash?: string | null; + } + + /** Represents a Bolt11InvoiceDescription. */ + class Bolt11InvoiceDescription implements IBolt11InvoiceDescription { + /** + * Constructs a new Bolt11InvoiceDescription. + * @param [properties] Properties to set + */ + constructor(properties?: types.IBolt11InvoiceDescription); + + /** Bolt11InvoiceDescription direct. */ + public direct?: string | null; + + /** Bolt11InvoiceDescription hash. */ + public hash?: string | null; + + /** Bolt11InvoiceDescription kind. */ + public kind?: 'direct' | 'hash'; + + /** + * Creates a new Bolt11InvoiceDescription instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11InvoiceDescription instance + */ + public static create( + properties?: types.IBolt11InvoiceDescription + ): types.Bolt11InvoiceDescription; + + /** + * Encodes the specified Bolt11InvoiceDescription message. Does not implicitly {@link types.Bolt11InvoiceDescription.verify|verify} messages. + * @param message Bolt11InvoiceDescription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IBolt11InvoiceDescription, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11InvoiceDescription message, length delimited. Does not implicitly {@link types.Bolt11InvoiceDescription.verify|verify} messages. + * @param message Bolt11InvoiceDescription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IBolt11InvoiceDescription, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11InvoiceDescription message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11InvoiceDescription + * @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 + ): types.Bolt11InvoiceDescription; + + /** + * Decodes a Bolt11InvoiceDescription message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11InvoiceDescription + * @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 + ): types.Bolt11InvoiceDescription; + + /** + * Verifies a Bolt11InvoiceDescription 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 Bolt11InvoiceDescription message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11InvoiceDescription + */ + public static fromObject(object: { + [k: string]: any; + }): types.Bolt11InvoiceDescription; + + /** + * Creates a plain object from a Bolt11InvoiceDescription message. Also converts values to other types if specified. + * @param message Bolt11InvoiceDescription + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Bolt11InvoiceDescription, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11InvoiceDescription to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11InvoiceDescription + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteParametersConfig. */ + interface IRouteParametersConfig { + /** RouteParametersConfig max_total_routing_fee_msat */ + max_total_routing_fee_msat?: Long | null; + + /** RouteParametersConfig max_total_cltv_expiry_delta */ + max_total_cltv_expiry_delta?: number | null; + + /** RouteParametersConfig max_path_count */ + max_path_count?: number | null; + + /** RouteParametersConfig max_channel_saturation_power_of_half */ + max_channel_saturation_power_of_half?: number | null; + } + + /** Represents a RouteParametersConfig. */ + class RouteParametersConfig implements IRouteParametersConfig { + /** + * Constructs a new RouteParametersConfig. + * @param [properties] Properties to set + */ + constructor(properties?: types.IRouteParametersConfig); + + /** RouteParametersConfig max_total_routing_fee_msat. */ + public max_total_routing_fee_msat?: Long | null; + + /** RouteParametersConfig max_total_cltv_expiry_delta. */ + public max_total_cltv_expiry_delta: number; + + /** RouteParametersConfig max_path_count. */ + public max_path_count: number; + + /** RouteParametersConfig max_channel_saturation_power_of_half. */ + public max_channel_saturation_power_of_half: number; + + /** + * Creates a new RouteParametersConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteParametersConfig instance + */ + public static create( + properties?: types.IRouteParametersConfig + ): types.RouteParametersConfig; + + /** + * Encodes the specified RouteParametersConfig message. Does not implicitly {@link types.RouteParametersConfig.verify|verify} messages. + * @param message RouteParametersConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IRouteParametersConfig, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified RouteParametersConfig message, length delimited. Does not implicitly {@link types.RouteParametersConfig.verify|verify} messages. + * @param message RouteParametersConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IRouteParametersConfig, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a RouteParametersConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteParametersConfig + * @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 + ): types.RouteParametersConfig; + + /** + * Decodes a RouteParametersConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteParametersConfig + * @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 + ): types.RouteParametersConfig; + + /** + * Verifies a RouteParametersConfig 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 RouteParametersConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteParametersConfig + */ + public static fromObject(object: { + [k: string]: any; + }): types.RouteParametersConfig; + + /** + * Creates a plain object from a RouteParametersConfig message. Also converts values to other types if specified. + * @param message RouteParametersConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.RouteParametersConfig, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this RouteParametersConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteParametersConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphRoutingFees. */ + interface IGraphRoutingFees { + /** GraphRoutingFees base_msat */ + base_msat?: number | null; + + /** GraphRoutingFees proportional_millionths */ + proportional_millionths?: number | null; + } + + /** Represents a GraphRoutingFees. */ + class GraphRoutingFees implements IGraphRoutingFees { + /** + * Constructs a new GraphRoutingFees. + * @param [properties] Properties to set + */ + constructor(properties?: types.IGraphRoutingFees); + + /** GraphRoutingFees base_msat. */ + public base_msat: number; + + /** GraphRoutingFees proportional_millionths. */ + public proportional_millionths: number; + + /** + * Creates a new GraphRoutingFees instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphRoutingFees instance + */ + public static create( + properties?: types.IGraphRoutingFees + ): types.GraphRoutingFees; + + /** + * Encodes the specified GraphRoutingFees message. Does not implicitly {@link types.GraphRoutingFees.verify|verify} messages. + * @param message GraphRoutingFees message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IGraphRoutingFees, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GraphRoutingFees message, length delimited. Does not implicitly {@link types.GraphRoutingFees.verify|verify} messages. + * @param message GraphRoutingFees message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IGraphRoutingFees, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GraphRoutingFees message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphRoutingFees + * @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 + ): types.GraphRoutingFees; + + /** + * Decodes a GraphRoutingFees message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphRoutingFees + * @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 + ): types.GraphRoutingFees; + + /** + * Verifies a GraphRoutingFees 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 GraphRoutingFees message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphRoutingFees + */ + public static fromObject(object: { + [k: string]: any; + }): types.GraphRoutingFees; + + /** + * Creates a plain object from a GraphRoutingFees message. Also converts values to other types if specified. + * @param message GraphRoutingFees + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.GraphRoutingFees, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GraphRoutingFees to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphRoutingFees + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphChannelUpdate. */ + interface IGraphChannelUpdate { + /** GraphChannelUpdate last_update */ + last_update?: number | null; + + /** GraphChannelUpdate enabled */ + enabled?: boolean | null; + + /** GraphChannelUpdate cltv_expiry_delta */ + cltv_expiry_delta?: number | null; + + /** GraphChannelUpdate htlc_minimum_msat */ + htlc_minimum_msat?: Long | null; + + /** GraphChannelUpdate htlc_maximum_msat */ + htlc_maximum_msat?: Long | null; + + /** GraphChannelUpdate fees */ + fees?: types.IGraphRoutingFees | null; + } + + /** Represents a GraphChannelUpdate. */ + class GraphChannelUpdate implements IGraphChannelUpdate { + /** + * Constructs a new GraphChannelUpdate. + * @param [properties] Properties to set + */ + constructor(properties?: types.IGraphChannelUpdate); + + /** GraphChannelUpdate last_update. */ + public last_update: number; + + /** GraphChannelUpdate enabled. */ + public enabled: boolean; + + /** GraphChannelUpdate cltv_expiry_delta. */ + public cltv_expiry_delta: number; + + /** GraphChannelUpdate htlc_minimum_msat. */ + public htlc_minimum_msat: Long; + + /** GraphChannelUpdate htlc_maximum_msat. */ + public htlc_maximum_msat: Long; + + /** GraphChannelUpdate fees. */ + public fees?: types.IGraphRoutingFees | null; + + /** + * Creates a new GraphChannelUpdate instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphChannelUpdate instance + */ + public static create( + properties?: types.IGraphChannelUpdate + ): types.GraphChannelUpdate; + + /** + * Encodes the specified GraphChannelUpdate message. Does not implicitly {@link types.GraphChannelUpdate.verify|verify} messages. + * @param message GraphChannelUpdate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IGraphChannelUpdate, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GraphChannelUpdate message, length delimited. Does not implicitly {@link types.GraphChannelUpdate.verify|verify} messages. + * @param message GraphChannelUpdate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IGraphChannelUpdate, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GraphChannelUpdate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphChannelUpdate + * @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 + ): types.GraphChannelUpdate; + + /** + * Decodes a GraphChannelUpdate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphChannelUpdate + * @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 + ): types.GraphChannelUpdate; + + /** + * Verifies a GraphChannelUpdate 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 GraphChannelUpdate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphChannelUpdate + */ + public static fromObject(object: { + [k: string]: any; + }): types.GraphChannelUpdate; + + /** + * Creates a plain object from a GraphChannelUpdate message. Also converts values to other types if specified. + * @param message GraphChannelUpdate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.GraphChannelUpdate, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GraphChannelUpdate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphChannelUpdate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphChannel. */ + interface IGraphChannel { + /** GraphChannel node_one */ + node_one?: string | null; + + /** GraphChannel node_two */ + node_two?: string | null; + + /** GraphChannel capacity_sats */ + capacity_sats?: Long | null; + + /** GraphChannel one_to_two */ + one_to_two?: types.IGraphChannelUpdate | null; + + /** GraphChannel two_to_one */ + two_to_one?: types.IGraphChannelUpdate | null; + } + + /** Represents a GraphChannel. */ + class GraphChannel implements IGraphChannel { + /** + * Constructs a new GraphChannel. + * @param [properties] Properties to set + */ + constructor(properties?: types.IGraphChannel); + + /** GraphChannel node_one. */ + public node_one: string; + + /** GraphChannel node_two. */ + public node_two: string; + + /** GraphChannel capacity_sats. */ + public capacity_sats?: Long | null; + + /** GraphChannel one_to_two. */ + public one_to_two?: types.IGraphChannelUpdate | null; + + /** GraphChannel two_to_one. */ + public two_to_one?: types.IGraphChannelUpdate | null; + + /** + * Creates a new GraphChannel instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphChannel instance + */ + public static create( + properties?: types.IGraphChannel + ): types.GraphChannel; + + /** + * Encodes the specified GraphChannel message. Does not implicitly {@link types.GraphChannel.verify|verify} messages. + * @param message GraphChannel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IGraphChannel, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GraphChannel message, length delimited. Does not implicitly {@link types.GraphChannel.verify|verify} messages. + * @param message GraphChannel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IGraphChannel, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GraphChannel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphChannel + * @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 + ): types.GraphChannel; + + /** + * Decodes a GraphChannel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphChannel + * @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 + ): types.GraphChannel; + + /** + * Verifies a GraphChannel 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 GraphChannel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphChannel + */ + public static fromObject(object: { + [k: string]: any; + }): types.GraphChannel; + + /** + * Creates a plain object from a GraphChannel message. Also converts values to other types if specified. + * @param message GraphChannel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.GraphChannel, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GraphChannel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphChannel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphNodeAnnouncement. */ + interface IGraphNodeAnnouncement { + /** GraphNodeAnnouncement last_update */ + last_update?: number | null; + + /** GraphNodeAnnouncement alias */ + alias?: string | null; + + /** GraphNodeAnnouncement rgb */ + rgb?: string | null; + + /** GraphNodeAnnouncement addresses */ + addresses?: string[] | null; + } + + /** Represents a GraphNodeAnnouncement. */ + class GraphNodeAnnouncement implements IGraphNodeAnnouncement { + /** + * Constructs a new GraphNodeAnnouncement. + * @param [properties] Properties to set + */ + constructor(properties?: types.IGraphNodeAnnouncement); + + /** GraphNodeAnnouncement last_update. */ + public last_update: number; + + /** GraphNodeAnnouncement alias. */ + public alias: string; + + /** GraphNodeAnnouncement rgb. */ + public rgb: string; + + /** GraphNodeAnnouncement addresses. */ + public addresses: string[]; + + /** + * Creates a new GraphNodeAnnouncement instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphNodeAnnouncement instance + */ + public static create( + properties?: types.IGraphNodeAnnouncement + ): types.GraphNodeAnnouncement; + + /** + * Encodes the specified GraphNodeAnnouncement message. Does not implicitly {@link types.GraphNodeAnnouncement.verify|verify} messages. + * @param message GraphNodeAnnouncement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IGraphNodeAnnouncement, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GraphNodeAnnouncement message, length delimited. Does not implicitly {@link types.GraphNodeAnnouncement.verify|verify} messages. + * @param message GraphNodeAnnouncement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IGraphNodeAnnouncement, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GraphNodeAnnouncement message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphNodeAnnouncement + * @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 + ): types.GraphNodeAnnouncement; + + /** + * Decodes a GraphNodeAnnouncement message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphNodeAnnouncement + * @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 + ): types.GraphNodeAnnouncement; + + /** + * Verifies a GraphNodeAnnouncement 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 GraphNodeAnnouncement message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphNodeAnnouncement + */ + public static fromObject(object: { + [k: string]: any; + }): types.GraphNodeAnnouncement; + + /** + * Creates a plain object from a GraphNodeAnnouncement message. Also converts values to other types if specified. + * @param message GraphNodeAnnouncement + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.GraphNodeAnnouncement, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GraphNodeAnnouncement to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphNodeAnnouncement + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Peer. */ + interface IPeer { + /** Peer node_id */ + node_id?: string | null; + + /** Peer address */ + address?: string | null; + + /** Peer is_persisted */ + is_persisted?: boolean | null; + + /** Peer is_connected */ + is_connected?: boolean | null; + } + + /** Represents a Peer. */ + class Peer implements IPeer { + /** + * Constructs a new Peer. + * @param [properties] Properties to set + */ + constructor(properties?: types.IPeer); + + /** Peer node_id. */ + public node_id: string; + + /** Peer address. */ + public address: string; + + /** Peer is_persisted. */ + public is_persisted: boolean; + + /** Peer is_connected. */ + public is_connected: boolean; + + /** + * Creates a new Peer instance using the specified properties. + * @param [properties] Properties to set + * @returns Peer instance + */ + public static create(properties?: types.IPeer): types.Peer; + + /** + * Encodes the specified Peer message. Does not implicitly {@link types.Peer.verify|verify} messages. + * @param message Peer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IPeer, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Peer message, length delimited. Does not implicitly {@link types.Peer.verify|verify} messages. + * @param message Peer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IPeer, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Peer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Peer + * @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 + ): types.Peer; + + /** + * Decodes a Peer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Peer + * @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 + ): types.Peer; + + /** + * Verifies a Peer 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 Peer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Peer + */ + public static fromObject(object: { [k: string]: any }): types.Peer; + + /** + * Creates a plain object from a Peer message. Also converts values to other types if specified. + * @param message Peer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Peer, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Peer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Peer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphNode. */ + interface IGraphNode { + /** GraphNode channels */ + channels?: Long[] | null; + + /** GraphNode announcement_info */ + announcement_info?: types.IGraphNodeAnnouncement | null; + } + + /** Represents a GraphNode. */ + class GraphNode implements IGraphNode { + /** + * Constructs a new GraphNode. + * @param [properties] Properties to set + */ + constructor(properties?: types.IGraphNode); + + /** GraphNode channels. */ + public channels: Long[]; + + /** GraphNode announcement_info. */ + public announcement_info?: types.IGraphNodeAnnouncement | null; + + /** + * Creates a new GraphNode instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphNode instance + */ + public static create(properties?: types.IGraphNode): types.GraphNode; + + /** + * Encodes the specified GraphNode message. Does not implicitly {@link types.GraphNode.verify|verify} messages. + * @param message GraphNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IGraphNode, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GraphNode message, length delimited. Does not implicitly {@link types.GraphNode.verify|verify} messages. + * @param message GraphNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IGraphNode, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GraphNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphNode + * @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 + ): types.GraphNode; + + /** + * Decodes a GraphNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphNode + * @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 + ): types.GraphNode; + + /** + * Verifies a GraphNode 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 GraphNode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphNode + */ + public static fromObject(object: { [k: string]: any }): types.GraphNode; + + /** + * Creates a plain object from a GraphNode message. Also converts values to other types if specified. + * @param message GraphNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.GraphNode, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GraphNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphNode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11RouteHint. */ + interface IBolt11RouteHint { + /** Bolt11RouteHint hop_hints */ + hop_hints?: types.IBolt11HopHint[] | null; + } + + /** Represents a Bolt11RouteHint. */ + class Bolt11RouteHint implements IBolt11RouteHint { + /** + * Constructs a new Bolt11RouteHint. + * @param [properties] Properties to set + */ + constructor(properties?: types.IBolt11RouteHint); + + /** Bolt11RouteHint hop_hints. */ + public hop_hints: types.IBolt11HopHint[]; + + /** + * Creates a new Bolt11RouteHint instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11RouteHint instance + */ + public static create( + properties?: types.IBolt11RouteHint + ): types.Bolt11RouteHint; + + /** + * Encodes the specified Bolt11RouteHint message. Does not implicitly {@link types.Bolt11RouteHint.verify|verify} messages. + * @param message Bolt11RouteHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IBolt11RouteHint, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11RouteHint message, length delimited. Does not implicitly {@link types.Bolt11RouteHint.verify|verify} messages. + * @param message Bolt11RouteHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IBolt11RouteHint, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11RouteHint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11RouteHint + * @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 + ): types.Bolt11RouteHint; + + /** + * Decodes a Bolt11RouteHint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11RouteHint + * @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 + ): types.Bolt11RouteHint; + + /** + * Verifies a Bolt11RouteHint 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 Bolt11RouteHint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11RouteHint + */ + public static fromObject(object: { + [k: string]: any; + }): types.Bolt11RouteHint; + + /** + * Creates a plain object from a Bolt11RouteHint message. Also converts values to other types if specified. + * @param message Bolt11RouteHint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Bolt11RouteHint, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11RouteHint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11RouteHint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11HopHint. */ + interface IBolt11HopHint { + /** Bolt11HopHint node_id */ + node_id?: string | null; + + /** Bolt11HopHint short_channel_id */ + short_channel_id?: Long | null; + + /** Bolt11HopHint fee_base_msat */ + fee_base_msat?: number | null; + + /** Bolt11HopHint fee_proportional_millionths */ + fee_proportional_millionths?: number | null; + + /** Bolt11HopHint cltv_expiry_delta */ + cltv_expiry_delta?: number | null; + } + + /** Represents a Bolt11HopHint. */ + class Bolt11HopHint implements IBolt11HopHint { + /** + * Constructs a new Bolt11HopHint. + * @param [properties] Properties to set + */ + constructor(properties?: types.IBolt11HopHint); + + /** Bolt11HopHint node_id. */ + public node_id: string; + + /** Bolt11HopHint short_channel_id. */ + public short_channel_id: Long; + + /** Bolt11HopHint fee_base_msat. */ + public fee_base_msat: number; + + /** Bolt11HopHint fee_proportional_millionths. */ + public fee_proportional_millionths: number; + + /** Bolt11HopHint cltv_expiry_delta. */ + public cltv_expiry_delta: number; + + /** + * Creates a new Bolt11HopHint instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11HopHint instance + */ + public static create( + properties?: types.IBolt11HopHint + ): types.Bolt11HopHint; + + /** + * Encodes the specified Bolt11HopHint message. Does not implicitly {@link types.Bolt11HopHint.verify|verify} messages. + * @param message Bolt11HopHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IBolt11HopHint, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11HopHint message, length delimited. Does not implicitly {@link types.Bolt11HopHint.verify|verify} messages. + * @param message Bolt11HopHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IBolt11HopHint, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11HopHint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11HopHint + * @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 + ): types.Bolt11HopHint; + + /** + * Decodes a Bolt11HopHint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11HopHint + * @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 + ): types.Bolt11HopHint; + + /** + * Verifies a Bolt11HopHint 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 Bolt11HopHint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11HopHint + */ + public static fromObject(object: { + [k: string]: any; + }): types.Bolt11HopHint; + + /** + * Creates a plain object from a Bolt11HopHint message. Also converts values to other types if specified. + * @param message Bolt11HopHint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Bolt11HopHint, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11HopHint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11HopHint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OfferAmount. */ + interface IOfferAmount { + /** OfferAmount bitcoin_amount_msats */ + bitcoin_amount_msats?: Long | null; + + /** OfferAmount currency_amount */ + currency_amount?: types.ICurrencyAmount | null; + } + + /** Represents an OfferAmount. */ + class OfferAmount implements IOfferAmount { + /** + * Constructs a new OfferAmount. + * @param [properties] Properties to set + */ + constructor(properties?: types.IOfferAmount); + + /** OfferAmount bitcoin_amount_msats. */ + public bitcoin_amount_msats?: Long | null; + + /** OfferAmount currency_amount. */ + public currency_amount?: types.ICurrencyAmount | null; + + /** OfferAmount amount. */ + public amount?: 'bitcoin_amount_msats' | 'currency_amount'; + + /** + * Creates a new OfferAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns OfferAmount instance + */ + public static create( + properties?: types.IOfferAmount + ): types.OfferAmount; + + /** + * Encodes the specified OfferAmount message. Does not implicitly {@link types.OfferAmount.verify|verify} messages. + * @param message OfferAmount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IOfferAmount, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified OfferAmount message, length delimited. Does not implicitly {@link types.OfferAmount.verify|verify} messages. + * @param message OfferAmount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IOfferAmount, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an OfferAmount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OfferAmount + * @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 + ): types.OfferAmount; + + /** + * Decodes an OfferAmount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OfferAmount + * @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 + ): types.OfferAmount; + + /** + * Verifies an OfferAmount 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 OfferAmount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OfferAmount + */ + public static fromObject(object: { + [k: string]: any; + }): types.OfferAmount; + + /** + * Creates a plain object from an OfferAmount message. Also converts values to other types if specified. + * @param message OfferAmount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.OfferAmount, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this OfferAmount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OfferAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrencyAmount. */ + interface ICurrencyAmount { + /** CurrencyAmount iso4217_code */ + iso4217_code?: string | null; + + /** CurrencyAmount amount */ + amount?: Long | null; + } + + /** Represents a CurrencyAmount. */ + class CurrencyAmount implements ICurrencyAmount { + /** + * Constructs a new CurrencyAmount. + * @param [properties] Properties to set + */ + constructor(properties?: types.ICurrencyAmount); + + /** CurrencyAmount iso4217_code. */ + public iso4217_code: string; + + /** CurrencyAmount amount. */ + public amount: Long; + + /** + * Creates a new CurrencyAmount instance using the specified properties. + * @param [properties] Properties to set + * @returns CurrencyAmount instance + */ + public static create( + properties?: types.ICurrencyAmount + ): types.CurrencyAmount; + + /** + * Encodes the specified CurrencyAmount message. Does not implicitly {@link types.CurrencyAmount.verify|verify} messages. + * @param message CurrencyAmount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.ICurrencyAmount, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified CurrencyAmount message, length delimited. Does not implicitly {@link types.CurrencyAmount.verify|verify} messages. + * @param message CurrencyAmount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.ICurrencyAmount, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a CurrencyAmount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CurrencyAmount + * @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 + ): types.CurrencyAmount; + + /** + * Decodes a CurrencyAmount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CurrencyAmount + * @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 + ): types.CurrencyAmount; + + /** + * Verifies a CurrencyAmount 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 CurrencyAmount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CurrencyAmount + */ + public static fromObject(object: { + [k: string]: any; + }): types.CurrencyAmount; + + /** + * Creates a plain object from a CurrencyAmount message. Also converts values to other types if specified. + * @param message CurrencyAmount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.CurrencyAmount, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this CurrencyAmount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CurrencyAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OfferQuantity. */ + interface IOfferQuantity { + /** OfferQuantity one */ + one?: boolean | null; + + /** OfferQuantity bounded */ + bounded?: Long | null; + + /** OfferQuantity unbounded */ + unbounded?: boolean | null; + } + + /** Represents an OfferQuantity. */ + class OfferQuantity implements IOfferQuantity { + /** + * Constructs a new OfferQuantity. + * @param [properties] Properties to set + */ + constructor(properties?: types.IOfferQuantity); + + /** OfferQuantity one. */ + public one?: boolean | null; + + /** OfferQuantity bounded. */ + public bounded?: Long | null; + + /** OfferQuantity unbounded. */ + public unbounded?: boolean | null; + + /** OfferQuantity quantity. */ + public quantity?: 'one' | 'bounded' | 'unbounded'; + + /** + * Creates a new OfferQuantity instance using the specified properties. + * @param [properties] Properties to set + * @returns OfferQuantity instance + */ + public static create( + properties?: types.IOfferQuantity + ): types.OfferQuantity; + + /** + * Encodes the specified OfferQuantity message. Does not implicitly {@link types.OfferQuantity.verify|verify} messages. + * @param message OfferQuantity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IOfferQuantity, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified OfferQuantity message, length delimited. Does not implicitly {@link types.OfferQuantity.verify|verify} messages. + * @param message OfferQuantity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IOfferQuantity, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an OfferQuantity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OfferQuantity + * @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 + ): types.OfferQuantity; + + /** + * Decodes an OfferQuantity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OfferQuantity + * @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 + ): types.OfferQuantity; + + /** + * Verifies an OfferQuantity 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 OfferQuantity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OfferQuantity + */ + public static fromObject(object: { + [k: string]: any; + }): types.OfferQuantity; + + /** + * Creates a plain object from an OfferQuantity message. Also converts values to other types if specified. + * @param message OfferQuantity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.OfferQuantity, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this OfferQuantity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OfferQuantity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BlindedPath. */ + interface IBlindedPath { + /** BlindedPath node_id */ + node_id?: string | null; + + /** BlindedPath directed_scid */ + directed_scid?: types.IDirectedShortChannelId | null; + + /** BlindedPath blinding_point */ + blinding_point?: string | null; + + /** BlindedPath num_hops */ + num_hops?: number | null; + } + + /** Represents a BlindedPath. */ + class BlindedPath implements IBlindedPath { + /** + * Constructs a new BlindedPath. + * @param [properties] Properties to set + */ + constructor(properties?: types.IBlindedPath); + + /** BlindedPath node_id. */ + public node_id?: string | null; + + /** BlindedPath directed_scid. */ + public directed_scid?: types.IDirectedShortChannelId | null; + + /** BlindedPath blinding_point. */ + public blinding_point: string; + + /** BlindedPath num_hops. */ + public num_hops: number; + + /** BlindedPath introduction_node. */ + public introduction_node?: 'node_id' | 'directed_scid'; + + /** + * Creates a new BlindedPath instance using the specified properties. + * @param [properties] Properties to set + * @returns BlindedPath instance + */ + public static create( + properties?: types.IBlindedPath + ): types.BlindedPath; + + /** + * Encodes the specified BlindedPath message. Does not implicitly {@link types.BlindedPath.verify|verify} messages. + * @param message BlindedPath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IBlindedPath, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified BlindedPath message, length delimited. Does not implicitly {@link types.BlindedPath.verify|verify} messages. + * @param message BlindedPath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IBlindedPath, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a BlindedPath message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BlindedPath + * @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 + ): types.BlindedPath; + + /** + * Decodes a BlindedPath message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BlindedPath + * @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 + ): types.BlindedPath; + + /** + * Verifies a BlindedPath 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 BlindedPath message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BlindedPath + */ + public static fromObject(object: { + [k: string]: any; + }): types.BlindedPath; + + /** + * Creates a plain object from a BlindedPath message. Also converts values to other types if specified. + * @param message BlindedPath + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.BlindedPath, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this BlindedPath to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BlindedPath + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DirectedShortChannelId. */ + interface IDirectedShortChannelId { + /** DirectedShortChannelId scid */ + scid?: Long | null; + + /** DirectedShortChannelId direction */ + direction?: types.ChannelDirection | null; + } + + /** Represents a DirectedShortChannelId. */ + class DirectedShortChannelId implements IDirectedShortChannelId { + /** + * Constructs a new DirectedShortChannelId. + * @param [properties] Properties to set + */ + constructor(properties?: types.IDirectedShortChannelId); + + /** DirectedShortChannelId scid. */ + public scid: Long; + + /** DirectedShortChannelId direction. */ + public direction: types.ChannelDirection; + + /** + * Creates a new DirectedShortChannelId instance using the specified properties. + * @param [properties] Properties to set + * @returns DirectedShortChannelId instance + */ + public static create( + properties?: types.IDirectedShortChannelId + ): types.DirectedShortChannelId; + + /** + * Encodes the specified DirectedShortChannelId message. Does not implicitly {@link types.DirectedShortChannelId.verify|verify} messages. + * @param message DirectedShortChannelId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IDirectedShortChannelId, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified DirectedShortChannelId message, length delimited. Does not implicitly {@link types.DirectedShortChannelId.verify|verify} messages. + * @param message DirectedShortChannelId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IDirectedShortChannelId, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a DirectedShortChannelId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DirectedShortChannelId + * @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 + ): types.DirectedShortChannelId; + + /** + * Decodes a DirectedShortChannelId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DirectedShortChannelId + * @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 + ): types.DirectedShortChannelId; + + /** + * Verifies a DirectedShortChannelId 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 DirectedShortChannelId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DirectedShortChannelId + */ + public static fromObject(object: { + [k: string]: any; + }): types.DirectedShortChannelId; + + /** + * Creates a plain object from a DirectedShortChannelId message. Also converts values to other types if specified. + * @param message DirectedShortChannelId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.DirectedShortChannelId, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this DirectedShortChannelId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DirectedShortChannelId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ChannelDirection enum. */ + enum ChannelDirection { + NODE_ONE = 0, + NODE_TWO = 1 + } + + /** Properties of a Bolt11Feature. */ + interface IBolt11Feature { + /** Bolt11Feature name */ + name?: string | null; + + /** Bolt11Feature is_required */ + is_required?: boolean | null; + + /** Bolt11Feature is_known */ + is_known?: boolean | null; + } + + /** Represents a Bolt11Feature. */ + class Bolt11Feature implements IBolt11Feature { + /** + * Constructs a new Bolt11Feature. + * @param [properties] Properties to set + */ + constructor(properties?: types.IBolt11Feature); + + /** Bolt11Feature name. */ + public name: string; + + /** Bolt11Feature is_required. */ + public is_required: boolean; + + /** Bolt11Feature is_known. */ + public is_known: boolean; + + /** + * Creates a new Bolt11Feature instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11Feature instance + */ + public static create( + properties?: types.IBolt11Feature + ): types.Bolt11Feature; + + /** + * Encodes the specified Bolt11Feature message. Does not implicitly {@link types.Bolt11Feature.verify|verify} messages. + * @param message Bolt11Feature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IBolt11Feature, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11Feature message, length delimited. Does not implicitly {@link types.Bolt11Feature.verify|verify} messages. + * @param message Bolt11Feature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IBolt11Feature, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11Feature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11Feature + * @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 + ): types.Bolt11Feature; + + /** + * Decodes a Bolt11Feature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11Feature + * @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 + ): types.Bolt11Feature; + + /** + * Verifies a Bolt11Feature 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 Bolt11Feature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11Feature + */ + public static fromObject(object: { + [k: string]: any; + }): types.Bolt11Feature; + + /** + * Creates a plain object from a Bolt11Feature message. Also converts values to other types if specified. + * @param message Bolt11Feature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Bolt11Feature, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11Feature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11Feature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } +} + +/** Namespace events. */ +export namespace events { + /** Properties of an EventEnvelope. */ + interface IEventEnvelope { + /** EventEnvelope payment_received */ + payment_received?: events.IPaymentReceived | null; + + /** EventEnvelope payment_successful */ + payment_successful?: events.IPaymentSuccessful | null; + + /** EventEnvelope payment_failed */ + payment_failed?: events.IPaymentFailed | null; + + /** EventEnvelope payment_forwarded */ + payment_forwarded?: events.IPaymentForwarded | null; + + /** EventEnvelope payment_claimable */ + payment_claimable?: events.IPaymentClaimable | null; + + /** EventEnvelope channel_state_changed */ + channel_state_changed?: events.IChannelStateChanged | null; + } + + /** Represents an EventEnvelope. */ + class EventEnvelope implements IEventEnvelope { + /** + * Constructs a new EventEnvelope. + * @param [properties] Properties to set + */ + constructor(properties?: events.IEventEnvelope); + + /** EventEnvelope payment_received. */ + public payment_received?: events.IPaymentReceived | null; + + /** EventEnvelope payment_successful. */ + public payment_successful?: events.IPaymentSuccessful | null; + + /** EventEnvelope payment_failed. */ + public payment_failed?: events.IPaymentFailed | null; + + /** EventEnvelope payment_forwarded. */ + public payment_forwarded?: events.IPaymentForwarded | null; + + /** EventEnvelope payment_claimable. */ + public payment_claimable?: events.IPaymentClaimable | null; + + /** EventEnvelope channel_state_changed. */ + public channel_state_changed?: events.IChannelStateChanged | null; + + /** EventEnvelope event. */ + public event?: + | 'payment_received' + | 'payment_successful' + | 'payment_failed' + | 'payment_forwarded' + | 'payment_claimable' + | 'channel_state_changed'; + + /** + * Creates a new EventEnvelope instance using the specified properties. + * @param [properties] Properties to set + * @returns EventEnvelope instance + */ + public static create( + properties?: events.IEventEnvelope + ): events.EventEnvelope; + + /** + * Encodes the specified EventEnvelope message. Does not implicitly {@link events.EventEnvelope.verify|verify} messages. + * @param message EventEnvelope message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: events.IEventEnvelope, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified EventEnvelope message, length delimited. Does not implicitly {@link events.EventEnvelope.verify|verify} messages. + * @param message EventEnvelope message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: events.IEventEnvelope, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an EventEnvelope message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventEnvelope + * @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 + ): events.EventEnvelope; + + /** + * Decodes an EventEnvelope message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventEnvelope + * @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 + ): events.EventEnvelope; + + /** + * Verifies an EventEnvelope 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 EventEnvelope message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventEnvelope + */ + public static fromObject(object: { + [k: string]: any; + }): events.EventEnvelope; + + /** + * Creates a plain object from an EventEnvelope message. Also converts values to other types if specified. + * @param message EventEnvelope + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: events.EventEnvelope, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this EventEnvelope to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EventEnvelope + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ChannelState enum. */ + enum ChannelState { + CHANNEL_STATE_UNSPECIFIED = 0, + CHANNEL_STATE_PENDING = 1, + CHANNEL_STATE_READY = 2, + CHANNEL_STATE_OPEN_FAILED = 3, + CHANNEL_STATE_CLOSED = 4 + } + + /** ChannelClosureInitiator enum. */ + enum ChannelClosureInitiator { + CHANNEL_CLOSURE_INITIATOR_UNSPECIFIED = 0, + CHANNEL_CLOSURE_INITIATOR_LOCAL = 1, + CHANNEL_CLOSURE_INITIATOR_REMOTE = 2, + CHANNEL_CLOSURE_INITIATOR_UNKNOWN = 3 + } + + /** ChannelStateChangeReasonKind enum. */ + enum ChannelStateChangeReasonKind { + CHANNEL_STATE_CHANGE_REASON_KIND_UNSPECIFIED = 0, + CHANNEL_STATE_CHANGE_REASON_KIND_COUNTERPARTY_FORCE_CLOSED = 1, + CHANNEL_STATE_CHANGE_REASON_KIND_HOLDER_FORCE_CLOSED = 2, + CHANNEL_STATE_CHANGE_REASON_KIND_LEGACY_COOPERATIVE_CLOSURE = 3, + CHANNEL_STATE_CHANGE_REASON_KIND_COUNTERPARTY_INITIATED_COOPERATIVE_CLOSURE = 4, + CHANNEL_STATE_CHANGE_REASON_KIND_LOCALLY_INITIATED_COOPERATIVE_CLOSURE = 5, + CHANNEL_STATE_CHANGE_REASON_KIND_COMMITMENT_TX_CONFIRMED = 6, + CHANNEL_STATE_CHANGE_REASON_KIND_FUNDING_TIMED_OUT = 7, + CHANNEL_STATE_CHANGE_REASON_KIND_PROCESSING_ERROR = 8, + CHANNEL_STATE_CHANGE_REASON_KIND_DISCONNECTED_PEER = 9, + CHANNEL_STATE_CHANGE_REASON_KIND_OUTDATED_CHANNEL_MANAGER = 10, + CHANNEL_STATE_CHANGE_REASON_KIND_COUNTERPARTY_COOP_CLOSED_UNFUNDED_CHANNEL = 11, + CHANNEL_STATE_CHANGE_REASON_KIND_LOCALLY_COOP_CLOSED_UNFUNDED_CHANNEL = 12, + CHANNEL_STATE_CHANGE_REASON_KIND_FUNDING_BATCH_CLOSURE = 13, + CHANNEL_STATE_CHANGE_REASON_KIND_HTLCS_TIMED_OUT = 14, + CHANNEL_STATE_CHANGE_REASON_KIND_PEER_FEERATE_TOO_LOW = 15 + } + + /** Properties of a CounterpartyForceClosedDetails. */ + interface ICounterpartyForceClosedDetails { + /** CounterpartyForceClosedDetails peer_msg */ + peer_msg?: string | null; + } + + /** Represents a CounterpartyForceClosedDetails. */ + class CounterpartyForceClosedDetails + implements ICounterpartyForceClosedDetails + { + /** + * Constructs a new CounterpartyForceClosedDetails. + * @param [properties] Properties to set + */ + constructor(properties?: events.ICounterpartyForceClosedDetails); + + /** CounterpartyForceClosedDetails peer_msg. */ + public peer_msg: string; + + /** + * Creates a new CounterpartyForceClosedDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns CounterpartyForceClosedDetails instance + */ + public static create( + properties?: events.ICounterpartyForceClosedDetails + ): events.CounterpartyForceClosedDetails; + + /** + * Encodes the specified CounterpartyForceClosedDetails message. Does not implicitly {@link events.CounterpartyForceClosedDetails.verify|verify} messages. + * @param message CounterpartyForceClosedDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: events.ICounterpartyForceClosedDetails, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified CounterpartyForceClosedDetails message, length delimited. Does not implicitly {@link events.CounterpartyForceClosedDetails.verify|verify} messages. + * @param message CounterpartyForceClosedDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: events.ICounterpartyForceClosedDetails, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a CounterpartyForceClosedDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CounterpartyForceClosedDetails + * @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 + ): events.CounterpartyForceClosedDetails; + + /** + * Decodes a CounterpartyForceClosedDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CounterpartyForceClosedDetails + * @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 + ): events.CounterpartyForceClosedDetails; + + /** + * Verifies a CounterpartyForceClosedDetails 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 CounterpartyForceClosedDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CounterpartyForceClosedDetails + */ + public static fromObject(object: { + [k: string]: any; + }): events.CounterpartyForceClosedDetails; + + /** + * Creates a plain object from a CounterpartyForceClosedDetails message. Also converts values to other types if specified. + * @param message CounterpartyForceClosedDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: events.CounterpartyForceClosedDetails, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this CounterpartyForceClosedDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CounterpartyForceClosedDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HolderForceClosedDetails. */ + interface IHolderForceClosedDetails { + /** HolderForceClosedDetails broadcasted_latest_txn */ + broadcasted_latest_txn?: boolean | null; + + /** HolderForceClosedDetails message */ + message?: string | null; + } + + /** Represents a HolderForceClosedDetails. */ + class HolderForceClosedDetails implements IHolderForceClosedDetails { + /** + * Constructs a new HolderForceClosedDetails. + * @param [properties] Properties to set + */ + constructor(properties?: events.IHolderForceClosedDetails); + + /** HolderForceClosedDetails broadcasted_latest_txn. */ + public broadcasted_latest_txn?: boolean | null; + + /** HolderForceClosedDetails message. */ + public message: string; + + /** + * Creates a new HolderForceClosedDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns HolderForceClosedDetails instance + */ + public static create( + properties?: events.IHolderForceClosedDetails + ): events.HolderForceClosedDetails; + + /** + * Encodes the specified HolderForceClosedDetails message. Does not implicitly {@link events.HolderForceClosedDetails.verify|verify} messages. + * @param message HolderForceClosedDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: events.IHolderForceClosedDetails, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified HolderForceClosedDetails message, length delimited. Does not implicitly {@link events.HolderForceClosedDetails.verify|verify} messages. + * @param message HolderForceClosedDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: events.IHolderForceClosedDetails, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a HolderForceClosedDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HolderForceClosedDetails + * @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 + ): events.HolderForceClosedDetails; + + /** + * Decodes a HolderForceClosedDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HolderForceClosedDetails + * @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 + ): events.HolderForceClosedDetails; + + /** + * Verifies a HolderForceClosedDetails 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 HolderForceClosedDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HolderForceClosedDetails + */ + public static fromObject(object: { + [k: string]: any; + }): events.HolderForceClosedDetails; + + /** + * Creates a plain object from a HolderForceClosedDetails message. Also converts values to other types if specified. + * @param message HolderForceClosedDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: events.HolderForceClosedDetails, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this HolderForceClosedDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HolderForceClosedDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ProcessingErrorDetails. */ + interface IProcessingErrorDetails { + /** ProcessingErrorDetails err */ + err?: string | null; + } + + /** Represents a ProcessingErrorDetails. */ + class ProcessingErrorDetails implements IProcessingErrorDetails { + /** + * Constructs a new ProcessingErrorDetails. + * @param [properties] Properties to set + */ + constructor(properties?: events.IProcessingErrorDetails); + + /** ProcessingErrorDetails err. */ + public err: string; + + /** + * Creates a new ProcessingErrorDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns ProcessingErrorDetails instance + */ + public static create( + properties?: events.IProcessingErrorDetails + ): events.ProcessingErrorDetails; + + /** + * Encodes the specified ProcessingErrorDetails message. Does not implicitly {@link events.ProcessingErrorDetails.verify|verify} messages. + * @param message ProcessingErrorDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: events.IProcessingErrorDetails, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ProcessingErrorDetails message, length delimited. Does not implicitly {@link events.ProcessingErrorDetails.verify|verify} messages. + * @param message ProcessingErrorDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: events.IProcessingErrorDetails, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ProcessingErrorDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProcessingErrorDetails + * @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 + ): events.ProcessingErrorDetails; + + /** + * Decodes a ProcessingErrorDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProcessingErrorDetails + * @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 + ): events.ProcessingErrorDetails; + + /** + * Verifies a ProcessingErrorDetails 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 ProcessingErrorDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProcessingErrorDetails + */ + public static fromObject(object: { + [k: string]: any; + }): events.ProcessingErrorDetails; + + /** + * Creates a plain object from a ProcessingErrorDetails message. Also converts values to other types if specified. + * @param message ProcessingErrorDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: events.ProcessingErrorDetails, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ProcessingErrorDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProcessingErrorDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HtlcsTimedOutDetails. */ + interface IHtlcsTimedOutDetails { + /** HtlcsTimedOutDetails payment_hash */ + payment_hash?: string | null; + } + + /** Represents a HtlcsTimedOutDetails. */ + class HtlcsTimedOutDetails implements IHtlcsTimedOutDetails { + /** + * Constructs a new HtlcsTimedOutDetails. + * @param [properties] Properties to set + */ + constructor(properties?: events.IHtlcsTimedOutDetails); + + /** HtlcsTimedOutDetails payment_hash. */ + public payment_hash?: string | null; + + /** + * Creates a new HtlcsTimedOutDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns HtlcsTimedOutDetails instance + */ + public static create( + properties?: events.IHtlcsTimedOutDetails + ): events.HtlcsTimedOutDetails; + + /** + * Encodes the specified HtlcsTimedOutDetails message. Does not implicitly {@link events.HtlcsTimedOutDetails.verify|verify} messages. + * @param message HtlcsTimedOutDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: events.IHtlcsTimedOutDetails, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified HtlcsTimedOutDetails message, length delimited. Does not implicitly {@link events.HtlcsTimedOutDetails.verify|verify} messages. + * @param message HtlcsTimedOutDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: events.IHtlcsTimedOutDetails, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a HtlcsTimedOutDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HtlcsTimedOutDetails + * @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 + ): events.HtlcsTimedOutDetails; + + /** + * Decodes a HtlcsTimedOutDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HtlcsTimedOutDetails + * @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 + ): events.HtlcsTimedOutDetails; + + /** + * Verifies a HtlcsTimedOutDetails 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 HtlcsTimedOutDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HtlcsTimedOutDetails + */ + public static fromObject(object: { + [k: string]: any; + }): events.HtlcsTimedOutDetails; + + /** + * Creates a plain object from a HtlcsTimedOutDetails message. Also converts values to other types if specified. + * @param message HtlcsTimedOutDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: events.HtlcsTimedOutDetails, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this HtlcsTimedOutDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HtlcsTimedOutDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PeerFeerateTooLowDetails. */ + interface IPeerFeerateTooLowDetails { + /** PeerFeerateTooLowDetails peer_feerate_sat_per_kw */ + peer_feerate_sat_per_kw?: number | null; + + /** PeerFeerateTooLowDetails required_feerate_sat_per_kw */ + required_feerate_sat_per_kw?: number | null; + } + + /** Represents a PeerFeerateTooLowDetails. */ + class PeerFeerateTooLowDetails implements IPeerFeerateTooLowDetails { + /** + * Constructs a new PeerFeerateTooLowDetails. + * @param [properties] Properties to set + */ + constructor(properties?: events.IPeerFeerateTooLowDetails); + + /** PeerFeerateTooLowDetails peer_feerate_sat_per_kw. */ + public peer_feerate_sat_per_kw: number; + + /** PeerFeerateTooLowDetails required_feerate_sat_per_kw. */ + public required_feerate_sat_per_kw: number; + + /** + * Creates a new PeerFeerateTooLowDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns PeerFeerateTooLowDetails instance + */ + public static create( + properties?: events.IPeerFeerateTooLowDetails + ): events.PeerFeerateTooLowDetails; + + /** + * Encodes the specified PeerFeerateTooLowDetails message. Does not implicitly {@link events.PeerFeerateTooLowDetails.verify|verify} messages. + * @param message PeerFeerateTooLowDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: events.IPeerFeerateTooLowDetails, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified PeerFeerateTooLowDetails message, length delimited. Does not implicitly {@link events.PeerFeerateTooLowDetails.verify|verify} messages. + * @param message PeerFeerateTooLowDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: events.IPeerFeerateTooLowDetails, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a PeerFeerateTooLowDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PeerFeerateTooLowDetails + * @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 + ): events.PeerFeerateTooLowDetails; + + /** + * Decodes a PeerFeerateTooLowDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PeerFeerateTooLowDetails + * @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 + ): events.PeerFeerateTooLowDetails; + + /** + * Verifies a PeerFeerateTooLowDetails 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 PeerFeerateTooLowDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PeerFeerateTooLowDetails + */ + public static fromObject(object: { + [k: string]: any; + }): events.PeerFeerateTooLowDetails; + + /** + * Creates a plain object from a PeerFeerateTooLowDetails message. Also converts values to other types if specified. + * @param message PeerFeerateTooLowDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: events.PeerFeerateTooLowDetails, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this PeerFeerateTooLowDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PeerFeerateTooLowDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChannelStateChangeReason. */ + interface IChannelStateChangeReason { + /** ChannelStateChangeReason kind */ + kind?: events.ChannelStateChangeReasonKind | null; + + /** ChannelStateChangeReason message */ + message?: string | null; + + /** ChannelStateChangeReason counterparty_force_closed */ + counterparty_force_closed?: events.ICounterpartyForceClosedDetails | null; + + /** ChannelStateChangeReason holder_force_closed */ + holder_force_closed?: events.IHolderForceClosedDetails | null; + + /** ChannelStateChangeReason processing_error */ + processing_error?: events.IProcessingErrorDetails | null; + + /** ChannelStateChangeReason htlcs_timed_out */ + htlcs_timed_out?: events.IHtlcsTimedOutDetails | null; + + /** ChannelStateChangeReason peer_feerate_too_low */ + peer_feerate_too_low?: events.IPeerFeerateTooLowDetails | null; + } + + /** Represents a ChannelStateChangeReason. */ + class ChannelStateChangeReason implements IChannelStateChangeReason { + /** + * Constructs a new ChannelStateChangeReason. + * @param [properties] Properties to set + */ + constructor(properties?: events.IChannelStateChangeReason); + + /** ChannelStateChangeReason kind. */ + public kind: events.ChannelStateChangeReasonKind; + + /** ChannelStateChangeReason message. */ + public message: string; + + /** ChannelStateChangeReason counterparty_force_closed. */ + public counterparty_force_closed?: events.ICounterpartyForceClosedDetails | null; + + /** ChannelStateChangeReason holder_force_closed. */ + public holder_force_closed?: events.IHolderForceClosedDetails | null; + + /** ChannelStateChangeReason processing_error. */ + public processing_error?: events.IProcessingErrorDetails | null; + + /** ChannelStateChangeReason htlcs_timed_out. */ + public htlcs_timed_out?: events.IHtlcsTimedOutDetails | null; + + /** ChannelStateChangeReason peer_feerate_too_low. */ + public peer_feerate_too_low?: events.IPeerFeerateTooLowDetails | null; + + /** ChannelStateChangeReason details. */ + public details?: + | 'counterparty_force_closed' + | 'holder_force_closed' + | 'processing_error' + | 'htlcs_timed_out' + | 'peer_feerate_too_low'; + + /** + * Creates a new ChannelStateChangeReason instance using the specified properties. + * @param [properties] Properties to set + * @returns ChannelStateChangeReason instance + */ + public static create( + properties?: events.IChannelStateChangeReason + ): events.ChannelStateChangeReason; + + /** + * Encodes the specified ChannelStateChangeReason message. Does not implicitly {@link events.ChannelStateChangeReason.verify|verify} messages. + * @param message ChannelStateChangeReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: events.IChannelStateChangeReason, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ChannelStateChangeReason message, length delimited. Does not implicitly {@link events.ChannelStateChangeReason.verify|verify} messages. + * @param message ChannelStateChangeReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: events.IChannelStateChangeReason, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ChannelStateChangeReason message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChannelStateChangeReason + * @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 + ): events.ChannelStateChangeReason; + + /** + * Decodes a ChannelStateChangeReason message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChannelStateChangeReason + * @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 + ): events.ChannelStateChangeReason; + + /** + * Verifies a ChannelStateChangeReason 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 ChannelStateChangeReason message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChannelStateChangeReason + */ + public static fromObject(object: { + [k: string]: any; + }): events.ChannelStateChangeReason; + + /** + * Creates a plain object from a ChannelStateChangeReason message. Also converts values to other types if specified. + * @param message ChannelStateChangeReason + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: events.ChannelStateChangeReason, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ChannelStateChangeReason to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChannelStateChangeReason + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChannelStateChanged. */ + interface IChannelStateChanged { + /** ChannelStateChanged channel_id */ + channel_id?: string | null; + + /** ChannelStateChanged user_channel_id */ + user_channel_id?: string | null; + + /** ChannelStateChanged counterparty_node_id */ + counterparty_node_id?: string | null; + + /** ChannelStateChanged state */ + state?: events.ChannelState | null; + + /** ChannelStateChanged funding_txo */ + funding_txo?: string | null; + + /** ChannelStateChanged reason */ + reason?: events.IChannelStateChangeReason | null; + + /** ChannelStateChanged closure_initiator */ + closure_initiator?: events.ChannelClosureInitiator | null; + } + + /** Represents a ChannelStateChanged. */ + class ChannelStateChanged implements IChannelStateChanged { + /** + * Constructs a new ChannelStateChanged. + * @param [properties] Properties to set + */ + constructor(properties?: events.IChannelStateChanged); + + /** ChannelStateChanged channel_id. */ + public channel_id: string; + + /** ChannelStateChanged user_channel_id. */ + public user_channel_id: string; + + /** ChannelStateChanged counterparty_node_id. */ + public counterparty_node_id?: string | null; + + /** ChannelStateChanged state. */ + public state: events.ChannelState; + + /** ChannelStateChanged funding_txo. */ + public funding_txo?: string | null; + + /** ChannelStateChanged reason. */ + public reason?: events.IChannelStateChangeReason | null; + + /** ChannelStateChanged closure_initiator. */ + public closure_initiator: events.ChannelClosureInitiator; + + /** + * Creates a new ChannelStateChanged instance using the specified properties. + * @param [properties] Properties to set + * @returns ChannelStateChanged instance + */ + public static create( + properties?: events.IChannelStateChanged + ): events.ChannelStateChanged; + + /** + * Encodes the specified ChannelStateChanged message. Does not implicitly {@link events.ChannelStateChanged.verify|verify} messages. + * @param message ChannelStateChanged message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: events.IChannelStateChanged, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ChannelStateChanged message, length delimited. Does not implicitly {@link events.ChannelStateChanged.verify|verify} messages. + * @param message ChannelStateChanged message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: events.IChannelStateChanged, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ChannelStateChanged message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChannelStateChanged + * @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 + ): events.ChannelStateChanged; + + /** + * Decodes a ChannelStateChanged message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChannelStateChanged + * @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 + ): events.ChannelStateChanged; + + /** + * Verifies a ChannelStateChanged 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 ChannelStateChanged message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChannelStateChanged + */ + public static fromObject(object: { + [k: string]: any; + }): events.ChannelStateChanged; + + /** + * Creates a plain object from a ChannelStateChanged message. Also converts values to other types if specified. + * @param message ChannelStateChanged + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: events.ChannelStateChanged, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ChannelStateChanged to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChannelStateChanged + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PaymentReceived. */ + interface IPaymentReceived { + /** PaymentReceived payment */ + payment?: types.IPayment | null; + } + + /** Represents a PaymentReceived. */ + class PaymentReceived implements IPaymentReceived { + /** + * Constructs a new PaymentReceived. + * @param [properties] Properties to set + */ + constructor(properties?: events.IPaymentReceived); + + /** PaymentReceived payment. */ + public payment?: types.IPayment | null; + + /** + * Creates a new PaymentReceived instance using the specified properties. + * @param [properties] Properties to set + * @returns PaymentReceived instance + */ + public static create( + properties?: events.IPaymentReceived + ): events.PaymentReceived; + + /** + * Encodes the specified PaymentReceived message. Does not implicitly {@link events.PaymentReceived.verify|verify} messages. + * @param message PaymentReceived message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: events.IPaymentReceived, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified PaymentReceived message, length delimited. Does not implicitly {@link events.PaymentReceived.verify|verify} messages. + * @param message PaymentReceived message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: events.IPaymentReceived, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a PaymentReceived message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PaymentReceived + * @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 + ): events.PaymentReceived; + + /** + * Decodes a PaymentReceived message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PaymentReceived + * @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 + ): events.PaymentReceived; + + /** + * Verifies a PaymentReceived 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 PaymentReceived message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PaymentReceived + */ + public static fromObject(object: { + [k: string]: any; + }): events.PaymentReceived; + + /** + * Creates a plain object from a PaymentReceived message. Also converts values to other types if specified. + * @param message PaymentReceived + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: events.PaymentReceived, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this PaymentReceived to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PaymentReceived + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PaymentSuccessful. */ + interface IPaymentSuccessful { + /** PaymentSuccessful payment */ + payment?: types.IPayment | null; + } + + /** Represents a PaymentSuccessful. */ + class PaymentSuccessful implements IPaymentSuccessful { + /** + * Constructs a new PaymentSuccessful. + * @param [properties] Properties to set + */ + constructor(properties?: events.IPaymentSuccessful); + + /** PaymentSuccessful payment. */ + public payment?: types.IPayment | null; + + /** + * Creates a new PaymentSuccessful instance using the specified properties. + * @param [properties] Properties to set + * @returns PaymentSuccessful instance + */ + public static create( + properties?: events.IPaymentSuccessful + ): events.PaymentSuccessful; + + /** + * Encodes the specified PaymentSuccessful message. Does not implicitly {@link events.PaymentSuccessful.verify|verify} messages. + * @param message PaymentSuccessful message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: events.IPaymentSuccessful, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified PaymentSuccessful message, length delimited. Does not implicitly {@link events.PaymentSuccessful.verify|verify} messages. + * @param message PaymentSuccessful message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: events.IPaymentSuccessful, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a PaymentSuccessful message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PaymentSuccessful + * @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 + ): events.PaymentSuccessful; + + /** + * Decodes a PaymentSuccessful message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PaymentSuccessful + * @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 + ): events.PaymentSuccessful; + + /** + * Verifies a PaymentSuccessful 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 PaymentSuccessful message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PaymentSuccessful + */ + public static fromObject(object: { + [k: string]: any; + }): events.PaymentSuccessful; + + /** + * Creates a plain object from a PaymentSuccessful message. Also converts values to other types if specified. + * @param message PaymentSuccessful + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: events.PaymentSuccessful, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this PaymentSuccessful to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PaymentSuccessful + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PaymentFailed. */ + interface IPaymentFailed { + /** PaymentFailed payment */ + payment?: types.IPayment | null; + } + + /** Represents a PaymentFailed. */ + class PaymentFailed implements IPaymentFailed { + /** + * Constructs a new PaymentFailed. + * @param [properties] Properties to set + */ + constructor(properties?: events.IPaymentFailed); + + /** PaymentFailed payment. */ + public payment?: types.IPayment | null; + + /** + * Creates a new PaymentFailed instance using the specified properties. + * @param [properties] Properties to set + * @returns PaymentFailed instance + */ + public static create( + properties?: events.IPaymentFailed + ): events.PaymentFailed; + + /** + * Encodes the specified PaymentFailed message. Does not implicitly {@link events.PaymentFailed.verify|verify} messages. + * @param message PaymentFailed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: events.IPaymentFailed, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified PaymentFailed message, length delimited. Does not implicitly {@link events.PaymentFailed.verify|verify} messages. + * @param message PaymentFailed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: events.IPaymentFailed, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a PaymentFailed message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PaymentFailed + * @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 + ): events.PaymentFailed; + + /** + * Decodes a PaymentFailed message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PaymentFailed + * @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 + ): events.PaymentFailed; + + /** + * Verifies a PaymentFailed 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 PaymentFailed message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PaymentFailed + */ + public static fromObject(object: { + [k: string]: any; + }): events.PaymentFailed; + + /** + * Creates a plain object from a PaymentFailed message. Also converts values to other types if specified. + * @param message PaymentFailed + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: events.PaymentFailed, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this PaymentFailed to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PaymentFailed + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PaymentClaimable. */ + interface IPaymentClaimable { + /** PaymentClaimable payment */ + payment?: types.IPayment | null; + } + + /** Represents a PaymentClaimable. */ + class PaymentClaimable implements IPaymentClaimable { + /** + * Constructs a new PaymentClaimable. + * @param [properties] Properties to set + */ + constructor(properties?: events.IPaymentClaimable); + + /** PaymentClaimable payment. */ + public payment?: types.IPayment | null; + + /** + * Creates a new PaymentClaimable instance using the specified properties. + * @param [properties] Properties to set + * @returns PaymentClaimable instance + */ + public static create( + properties?: events.IPaymentClaimable + ): events.PaymentClaimable; + + /** + * Encodes the specified PaymentClaimable message. Does not implicitly {@link events.PaymentClaimable.verify|verify} messages. + * @param message PaymentClaimable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: events.IPaymentClaimable, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified PaymentClaimable message, length delimited. Does not implicitly {@link events.PaymentClaimable.verify|verify} messages. + * @param message PaymentClaimable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: events.IPaymentClaimable, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a PaymentClaimable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PaymentClaimable + * @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 + ): events.PaymentClaimable; + + /** + * Decodes a PaymentClaimable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PaymentClaimable + * @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 + ): events.PaymentClaimable; + + /** + * Verifies a PaymentClaimable 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 PaymentClaimable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PaymentClaimable + */ + public static fromObject(object: { + [k: string]: any; + }): events.PaymentClaimable; + + /** + * Creates a plain object from a PaymentClaimable message. Also converts values to other types if specified. + * @param message PaymentClaimable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: events.PaymentClaimable, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this PaymentClaimable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PaymentClaimable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PaymentForwarded. */ + interface IPaymentForwarded { + /** PaymentForwarded forwarded_payment */ + forwarded_payment?: types.IForwardedPayment | null; + } + + /** Represents a PaymentForwarded. */ + class PaymentForwarded implements IPaymentForwarded { + /** + * Constructs a new PaymentForwarded. + * @param [properties] Properties to set + */ + constructor(properties?: events.IPaymentForwarded); + + /** PaymentForwarded forwarded_payment. */ + public forwarded_payment?: types.IForwardedPayment | null; + + /** + * Creates a new PaymentForwarded instance using the specified properties. + * @param [properties] Properties to set + * @returns PaymentForwarded instance + */ + public static create( + properties?: events.IPaymentForwarded + ): events.PaymentForwarded; + + /** + * Encodes the specified PaymentForwarded message. Does not implicitly {@link events.PaymentForwarded.verify|verify} messages. + * @param message PaymentForwarded message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: events.IPaymentForwarded, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified PaymentForwarded message, length delimited. Does not implicitly {@link events.PaymentForwarded.verify|verify} messages. + * @param message PaymentForwarded message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: events.IPaymentForwarded, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a PaymentForwarded message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PaymentForwarded + * @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 + ): events.PaymentForwarded; + + /** + * Decodes a PaymentForwarded message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PaymentForwarded + * @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 + ): events.PaymentForwarded; + + /** + * Verifies a PaymentForwarded 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 PaymentForwarded message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PaymentForwarded + */ + public static fromObject(object: { + [k: string]: any; + }): events.PaymentForwarded; + + /** + * Creates a plain object from a PaymentForwarded message. Also converts values to other types if specified. + * @param message PaymentForwarded + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: events.PaymentForwarded, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this PaymentForwarded to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PaymentForwarded + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } +} + +/** Namespace error. */ +export namespace error { + /** Properties of an ErrorResponse. */ + interface IErrorResponse { + /** ErrorResponse message */ + message?: string | null; + + /** ErrorResponse error_code */ + error_code?: error.ErrorCode | null; + } + + /** Represents an ErrorResponse. */ + class ErrorResponse implements IErrorResponse { + /** + * Constructs a new ErrorResponse. + * @param [properties] Properties to set + */ + constructor(properties?: error.IErrorResponse); + + /** ErrorResponse message. */ + public message: string; + + /** ErrorResponse error_code. */ + public error_code: error.ErrorCode; + + /** + * Creates a new ErrorResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ErrorResponse instance + */ + public static create( + properties?: error.IErrorResponse + ): error.ErrorResponse; + + /** + * Encodes the specified ErrorResponse message. Does not implicitly {@link error.ErrorResponse.verify|verify} messages. + * @param message ErrorResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: error.IErrorResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ErrorResponse message, length delimited. Does not implicitly {@link error.ErrorResponse.verify|verify} messages. + * @param message ErrorResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: error.IErrorResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an ErrorResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ErrorResponse + * @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 + ): error.ErrorResponse; + + /** + * Decodes an ErrorResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ErrorResponse + * @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 + ): error.ErrorResponse; + + /** + * Verifies an ErrorResponse 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 ErrorResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ErrorResponse + */ + public static fromObject(object: { + [k: string]: any; + }): error.ErrorResponse; + + /** + * Creates a plain object from an ErrorResponse message. Also converts values to other types if specified. + * @param message ErrorResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: error.ErrorResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ErrorResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ErrorResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ErrorCode enum. */ + enum ErrorCode { + UNKNOWN_ERROR = 0, + INVALID_REQUEST_ERROR = 1, + AUTH_ERROR = 2, + LIGHTNING_ERROR = 3, + INTERNAL_SERVER_ERROR = 4 + } +} diff --git a/proto/ldkserver.js b/proto/ldkserver.js new file mode 100644 index 0000000000..91940fec2b --- /dev/null +++ b/proto/ldkserver.js @@ -0,0 +1,40114 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +import * as $protobuf from "protobufjs/minimal"; + +// Common aliases +const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + +export const api = $root.api = (() => { + + /** + * Namespace api. + * @exports api + * @namespace + */ + const api = {}; + + api.GetNodeInfoRequest = (function() { + + /** + * Properties of a GetNodeInfoRequest. + * @memberof api + * @interface IGetNodeInfoRequest + */ + + /** + * Constructs a new GetNodeInfoRequest. + * @memberof api + * @classdesc Represents a GetNodeInfoRequest. + * @implements IGetNodeInfoRequest + * @constructor + * @param {api.IGetNodeInfoRequest=} [properties] Properties to set + */ + function GetNodeInfoRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new GetNodeInfoRequest instance using the specified properties. + * @function create + * @memberof api.GetNodeInfoRequest + * @static + * @param {api.IGetNodeInfoRequest=} [properties] Properties to set + * @returns {api.GetNodeInfoRequest} GetNodeInfoRequest instance + */ + GetNodeInfoRequest.create = function create(properties) { + return new GetNodeInfoRequest(properties); + }; + + /** + * Encodes the specified GetNodeInfoRequest message. Does not implicitly {@link api.GetNodeInfoRequest.verify|verify} messages. + * @function encode + * @memberof api.GetNodeInfoRequest + * @static + * @param {api.IGetNodeInfoRequest} message GetNodeInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeInfoRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GetNodeInfoRequest message, length delimited. Does not implicitly {@link api.GetNodeInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.GetNodeInfoRequest + * @static + * @param {api.IGetNodeInfoRequest} message GetNodeInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetNodeInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof api.GetNodeInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.GetNodeInfoRequest} GetNodeInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeInfoRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GetNodeInfoRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetNodeInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.GetNodeInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.GetNodeInfoRequest} GetNodeInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetNodeInfoRequest message. + * @function verify + * @memberof api.GetNodeInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetNodeInfoRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a GetNodeInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.GetNodeInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {api.GetNodeInfoRequest} GetNodeInfoRequest + */ + GetNodeInfoRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.GetNodeInfoRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.api.GetNodeInfoRequest(); + }; + + /** + * Creates a plain object from a GetNodeInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.GetNodeInfoRequest + * @static + * @param {api.GetNodeInfoRequest} message GetNodeInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetNodeInfoRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GetNodeInfoRequest to JSON. + * @function toJSON + * @memberof api.GetNodeInfoRequest + * @instance + * @returns {Object.} JSON object + */ + GetNodeInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetNodeInfoRequest + * @function getTypeUrl + * @memberof api.GetNodeInfoRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetNodeInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GetNodeInfoRequest"; + }; + + return GetNodeInfoRequest; + })(); + + api.GetNodeInfoResponse = (function() { + + /** + * Properties of a GetNodeInfoResponse. + * @memberof api + * @interface IGetNodeInfoResponse + * @property {string|null} [node_id] GetNodeInfoResponse node_id + * @property {types.IBestBlock|null} [current_best_block] GetNodeInfoResponse current_best_block + * @property {Long|null} [latest_lightning_wallet_sync_timestamp] GetNodeInfoResponse latest_lightning_wallet_sync_timestamp + * @property {Long|null} [latest_onchain_wallet_sync_timestamp] GetNodeInfoResponse latest_onchain_wallet_sync_timestamp + * @property {Long|null} [latest_fee_rate_cache_update_timestamp] GetNodeInfoResponse latest_fee_rate_cache_update_timestamp + * @property {Long|null} [latest_rgs_snapshot_timestamp] GetNodeInfoResponse latest_rgs_snapshot_timestamp + * @property {Long|null} [latest_node_announcement_broadcast_timestamp] GetNodeInfoResponse latest_node_announcement_broadcast_timestamp + * @property {Array.|null} [listening_addresses] GetNodeInfoResponse listening_addresses + * @property {Array.|null} [announcement_addresses] GetNodeInfoResponse announcement_addresses + * @property {string|null} [node_alias] GetNodeInfoResponse node_alias + * @property {Array.|null} [node_uris] GetNodeInfoResponse node_uris + * @property {types.Network|null} [network] GetNodeInfoResponse network + */ + + /** + * Constructs a new GetNodeInfoResponse. + * @memberof api + * @classdesc Represents a GetNodeInfoResponse. + * @implements IGetNodeInfoResponse + * @constructor + * @param {api.IGetNodeInfoResponse=} [properties] Properties to set + */ + function GetNodeInfoResponse(properties) { + this.listening_addresses = []; + this.announcement_addresses = []; + this.node_uris = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetNodeInfoResponse node_id. + * @member {string} node_id + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.node_id = ""; + + /** + * GetNodeInfoResponse current_best_block. + * @member {types.IBestBlock|null|undefined} current_best_block + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.current_best_block = null; + + /** + * GetNodeInfoResponse latest_lightning_wallet_sync_timestamp. + * @member {Long|null|undefined} latest_lightning_wallet_sync_timestamp + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.latest_lightning_wallet_sync_timestamp = null; + + /** + * GetNodeInfoResponse latest_onchain_wallet_sync_timestamp. + * @member {Long|null|undefined} latest_onchain_wallet_sync_timestamp + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.latest_onchain_wallet_sync_timestamp = null; + + /** + * GetNodeInfoResponse latest_fee_rate_cache_update_timestamp. + * @member {Long|null|undefined} latest_fee_rate_cache_update_timestamp + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.latest_fee_rate_cache_update_timestamp = null; + + /** + * GetNodeInfoResponse latest_rgs_snapshot_timestamp. + * @member {Long|null|undefined} latest_rgs_snapshot_timestamp + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.latest_rgs_snapshot_timestamp = null; + + /** + * GetNodeInfoResponse latest_node_announcement_broadcast_timestamp. + * @member {Long|null|undefined} latest_node_announcement_broadcast_timestamp + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.latest_node_announcement_broadcast_timestamp = null; + + /** + * GetNodeInfoResponse listening_addresses. + * @member {Array.} listening_addresses + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.listening_addresses = $util.emptyArray; + + /** + * GetNodeInfoResponse announcement_addresses. + * @member {Array.} announcement_addresses + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.announcement_addresses = $util.emptyArray; + + /** + * GetNodeInfoResponse node_alias. + * @member {string|null|undefined} node_alias + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.node_alias = null; + + /** + * GetNodeInfoResponse node_uris. + * @member {Array.} node_uris + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.node_uris = $util.emptyArray; + + /** + * GetNodeInfoResponse network. + * @member {types.Network} network + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.network = 0; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetNodeInfoResponse.prototype, "_latest_lightning_wallet_sync_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["latest_lightning_wallet_sync_timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetNodeInfoResponse.prototype, "_latest_onchain_wallet_sync_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["latest_onchain_wallet_sync_timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetNodeInfoResponse.prototype, "_latest_fee_rate_cache_update_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["latest_fee_rate_cache_update_timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetNodeInfoResponse.prototype, "_latest_rgs_snapshot_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["latest_rgs_snapshot_timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetNodeInfoResponse.prototype, "_latest_node_announcement_broadcast_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["latest_node_announcement_broadcast_timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetNodeInfoResponse.prototype, "_node_alias", { + get: $util.oneOfGetter($oneOfFields = ["node_alias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetNodeInfoResponse instance using the specified properties. + * @function create + * @memberof api.GetNodeInfoResponse + * @static + * @param {api.IGetNodeInfoResponse=} [properties] Properties to set + * @returns {api.GetNodeInfoResponse} GetNodeInfoResponse instance + */ + GetNodeInfoResponse.create = function create(properties) { + return new GetNodeInfoResponse(properties); + }; + + /** + * Encodes the specified GetNodeInfoResponse message. Does not implicitly {@link api.GetNodeInfoResponse.verify|verify} messages. + * @function encode + * @memberof api.GetNodeInfoResponse + * @static + * @param {api.IGetNodeInfoResponse} message GetNodeInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeInfoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.node_id != null && Object.hasOwnProperty.call(message, "node_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.node_id); + if (message.current_best_block != null && Object.hasOwnProperty.call(message, "current_best_block")) + $root.types.BestBlock.encode(message.current_best_block, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.latest_lightning_wallet_sync_timestamp != null && Object.hasOwnProperty.call(message, "latest_lightning_wallet_sync_timestamp")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.latest_lightning_wallet_sync_timestamp); + if (message.latest_onchain_wallet_sync_timestamp != null && Object.hasOwnProperty.call(message, "latest_onchain_wallet_sync_timestamp")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.latest_onchain_wallet_sync_timestamp); + if (message.latest_fee_rate_cache_update_timestamp != null && Object.hasOwnProperty.call(message, "latest_fee_rate_cache_update_timestamp")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.latest_fee_rate_cache_update_timestamp); + if (message.latest_rgs_snapshot_timestamp != null && Object.hasOwnProperty.call(message, "latest_rgs_snapshot_timestamp")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.latest_rgs_snapshot_timestamp); + if (message.latest_node_announcement_broadcast_timestamp != null && Object.hasOwnProperty.call(message, "latest_node_announcement_broadcast_timestamp")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.latest_node_announcement_broadcast_timestamp); + if (message.listening_addresses != null && message.listening_addresses.length) + for (let i = 0; i < message.listening_addresses.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.listening_addresses[i]); + if (message.announcement_addresses != null && message.announcement_addresses.length) + for (let i = 0; i < message.announcement_addresses.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.announcement_addresses[i]); + if (message.node_alias != null && Object.hasOwnProperty.call(message, "node_alias")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.node_alias); + if (message.node_uris != null && message.node_uris.length) + for (let i = 0; i < message.node_uris.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.node_uris[i]); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.network); + return writer; + }; + + /** + * Encodes the specified GetNodeInfoResponse message, length delimited. Does not implicitly {@link api.GetNodeInfoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.GetNodeInfoResponse + * @static + * @param {api.IGetNodeInfoResponse} message GetNodeInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetNodeInfoResponse message from the specified reader or buffer. + * @function decode + * @memberof api.GetNodeInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.GetNodeInfoResponse} GetNodeInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeInfoResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GetNodeInfoResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.node_id = reader.string(); + break; + } + case 3: { + message.current_best_block = $root.types.BestBlock.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.latest_lightning_wallet_sync_timestamp = reader.uint64(); + break; + } + case 5: { + message.latest_onchain_wallet_sync_timestamp = reader.uint64(); + break; + } + case 6: { + message.latest_fee_rate_cache_update_timestamp = reader.uint64(); + break; + } + case 7: { + message.latest_rgs_snapshot_timestamp = reader.uint64(); + break; + } + case 8: { + message.latest_node_announcement_broadcast_timestamp = reader.uint64(); + break; + } + case 9: { + if (!(message.listening_addresses && message.listening_addresses.length)) + message.listening_addresses = []; + message.listening_addresses.push(reader.string()); + break; + } + case 10: { + if (!(message.announcement_addresses && message.announcement_addresses.length)) + message.announcement_addresses = []; + message.announcement_addresses.push(reader.string()); + break; + } + case 11: { + message.node_alias = reader.string(); + break; + } + case 12: { + if (!(message.node_uris && message.node_uris.length)) + message.node_uris = []; + message.node_uris.push(reader.string()); + break; + } + case 13: { + message.network = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetNodeInfoResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.GetNodeInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.GetNodeInfoResponse} GetNodeInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeInfoResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetNodeInfoResponse message. + * @function verify + * @memberof api.GetNodeInfoResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetNodeInfoResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.node_id != null && message.hasOwnProperty("node_id")) + if (!$util.isString(message.node_id)) + return "node_id: string expected"; + if (message.current_best_block != null && message.hasOwnProperty("current_best_block")) { + let error = $root.types.BestBlock.verify(message.current_best_block, long + 1); + if (error) + return "current_best_block." + error; + } + if (message.latest_lightning_wallet_sync_timestamp != null && message.hasOwnProperty("latest_lightning_wallet_sync_timestamp")) { + properties._latest_lightning_wallet_sync_timestamp = 1; + if (!$util.isInteger(message.latest_lightning_wallet_sync_timestamp) && !(message.latest_lightning_wallet_sync_timestamp && $util.isInteger(message.latest_lightning_wallet_sync_timestamp.low) && $util.isInteger(message.latest_lightning_wallet_sync_timestamp.high))) + return "latest_lightning_wallet_sync_timestamp: integer|Long expected"; + } + if (message.latest_onchain_wallet_sync_timestamp != null && message.hasOwnProperty("latest_onchain_wallet_sync_timestamp")) { + properties._latest_onchain_wallet_sync_timestamp = 1; + if (!$util.isInteger(message.latest_onchain_wallet_sync_timestamp) && !(message.latest_onchain_wallet_sync_timestamp && $util.isInteger(message.latest_onchain_wallet_sync_timestamp.low) && $util.isInteger(message.latest_onchain_wallet_sync_timestamp.high))) + return "latest_onchain_wallet_sync_timestamp: integer|Long expected"; + } + if (message.latest_fee_rate_cache_update_timestamp != null && message.hasOwnProperty("latest_fee_rate_cache_update_timestamp")) { + properties._latest_fee_rate_cache_update_timestamp = 1; + if (!$util.isInteger(message.latest_fee_rate_cache_update_timestamp) && !(message.latest_fee_rate_cache_update_timestamp && $util.isInteger(message.latest_fee_rate_cache_update_timestamp.low) && $util.isInteger(message.latest_fee_rate_cache_update_timestamp.high))) + return "latest_fee_rate_cache_update_timestamp: integer|Long expected"; + } + if (message.latest_rgs_snapshot_timestamp != null && message.hasOwnProperty("latest_rgs_snapshot_timestamp")) { + properties._latest_rgs_snapshot_timestamp = 1; + if (!$util.isInteger(message.latest_rgs_snapshot_timestamp) && !(message.latest_rgs_snapshot_timestamp && $util.isInteger(message.latest_rgs_snapshot_timestamp.low) && $util.isInteger(message.latest_rgs_snapshot_timestamp.high))) + return "latest_rgs_snapshot_timestamp: integer|Long expected"; + } + if (message.latest_node_announcement_broadcast_timestamp != null && message.hasOwnProperty("latest_node_announcement_broadcast_timestamp")) { + properties._latest_node_announcement_broadcast_timestamp = 1; + if (!$util.isInteger(message.latest_node_announcement_broadcast_timestamp) && !(message.latest_node_announcement_broadcast_timestamp && $util.isInteger(message.latest_node_announcement_broadcast_timestamp.low) && $util.isInteger(message.latest_node_announcement_broadcast_timestamp.high))) + return "latest_node_announcement_broadcast_timestamp: integer|Long expected"; + } + if (message.listening_addresses != null && message.hasOwnProperty("listening_addresses")) { + if (!Array.isArray(message.listening_addresses)) + return "listening_addresses: array expected"; + for (let i = 0; i < message.listening_addresses.length; ++i) + if (!$util.isString(message.listening_addresses[i])) + return "listening_addresses: string[] expected"; + } + if (message.announcement_addresses != null && message.hasOwnProperty("announcement_addresses")) { + if (!Array.isArray(message.announcement_addresses)) + return "announcement_addresses: array expected"; + for (let i = 0; i < message.announcement_addresses.length; ++i) + if (!$util.isString(message.announcement_addresses[i])) + return "announcement_addresses: string[] expected"; + } + if (message.node_alias != null && message.hasOwnProperty("node_alias")) { + properties._node_alias = 1; + if (!$util.isString(message.node_alias)) + return "node_alias: string expected"; + } + if (message.node_uris != null && message.hasOwnProperty("node_uris")) { + if (!Array.isArray(message.node_uris)) + return "node_uris: array expected"; + for (let i = 0; i < message.node_uris.length; ++i) + if (!$util.isString(message.node_uris[i])) + return "node_uris: string[] expected"; + } + if (message.network != null && message.hasOwnProperty("network")) + switch (message.network) { + default: + return "network: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a GetNodeInfoResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.GetNodeInfoResponse + * @static + * @param {Object.} object Plain object + * @returns {api.GetNodeInfoResponse} GetNodeInfoResponse + */ + GetNodeInfoResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.GetNodeInfoResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.GetNodeInfoResponse(); + if (object.node_id != null) + message.node_id = String(object.node_id); + if (object.current_best_block != null) { + if (typeof object.current_best_block !== "object") + throw TypeError(".api.GetNodeInfoResponse.current_best_block: object expected"); + message.current_best_block = $root.types.BestBlock.fromObject(object.current_best_block, long + 1); + } + if (object.latest_lightning_wallet_sync_timestamp != null) + if ($util.Long) + (message.latest_lightning_wallet_sync_timestamp = $util.Long.fromValue(object.latest_lightning_wallet_sync_timestamp)).unsigned = true; + else if (typeof object.latest_lightning_wallet_sync_timestamp === "string") + message.latest_lightning_wallet_sync_timestamp = parseInt(object.latest_lightning_wallet_sync_timestamp, 10); + else if (typeof object.latest_lightning_wallet_sync_timestamp === "number") + message.latest_lightning_wallet_sync_timestamp = object.latest_lightning_wallet_sync_timestamp; + else if (typeof object.latest_lightning_wallet_sync_timestamp === "object") + message.latest_lightning_wallet_sync_timestamp = new $util.LongBits(object.latest_lightning_wallet_sync_timestamp.low >>> 0, object.latest_lightning_wallet_sync_timestamp.high >>> 0).toNumber(true); + if (object.latest_onchain_wallet_sync_timestamp != null) + if ($util.Long) + (message.latest_onchain_wallet_sync_timestamp = $util.Long.fromValue(object.latest_onchain_wallet_sync_timestamp)).unsigned = true; + else if (typeof object.latest_onchain_wallet_sync_timestamp === "string") + message.latest_onchain_wallet_sync_timestamp = parseInt(object.latest_onchain_wallet_sync_timestamp, 10); + else if (typeof object.latest_onchain_wallet_sync_timestamp === "number") + message.latest_onchain_wallet_sync_timestamp = object.latest_onchain_wallet_sync_timestamp; + else if (typeof object.latest_onchain_wallet_sync_timestamp === "object") + message.latest_onchain_wallet_sync_timestamp = new $util.LongBits(object.latest_onchain_wallet_sync_timestamp.low >>> 0, object.latest_onchain_wallet_sync_timestamp.high >>> 0).toNumber(true); + if (object.latest_fee_rate_cache_update_timestamp != null) + if ($util.Long) + (message.latest_fee_rate_cache_update_timestamp = $util.Long.fromValue(object.latest_fee_rate_cache_update_timestamp)).unsigned = true; + else if (typeof object.latest_fee_rate_cache_update_timestamp === "string") + message.latest_fee_rate_cache_update_timestamp = parseInt(object.latest_fee_rate_cache_update_timestamp, 10); + else if (typeof object.latest_fee_rate_cache_update_timestamp === "number") + message.latest_fee_rate_cache_update_timestamp = object.latest_fee_rate_cache_update_timestamp; + else if (typeof object.latest_fee_rate_cache_update_timestamp === "object") + message.latest_fee_rate_cache_update_timestamp = new $util.LongBits(object.latest_fee_rate_cache_update_timestamp.low >>> 0, object.latest_fee_rate_cache_update_timestamp.high >>> 0).toNumber(true); + if (object.latest_rgs_snapshot_timestamp != null) + if ($util.Long) + (message.latest_rgs_snapshot_timestamp = $util.Long.fromValue(object.latest_rgs_snapshot_timestamp)).unsigned = true; + else if (typeof object.latest_rgs_snapshot_timestamp === "string") + message.latest_rgs_snapshot_timestamp = parseInt(object.latest_rgs_snapshot_timestamp, 10); + else if (typeof object.latest_rgs_snapshot_timestamp === "number") + message.latest_rgs_snapshot_timestamp = object.latest_rgs_snapshot_timestamp; + else if (typeof object.latest_rgs_snapshot_timestamp === "object") + message.latest_rgs_snapshot_timestamp = new $util.LongBits(object.latest_rgs_snapshot_timestamp.low >>> 0, object.latest_rgs_snapshot_timestamp.high >>> 0).toNumber(true); + if (object.latest_node_announcement_broadcast_timestamp != null) + if ($util.Long) + (message.latest_node_announcement_broadcast_timestamp = $util.Long.fromValue(object.latest_node_announcement_broadcast_timestamp)).unsigned = true; + else if (typeof object.latest_node_announcement_broadcast_timestamp === "string") + message.latest_node_announcement_broadcast_timestamp = parseInt(object.latest_node_announcement_broadcast_timestamp, 10); + else if (typeof object.latest_node_announcement_broadcast_timestamp === "number") + message.latest_node_announcement_broadcast_timestamp = object.latest_node_announcement_broadcast_timestamp; + else if (typeof object.latest_node_announcement_broadcast_timestamp === "object") + message.latest_node_announcement_broadcast_timestamp = new $util.LongBits(object.latest_node_announcement_broadcast_timestamp.low >>> 0, object.latest_node_announcement_broadcast_timestamp.high >>> 0).toNumber(true); + if (object.listening_addresses) { + if (!Array.isArray(object.listening_addresses)) + throw TypeError(".api.GetNodeInfoResponse.listening_addresses: array expected"); + message.listening_addresses = []; + for (let i = 0; i < object.listening_addresses.length; ++i) + message.listening_addresses[i] = String(object.listening_addresses[i]); + } + if (object.announcement_addresses) { + if (!Array.isArray(object.announcement_addresses)) + throw TypeError(".api.GetNodeInfoResponse.announcement_addresses: array expected"); + message.announcement_addresses = []; + for (let i = 0; i < object.announcement_addresses.length; ++i) + message.announcement_addresses[i] = String(object.announcement_addresses[i]); + } + if (object.node_alias != null) + message.node_alias = String(object.node_alias); + if (object.node_uris) { + if (!Array.isArray(object.node_uris)) + throw TypeError(".api.GetNodeInfoResponse.node_uris: array expected"); + message.node_uris = []; + for (let i = 0; i < object.node_uris.length; ++i) + message.node_uris[i] = String(object.node_uris[i]); + } + switch (object.network) { + default: + if (typeof object.network === "number") { + message.network = object.network; + break; + } + break; + case "BITCOIN": + case 0: + message.network = 0; + break; + case "TESTNET": + case 1: + message.network = 1; + break; + case "TESTNET4": + case 2: + message.network = 2; + break; + case "SIGNET": + case 3: + message.network = 3; + break; + case "REGTEST": + case 4: + message.network = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetNodeInfoResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.GetNodeInfoResponse + * @static + * @param {api.GetNodeInfoResponse} message GetNodeInfoResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetNodeInfoResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.listening_addresses = []; + object.announcement_addresses = []; + object.node_uris = []; + } + if (options.defaults) { + object.node_id = ""; + object.current_best_block = null; + object.network = options.enums === String ? "BITCOIN" : 0; + } + if (message.node_id != null && message.hasOwnProperty("node_id")) + object.node_id = message.node_id; + if (message.current_best_block != null && message.hasOwnProperty("current_best_block")) + object.current_best_block = $root.types.BestBlock.toObject(message.current_best_block, options); + if (message.latest_lightning_wallet_sync_timestamp != null && message.hasOwnProperty("latest_lightning_wallet_sync_timestamp")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.latest_lightning_wallet_sync_timestamp = typeof message.latest_lightning_wallet_sync_timestamp === "number" ? BigInt(message.latest_lightning_wallet_sync_timestamp) : $util.Long.fromBits(message.latest_lightning_wallet_sync_timestamp.low >>> 0, message.latest_lightning_wallet_sync_timestamp.high >>> 0, true).toBigInt(); + else if (typeof message.latest_lightning_wallet_sync_timestamp === "number") + object.latest_lightning_wallet_sync_timestamp = options.longs === String ? String(message.latest_lightning_wallet_sync_timestamp) : message.latest_lightning_wallet_sync_timestamp; + else + object.latest_lightning_wallet_sync_timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.latest_lightning_wallet_sync_timestamp) : options.longs === Number ? new $util.LongBits(message.latest_lightning_wallet_sync_timestamp.low >>> 0, message.latest_lightning_wallet_sync_timestamp.high >>> 0).toNumber(true) : message.latest_lightning_wallet_sync_timestamp; + if (options.oneofs) + object._latest_lightning_wallet_sync_timestamp = "latest_lightning_wallet_sync_timestamp"; + } + if (message.latest_onchain_wallet_sync_timestamp != null && message.hasOwnProperty("latest_onchain_wallet_sync_timestamp")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.latest_onchain_wallet_sync_timestamp = typeof message.latest_onchain_wallet_sync_timestamp === "number" ? BigInt(message.latest_onchain_wallet_sync_timestamp) : $util.Long.fromBits(message.latest_onchain_wallet_sync_timestamp.low >>> 0, message.latest_onchain_wallet_sync_timestamp.high >>> 0, true).toBigInt(); + else if (typeof message.latest_onchain_wallet_sync_timestamp === "number") + object.latest_onchain_wallet_sync_timestamp = options.longs === String ? String(message.latest_onchain_wallet_sync_timestamp) : message.latest_onchain_wallet_sync_timestamp; + else + object.latest_onchain_wallet_sync_timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.latest_onchain_wallet_sync_timestamp) : options.longs === Number ? new $util.LongBits(message.latest_onchain_wallet_sync_timestamp.low >>> 0, message.latest_onchain_wallet_sync_timestamp.high >>> 0).toNumber(true) : message.latest_onchain_wallet_sync_timestamp; + if (options.oneofs) + object._latest_onchain_wallet_sync_timestamp = "latest_onchain_wallet_sync_timestamp"; + } + if (message.latest_fee_rate_cache_update_timestamp != null && message.hasOwnProperty("latest_fee_rate_cache_update_timestamp")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.latest_fee_rate_cache_update_timestamp = typeof message.latest_fee_rate_cache_update_timestamp === "number" ? BigInt(message.latest_fee_rate_cache_update_timestamp) : $util.Long.fromBits(message.latest_fee_rate_cache_update_timestamp.low >>> 0, message.latest_fee_rate_cache_update_timestamp.high >>> 0, true).toBigInt(); + else if (typeof message.latest_fee_rate_cache_update_timestamp === "number") + object.latest_fee_rate_cache_update_timestamp = options.longs === String ? String(message.latest_fee_rate_cache_update_timestamp) : message.latest_fee_rate_cache_update_timestamp; + else + object.latest_fee_rate_cache_update_timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.latest_fee_rate_cache_update_timestamp) : options.longs === Number ? new $util.LongBits(message.latest_fee_rate_cache_update_timestamp.low >>> 0, message.latest_fee_rate_cache_update_timestamp.high >>> 0).toNumber(true) : message.latest_fee_rate_cache_update_timestamp; + if (options.oneofs) + object._latest_fee_rate_cache_update_timestamp = "latest_fee_rate_cache_update_timestamp"; + } + if (message.latest_rgs_snapshot_timestamp != null && message.hasOwnProperty("latest_rgs_snapshot_timestamp")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.latest_rgs_snapshot_timestamp = typeof message.latest_rgs_snapshot_timestamp === "number" ? BigInt(message.latest_rgs_snapshot_timestamp) : $util.Long.fromBits(message.latest_rgs_snapshot_timestamp.low >>> 0, message.latest_rgs_snapshot_timestamp.high >>> 0, true).toBigInt(); + else if (typeof message.latest_rgs_snapshot_timestamp === "number") + object.latest_rgs_snapshot_timestamp = options.longs === String ? String(message.latest_rgs_snapshot_timestamp) : message.latest_rgs_snapshot_timestamp; + else + object.latest_rgs_snapshot_timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.latest_rgs_snapshot_timestamp) : options.longs === Number ? new $util.LongBits(message.latest_rgs_snapshot_timestamp.low >>> 0, message.latest_rgs_snapshot_timestamp.high >>> 0).toNumber(true) : message.latest_rgs_snapshot_timestamp; + if (options.oneofs) + object._latest_rgs_snapshot_timestamp = "latest_rgs_snapshot_timestamp"; + } + if (message.latest_node_announcement_broadcast_timestamp != null && message.hasOwnProperty("latest_node_announcement_broadcast_timestamp")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.latest_node_announcement_broadcast_timestamp = typeof message.latest_node_announcement_broadcast_timestamp === "number" ? BigInt(message.latest_node_announcement_broadcast_timestamp) : $util.Long.fromBits(message.latest_node_announcement_broadcast_timestamp.low >>> 0, message.latest_node_announcement_broadcast_timestamp.high >>> 0, true).toBigInt(); + else if (typeof message.latest_node_announcement_broadcast_timestamp === "number") + object.latest_node_announcement_broadcast_timestamp = options.longs === String ? String(message.latest_node_announcement_broadcast_timestamp) : message.latest_node_announcement_broadcast_timestamp; + else + object.latest_node_announcement_broadcast_timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.latest_node_announcement_broadcast_timestamp) : options.longs === Number ? new $util.LongBits(message.latest_node_announcement_broadcast_timestamp.low >>> 0, message.latest_node_announcement_broadcast_timestamp.high >>> 0).toNumber(true) : message.latest_node_announcement_broadcast_timestamp; + if (options.oneofs) + object._latest_node_announcement_broadcast_timestamp = "latest_node_announcement_broadcast_timestamp"; + } + if (message.listening_addresses && message.listening_addresses.length) { + object.listening_addresses = []; + for (let j = 0; j < message.listening_addresses.length; ++j) + object.listening_addresses[j] = message.listening_addresses[j]; + } + if (message.announcement_addresses && message.announcement_addresses.length) { + object.announcement_addresses = []; + for (let j = 0; j < message.announcement_addresses.length; ++j) + object.announcement_addresses[j] = message.announcement_addresses[j]; + } + if (message.node_alias != null && message.hasOwnProperty("node_alias")) { + object.node_alias = message.node_alias; + if (options.oneofs) + object._node_alias = "node_alias"; + } + if (message.node_uris && message.node_uris.length) { + object.node_uris = []; + for (let j = 0; j < message.node_uris.length; ++j) + object.node_uris[j] = message.node_uris[j]; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = options.enums === String ? $root.types.Network[message.network] === undefined ? message.network : $root.types.Network[message.network] : message.network; + return object; + }; + + /** + * Converts this GetNodeInfoResponse to JSON. + * @function toJSON + * @memberof api.GetNodeInfoResponse + * @instance + * @returns {Object.} JSON object + */ + GetNodeInfoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetNodeInfoResponse + * @function getTypeUrl + * @memberof api.GetNodeInfoResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetNodeInfoResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GetNodeInfoResponse"; + }; + + return GetNodeInfoResponse; + })(); + + api.OnchainReceiveRequest = (function() { + + /** + * Properties of an OnchainReceiveRequest. + * @memberof api + * @interface IOnchainReceiveRequest + */ + + /** + * Constructs a new OnchainReceiveRequest. + * @memberof api + * @classdesc Represents an OnchainReceiveRequest. + * @implements IOnchainReceiveRequest + * @constructor + * @param {api.IOnchainReceiveRequest=} [properties] Properties to set + */ + function OnchainReceiveRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new OnchainReceiveRequest instance using the specified properties. + * @function create + * @memberof api.OnchainReceiveRequest + * @static + * @param {api.IOnchainReceiveRequest=} [properties] Properties to set + * @returns {api.OnchainReceiveRequest} OnchainReceiveRequest instance + */ + OnchainReceiveRequest.create = function create(properties) { + return new OnchainReceiveRequest(properties); + }; + + /** + * Encodes the specified OnchainReceiveRequest message. Does not implicitly {@link api.OnchainReceiveRequest.verify|verify} messages. + * @function encode + * @memberof api.OnchainReceiveRequest + * @static + * @param {api.IOnchainReceiveRequest} message OnchainReceiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnchainReceiveRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified OnchainReceiveRequest message, length delimited. Does not implicitly {@link api.OnchainReceiveRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.OnchainReceiveRequest + * @static + * @param {api.IOnchainReceiveRequest} message OnchainReceiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnchainReceiveRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OnchainReceiveRequest message from the specified reader or buffer. + * @function decode + * @memberof api.OnchainReceiveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.OnchainReceiveRequest} OnchainReceiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnchainReceiveRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.OnchainReceiveRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OnchainReceiveRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.OnchainReceiveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.OnchainReceiveRequest} OnchainReceiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnchainReceiveRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OnchainReceiveRequest message. + * @function verify + * @memberof api.OnchainReceiveRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OnchainReceiveRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an OnchainReceiveRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.OnchainReceiveRequest + * @static + * @param {Object.} object Plain object + * @returns {api.OnchainReceiveRequest} OnchainReceiveRequest + */ + OnchainReceiveRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.OnchainReceiveRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.api.OnchainReceiveRequest(); + }; + + /** + * Creates a plain object from an OnchainReceiveRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.OnchainReceiveRequest + * @static + * @param {api.OnchainReceiveRequest} message OnchainReceiveRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OnchainReceiveRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this OnchainReceiveRequest to JSON. + * @function toJSON + * @memberof api.OnchainReceiveRequest + * @instance + * @returns {Object.} JSON object + */ + OnchainReceiveRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OnchainReceiveRequest + * @function getTypeUrl + * @memberof api.OnchainReceiveRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OnchainReceiveRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.OnchainReceiveRequest"; + }; + + return OnchainReceiveRequest; + })(); + + api.OnchainReceiveResponse = (function() { + + /** + * Properties of an OnchainReceiveResponse. + * @memberof api + * @interface IOnchainReceiveResponse + * @property {string|null} [address] OnchainReceiveResponse address + */ + + /** + * Constructs a new OnchainReceiveResponse. + * @memberof api + * @classdesc Represents an OnchainReceiveResponse. + * @implements IOnchainReceiveResponse + * @constructor + * @param {api.IOnchainReceiveResponse=} [properties] Properties to set + */ + function OnchainReceiveResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OnchainReceiveResponse address. + * @member {string} address + * @memberof api.OnchainReceiveResponse + * @instance + */ + OnchainReceiveResponse.prototype.address = ""; + + /** + * Creates a new OnchainReceiveResponse instance using the specified properties. + * @function create + * @memberof api.OnchainReceiveResponse + * @static + * @param {api.IOnchainReceiveResponse=} [properties] Properties to set + * @returns {api.OnchainReceiveResponse} OnchainReceiveResponse instance + */ + OnchainReceiveResponse.create = function create(properties) { + return new OnchainReceiveResponse(properties); + }; + + /** + * Encodes the specified OnchainReceiveResponse message. Does not implicitly {@link api.OnchainReceiveResponse.verify|verify} messages. + * @function encode + * @memberof api.OnchainReceiveResponse + * @static + * @param {api.IOnchainReceiveResponse} message OnchainReceiveResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnchainReceiveResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + return writer; + }; + + /** + * Encodes the specified OnchainReceiveResponse message, length delimited. Does not implicitly {@link api.OnchainReceiveResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.OnchainReceiveResponse + * @static + * @param {api.IOnchainReceiveResponse} message OnchainReceiveResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnchainReceiveResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OnchainReceiveResponse message from the specified reader or buffer. + * @function decode + * @memberof api.OnchainReceiveResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.OnchainReceiveResponse} OnchainReceiveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnchainReceiveResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.OnchainReceiveResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.address = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OnchainReceiveResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.OnchainReceiveResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.OnchainReceiveResponse} OnchainReceiveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnchainReceiveResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OnchainReceiveResponse message. + * @function verify + * @memberof api.OnchainReceiveResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OnchainReceiveResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + return null; + }; + + /** + * Creates an OnchainReceiveResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.OnchainReceiveResponse + * @static + * @param {Object.} object Plain object + * @returns {api.OnchainReceiveResponse} OnchainReceiveResponse + */ + OnchainReceiveResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.OnchainReceiveResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.OnchainReceiveResponse(); + if (object.address != null) + message.address = String(object.address); + return message; + }; + + /** + * Creates a plain object from an OnchainReceiveResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.OnchainReceiveResponse + * @static + * @param {api.OnchainReceiveResponse} message OnchainReceiveResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OnchainReceiveResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.address = ""; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + return object; + }; + + /** + * Converts this OnchainReceiveResponse to JSON. + * @function toJSON + * @memberof api.OnchainReceiveResponse + * @instance + * @returns {Object.} JSON object + */ + OnchainReceiveResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OnchainReceiveResponse + * @function getTypeUrl + * @memberof api.OnchainReceiveResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OnchainReceiveResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.OnchainReceiveResponse"; + }; + + return OnchainReceiveResponse; + })(); + + api.OnchainSendRequest = (function() { + + /** + * Properties of an OnchainSendRequest. + * @memberof api + * @interface IOnchainSendRequest + * @property {string|null} [address] OnchainSendRequest address + * @property {Long|null} [amount_sats] OnchainSendRequest amount_sats + * @property {boolean|null} [send_all] OnchainSendRequest send_all + * @property {Long|null} [fee_rate_sat_per_vb] OnchainSendRequest fee_rate_sat_per_vb + */ + + /** + * Constructs a new OnchainSendRequest. + * @memberof api + * @classdesc Represents an OnchainSendRequest. + * @implements IOnchainSendRequest + * @constructor + * @param {api.IOnchainSendRequest=} [properties] Properties to set + */ + function OnchainSendRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OnchainSendRequest address. + * @member {string} address + * @memberof api.OnchainSendRequest + * @instance + */ + OnchainSendRequest.prototype.address = ""; + + /** + * OnchainSendRequest amount_sats. + * @member {Long|null|undefined} amount_sats + * @memberof api.OnchainSendRequest + * @instance + */ + OnchainSendRequest.prototype.amount_sats = null; + + /** + * OnchainSendRequest send_all. + * @member {boolean|null|undefined} send_all + * @memberof api.OnchainSendRequest + * @instance + */ + OnchainSendRequest.prototype.send_all = null; + + /** + * OnchainSendRequest fee_rate_sat_per_vb. + * @member {Long|null|undefined} fee_rate_sat_per_vb + * @memberof api.OnchainSendRequest + * @instance + */ + OnchainSendRequest.prototype.fee_rate_sat_per_vb = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OnchainSendRequest.prototype, "_amount_sats", { + get: $util.oneOfGetter($oneOfFields = ["amount_sats"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OnchainSendRequest.prototype, "_send_all", { + get: $util.oneOfGetter($oneOfFields = ["send_all"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OnchainSendRequest.prototype, "_fee_rate_sat_per_vb", { + get: $util.oneOfGetter($oneOfFields = ["fee_rate_sat_per_vb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OnchainSendRequest instance using the specified properties. + * @function create + * @memberof api.OnchainSendRequest + * @static + * @param {api.IOnchainSendRequest=} [properties] Properties to set + * @returns {api.OnchainSendRequest} OnchainSendRequest instance + */ + OnchainSendRequest.create = function create(properties) { + return new OnchainSendRequest(properties); + }; + + /** + * Encodes the specified OnchainSendRequest message. Does not implicitly {@link api.OnchainSendRequest.verify|verify} messages. + * @function encode + * @memberof api.OnchainSendRequest + * @static + * @param {api.IOnchainSendRequest} message OnchainSendRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnchainSendRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.amount_sats != null && Object.hasOwnProperty.call(message, "amount_sats")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount_sats); + if (message.send_all != null && Object.hasOwnProperty.call(message, "send_all")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.send_all); + if (message.fee_rate_sat_per_vb != null && Object.hasOwnProperty.call(message, "fee_rate_sat_per_vb")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.fee_rate_sat_per_vb); + return writer; + }; + + /** + * Encodes the specified OnchainSendRequest message, length delimited. Does not implicitly {@link api.OnchainSendRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.OnchainSendRequest + * @static + * @param {api.IOnchainSendRequest} message OnchainSendRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnchainSendRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OnchainSendRequest message from the specified reader or buffer. + * @function decode + * @memberof api.OnchainSendRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.OnchainSendRequest} OnchainSendRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnchainSendRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.OnchainSendRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.address = reader.string(); + break; + } + case 2: { + message.amount_sats = reader.uint64(); + break; + } + case 3: { + message.send_all = reader.bool(); + break; + } + case 4: { + message.fee_rate_sat_per_vb = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OnchainSendRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.OnchainSendRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.OnchainSendRequest} OnchainSendRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnchainSendRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OnchainSendRequest message. + * @function verify + * @memberof api.OnchainSendRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OnchainSendRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.amount_sats != null && message.hasOwnProperty("amount_sats")) { + properties._amount_sats = 1; + if (!$util.isInteger(message.amount_sats) && !(message.amount_sats && $util.isInteger(message.amount_sats.low) && $util.isInteger(message.amount_sats.high))) + return "amount_sats: integer|Long expected"; + } + if (message.send_all != null && message.hasOwnProperty("send_all")) { + properties._send_all = 1; + if (typeof message.send_all !== "boolean") + return "send_all: boolean expected"; + } + if (message.fee_rate_sat_per_vb != null && message.hasOwnProperty("fee_rate_sat_per_vb")) { + properties._fee_rate_sat_per_vb = 1; + if (!$util.isInteger(message.fee_rate_sat_per_vb) && !(message.fee_rate_sat_per_vb && $util.isInteger(message.fee_rate_sat_per_vb.low) && $util.isInteger(message.fee_rate_sat_per_vb.high))) + return "fee_rate_sat_per_vb: integer|Long expected"; + } + return null; + }; + + /** + * Creates an OnchainSendRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.OnchainSendRequest + * @static + * @param {Object.} object Plain object + * @returns {api.OnchainSendRequest} OnchainSendRequest + */ + OnchainSendRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.OnchainSendRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.OnchainSendRequest(); + if (object.address != null) + message.address = String(object.address); + if (object.amount_sats != null) + if ($util.Long) + (message.amount_sats = $util.Long.fromValue(object.amount_sats)).unsigned = true; + else if (typeof object.amount_sats === "string") + message.amount_sats = parseInt(object.amount_sats, 10); + else if (typeof object.amount_sats === "number") + message.amount_sats = object.amount_sats; + else if (typeof object.amount_sats === "object") + message.amount_sats = new $util.LongBits(object.amount_sats.low >>> 0, object.amount_sats.high >>> 0).toNumber(true); + if (object.send_all != null) + message.send_all = Boolean(object.send_all); + if (object.fee_rate_sat_per_vb != null) + if ($util.Long) + (message.fee_rate_sat_per_vb = $util.Long.fromValue(object.fee_rate_sat_per_vb)).unsigned = true; + else if (typeof object.fee_rate_sat_per_vb === "string") + message.fee_rate_sat_per_vb = parseInt(object.fee_rate_sat_per_vb, 10); + else if (typeof object.fee_rate_sat_per_vb === "number") + message.fee_rate_sat_per_vb = object.fee_rate_sat_per_vb; + else if (typeof object.fee_rate_sat_per_vb === "object") + message.fee_rate_sat_per_vb = new $util.LongBits(object.fee_rate_sat_per_vb.low >>> 0, object.fee_rate_sat_per_vb.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from an OnchainSendRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.OnchainSendRequest + * @static + * @param {api.OnchainSendRequest} message OnchainSendRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OnchainSendRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.address = ""; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.amount_sats != null && message.hasOwnProperty("amount_sats")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_sats = typeof message.amount_sats === "number" ? BigInt(message.amount_sats) : $util.Long.fromBits(message.amount_sats.low >>> 0, message.amount_sats.high >>> 0, true).toBigInt(); + else if (typeof message.amount_sats === "number") + object.amount_sats = options.longs === String ? String(message.amount_sats) : message.amount_sats; + else + object.amount_sats = options.longs === String ? $util.Long.prototype.toString.call(message.amount_sats) : options.longs === Number ? new $util.LongBits(message.amount_sats.low >>> 0, message.amount_sats.high >>> 0).toNumber(true) : message.amount_sats; + if (options.oneofs) + object._amount_sats = "amount_sats"; + } + if (message.send_all != null && message.hasOwnProperty("send_all")) { + object.send_all = message.send_all; + if (options.oneofs) + object._send_all = "send_all"; + } + if (message.fee_rate_sat_per_vb != null && message.hasOwnProperty("fee_rate_sat_per_vb")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.fee_rate_sat_per_vb = typeof message.fee_rate_sat_per_vb === "number" ? BigInt(message.fee_rate_sat_per_vb) : $util.Long.fromBits(message.fee_rate_sat_per_vb.low >>> 0, message.fee_rate_sat_per_vb.high >>> 0, true).toBigInt(); + else if (typeof message.fee_rate_sat_per_vb === "number") + object.fee_rate_sat_per_vb = options.longs === String ? String(message.fee_rate_sat_per_vb) : message.fee_rate_sat_per_vb; + else + object.fee_rate_sat_per_vb = options.longs === String ? $util.Long.prototype.toString.call(message.fee_rate_sat_per_vb) : options.longs === Number ? new $util.LongBits(message.fee_rate_sat_per_vb.low >>> 0, message.fee_rate_sat_per_vb.high >>> 0).toNumber(true) : message.fee_rate_sat_per_vb; + if (options.oneofs) + object._fee_rate_sat_per_vb = "fee_rate_sat_per_vb"; + } + return object; + }; + + /** + * Converts this OnchainSendRequest to JSON. + * @function toJSON + * @memberof api.OnchainSendRequest + * @instance + * @returns {Object.} JSON object + */ + OnchainSendRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OnchainSendRequest + * @function getTypeUrl + * @memberof api.OnchainSendRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OnchainSendRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.OnchainSendRequest"; + }; + + return OnchainSendRequest; + })(); + + api.OnchainSendResponse = (function() { + + /** + * Properties of an OnchainSendResponse. + * @memberof api + * @interface IOnchainSendResponse + * @property {string|null} [txid] OnchainSendResponse txid + */ + + /** + * Constructs a new OnchainSendResponse. + * @memberof api + * @classdesc Represents an OnchainSendResponse. + * @implements IOnchainSendResponse + * @constructor + * @param {api.IOnchainSendResponse=} [properties] Properties to set + */ + function OnchainSendResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OnchainSendResponse txid. + * @member {string} txid + * @memberof api.OnchainSendResponse + * @instance + */ + OnchainSendResponse.prototype.txid = ""; + + /** + * Creates a new OnchainSendResponse instance using the specified properties. + * @function create + * @memberof api.OnchainSendResponse + * @static + * @param {api.IOnchainSendResponse=} [properties] Properties to set + * @returns {api.OnchainSendResponse} OnchainSendResponse instance + */ + OnchainSendResponse.create = function create(properties) { + return new OnchainSendResponse(properties); + }; + + /** + * Encodes the specified OnchainSendResponse message. Does not implicitly {@link api.OnchainSendResponse.verify|verify} messages. + * @function encode + * @memberof api.OnchainSendResponse + * @static + * @param {api.IOnchainSendResponse} message OnchainSendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnchainSendResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.txid != null && Object.hasOwnProperty.call(message, "txid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.txid); + return writer; + }; + + /** + * Encodes the specified OnchainSendResponse message, length delimited. Does not implicitly {@link api.OnchainSendResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.OnchainSendResponse + * @static + * @param {api.IOnchainSendResponse} message OnchainSendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnchainSendResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OnchainSendResponse message from the specified reader or buffer. + * @function decode + * @memberof api.OnchainSendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.OnchainSendResponse} OnchainSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnchainSendResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.OnchainSendResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.txid = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OnchainSendResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.OnchainSendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.OnchainSendResponse} OnchainSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnchainSendResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OnchainSendResponse message. + * @function verify + * @memberof api.OnchainSendResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OnchainSendResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.txid != null && message.hasOwnProperty("txid")) + if (!$util.isString(message.txid)) + return "txid: string expected"; + return null; + }; + + /** + * Creates an OnchainSendResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.OnchainSendResponse + * @static + * @param {Object.} object Plain object + * @returns {api.OnchainSendResponse} OnchainSendResponse + */ + OnchainSendResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.OnchainSendResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.OnchainSendResponse(); + if (object.txid != null) + message.txid = String(object.txid); + return message; + }; + + /** + * Creates a plain object from an OnchainSendResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.OnchainSendResponse + * @static + * @param {api.OnchainSendResponse} message OnchainSendResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OnchainSendResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.txid = ""; + if (message.txid != null && message.hasOwnProperty("txid")) + object.txid = message.txid; + return object; + }; + + /** + * Converts this OnchainSendResponse to JSON. + * @function toJSON + * @memberof api.OnchainSendResponse + * @instance + * @returns {Object.} JSON object + */ + OnchainSendResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OnchainSendResponse + * @function getTypeUrl + * @memberof api.OnchainSendResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OnchainSendResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.OnchainSendResponse"; + }; + + return OnchainSendResponse; + })(); + + api.Bolt11ReceiveRequest = (function() { + + /** + * Properties of a Bolt11ReceiveRequest. + * @memberof api + * @interface IBolt11ReceiveRequest + * @property {Long|null} [amount_msat] Bolt11ReceiveRequest amount_msat + * @property {types.IBolt11InvoiceDescription|null} [description] Bolt11ReceiveRequest description + * @property {number|null} [expiry_secs] Bolt11ReceiveRequest expiry_secs + */ + + /** + * Constructs a new Bolt11ReceiveRequest. + * @memberof api + * @classdesc Represents a Bolt11ReceiveRequest. + * @implements IBolt11ReceiveRequest + * @constructor + * @param {api.IBolt11ReceiveRequest=} [properties] Properties to set + */ + function Bolt11ReceiveRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11ReceiveRequest amount_msat. + * @member {Long|null|undefined} amount_msat + * @memberof api.Bolt11ReceiveRequest + * @instance + */ + Bolt11ReceiveRequest.prototype.amount_msat = null; + + /** + * Bolt11ReceiveRequest description. + * @member {types.IBolt11InvoiceDescription|null|undefined} description + * @memberof api.Bolt11ReceiveRequest + * @instance + */ + Bolt11ReceiveRequest.prototype.description = null; + + /** + * Bolt11ReceiveRequest expiry_secs. + * @member {number} expiry_secs + * @memberof api.Bolt11ReceiveRequest + * @instance + */ + Bolt11ReceiveRequest.prototype.expiry_secs = 0; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11ReceiveRequest.prototype, "_amount_msat", { + get: $util.oneOfGetter($oneOfFields = ["amount_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt11ReceiveRequest instance using the specified properties. + * @function create + * @memberof api.Bolt11ReceiveRequest + * @static + * @param {api.IBolt11ReceiveRequest=} [properties] Properties to set + * @returns {api.Bolt11ReceiveRequest} Bolt11ReceiveRequest instance + */ + Bolt11ReceiveRequest.create = function create(properties) { + return new Bolt11ReceiveRequest(properties); + }; + + /** + * Encodes the specified Bolt11ReceiveRequest message. Does not implicitly {@link api.Bolt11ReceiveRequest.verify|verify} messages. + * @function encode + * @memberof api.Bolt11ReceiveRequest + * @static + * @param {api.IBolt11ReceiveRequest} message Bolt11ReceiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount_msat != null && Object.hasOwnProperty.call(message, "amount_msat")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amount_msat); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.types.Bolt11InvoiceDescription.encode(message.description, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.expiry_secs != null && Object.hasOwnProperty.call(message, "expiry_secs")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.expiry_secs); + return writer; + }; + + /** + * Encodes the specified Bolt11ReceiveRequest message, length delimited. Does not implicitly {@link api.Bolt11ReceiveRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.Bolt11ReceiveRequest + * @static + * @param {api.IBolt11ReceiveRequest} message Bolt11ReceiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11ReceiveRequest message from the specified reader or buffer. + * @function decode + * @memberof api.Bolt11ReceiveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.Bolt11ReceiveRequest} Bolt11ReceiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ReceiveRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ReceiveRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.amount_msat = reader.uint64(); + break; + } + case 2: { + message.description = $root.types.Bolt11InvoiceDescription.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.expiry_secs = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11ReceiveRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.Bolt11ReceiveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.Bolt11ReceiveRequest} Bolt11ReceiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ReceiveRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11ReceiveRequest message. + * @function verify + * @memberof api.Bolt11ReceiveRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11ReceiveRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) { + properties._amount_msat = 1; + if (!$util.isInteger(message.amount_msat) && !(message.amount_msat && $util.isInteger(message.amount_msat.low) && $util.isInteger(message.amount_msat.high))) + return "amount_msat: integer|Long expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + let error = $root.types.Bolt11InvoiceDescription.verify(message.description, long + 1); + if (error) + return "description." + error; + } + if (message.expiry_secs != null && message.hasOwnProperty("expiry_secs")) + if (!$util.isInteger(message.expiry_secs)) + return "expiry_secs: integer expected"; + return null; + }; + + /** + * Creates a Bolt11ReceiveRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt11ReceiveRequest + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt11ReceiveRequest} Bolt11ReceiveRequest + */ + Bolt11ReceiveRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.Bolt11ReceiveRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.Bolt11ReceiveRequest(); + if (object.amount_msat != null) + if ($util.Long) + (message.amount_msat = $util.Long.fromValue(object.amount_msat)).unsigned = true; + else if (typeof object.amount_msat === "string") + message.amount_msat = parseInt(object.amount_msat, 10); + else if (typeof object.amount_msat === "number") + message.amount_msat = object.amount_msat; + else if (typeof object.amount_msat === "object") + message.amount_msat = new $util.LongBits(object.amount_msat.low >>> 0, object.amount_msat.high >>> 0).toNumber(true); + if (object.description != null) { + if (typeof object.description !== "object") + throw TypeError(".api.Bolt11ReceiveRequest.description: object expected"); + message.description = $root.types.Bolt11InvoiceDescription.fromObject(object.description, long + 1); + } + if (object.expiry_secs != null) + message.expiry_secs = object.expiry_secs >>> 0; + return message; + }; + + /** + * Creates a plain object from a Bolt11ReceiveRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.Bolt11ReceiveRequest + * @static + * @param {api.Bolt11ReceiveRequest} message Bolt11ReceiveRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11ReceiveRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.description = null; + object.expiry_secs = 0; + } + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_msat = typeof message.amount_msat === "number" ? BigInt(message.amount_msat) : $util.Long.fromBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0, true).toBigInt(); + else if (typeof message.amount_msat === "number") + object.amount_msat = options.longs === String ? String(message.amount_msat) : message.amount_msat; + else + object.amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amount_msat) : options.longs === Number ? new $util.LongBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0).toNumber(true) : message.amount_msat; + if (options.oneofs) + object._amount_msat = "amount_msat"; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.types.Bolt11InvoiceDescription.toObject(message.description, options); + if (message.expiry_secs != null && message.hasOwnProperty("expiry_secs")) + object.expiry_secs = message.expiry_secs; + return object; + }; + + /** + * Converts this Bolt11ReceiveRequest to JSON. + * @function toJSON + * @memberof api.Bolt11ReceiveRequest + * @instance + * @returns {Object.} JSON object + */ + Bolt11ReceiveRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11ReceiveRequest + * @function getTypeUrl + * @memberof api.Bolt11ReceiveRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ReceiveRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ReceiveRequest"; + }; + + return Bolt11ReceiveRequest; + })(); + + api.Bolt11ReceiveResponse = (function() { + + /** + * Properties of a Bolt11ReceiveResponse. + * @memberof api + * @interface IBolt11ReceiveResponse + * @property {string|null} [invoice] Bolt11ReceiveResponse invoice + * @property {string|null} [payment_hash] Bolt11ReceiveResponse payment_hash + * @property {string|null} [payment_secret] Bolt11ReceiveResponse payment_secret + */ + + /** + * Constructs a new Bolt11ReceiveResponse. + * @memberof api + * @classdesc Represents a Bolt11ReceiveResponse. + * @implements IBolt11ReceiveResponse + * @constructor + * @param {api.IBolt11ReceiveResponse=} [properties] Properties to set + */ + function Bolt11ReceiveResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11ReceiveResponse invoice. + * @member {string} invoice + * @memberof api.Bolt11ReceiveResponse + * @instance + */ + Bolt11ReceiveResponse.prototype.invoice = ""; + + /** + * Bolt11ReceiveResponse payment_hash. + * @member {string} payment_hash + * @memberof api.Bolt11ReceiveResponse + * @instance + */ + Bolt11ReceiveResponse.prototype.payment_hash = ""; + + /** + * Bolt11ReceiveResponse payment_secret. + * @member {string} payment_secret + * @memberof api.Bolt11ReceiveResponse + * @instance + */ + Bolt11ReceiveResponse.prototype.payment_secret = ""; + + /** + * Creates a new Bolt11ReceiveResponse instance using the specified properties. + * @function create + * @memberof api.Bolt11ReceiveResponse + * @static + * @param {api.IBolt11ReceiveResponse=} [properties] Properties to set + * @returns {api.Bolt11ReceiveResponse} Bolt11ReceiveResponse instance + */ + Bolt11ReceiveResponse.create = function create(properties) { + return new Bolt11ReceiveResponse(properties); + }; + + /** + * Encodes the specified Bolt11ReceiveResponse message. Does not implicitly {@link api.Bolt11ReceiveResponse.verify|verify} messages. + * @function encode + * @memberof api.Bolt11ReceiveResponse + * @static + * @param {api.IBolt11ReceiveResponse} message Bolt11ReceiveResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.invoice != null && Object.hasOwnProperty.call(message, "invoice")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.invoice); + if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.payment_hash); + if (message.payment_secret != null && Object.hasOwnProperty.call(message, "payment_secret")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.payment_secret); + return writer; + }; + + /** + * Encodes the specified Bolt11ReceiveResponse message, length delimited. Does not implicitly {@link api.Bolt11ReceiveResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.Bolt11ReceiveResponse + * @static + * @param {api.IBolt11ReceiveResponse} message Bolt11ReceiveResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11ReceiveResponse message from the specified reader or buffer. + * @function decode + * @memberof api.Bolt11ReceiveResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.Bolt11ReceiveResponse} Bolt11ReceiveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ReceiveResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ReceiveResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.invoice = reader.string(); + break; + } + case 2: { + message.payment_hash = reader.string(); + break; + } + case 3: { + message.payment_secret = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11ReceiveResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.Bolt11ReceiveResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.Bolt11ReceiveResponse} Bolt11ReceiveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ReceiveResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11ReceiveResponse message. + * @function verify + * @memberof api.Bolt11ReceiveResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11ReceiveResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.invoice != null && message.hasOwnProperty("invoice")) + if (!$util.isString(message.invoice)) + return "invoice: string expected"; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + if (!$util.isString(message.payment_hash)) + return "payment_hash: string expected"; + if (message.payment_secret != null && message.hasOwnProperty("payment_secret")) + if (!$util.isString(message.payment_secret)) + return "payment_secret: string expected"; + return null; + }; + + /** + * Creates a Bolt11ReceiveResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt11ReceiveResponse + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt11ReceiveResponse} Bolt11ReceiveResponse + */ + Bolt11ReceiveResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.Bolt11ReceiveResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.Bolt11ReceiveResponse(); + if (object.invoice != null) + message.invoice = String(object.invoice); + if (object.payment_hash != null) + message.payment_hash = String(object.payment_hash); + if (object.payment_secret != null) + message.payment_secret = String(object.payment_secret); + return message; + }; + + /** + * Creates a plain object from a Bolt11ReceiveResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.Bolt11ReceiveResponse + * @static + * @param {api.Bolt11ReceiveResponse} message Bolt11ReceiveResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11ReceiveResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.invoice = ""; + object.payment_hash = ""; + object.payment_secret = ""; + } + if (message.invoice != null && message.hasOwnProperty("invoice")) + object.invoice = message.invoice; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + object.payment_hash = message.payment_hash; + if (message.payment_secret != null && message.hasOwnProperty("payment_secret")) + object.payment_secret = message.payment_secret; + return object; + }; + + /** + * Converts this Bolt11ReceiveResponse to JSON. + * @function toJSON + * @memberof api.Bolt11ReceiveResponse + * @instance + * @returns {Object.} JSON object + */ + Bolt11ReceiveResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11ReceiveResponse + * @function getTypeUrl + * @memberof api.Bolt11ReceiveResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ReceiveResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ReceiveResponse"; + }; + + return Bolt11ReceiveResponse; + })(); + + api.Bolt11ReceiveForHashRequest = (function() { + + /** + * Properties of a Bolt11ReceiveForHashRequest. + * @memberof api + * @interface IBolt11ReceiveForHashRequest + * @property {Long|null} [amount_msat] Bolt11ReceiveForHashRequest amount_msat + * @property {types.IBolt11InvoiceDescription|null} [description] Bolt11ReceiveForHashRequest description + * @property {number|null} [expiry_secs] Bolt11ReceiveForHashRequest expiry_secs + * @property {string|null} [payment_hash] Bolt11ReceiveForHashRequest payment_hash + */ + + /** + * Constructs a new Bolt11ReceiveForHashRequest. + * @memberof api + * @classdesc Represents a Bolt11ReceiveForHashRequest. + * @implements IBolt11ReceiveForHashRequest + * @constructor + * @param {api.IBolt11ReceiveForHashRequest=} [properties] Properties to set + */ + function Bolt11ReceiveForHashRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11ReceiveForHashRequest amount_msat. + * @member {Long|null|undefined} amount_msat + * @memberof api.Bolt11ReceiveForHashRequest + * @instance + */ + Bolt11ReceiveForHashRequest.prototype.amount_msat = null; + + /** + * Bolt11ReceiveForHashRequest description. + * @member {types.IBolt11InvoiceDescription|null|undefined} description + * @memberof api.Bolt11ReceiveForHashRequest + * @instance + */ + Bolt11ReceiveForHashRequest.prototype.description = null; + + /** + * Bolt11ReceiveForHashRequest expiry_secs. + * @member {number} expiry_secs + * @memberof api.Bolt11ReceiveForHashRequest + * @instance + */ + Bolt11ReceiveForHashRequest.prototype.expiry_secs = 0; + + /** + * Bolt11ReceiveForHashRequest payment_hash. + * @member {string} payment_hash + * @memberof api.Bolt11ReceiveForHashRequest + * @instance + */ + Bolt11ReceiveForHashRequest.prototype.payment_hash = ""; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11ReceiveForHashRequest.prototype, "_amount_msat", { + get: $util.oneOfGetter($oneOfFields = ["amount_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt11ReceiveForHashRequest instance using the specified properties. + * @function create + * @memberof api.Bolt11ReceiveForHashRequest + * @static + * @param {api.IBolt11ReceiveForHashRequest=} [properties] Properties to set + * @returns {api.Bolt11ReceiveForHashRequest} Bolt11ReceiveForHashRequest instance + */ + Bolt11ReceiveForHashRequest.create = function create(properties) { + return new Bolt11ReceiveForHashRequest(properties); + }; + + /** + * Encodes the specified Bolt11ReceiveForHashRequest message. Does not implicitly {@link api.Bolt11ReceiveForHashRequest.verify|verify} messages. + * @function encode + * @memberof api.Bolt11ReceiveForHashRequest + * @static + * @param {api.IBolt11ReceiveForHashRequest} message Bolt11ReceiveForHashRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveForHashRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount_msat != null && Object.hasOwnProperty.call(message, "amount_msat")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amount_msat); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.types.Bolt11InvoiceDescription.encode(message.description, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.expiry_secs != null && Object.hasOwnProperty.call(message, "expiry_secs")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.expiry_secs); + if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.payment_hash); + return writer; + }; + + /** + * Encodes the specified Bolt11ReceiveForHashRequest message, length delimited. Does not implicitly {@link api.Bolt11ReceiveForHashRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.Bolt11ReceiveForHashRequest + * @static + * @param {api.IBolt11ReceiveForHashRequest} message Bolt11ReceiveForHashRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveForHashRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11ReceiveForHashRequest message from the specified reader or buffer. + * @function decode + * @memberof api.Bolt11ReceiveForHashRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.Bolt11ReceiveForHashRequest} Bolt11ReceiveForHashRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ReceiveForHashRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ReceiveForHashRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.amount_msat = reader.uint64(); + break; + } + case 2: { + message.description = $root.types.Bolt11InvoiceDescription.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.expiry_secs = reader.uint32(); + break; + } + case 4: { + message.payment_hash = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11ReceiveForHashRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.Bolt11ReceiveForHashRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.Bolt11ReceiveForHashRequest} Bolt11ReceiveForHashRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ReceiveForHashRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11ReceiveForHashRequest message. + * @function verify + * @memberof api.Bolt11ReceiveForHashRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11ReceiveForHashRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) { + properties._amount_msat = 1; + if (!$util.isInteger(message.amount_msat) && !(message.amount_msat && $util.isInteger(message.amount_msat.low) && $util.isInteger(message.amount_msat.high))) + return "amount_msat: integer|Long expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + let error = $root.types.Bolt11InvoiceDescription.verify(message.description, long + 1); + if (error) + return "description." + error; + } + if (message.expiry_secs != null && message.hasOwnProperty("expiry_secs")) + if (!$util.isInteger(message.expiry_secs)) + return "expiry_secs: integer expected"; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + if (!$util.isString(message.payment_hash)) + return "payment_hash: string expected"; + return null; + }; + + /** + * Creates a Bolt11ReceiveForHashRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt11ReceiveForHashRequest + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt11ReceiveForHashRequest} Bolt11ReceiveForHashRequest + */ + Bolt11ReceiveForHashRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.Bolt11ReceiveForHashRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.Bolt11ReceiveForHashRequest(); + if (object.amount_msat != null) + if ($util.Long) + (message.amount_msat = $util.Long.fromValue(object.amount_msat)).unsigned = true; + else if (typeof object.amount_msat === "string") + message.amount_msat = parseInt(object.amount_msat, 10); + else if (typeof object.amount_msat === "number") + message.amount_msat = object.amount_msat; + else if (typeof object.amount_msat === "object") + message.amount_msat = new $util.LongBits(object.amount_msat.low >>> 0, object.amount_msat.high >>> 0).toNumber(true); + if (object.description != null) { + if (typeof object.description !== "object") + throw TypeError(".api.Bolt11ReceiveForHashRequest.description: object expected"); + message.description = $root.types.Bolt11InvoiceDescription.fromObject(object.description, long + 1); + } + if (object.expiry_secs != null) + message.expiry_secs = object.expiry_secs >>> 0; + if (object.payment_hash != null) + message.payment_hash = String(object.payment_hash); + return message; + }; + + /** + * Creates a plain object from a Bolt11ReceiveForHashRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.Bolt11ReceiveForHashRequest + * @static + * @param {api.Bolt11ReceiveForHashRequest} message Bolt11ReceiveForHashRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11ReceiveForHashRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.description = null; + object.expiry_secs = 0; + object.payment_hash = ""; + } + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_msat = typeof message.amount_msat === "number" ? BigInt(message.amount_msat) : $util.Long.fromBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0, true).toBigInt(); + else if (typeof message.amount_msat === "number") + object.amount_msat = options.longs === String ? String(message.amount_msat) : message.amount_msat; + else + object.amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amount_msat) : options.longs === Number ? new $util.LongBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0).toNumber(true) : message.amount_msat; + if (options.oneofs) + object._amount_msat = "amount_msat"; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.types.Bolt11InvoiceDescription.toObject(message.description, options); + if (message.expiry_secs != null && message.hasOwnProperty("expiry_secs")) + object.expiry_secs = message.expiry_secs; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + object.payment_hash = message.payment_hash; + return object; + }; + + /** + * Converts this Bolt11ReceiveForHashRequest to JSON. + * @function toJSON + * @memberof api.Bolt11ReceiveForHashRequest + * @instance + * @returns {Object.} JSON object + */ + Bolt11ReceiveForHashRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11ReceiveForHashRequest + * @function getTypeUrl + * @memberof api.Bolt11ReceiveForHashRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ReceiveForHashRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ReceiveForHashRequest"; + }; + + return Bolt11ReceiveForHashRequest; + })(); + + api.Bolt11ReceiveForHashResponse = (function() { + + /** + * Properties of a Bolt11ReceiveForHashResponse. + * @memberof api + * @interface IBolt11ReceiveForHashResponse + * @property {string|null} [invoice] Bolt11ReceiveForHashResponse invoice + */ + + /** + * Constructs a new Bolt11ReceiveForHashResponse. + * @memberof api + * @classdesc Represents a Bolt11ReceiveForHashResponse. + * @implements IBolt11ReceiveForHashResponse + * @constructor + * @param {api.IBolt11ReceiveForHashResponse=} [properties] Properties to set + */ + function Bolt11ReceiveForHashResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11ReceiveForHashResponse invoice. + * @member {string} invoice + * @memberof api.Bolt11ReceiveForHashResponse + * @instance + */ + Bolt11ReceiveForHashResponse.prototype.invoice = ""; + + /** + * Creates a new Bolt11ReceiveForHashResponse instance using the specified properties. + * @function create + * @memberof api.Bolt11ReceiveForHashResponse + * @static + * @param {api.IBolt11ReceiveForHashResponse=} [properties] Properties to set + * @returns {api.Bolt11ReceiveForHashResponse} Bolt11ReceiveForHashResponse instance + */ + Bolt11ReceiveForHashResponse.create = function create(properties) { + return new Bolt11ReceiveForHashResponse(properties); + }; + + /** + * Encodes the specified Bolt11ReceiveForHashResponse message. Does not implicitly {@link api.Bolt11ReceiveForHashResponse.verify|verify} messages. + * @function encode + * @memberof api.Bolt11ReceiveForHashResponse + * @static + * @param {api.IBolt11ReceiveForHashResponse} message Bolt11ReceiveForHashResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveForHashResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.invoice != null && Object.hasOwnProperty.call(message, "invoice")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.invoice); + return writer; + }; + + /** + * Encodes the specified Bolt11ReceiveForHashResponse message, length delimited. Does not implicitly {@link api.Bolt11ReceiveForHashResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.Bolt11ReceiveForHashResponse + * @static + * @param {api.IBolt11ReceiveForHashResponse} message Bolt11ReceiveForHashResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveForHashResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11ReceiveForHashResponse message from the specified reader or buffer. + * @function decode + * @memberof api.Bolt11ReceiveForHashResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.Bolt11ReceiveForHashResponse} Bolt11ReceiveForHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ReceiveForHashResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ReceiveForHashResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.invoice = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11ReceiveForHashResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.Bolt11ReceiveForHashResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.Bolt11ReceiveForHashResponse} Bolt11ReceiveForHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ReceiveForHashResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11ReceiveForHashResponse message. + * @function verify + * @memberof api.Bolt11ReceiveForHashResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11ReceiveForHashResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.invoice != null && message.hasOwnProperty("invoice")) + if (!$util.isString(message.invoice)) + return "invoice: string expected"; + return null; + }; + + /** + * Creates a Bolt11ReceiveForHashResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt11ReceiveForHashResponse + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt11ReceiveForHashResponse} Bolt11ReceiveForHashResponse + */ + Bolt11ReceiveForHashResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.Bolt11ReceiveForHashResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.Bolt11ReceiveForHashResponse(); + if (object.invoice != null) + message.invoice = String(object.invoice); + return message; + }; + + /** + * Creates a plain object from a Bolt11ReceiveForHashResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.Bolt11ReceiveForHashResponse + * @static + * @param {api.Bolt11ReceiveForHashResponse} message Bolt11ReceiveForHashResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11ReceiveForHashResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.invoice = ""; + if (message.invoice != null && message.hasOwnProperty("invoice")) + object.invoice = message.invoice; + return object; + }; + + /** + * Converts this Bolt11ReceiveForHashResponse to JSON. + * @function toJSON + * @memberof api.Bolt11ReceiveForHashResponse + * @instance + * @returns {Object.} JSON object + */ + Bolt11ReceiveForHashResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11ReceiveForHashResponse + * @function getTypeUrl + * @memberof api.Bolt11ReceiveForHashResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ReceiveForHashResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ReceiveForHashResponse"; + }; + + return Bolt11ReceiveForHashResponse; + })(); + + api.Bolt11ClaimForHashRequest = (function() { + + /** + * Properties of a Bolt11ClaimForHashRequest. + * @memberof api + * @interface IBolt11ClaimForHashRequest + * @property {string|null} [payment_hash] Bolt11ClaimForHashRequest payment_hash + * @property {Long|null} [claimable_amount_msat] Bolt11ClaimForHashRequest claimable_amount_msat + * @property {string|null} [preimage] Bolt11ClaimForHashRequest preimage + */ + + /** + * Constructs a new Bolt11ClaimForHashRequest. + * @memberof api + * @classdesc Represents a Bolt11ClaimForHashRequest. + * @implements IBolt11ClaimForHashRequest + * @constructor + * @param {api.IBolt11ClaimForHashRequest=} [properties] Properties to set + */ + function Bolt11ClaimForHashRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11ClaimForHashRequest payment_hash. + * @member {string|null|undefined} payment_hash + * @memberof api.Bolt11ClaimForHashRequest + * @instance + */ + Bolt11ClaimForHashRequest.prototype.payment_hash = null; + + /** + * Bolt11ClaimForHashRequest claimable_amount_msat. + * @member {Long|null|undefined} claimable_amount_msat + * @memberof api.Bolt11ClaimForHashRequest + * @instance + */ + Bolt11ClaimForHashRequest.prototype.claimable_amount_msat = null; + + /** + * Bolt11ClaimForHashRequest preimage. + * @member {string} preimage + * @memberof api.Bolt11ClaimForHashRequest + * @instance + */ + Bolt11ClaimForHashRequest.prototype.preimage = ""; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11ClaimForHashRequest.prototype, "_payment_hash", { + get: $util.oneOfGetter($oneOfFields = ["payment_hash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11ClaimForHashRequest.prototype, "_claimable_amount_msat", { + get: $util.oneOfGetter($oneOfFields = ["claimable_amount_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt11ClaimForHashRequest instance using the specified properties. + * @function create + * @memberof api.Bolt11ClaimForHashRequest + * @static + * @param {api.IBolt11ClaimForHashRequest=} [properties] Properties to set + * @returns {api.Bolt11ClaimForHashRequest} Bolt11ClaimForHashRequest instance + */ + Bolt11ClaimForHashRequest.create = function create(properties) { + return new Bolt11ClaimForHashRequest(properties); + }; + + /** + * Encodes the specified Bolt11ClaimForHashRequest message. Does not implicitly {@link api.Bolt11ClaimForHashRequest.verify|verify} messages. + * @function encode + * @memberof api.Bolt11ClaimForHashRequest + * @static + * @param {api.IBolt11ClaimForHashRequest} message Bolt11ClaimForHashRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ClaimForHashRequest.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).string(message.payment_hash); + if (message.claimable_amount_msat != null && Object.hasOwnProperty.call(message, "claimable_amount_msat")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.claimable_amount_msat); + if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.preimage); + return writer; + }; + + /** + * Encodes the specified Bolt11ClaimForHashRequest message, length delimited. Does not implicitly {@link api.Bolt11ClaimForHashRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.Bolt11ClaimForHashRequest + * @static + * @param {api.IBolt11ClaimForHashRequest} message Bolt11ClaimForHashRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ClaimForHashRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11ClaimForHashRequest message from the specified reader or buffer. + * @function decode + * @memberof api.Bolt11ClaimForHashRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.Bolt11ClaimForHashRequest} Bolt11ClaimForHashRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ClaimForHashRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ClaimForHashRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.payment_hash = reader.string(); + break; + } + case 2: { + message.claimable_amount_msat = reader.uint64(); + break; + } + case 3: { + message.preimage = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11ClaimForHashRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.Bolt11ClaimForHashRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.Bolt11ClaimForHashRequest} Bolt11ClaimForHashRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ClaimForHashRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11ClaimForHashRequest message. + * @function verify + * @memberof api.Bolt11ClaimForHashRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11ClaimForHashRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) { + properties._payment_hash = 1; + if (!$util.isString(message.payment_hash)) + return "payment_hash: string expected"; + } + if (message.claimable_amount_msat != null && message.hasOwnProperty("claimable_amount_msat")) { + properties._claimable_amount_msat = 1; + if (!$util.isInteger(message.claimable_amount_msat) && !(message.claimable_amount_msat && $util.isInteger(message.claimable_amount_msat.low) && $util.isInteger(message.claimable_amount_msat.high))) + return "claimable_amount_msat: integer|Long expected"; + } + if (message.preimage != null && message.hasOwnProperty("preimage")) + if (!$util.isString(message.preimage)) + return "preimage: string expected"; + return null; + }; + + /** + * Creates a Bolt11ClaimForHashRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt11ClaimForHashRequest + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt11ClaimForHashRequest} Bolt11ClaimForHashRequest + */ + Bolt11ClaimForHashRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.Bolt11ClaimForHashRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.Bolt11ClaimForHashRequest(); + if (object.payment_hash != null) + message.payment_hash = String(object.payment_hash); + if (object.claimable_amount_msat != null) + if ($util.Long) + (message.claimable_amount_msat = $util.Long.fromValue(object.claimable_amount_msat)).unsigned = true; + else if (typeof object.claimable_amount_msat === "string") + message.claimable_amount_msat = parseInt(object.claimable_amount_msat, 10); + else if (typeof object.claimable_amount_msat === "number") + message.claimable_amount_msat = object.claimable_amount_msat; + else if (typeof object.claimable_amount_msat === "object") + message.claimable_amount_msat = new $util.LongBits(object.claimable_amount_msat.low >>> 0, object.claimable_amount_msat.high >>> 0).toNumber(true); + if (object.preimage != null) + message.preimage = String(object.preimage); + return message; + }; + + /** + * Creates a plain object from a Bolt11ClaimForHashRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.Bolt11ClaimForHashRequest + * @static + * @param {api.Bolt11ClaimForHashRequest} message Bolt11ClaimForHashRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11ClaimForHashRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.preimage = ""; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) { + object.payment_hash = message.payment_hash; + if (options.oneofs) + object._payment_hash = "payment_hash"; + } + if (message.claimable_amount_msat != null && message.hasOwnProperty("claimable_amount_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.claimable_amount_msat = typeof message.claimable_amount_msat === "number" ? BigInt(message.claimable_amount_msat) : $util.Long.fromBits(message.claimable_amount_msat.low >>> 0, message.claimable_amount_msat.high >>> 0, true).toBigInt(); + else if (typeof message.claimable_amount_msat === "number") + object.claimable_amount_msat = options.longs === String ? String(message.claimable_amount_msat) : message.claimable_amount_msat; + else + object.claimable_amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.claimable_amount_msat) : options.longs === Number ? new $util.LongBits(message.claimable_amount_msat.low >>> 0, message.claimable_amount_msat.high >>> 0).toNumber(true) : message.claimable_amount_msat; + if (options.oneofs) + object._claimable_amount_msat = "claimable_amount_msat"; + } + if (message.preimage != null && message.hasOwnProperty("preimage")) + object.preimage = message.preimage; + return object; + }; + + /** + * Converts this Bolt11ClaimForHashRequest to JSON. + * @function toJSON + * @memberof api.Bolt11ClaimForHashRequest + * @instance + * @returns {Object.} JSON object + */ + Bolt11ClaimForHashRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11ClaimForHashRequest + * @function getTypeUrl + * @memberof api.Bolt11ClaimForHashRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ClaimForHashRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ClaimForHashRequest"; + }; + + return Bolt11ClaimForHashRequest; + })(); + + api.Bolt11ClaimForHashResponse = (function() { + + /** + * Properties of a Bolt11ClaimForHashResponse. + * @memberof api + * @interface IBolt11ClaimForHashResponse + */ + + /** + * Constructs a new Bolt11ClaimForHashResponse. + * @memberof api + * @classdesc Represents a Bolt11ClaimForHashResponse. + * @implements IBolt11ClaimForHashResponse + * @constructor + * @param {api.IBolt11ClaimForHashResponse=} [properties] Properties to set + */ + function Bolt11ClaimForHashResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Bolt11ClaimForHashResponse instance using the specified properties. + * @function create + * @memberof api.Bolt11ClaimForHashResponse + * @static + * @param {api.IBolt11ClaimForHashResponse=} [properties] Properties to set + * @returns {api.Bolt11ClaimForHashResponse} Bolt11ClaimForHashResponse instance + */ + Bolt11ClaimForHashResponse.create = function create(properties) { + return new Bolt11ClaimForHashResponse(properties); + }; + + /** + * Encodes the specified Bolt11ClaimForHashResponse message. Does not implicitly {@link api.Bolt11ClaimForHashResponse.verify|verify} messages. + * @function encode + * @memberof api.Bolt11ClaimForHashResponse + * @static + * @param {api.IBolt11ClaimForHashResponse} message Bolt11ClaimForHashResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ClaimForHashResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Bolt11ClaimForHashResponse message, length delimited. Does not implicitly {@link api.Bolt11ClaimForHashResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.Bolt11ClaimForHashResponse + * @static + * @param {api.IBolt11ClaimForHashResponse} message Bolt11ClaimForHashResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ClaimForHashResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11ClaimForHashResponse message from the specified reader or buffer. + * @function decode + * @memberof api.Bolt11ClaimForHashResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.Bolt11ClaimForHashResponse} Bolt11ClaimForHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ClaimForHashResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ClaimForHashResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11ClaimForHashResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.Bolt11ClaimForHashResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.Bolt11ClaimForHashResponse} Bolt11ClaimForHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ClaimForHashResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11ClaimForHashResponse message. + * @function verify + * @memberof api.Bolt11ClaimForHashResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11ClaimForHashResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a Bolt11ClaimForHashResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt11ClaimForHashResponse + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt11ClaimForHashResponse} Bolt11ClaimForHashResponse + */ + Bolt11ClaimForHashResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.Bolt11ClaimForHashResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.api.Bolt11ClaimForHashResponse(); + }; + + /** + * Creates a plain object from a Bolt11ClaimForHashResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.Bolt11ClaimForHashResponse + * @static + * @param {api.Bolt11ClaimForHashResponse} message Bolt11ClaimForHashResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11ClaimForHashResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Bolt11ClaimForHashResponse to JSON. + * @function toJSON + * @memberof api.Bolt11ClaimForHashResponse + * @instance + * @returns {Object.} JSON object + */ + Bolt11ClaimForHashResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11ClaimForHashResponse + * @function getTypeUrl + * @memberof api.Bolt11ClaimForHashResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ClaimForHashResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ClaimForHashResponse"; + }; + + return Bolt11ClaimForHashResponse; + })(); + + api.Bolt11FailForHashRequest = (function() { + + /** + * Properties of a Bolt11FailForHashRequest. + * @memberof api + * @interface IBolt11FailForHashRequest + * @property {string|null} [payment_hash] Bolt11FailForHashRequest payment_hash + */ + + /** + * Constructs a new Bolt11FailForHashRequest. + * @memberof api + * @classdesc Represents a Bolt11FailForHashRequest. + * @implements IBolt11FailForHashRequest + * @constructor + * @param {api.IBolt11FailForHashRequest=} [properties] Properties to set + */ + function Bolt11FailForHashRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11FailForHashRequest payment_hash. + * @member {string} payment_hash + * @memberof api.Bolt11FailForHashRequest + * @instance + */ + Bolt11FailForHashRequest.prototype.payment_hash = ""; + + /** + * Creates a new Bolt11FailForHashRequest instance using the specified properties. + * @function create + * @memberof api.Bolt11FailForHashRequest + * @static + * @param {api.IBolt11FailForHashRequest=} [properties] Properties to set + * @returns {api.Bolt11FailForHashRequest} Bolt11FailForHashRequest instance + */ + Bolt11FailForHashRequest.create = function create(properties) { + return new Bolt11FailForHashRequest(properties); + }; + + /** + * Encodes the specified Bolt11FailForHashRequest message. Does not implicitly {@link api.Bolt11FailForHashRequest.verify|verify} messages. + * @function encode + * @memberof api.Bolt11FailForHashRequest + * @static + * @param {api.IBolt11FailForHashRequest} message Bolt11FailForHashRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11FailForHashRequest.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).string(message.payment_hash); + return writer; + }; + + /** + * Encodes the specified Bolt11FailForHashRequest message, length delimited. Does not implicitly {@link api.Bolt11FailForHashRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.Bolt11FailForHashRequest + * @static + * @param {api.IBolt11FailForHashRequest} message Bolt11FailForHashRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11FailForHashRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11FailForHashRequest message from the specified reader or buffer. + * @function decode + * @memberof api.Bolt11FailForHashRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.Bolt11FailForHashRequest} Bolt11FailForHashRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11FailForHashRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11FailForHashRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.payment_hash = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11FailForHashRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.Bolt11FailForHashRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.Bolt11FailForHashRequest} Bolt11FailForHashRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11FailForHashRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11FailForHashRequest message. + * @function verify + * @memberof api.Bolt11FailForHashRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11FailForHashRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + if (!$util.isString(message.payment_hash)) + return "payment_hash: string expected"; + return null; + }; + + /** + * Creates a Bolt11FailForHashRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt11FailForHashRequest + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt11FailForHashRequest} Bolt11FailForHashRequest + */ + Bolt11FailForHashRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.Bolt11FailForHashRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.Bolt11FailForHashRequest(); + if (object.payment_hash != null) + message.payment_hash = String(object.payment_hash); + return message; + }; + + /** + * Creates a plain object from a Bolt11FailForHashRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.Bolt11FailForHashRequest + * @static + * @param {api.Bolt11FailForHashRequest} message Bolt11FailForHashRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11FailForHashRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.payment_hash = ""; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + object.payment_hash = message.payment_hash; + return object; + }; + + /** + * Converts this Bolt11FailForHashRequest to JSON. + * @function toJSON + * @memberof api.Bolt11FailForHashRequest + * @instance + * @returns {Object.} JSON object + */ + Bolt11FailForHashRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11FailForHashRequest + * @function getTypeUrl + * @memberof api.Bolt11FailForHashRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11FailForHashRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11FailForHashRequest"; + }; + + return Bolt11FailForHashRequest; + })(); + + api.Bolt11FailForHashResponse = (function() { + + /** + * Properties of a Bolt11FailForHashResponse. + * @memberof api + * @interface IBolt11FailForHashResponse + */ + + /** + * Constructs a new Bolt11FailForHashResponse. + * @memberof api + * @classdesc Represents a Bolt11FailForHashResponse. + * @implements IBolt11FailForHashResponse + * @constructor + * @param {api.IBolt11FailForHashResponse=} [properties] Properties to set + */ + function Bolt11FailForHashResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Bolt11FailForHashResponse instance using the specified properties. + * @function create + * @memberof api.Bolt11FailForHashResponse + * @static + * @param {api.IBolt11FailForHashResponse=} [properties] Properties to set + * @returns {api.Bolt11FailForHashResponse} Bolt11FailForHashResponse instance + */ + Bolt11FailForHashResponse.create = function create(properties) { + return new Bolt11FailForHashResponse(properties); + }; + + /** + * Encodes the specified Bolt11FailForHashResponse message. Does not implicitly {@link api.Bolt11FailForHashResponse.verify|verify} messages. + * @function encode + * @memberof api.Bolt11FailForHashResponse + * @static + * @param {api.IBolt11FailForHashResponse} message Bolt11FailForHashResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11FailForHashResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Bolt11FailForHashResponse message, length delimited. Does not implicitly {@link api.Bolt11FailForHashResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.Bolt11FailForHashResponse + * @static + * @param {api.IBolt11FailForHashResponse} message Bolt11FailForHashResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11FailForHashResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11FailForHashResponse message from the specified reader or buffer. + * @function decode + * @memberof api.Bolt11FailForHashResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.Bolt11FailForHashResponse} Bolt11FailForHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11FailForHashResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11FailForHashResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11FailForHashResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.Bolt11FailForHashResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.Bolt11FailForHashResponse} Bolt11FailForHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11FailForHashResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11FailForHashResponse message. + * @function verify + * @memberof api.Bolt11FailForHashResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11FailForHashResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a Bolt11FailForHashResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt11FailForHashResponse + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt11FailForHashResponse} Bolt11FailForHashResponse + */ + Bolt11FailForHashResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.Bolt11FailForHashResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.api.Bolt11FailForHashResponse(); + }; + + /** + * Creates a plain object from a Bolt11FailForHashResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.Bolt11FailForHashResponse + * @static + * @param {api.Bolt11FailForHashResponse} message Bolt11FailForHashResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11FailForHashResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Bolt11FailForHashResponse to JSON. + * @function toJSON + * @memberof api.Bolt11FailForHashResponse + * @instance + * @returns {Object.} JSON object + */ + Bolt11FailForHashResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11FailForHashResponse + * @function getTypeUrl + * @memberof api.Bolt11FailForHashResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11FailForHashResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11FailForHashResponse"; + }; + + return Bolt11FailForHashResponse; + })(); + + api.Bolt11ReceiveViaJitChannelRequest = (function() { + + /** + * Properties of a Bolt11ReceiveViaJitChannelRequest. + * @memberof api + * @interface IBolt11ReceiveViaJitChannelRequest + * @property {Long|null} [amount_msat] Bolt11ReceiveViaJitChannelRequest amount_msat + * @property {types.IBolt11InvoiceDescription|null} [description] Bolt11ReceiveViaJitChannelRequest description + * @property {number|null} [expiry_secs] Bolt11ReceiveViaJitChannelRequest expiry_secs + * @property {Long|null} [max_total_lsp_fee_limit_msat] Bolt11ReceiveViaJitChannelRequest max_total_lsp_fee_limit_msat + */ + + /** + * Constructs a new Bolt11ReceiveViaJitChannelRequest. + * @memberof api + * @classdesc Represents a Bolt11ReceiveViaJitChannelRequest. + * @implements IBolt11ReceiveViaJitChannelRequest + * @constructor + * @param {api.IBolt11ReceiveViaJitChannelRequest=} [properties] Properties to set + */ + function Bolt11ReceiveViaJitChannelRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11ReceiveViaJitChannelRequest amount_msat. + * @member {Long} amount_msat + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @instance + */ + Bolt11ReceiveViaJitChannelRequest.prototype.amount_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Bolt11ReceiveViaJitChannelRequest description. + * @member {types.IBolt11InvoiceDescription|null|undefined} description + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @instance + */ + Bolt11ReceiveViaJitChannelRequest.prototype.description = null; + + /** + * Bolt11ReceiveViaJitChannelRequest expiry_secs. + * @member {number} expiry_secs + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @instance + */ + Bolt11ReceiveViaJitChannelRequest.prototype.expiry_secs = 0; + + /** + * Bolt11ReceiveViaJitChannelRequest max_total_lsp_fee_limit_msat. + * @member {Long|null|undefined} max_total_lsp_fee_limit_msat + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @instance + */ + Bolt11ReceiveViaJitChannelRequest.prototype.max_total_lsp_fee_limit_msat = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11ReceiveViaJitChannelRequest.prototype, "_max_total_lsp_fee_limit_msat", { + get: $util.oneOfGetter($oneOfFields = ["max_total_lsp_fee_limit_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt11ReceiveViaJitChannelRequest instance using the specified properties. + * @function create + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @static + * @param {api.IBolt11ReceiveViaJitChannelRequest=} [properties] Properties to set + * @returns {api.Bolt11ReceiveViaJitChannelRequest} Bolt11ReceiveViaJitChannelRequest instance + */ + Bolt11ReceiveViaJitChannelRequest.create = function create(properties) { + return new Bolt11ReceiveViaJitChannelRequest(properties); + }; + + /** + * Encodes the specified Bolt11ReceiveViaJitChannelRequest message. Does not implicitly {@link api.Bolt11ReceiveViaJitChannelRequest.verify|verify} messages. + * @function encode + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @static + * @param {api.IBolt11ReceiveViaJitChannelRequest} message Bolt11ReceiveViaJitChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveViaJitChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount_msat != null && Object.hasOwnProperty.call(message, "amount_msat")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amount_msat); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.types.Bolt11InvoiceDescription.encode(message.description, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.expiry_secs != null && Object.hasOwnProperty.call(message, "expiry_secs")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.expiry_secs); + if (message.max_total_lsp_fee_limit_msat != null && Object.hasOwnProperty.call(message, "max_total_lsp_fee_limit_msat")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.max_total_lsp_fee_limit_msat); + return writer; + }; + + /** + * Encodes the specified Bolt11ReceiveViaJitChannelRequest message, length delimited. Does not implicitly {@link api.Bolt11ReceiveViaJitChannelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @static + * @param {api.IBolt11ReceiveViaJitChannelRequest} message Bolt11ReceiveViaJitChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveViaJitChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11ReceiveViaJitChannelRequest message from the specified reader or buffer. + * @function decode + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.Bolt11ReceiveViaJitChannelRequest} Bolt11ReceiveViaJitChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ReceiveViaJitChannelRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ReceiveViaJitChannelRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.amount_msat = reader.uint64(); + break; + } + case 2: { + message.description = $root.types.Bolt11InvoiceDescription.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.expiry_secs = reader.uint32(); + break; + } + case 4: { + message.max_total_lsp_fee_limit_msat = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11ReceiveViaJitChannelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.Bolt11ReceiveViaJitChannelRequest} Bolt11ReceiveViaJitChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ReceiveViaJitChannelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11ReceiveViaJitChannelRequest message. + * @function verify + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11ReceiveViaJitChannelRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) + if (!$util.isInteger(message.amount_msat) && !(message.amount_msat && $util.isInteger(message.amount_msat.low) && $util.isInteger(message.amount_msat.high))) + return "amount_msat: integer|Long expected"; + if (message.description != null && message.hasOwnProperty("description")) { + let error = $root.types.Bolt11InvoiceDescription.verify(message.description, long + 1); + if (error) + return "description." + error; + } + if (message.expiry_secs != null && message.hasOwnProperty("expiry_secs")) + if (!$util.isInteger(message.expiry_secs)) + return "expiry_secs: integer expected"; + if (message.max_total_lsp_fee_limit_msat != null && message.hasOwnProperty("max_total_lsp_fee_limit_msat")) { + properties._max_total_lsp_fee_limit_msat = 1; + if (!$util.isInteger(message.max_total_lsp_fee_limit_msat) && !(message.max_total_lsp_fee_limit_msat && $util.isInteger(message.max_total_lsp_fee_limit_msat.low) && $util.isInteger(message.max_total_lsp_fee_limit_msat.high))) + return "max_total_lsp_fee_limit_msat: integer|Long expected"; + } + return null; + }; + + /** + * Creates a Bolt11ReceiveViaJitChannelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt11ReceiveViaJitChannelRequest} Bolt11ReceiveViaJitChannelRequest + */ + Bolt11ReceiveViaJitChannelRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.Bolt11ReceiveViaJitChannelRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.Bolt11ReceiveViaJitChannelRequest(); + if (object.amount_msat != null) + if ($util.Long) + (message.amount_msat = $util.Long.fromValue(object.amount_msat)).unsigned = true; + else if (typeof object.amount_msat === "string") + message.amount_msat = parseInt(object.amount_msat, 10); + else if (typeof object.amount_msat === "number") + message.amount_msat = object.amount_msat; + else if (typeof object.amount_msat === "object") + message.amount_msat = new $util.LongBits(object.amount_msat.low >>> 0, object.amount_msat.high >>> 0).toNumber(true); + if (object.description != null) { + if (typeof object.description !== "object") + throw TypeError(".api.Bolt11ReceiveViaJitChannelRequest.description: object expected"); + message.description = $root.types.Bolt11InvoiceDescription.fromObject(object.description, long + 1); + } + if (object.expiry_secs != null) + message.expiry_secs = object.expiry_secs >>> 0; + if (object.max_total_lsp_fee_limit_msat != null) + if ($util.Long) + (message.max_total_lsp_fee_limit_msat = $util.Long.fromValue(object.max_total_lsp_fee_limit_msat)).unsigned = true; + else if (typeof object.max_total_lsp_fee_limit_msat === "string") + message.max_total_lsp_fee_limit_msat = parseInt(object.max_total_lsp_fee_limit_msat, 10); + else if (typeof object.max_total_lsp_fee_limit_msat === "number") + message.max_total_lsp_fee_limit_msat = object.max_total_lsp_fee_limit_msat; + else if (typeof object.max_total_lsp_fee_limit_msat === "object") + message.max_total_lsp_fee_limit_msat = new $util.LongBits(object.max_total_lsp_fee_limit_msat.low >>> 0, object.max_total_lsp_fee_limit_msat.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Bolt11ReceiveViaJitChannelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @static + * @param {api.Bolt11ReceiveViaJitChannelRequest} message Bolt11ReceiveViaJitChannelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11ReceiveViaJitChannelRequest.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.amount_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.amount_msat = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.description = null; + object.expiry_secs = 0; + } + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_msat = typeof message.amount_msat === "number" ? BigInt(message.amount_msat) : $util.Long.fromBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0, true).toBigInt(); + else if (typeof message.amount_msat === "number") + object.amount_msat = options.longs === String ? String(message.amount_msat) : message.amount_msat; + else + object.amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amount_msat) : options.longs === Number ? new $util.LongBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0).toNumber(true) : message.amount_msat; + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.types.Bolt11InvoiceDescription.toObject(message.description, options); + if (message.expiry_secs != null && message.hasOwnProperty("expiry_secs")) + object.expiry_secs = message.expiry_secs; + if (message.max_total_lsp_fee_limit_msat != null && message.hasOwnProperty("max_total_lsp_fee_limit_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.max_total_lsp_fee_limit_msat = typeof message.max_total_lsp_fee_limit_msat === "number" ? BigInt(message.max_total_lsp_fee_limit_msat) : $util.Long.fromBits(message.max_total_lsp_fee_limit_msat.low >>> 0, message.max_total_lsp_fee_limit_msat.high >>> 0, true).toBigInt(); + else if (typeof message.max_total_lsp_fee_limit_msat === "number") + object.max_total_lsp_fee_limit_msat = options.longs === String ? String(message.max_total_lsp_fee_limit_msat) : message.max_total_lsp_fee_limit_msat; + else + object.max_total_lsp_fee_limit_msat = options.longs === String ? $util.Long.prototype.toString.call(message.max_total_lsp_fee_limit_msat) : options.longs === Number ? new $util.LongBits(message.max_total_lsp_fee_limit_msat.low >>> 0, message.max_total_lsp_fee_limit_msat.high >>> 0).toNumber(true) : message.max_total_lsp_fee_limit_msat; + if (options.oneofs) + object._max_total_lsp_fee_limit_msat = "max_total_lsp_fee_limit_msat"; + } + return object; + }; + + /** + * Converts this Bolt11ReceiveViaJitChannelRequest to JSON. + * @function toJSON + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @instance + * @returns {Object.} JSON object + */ + Bolt11ReceiveViaJitChannelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11ReceiveViaJitChannelRequest + * @function getTypeUrl + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ReceiveViaJitChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ReceiveViaJitChannelRequest"; + }; + + return Bolt11ReceiveViaJitChannelRequest; + })(); + + api.Bolt11ReceiveViaJitChannelResponse = (function() { + + /** + * Properties of a Bolt11ReceiveViaJitChannelResponse. + * @memberof api + * @interface IBolt11ReceiveViaJitChannelResponse + * @property {string|null} [invoice] Bolt11ReceiveViaJitChannelResponse invoice + */ + + /** + * Constructs a new Bolt11ReceiveViaJitChannelResponse. + * @memberof api + * @classdesc Represents a Bolt11ReceiveViaJitChannelResponse. + * @implements IBolt11ReceiveViaJitChannelResponse + * @constructor + * @param {api.IBolt11ReceiveViaJitChannelResponse=} [properties] Properties to set + */ + function Bolt11ReceiveViaJitChannelResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11ReceiveViaJitChannelResponse invoice. + * @member {string} invoice + * @memberof api.Bolt11ReceiveViaJitChannelResponse + * @instance + */ + Bolt11ReceiveViaJitChannelResponse.prototype.invoice = ""; + + /** + * Creates a new Bolt11ReceiveViaJitChannelResponse instance using the specified properties. + * @function create + * @memberof api.Bolt11ReceiveViaJitChannelResponse + * @static + * @param {api.IBolt11ReceiveViaJitChannelResponse=} [properties] Properties to set + * @returns {api.Bolt11ReceiveViaJitChannelResponse} Bolt11ReceiveViaJitChannelResponse instance + */ + Bolt11ReceiveViaJitChannelResponse.create = function create(properties) { + return new Bolt11ReceiveViaJitChannelResponse(properties); + }; + + /** + * Encodes the specified Bolt11ReceiveViaJitChannelResponse message. Does not implicitly {@link api.Bolt11ReceiveViaJitChannelResponse.verify|verify} messages. + * @function encode + * @memberof api.Bolt11ReceiveViaJitChannelResponse + * @static + * @param {api.IBolt11ReceiveViaJitChannelResponse} message Bolt11ReceiveViaJitChannelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveViaJitChannelResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.invoice != null && Object.hasOwnProperty.call(message, "invoice")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.invoice); + return writer; + }; + + /** + * Encodes the specified Bolt11ReceiveViaJitChannelResponse message, length delimited. Does not implicitly {@link api.Bolt11ReceiveViaJitChannelResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.Bolt11ReceiveViaJitChannelResponse + * @static + * @param {api.IBolt11ReceiveViaJitChannelResponse} message Bolt11ReceiveViaJitChannelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveViaJitChannelResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11ReceiveViaJitChannelResponse message from the specified reader or buffer. + * @function decode + * @memberof api.Bolt11ReceiveViaJitChannelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.Bolt11ReceiveViaJitChannelResponse} Bolt11ReceiveViaJitChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ReceiveViaJitChannelResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ReceiveViaJitChannelResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.invoice = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11ReceiveViaJitChannelResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.Bolt11ReceiveViaJitChannelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.Bolt11ReceiveViaJitChannelResponse} Bolt11ReceiveViaJitChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ReceiveViaJitChannelResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11ReceiveViaJitChannelResponse message. + * @function verify + * @memberof api.Bolt11ReceiveViaJitChannelResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11ReceiveViaJitChannelResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.invoice != null && message.hasOwnProperty("invoice")) + if (!$util.isString(message.invoice)) + return "invoice: string expected"; + return null; + }; + + /** + * Creates a Bolt11ReceiveViaJitChannelResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt11ReceiveViaJitChannelResponse + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt11ReceiveViaJitChannelResponse} Bolt11ReceiveViaJitChannelResponse + */ + Bolt11ReceiveViaJitChannelResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.Bolt11ReceiveViaJitChannelResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.Bolt11ReceiveViaJitChannelResponse(); + if (object.invoice != null) + message.invoice = String(object.invoice); + return message; + }; + + /** + * Creates a plain object from a Bolt11ReceiveViaJitChannelResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.Bolt11ReceiveViaJitChannelResponse + * @static + * @param {api.Bolt11ReceiveViaJitChannelResponse} message Bolt11ReceiveViaJitChannelResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11ReceiveViaJitChannelResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.invoice = ""; + if (message.invoice != null && message.hasOwnProperty("invoice")) + object.invoice = message.invoice; + return object; + }; + + /** + * Converts this Bolt11ReceiveViaJitChannelResponse to JSON. + * @function toJSON + * @memberof api.Bolt11ReceiveViaJitChannelResponse + * @instance + * @returns {Object.} JSON object + */ + Bolt11ReceiveViaJitChannelResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11ReceiveViaJitChannelResponse + * @function getTypeUrl + * @memberof api.Bolt11ReceiveViaJitChannelResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ReceiveViaJitChannelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ReceiveViaJitChannelResponse"; + }; + + return Bolt11ReceiveViaJitChannelResponse; + })(); + + api.Bolt11ReceiveVariableAmountViaJitChannelRequest = (function() { + + /** + * Properties of a Bolt11ReceiveVariableAmountViaJitChannelRequest. + * @memberof api + * @interface IBolt11ReceiveVariableAmountViaJitChannelRequest + * @property {types.IBolt11InvoiceDescription|null} [description] Bolt11ReceiveVariableAmountViaJitChannelRequest description + * @property {number|null} [expiry_secs] Bolt11ReceiveVariableAmountViaJitChannelRequest expiry_secs + * @property {Long|null} [max_proportional_lsp_fee_limit_ppm_msat] Bolt11ReceiveVariableAmountViaJitChannelRequest max_proportional_lsp_fee_limit_ppm_msat + */ + + /** + * Constructs a new Bolt11ReceiveVariableAmountViaJitChannelRequest. + * @memberof api + * @classdesc Represents a Bolt11ReceiveVariableAmountViaJitChannelRequest. + * @implements IBolt11ReceiveVariableAmountViaJitChannelRequest + * @constructor + * @param {api.IBolt11ReceiveVariableAmountViaJitChannelRequest=} [properties] Properties to set + */ + function Bolt11ReceiveVariableAmountViaJitChannelRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11ReceiveVariableAmountViaJitChannelRequest description. + * @member {types.IBolt11InvoiceDescription|null|undefined} description + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @instance + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.prototype.description = null; + + /** + * Bolt11ReceiveVariableAmountViaJitChannelRequest expiry_secs. + * @member {number} expiry_secs + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @instance + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.prototype.expiry_secs = 0; + + /** + * Bolt11ReceiveVariableAmountViaJitChannelRequest max_proportional_lsp_fee_limit_ppm_msat. + * @member {Long|null|undefined} max_proportional_lsp_fee_limit_ppm_msat + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @instance + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.prototype.max_proportional_lsp_fee_limit_ppm_msat = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11ReceiveVariableAmountViaJitChannelRequest.prototype, "_max_proportional_lsp_fee_limit_ppm_msat", { + get: $util.oneOfGetter($oneOfFields = ["max_proportional_lsp_fee_limit_ppm_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt11ReceiveVariableAmountViaJitChannelRequest instance using the specified properties. + * @function create + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @static + * @param {api.IBolt11ReceiveVariableAmountViaJitChannelRequest=} [properties] Properties to set + * @returns {api.Bolt11ReceiveVariableAmountViaJitChannelRequest} Bolt11ReceiveVariableAmountViaJitChannelRequest instance + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.create = function create(properties) { + return new Bolt11ReceiveVariableAmountViaJitChannelRequest(properties); + }; + + /** + * Encodes the specified Bolt11ReceiveVariableAmountViaJitChannelRequest message. Does not implicitly {@link api.Bolt11ReceiveVariableAmountViaJitChannelRequest.verify|verify} messages. + * @function encode + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @static + * @param {api.IBolt11ReceiveVariableAmountViaJitChannelRequest} message Bolt11ReceiveVariableAmountViaJitChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.types.Bolt11InvoiceDescription.encode(message.description, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.expiry_secs != null && Object.hasOwnProperty.call(message, "expiry_secs")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.expiry_secs); + if (message.max_proportional_lsp_fee_limit_ppm_msat != null && Object.hasOwnProperty.call(message, "max_proportional_lsp_fee_limit_ppm_msat")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.max_proportional_lsp_fee_limit_ppm_msat); + return writer; + }; + + /** + * Encodes the specified Bolt11ReceiveVariableAmountViaJitChannelRequest message, length delimited. Does not implicitly {@link api.Bolt11ReceiveVariableAmountViaJitChannelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @static + * @param {api.IBolt11ReceiveVariableAmountViaJitChannelRequest} message Bolt11ReceiveVariableAmountViaJitChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11ReceiveVariableAmountViaJitChannelRequest message from the specified reader or buffer. + * @function decode + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.Bolt11ReceiveVariableAmountViaJitChannelRequest} Bolt11ReceiveVariableAmountViaJitChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ReceiveVariableAmountViaJitChannelRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.description = $root.types.Bolt11InvoiceDescription.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.expiry_secs = reader.uint32(); + break; + } + case 3: { + message.max_proportional_lsp_fee_limit_ppm_msat = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11ReceiveVariableAmountViaJitChannelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.Bolt11ReceiveVariableAmountViaJitChannelRequest} Bolt11ReceiveVariableAmountViaJitChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11ReceiveVariableAmountViaJitChannelRequest message. + * @function verify + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.description != null && message.hasOwnProperty("description")) { + let error = $root.types.Bolt11InvoiceDescription.verify(message.description, long + 1); + if (error) + return "description." + error; + } + if (message.expiry_secs != null && message.hasOwnProperty("expiry_secs")) + if (!$util.isInteger(message.expiry_secs)) + return "expiry_secs: integer expected"; + if (message.max_proportional_lsp_fee_limit_ppm_msat != null && message.hasOwnProperty("max_proportional_lsp_fee_limit_ppm_msat")) { + properties._max_proportional_lsp_fee_limit_ppm_msat = 1; + if (!$util.isInteger(message.max_proportional_lsp_fee_limit_ppm_msat) && !(message.max_proportional_lsp_fee_limit_ppm_msat && $util.isInteger(message.max_proportional_lsp_fee_limit_ppm_msat.low) && $util.isInteger(message.max_proportional_lsp_fee_limit_ppm_msat.high))) + return "max_proportional_lsp_fee_limit_ppm_msat: integer|Long expected"; + } + return null; + }; + + /** + * Creates a Bolt11ReceiveVariableAmountViaJitChannelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt11ReceiveVariableAmountViaJitChannelRequest} Bolt11ReceiveVariableAmountViaJitChannelRequest + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.Bolt11ReceiveVariableAmountViaJitChannelRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.Bolt11ReceiveVariableAmountViaJitChannelRequest(); + if (object.description != null) { + if (typeof object.description !== "object") + throw TypeError(".api.Bolt11ReceiveVariableAmountViaJitChannelRequest.description: object expected"); + message.description = $root.types.Bolt11InvoiceDescription.fromObject(object.description, long + 1); + } + if (object.expiry_secs != null) + message.expiry_secs = object.expiry_secs >>> 0; + if (object.max_proportional_lsp_fee_limit_ppm_msat != null) + if ($util.Long) + (message.max_proportional_lsp_fee_limit_ppm_msat = $util.Long.fromValue(object.max_proportional_lsp_fee_limit_ppm_msat)).unsigned = true; + else if (typeof object.max_proportional_lsp_fee_limit_ppm_msat === "string") + message.max_proportional_lsp_fee_limit_ppm_msat = parseInt(object.max_proportional_lsp_fee_limit_ppm_msat, 10); + else if (typeof object.max_proportional_lsp_fee_limit_ppm_msat === "number") + message.max_proportional_lsp_fee_limit_ppm_msat = object.max_proportional_lsp_fee_limit_ppm_msat; + else if (typeof object.max_proportional_lsp_fee_limit_ppm_msat === "object") + message.max_proportional_lsp_fee_limit_ppm_msat = new $util.LongBits(object.max_proportional_lsp_fee_limit_ppm_msat.low >>> 0, object.max_proportional_lsp_fee_limit_ppm_msat.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Bolt11ReceiveVariableAmountViaJitChannelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @static + * @param {api.Bolt11ReceiveVariableAmountViaJitChannelRequest} message Bolt11ReceiveVariableAmountViaJitChannelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.description = null; + object.expiry_secs = 0; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.types.Bolt11InvoiceDescription.toObject(message.description, options); + if (message.expiry_secs != null && message.hasOwnProperty("expiry_secs")) + object.expiry_secs = message.expiry_secs; + if (message.max_proportional_lsp_fee_limit_ppm_msat != null && message.hasOwnProperty("max_proportional_lsp_fee_limit_ppm_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.max_proportional_lsp_fee_limit_ppm_msat = typeof message.max_proportional_lsp_fee_limit_ppm_msat === "number" ? BigInt(message.max_proportional_lsp_fee_limit_ppm_msat) : $util.Long.fromBits(message.max_proportional_lsp_fee_limit_ppm_msat.low >>> 0, message.max_proportional_lsp_fee_limit_ppm_msat.high >>> 0, true).toBigInt(); + else if (typeof message.max_proportional_lsp_fee_limit_ppm_msat === "number") + object.max_proportional_lsp_fee_limit_ppm_msat = options.longs === String ? String(message.max_proportional_lsp_fee_limit_ppm_msat) : message.max_proportional_lsp_fee_limit_ppm_msat; + else + object.max_proportional_lsp_fee_limit_ppm_msat = options.longs === String ? $util.Long.prototype.toString.call(message.max_proportional_lsp_fee_limit_ppm_msat) : options.longs === Number ? new $util.LongBits(message.max_proportional_lsp_fee_limit_ppm_msat.low >>> 0, message.max_proportional_lsp_fee_limit_ppm_msat.high >>> 0).toNumber(true) : message.max_proportional_lsp_fee_limit_ppm_msat; + if (options.oneofs) + object._max_proportional_lsp_fee_limit_ppm_msat = "max_proportional_lsp_fee_limit_ppm_msat"; + } + return object; + }; + + /** + * Converts this Bolt11ReceiveVariableAmountViaJitChannelRequest to JSON. + * @function toJSON + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @instance + * @returns {Object.} JSON object + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11ReceiveVariableAmountViaJitChannelRequest + * @function getTypeUrl + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ReceiveVariableAmountViaJitChannelRequest"; + }; + + return Bolt11ReceiveVariableAmountViaJitChannelRequest; + })(); + + api.Bolt11ReceiveVariableAmountViaJitChannelResponse = (function() { + + /** + * Properties of a Bolt11ReceiveVariableAmountViaJitChannelResponse. + * @memberof api + * @interface IBolt11ReceiveVariableAmountViaJitChannelResponse + * @property {string|null} [invoice] Bolt11ReceiveVariableAmountViaJitChannelResponse invoice + */ + + /** + * Constructs a new Bolt11ReceiveVariableAmountViaJitChannelResponse. + * @memberof api + * @classdesc Represents a Bolt11ReceiveVariableAmountViaJitChannelResponse. + * @implements IBolt11ReceiveVariableAmountViaJitChannelResponse + * @constructor + * @param {api.IBolt11ReceiveVariableAmountViaJitChannelResponse=} [properties] Properties to set + */ + function Bolt11ReceiveVariableAmountViaJitChannelResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11ReceiveVariableAmountViaJitChannelResponse invoice. + * @member {string} invoice + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelResponse + * @instance + */ + Bolt11ReceiveVariableAmountViaJitChannelResponse.prototype.invoice = ""; + + /** + * Creates a new Bolt11ReceiveVariableAmountViaJitChannelResponse instance using the specified properties. + * @function create + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelResponse + * @static + * @param {api.IBolt11ReceiveVariableAmountViaJitChannelResponse=} [properties] Properties to set + * @returns {api.Bolt11ReceiveVariableAmountViaJitChannelResponse} Bolt11ReceiveVariableAmountViaJitChannelResponse instance + */ + Bolt11ReceiveVariableAmountViaJitChannelResponse.create = function create(properties) { + return new Bolt11ReceiveVariableAmountViaJitChannelResponse(properties); + }; + + /** + * Encodes the specified Bolt11ReceiveVariableAmountViaJitChannelResponse message. Does not implicitly {@link api.Bolt11ReceiveVariableAmountViaJitChannelResponse.verify|verify} messages. + * @function encode + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelResponse + * @static + * @param {api.IBolt11ReceiveVariableAmountViaJitChannelResponse} message Bolt11ReceiveVariableAmountViaJitChannelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveVariableAmountViaJitChannelResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.invoice != null && Object.hasOwnProperty.call(message, "invoice")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.invoice); + return writer; + }; + + /** + * Encodes the specified Bolt11ReceiveVariableAmountViaJitChannelResponse message, length delimited. Does not implicitly {@link api.Bolt11ReceiveVariableAmountViaJitChannelResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelResponse + * @static + * @param {api.IBolt11ReceiveVariableAmountViaJitChannelResponse} message Bolt11ReceiveVariableAmountViaJitChannelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveVariableAmountViaJitChannelResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11ReceiveVariableAmountViaJitChannelResponse message from the specified reader or buffer. + * @function decode + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.Bolt11ReceiveVariableAmountViaJitChannelResponse} Bolt11ReceiveVariableAmountViaJitChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ReceiveVariableAmountViaJitChannelResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ReceiveVariableAmountViaJitChannelResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.invoice = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11ReceiveVariableAmountViaJitChannelResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.Bolt11ReceiveVariableAmountViaJitChannelResponse} Bolt11ReceiveVariableAmountViaJitChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11ReceiveVariableAmountViaJitChannelResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11ReceiveVariableAmountViaJitChannelResponse message. + * @function verify + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11ReceiveVariableAmountViaJitChannelResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.invoice != null && message.hasOwnProperty("invoice")) + if (!$util.isString(message.invoice)) + return "invoice: string expected"; + return null; + }; + + /** + * Creates a Bolt11ReceiveVariableAmountViaJitChannelResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelResponse + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt11ReceiveVariableAmountViaJitChannelResponse} Bolt11ReceiveVariableAmountViaJitChannelResponse + */ + Bolt11ReceiveVariableAmountViaJitChannelResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.Bolt11ReceiveVariableAmountViaJitChannelResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.Bolt11ReceiveVariableAmountViaJitChannelResponse(); + if (object.invoice != null) + message.invoice = String(object.invoice); + return message; + }; + + /** + * Creates a plain object from a Bolt11ReceiveVariableAmountViaJitChannelResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelResponse + * @static + * @param {api.Bolt11ReceiveVariableAmountViaJitChannelResponse} message Bolt11ReceiveVariableAmountViaJitChannelResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11ReceiveVariableAmountViaJitChannelResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.invoice = ""; + if (message.invoice != null && message.hasOwnProperty("invoice")) + object.invoice = message.invoice; + return object; + }; + + /** + * Converts this Bolt11ReceiveVariableAmountViaJitChannelResponse to JSON. + * @function toJSON + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelResponse + * @instance + * @returns {Object.} JSON object + */ + Bolt11ReceiveVariableAmountViaJitChannelResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11ReceiveVariableAmountViaJitChannelResponse + * @function getTypeUrl + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ReceiveVariableAmountViaJitChannelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ReceiveVariableAmountViaJitChannelResponse"; + }; + + return Bolt11ReceiveVariableAmountViaJitChannelResponse; + })(); + + api.Bolt11SendRequest = (function() { + + /** + * Properties of a Bolt11SendRequest. + * @memberof api + * @interface IBolt11SendRequest + * @property {string|null} [invoice] Bolt11SendRequest invoice + * @property {Long|null} [amount_msat] Bolt11SendRequest amount_msat + * @property {types.IRouteParametersConfig|null} [route_parameters] Bolt11SendRequest route_parameters + */ + + /** + * Constructs a new Bolt11SendRequest. + * @memberof api + * @classdesc Represents a Bolt11SendRequest. + * @implements IBolt11SendRequest + * @constructor + * @param {api.IBolt11SendRequest=} [properties] Properties to set + */ + function Bolt11SendRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11SendRequest invoice. + * @member {string} invoice + * @memberof api.Bolt11SendRequest + * @instance + */ + Bolt11SendRequest.prototype.invoice = ""; + + /** + * Bolt11SendRequest amount_msat. + * @member {Long|null|undefined} amount_msat + * @memberof api.Bolt11SendRequest + * @instance + */ + Bolt11SendRequest.prototype.amount_msat = null; + + /** + * Bolt11SendRequest route_parameters. + * @member {types.IRouteParametersConfig|null|undefined} route_parameters + * @memberof api.Bolt11SendRequest + * @instance + */ + Bolt11SendRequest.prototype.route_parameters = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11SendRequest.prototype, "_amount_msat", { + get: $util.oneOfGetter($oneOfFields = ["amount_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11SendRequest.prototype, "_route_parameters", { + get: $util.oneOfGetter($oneOfFields = ["route_parameters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt11SendRequest instance using the specified properties. + * @function create + * @memberof api.Bolt11SendRequest + * @static + * @param {api.IBolt11SendRequest=} [properties] Properties to set + * @returns {api.Bolt11SendRequest} Bolt11SendRequest instance + */ + Bolt11SendRequest.create = function create(properties) { + return new Bolt11SendRequest(properties); + }; + + /** + * Encodes the specified Bolt11SendRequest message. Does not implicitly {@link api.Bolt11SendRequest.verify|verify} messages. + * @function encode + * @memberof api.Bolt11SendRequest + * @static + * @param {api.IBolt11SendRequest} message Bolt11SendRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11SendRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.invoice != null && Object.hasOwnProperty.call(message, "invoice")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.invoice); + if (message.amount_msat != null && Object.hasOwnProperty.call(message, "amount_msat")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount_msat); + if (message.route_parameters != null && Object.hasOwnProperty.call(message, "route_parameters")) + $root.types.RouteParametersConfig.encode(message.route_parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Bolt11SendRequest message, length delimited. Does not implicitly {@link api.Bolt11SendRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.Bolt11SendRequest + * @static + * @param {api.IBolt11SendRequest} message Bolt11SendRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11SendRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11SendRequest message from the specified reader or buffer. + * @function decode + * @memberof api.Bolt11SendRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.Bolt11SendRequest} Bolt11SendRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11SendRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11SendRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.invoice = reader.string(); + break; + } + case 2: { + message.amount_msat = reader.uint64(); + break; + } + case 3: { + message.route_parameters = $root.types.RouteParametersConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11SendRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.Bolt11SendRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.Bolt11SendRequest} Bolt11SendRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11SendRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11SendRequest message. + * @function verify + * @memberof api.Bolt11SendRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11SendRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.invoice != null && message.hasOwnProperty("invoice")) + if (!$util.isString(message.invoice)) + return "invoice: string expected"; + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) { + properties._amount_msat = 1; + if (!$util.isInteger(message.amount_msat) && !(message.amount_msat && $util.isInteger(message.amount_msat.low) && $util.isInteger(message.amount_msat.high))) + return "amount_msat: integer|Long expected"; + } + if (message.route_parameters != null && message.hasOwnProperty("route_parameters")) { + properties._route_parameters = 1; + { + let error = $root.types.RouteParametersConfig.verify(message.route_parameters, long + 1); + if (error) + return "route_parameters." + error; + } + } + return null; + }; + + /** + * Creates a Bolt11SendRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt11SendRequest + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt11SendRequest} Bolt11SendRequest + */ + Bolt11SendRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.Bolt11SendRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.Bolt11SendRequest(); + if (object.invoice != null) + message.invoice = String(object.invoice); + if (object.amount_msat != null) + if ($util.Long) + (message.amount_msat = $util.Long.fromValue(object.amount_msat)).unsigned = true; + else if (typeof object.amount_msat === "string") + message.amount_msat = parseInt(object.amount_msat, 10); + else if (typeof object.amount_msat === "number") + message.amount_msat = object.amount_msat; + else if (typeof object.amount_msat === "object") + message.amount_msat = new $util.LongBits(object.amount_msat.low >>> 0, object.amount_msat.high >>> 0).toNumber(true); + if (object.route_parameters != null) { + if (typeof object.route_parameters !== "object") + throw TypeError(".api.Bolt11SendRequest.route_parameters: object expected"); + message.route_parameters = $root.types.RouteParametersConfig.fromObject(object.route_parameters, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Bolt11SendRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.Bolt11SendRequest + * @static + * @param {api.Bolt11SendRequest} message Bolt11SendRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11SendRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.invoice = ""; + if (message.invoice != null && message.hasOwnProperty("invoice")) + object.invoice = message.invoice; + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_msat = typeof message.amount_msat === "number" ? BigInt(message.amount_msat) : $util.Long.fromBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0, true).toBigInt(); + else if (typeof message.amount_msat === "number") + object.amount_msat = options.longs === String ? String(message.amount_msat) : message.amount_msat; + else + object.amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amount_msat) : options.longs === Number ? new $util.LongBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0).toNumber(true) : message.amount_msat; + if (options.oneofs) + object._amount_msat = "amount_msat"; + } + if (message.route_parameters != null && message.hasOwnProperty("route_parameters")) { + object.route_parameters = $root.types.RouteParametersConfig.toObject(message.route_parameters, options); + if (options.oneofs) + object._route_parameters = "route_parameters"; + } + return object; + }; + + /** + * Converts this Bolt11SendRequest to JSON. + * @function toJSON + * @memberof api.Bolt11SendRequest + * @instance + * @returns {Object.} JSON object + */ + Bolt11SendRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11SendRequest + * @function getTypeUrl + * @memberof api.Bolt11SendRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11SendRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11SendRequest"; + }; + + return Bolt11SendRequest; + })(); + + api.Bolt11SendResponse = (function() { + + /** + * Properties of a Bolt11SendResponse. + * @memberof api + * @interface IBolt11SendResponse + * @property {string|null} [payment_id] Bolt11SendResponse payment_id + */ + + /** + * Constructs a new Bolt11SendResponse. + * @memberof api + * @classdesc Represents a Bolt11SendResponse. + * @implements IBolt11SendResponse + * @constructor + * @param {api.IBolt11SendResponse=} [properties] Properties to set + */ + function Bolt11SendResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11SendResponse payment_id. + * @member {string} payment_id + * @memberof api.Bolt11SendResponse + * @instance + */ + Bolt11SendResponse.prototype.payment_id = ""; + + /** + * Creates a new Bolt11SendResponse instance using the specified properties. + * @function create + * @memberof api.Bolt11SendResponse + * @static + * @param {api.IBolt11SendResponse=} [properties] Properties to set + * @returns {api.Bolt11SendResponse} Bolt11SendResponse instance + */ + Bolt11SendResponse.create = function create(properties) { + return new Bolt11SendResponse(properties); + }; + + /** + * Encodes the specified Bolt11SendResponse message. Does not implicitly {@link api.Bolt11SendResponse.verify|verify} messages. + * @function encode + * @memberof api.Bolt11SendResponse + * @static + * @param {api.IBolt11SendResponse} message Bolt11SendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11SendResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payment_id != null && Object.hasOwnProperty.call(message, "payment_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.payment_id); + return writer; + }; + + /** + * Encodes the specified Bolt11SendResponse message, length delimited. Does not implicitly {@link api.Bolt11SendResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.Bolt11SendResponse + * @static + * @param {api.IBolt11SendResponse} message Bolt11SendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11SendResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11SendResponse message from the specified reader or buffer. + * @function decode + * @memberof api.Bolt11SendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.Bolt11SendResponse} Bolt11SendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11SendResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11SendResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.payment_id = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11SendResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.Bolt11SendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.Bolt11SendResponse} Bolt11SendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11SendResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11SendResponse message. + * @function verify + * @memberof api.Bolt11SendResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11SendResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.payment_id != null && message.hasOwnProperty("payment_id")) + if (!$util.isString(message.payment_id)) + return "payment_id: string expected"; + return null; + }; + + /** + * Creates a Bolt11SendResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt11SendResponse + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt11SendResponse} Bolt11SendResponse + */ + Bolt11SendResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.Bolt11SendResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.Bolt11SendResponse(); + if (object.payment_id != null) + message.payment_id = String(object.payment_id); + return message; + }; + + /** + * Creates a plain object from a Bolt11SendResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.Bolt11SendResponse + * @static + * @param {api.Bolt11SendResponse} message Bolt11SendResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11SendResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.payment_id = ""; + if (message.payment_id != null && message.hasOwnProperty("payment_id")) + object.payment_id = message.payment_id; + return object; + }; + + /** + * Converts this Bolt11SendResponse to JSON. + * @function toJSON + * @memberof api.Bolt11SendResponse + * @instance + * @returns {Object.} JSON object + */ + Bolt11SendResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11SendResponse + * @function getTypeUrl + * @memberof api.Bolt11SendResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11SendResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11SendResponse"; + }; + + return Bolt11SendResponse; + })(); + + api.Bolt12ReceiveRequest = (function() { + + /** + * Properties of a Bolt12ReceiveRequest. + * @memberof api + * @interface IBolt12ReceiveRequest + * @property {string|null} [description] Bolt12ReceiveRequest description + * @property {Long|null} [amount_msat] Bolt12ReceiveRequest amount_msat + * @property {number|null} [expiry_secs] Bolt12ReceiveRequest expiry_secs + * @property {Long|null} [quantity] Bolt12ReceiveRequest quantity + */ + + /** + * Constructs a new Bolt12ReceiveRequest. + * @memberof api + * @classdesc Represents a Bolt12ReceiveRequest. + * @implements IBolt12ReceiveRequest + * @constructor + * @param {api.IBolt12ReceiveRequest=} [properties] Properties to set + */ + function Bolt12ReceiveRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt12ReceiveRequest description. + * @member {string} description + * @memberof api.Bolt12ReceiveRequest + * @instance + */ + Bolt12ReceiveRequest.prototype.description = ""; + + /** + * Bolt12ReceiveRequest amount_msat. + * @member {Long|null|undefined} amount_msat + * @memberof api.Bolt12ReceiveRequest + * @instance + */ + Bolt12ReceiveRequest.prototype.amount_msat = null; + + /** + * Bolt12ReceiveRequest expiry_secs. + * @member {number|null|undefined} expiry_secs + * @memberof api.Bolt12ReceiveRequest + * @instance + */ + Bolt12ReceiveRequest.prototype.expiry_secs = null; + + /** + * Bolt12ReceiveRequest quantity. + * @member {Long|null|undefined} quantity + * @memberof api.Bolt12ReceiveRequest + * @instance + */ + Bolt12ReceiveRequest.prototype.quantity = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12ReceiveRequest.prototype, "_amount_msat", { + get: $util.oneOfGetter($oneOfFields = ["amount_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12ReceiveRequest.prototype, "_expiry_secs", { + get: $util.oneOfGetter($oneOfFields = ["expiry_secs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12ReceiveRequest.prototype, "_quantity", { + get: $util.oneOfGetter($oneOfFields = ["quantity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt12ReceiveRequest instance using the specified properties. + * @function create + * @memberof api.Bolt12ReceiveRequest + * @static + * @param {api.IBolt12ReceiveRequest=} [properties] Properties to set + * @returns {api.Bolt12ReceiveRequest} Bolt12ReceiveRequest instance + */ + Bolt12ReceiveRequest.create = function create(properties) { + return new Bolt12ReceiveRequest(properties); + }; + + /** + * Encodes the specified Bolt12ReceiveRequest message. Does not implicitly {@link api.Bolt12ReceiveRequest.verify|verify} messages. + * @function encode + * @memberof api.Bolt12ReceiveRequest + * @static + * @param {api.IBolt12ReceiveRequest} message Bolt12ReceiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt12ReceiveRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.amount_msat != null && Object.hasOwnProperty.call(message, "amount_msat")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount_msat); + if (message.expiry_secs != null && Object.hasOwnProperty.call(message, "expiry_secs")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.expiry_secs); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.quantity); + return writer; + }; + + /** + * Encodes the specified Bolt12ReceiveRequest message, length delimited. Does not implicitly {@link api.Bolt12ReceiveRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.Bolt12ReceiveRequest + * @static + * @param {api.IBolt12ReceiveRequest} message Bolt12ReceiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt12ReceiveRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt12ReceiveRequest message from the specified reader or buffer. + * @function decode + * @memberof api.Bolt12ReceiveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.Bolt12ReceiveRequest} Bolt12ReceiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt12ReceiveRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt12ReceiveRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.description = reader.string(); + break; + } + case 2: { + message.amount_msat = reader.uint64(); + break; + } + case 3: { + message.expiry_secs = reader.uint32(); + break; + } + case 4: { + message.quantity = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt12ReceiveRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.Bolt12ReceiveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.Bolt12ReceiveRequest} Bolt12ReceiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt12ReceiveRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt12ReceiveRequest message. + * @function verify + * @memberof api.Bolt12ReceiveRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt12ReceiveRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) { + properties._amount_msat = 1; + if (!$util.isInteger(message.amount_msat) && !(message.amount_msat && $util.isInteger(message.amount_msat.low) && $util.isInteger(message.amount_msat.high))) + return "amount_msat: integer|Long expected"; + } + if (message.expiry_secs != null && message.hasOwnProperty("expiry_secs")) { + properties._expiry_secs = 1; + if (!$util.isInteger(message.expiry_secs)) + return "expiry_secs: integer expected"; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) { + properties._quantity = 1; + if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) + return "quantity: integer|Long expected"; + } + return null; + }; + + /** + * Creates a Bolt12ReceiveRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt12ReceiveRequest + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt12ReceiveRequest} Bolt12ReceiveRequest + */ + Bolt12ReceiveRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.Bolt12ReceiveRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.Bolt12ReceiveRequest(); + if (object.description != null) + message.description = String(object.description); + if (object.amount_msat != null) + if ($util.Long) + (message.amount_msat = $util.Long.fromValue(object.amount_msat)).unsigned = true; + else if (typeof object.amount_msat === "string") + message.amount_msat = parseInt(object.amount_msat, 10); + else if (typeof object.amount_msat === "number") + message.amount_msat = object.amount_msat; + else if (typeof object.amount_msat === "object") + message.amount_msat = new $util.LongBits(object.amount_msat.low >>> 0, object.amount_msat.high >>> 0).toNumber(true); + if (object.expiry_secs != null) + message.expiry_secs = object.expiry_secs >>> 0; + if (object.quantity != null) + if ($util.Long) + (message.quantity = $util.Long.fromValue(object.quantity)).unsigned = true; + else if (typeof object.quantity === "string") + message.quantity = parseInt(object.quantity, 10); + else if (typeof object.quantity === "number") + message.quantity = object.quantity; + else if (typeof object.quantity === "object") + message.quantity = new $util.LongBits(object.quantity.low >>> 0, object.quantity.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Bolt12ReceiveRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.Bolt12ReceiveRequest + * @static + * @param {api.Bolt12ReceiveRequest} message Bolt12ReceiveRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt12ReceiveRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.description = ""; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_msat = typeof message.amount_msat === "number" ? BigInt(message.amount_msat) : $util.Long.fromBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0, true).toBigInt(); + else if (typeof message.amount_msat === "number") + object.amount_msat = options.longs === String ? String(message.amount_msat) : message.amount_msat; + else + object.amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amount_msat) : options.longs === Number ? new $util.LongBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0).toNumber(true) : message.amount_msat; + if (options.oneofs) + object._amount_msat = "amount_msat"; + } + if (message.expiry_secs != null && message.hasOwnProperty("expiry_secs")) { + object.expiry_secs = message.expiry_secs; + if (options.oneofs) + object._expiry_secs = "expiry_secs"; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.quantity = typeof message.quantity === "number" ? BigInt(message.quantity) : $util.Long.fromBits(message.quantity.low >>> 0, message.quantity.high >>> 0, true).toBigInt(); + else if (typeof message.quantity === "number") + object.quantity = options.longs === String ? String(message.quantity) : message.quantity; + else + object.quantity = options.longs === String ? $util.Long.prototype.toString.call(message.quantity) : options.longs === Number ? new $util.LongBits(message.quantity.low >>> 0, message.quantity.high >>> 0).toNumber(true) : message.quantity; + if (options.oneofs) + object._quantity = "quantity"; + } + return object; + }; + + /** + * Converts this Bolt12ReceiveRequest to JSON. + * @function toJSON + * @memberof api.Bolt12ReceiveRequest + * @instance + * @returns {Object.} JSON object + */ + Bolt12ReceiveRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt12ReceiveRequest + * @function getTypeUrl + * @memberof api.Bolt12ReceiveRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt12ReceiveRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt12ReceiveRequest"; + }; + + return Bolt12ReceiveRequest; + })(); + + api.Bolt12ReceiveResponse = (function() { + + /** + * Properties of a Bolt12ReceiveResponse. + * @memberof api + * @interface IBolt12ReceiveResponse + * @property {string|null} [offer] Bolt12ReceiveResponse offer + * @property {string|null} [offer_id] Bolt12ReceiveResponse offer_id + */ + + /** + * Constructs a new Bolt12ReceiveResponse. + * @memberof api + * @classdesc Represents a Bolt12ReceiveResponse. + * @implements IBolt12ReceiveResponse + * @constructor + * @param {api.IBolt12ReceiveResponse=} [properties] Properties to set + */ + function Bolt12ReceiveResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt12ReceiveResponse offer. + * @member {string} offer + * @memberof api.Bolt12ReceiveResponse + * @instance + */ + Bolt12ReceiveResponse.prototype.offer = ""; + + /** + * Bolt12ReceiveResponse offer_id. + * @member {string} offer_id + * @memberof api.Bolt12ReceiveResponse + * @instance + */ + Bolt12ReceiveResponse.prototype.offer_id = ""; + + /** + * Creates a new Bolt12ReceiveResponse instance using the specified properties. + * @function create + * @memberof api.Bolt12ReceiveResponse + * @static + * @param {api.IBolt12ReceiveResponse=} [properties] Properties to set + * @returns {api.Bolt12ReceiveResponse} Bolt12ReceiveResponse instance + */ + Bolt12ReceiveResponse.create = function create(properties) { + return new Bolt12ReceiveResponse(properties); + }; + + /** + * Encodes the specified Bolt12ReceiveResponse message. Does not implicitly {@link api.Bolt12ReceiveResponse.verify|verify} messages. + * @function encode + * @memberof api.Bolt12ReceiveResponse + * @static + * @param {api.IBolt12ReceiveResponse} message Bolt12ReceiveResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt12ReceiveResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.offer != null && Object.hasOwnProperty.call(message, "offer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.offer); + if (message.offer_id != null && Object.hasOwnProperty.call(message, "offer_id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.offer_id); + return writer; + }; + + /** + * Encodes the specified Bolt12ReceiveResponse message, length delimited. Does not implicitly {@link api.Bolt12ReceiveResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.Bolt12ReceiveResponse + * @static + * @param {api.IBolt12ReceiveResponse} message Bolt12ReceiveResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt12ReceiveResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt12ReceiveResponse message from the specified reader or buffer. + * @function decode + * @memberof api.Bolt12ReceiveResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.Bolt12ReceiveResponse} Bolt12ReceiveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt12ReceiveResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt12ReceiveResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.offer = reader.string(); + break; + } + case 2: { + message.offer_id = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt12ReceiveResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.Bolt12ReceiveResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.Bolt12ReceiveResponse} Bolt12ReceiveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt12ReceiveResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt12ReceiveResponse message. + * @function verify + * @memberof api.Bolt12ReceiveResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt12ReceiveResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.offer != null && message.hasOwnProperty("offer")) + if (!$util.isString(message.offer)) + return "offer: string expected"; + if (message.offer_id != null && message.hasOwnProperty("offer_id")) + if (!$util.isString(message.offer_id)) + return "offer_id: string expected"; + return null; + }; + + /** + * Creates a Bolt12ReceiveResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt12ReceiveResponse + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt12ReceiveResponse} Bolt12ReceiveResponse + */ + Bolt12ReceiveResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.Bolt12ReceiveResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.Bolt12ReceiveResponse(); + if (object.offer != null) + message.offer = String(object.offer); + if (object.offer_id != null) + message.offer_id = String(object.offer_id); + return message; + }; + + /** + * Creates a plain object from a Bolt12ReceiveResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.Bolt12ReceiveResponse + * @static + * @param {api.Bolt12ReceiveResponse} message Bolt12ReceiveResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt12ReceiveResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.offer = ""; + object.offer_id = ""; + } + if (message.offer != null && message.hasOwnProperty("offer")) + object.offer = message.offer; + if (message.offer_id != null && message.hasOwnProperty("offer_id")) + object.offer_id = message.offer_id; + return object; + }; + + /** + * Converts this Bolt12ReceiveResponse to JSON. + * @function toJSON + * @memberof api.Bolt12ReceiveResponse + * @instance + * @returns {Object.} JSON object + */ + Bolt12ReceiveResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt12ReceiveResponse + * @function getTypeUrl + * @memberof api.Bolt12ReceiveResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt12ReceiveResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt12ReceiveResponse"; + }; + + return Bolt12ReceiveResponse; + })(); + + api.Bolt12SendRequest = (function() { + + /** + * Properties of a Bolt12SendRequest. + * @memberof api + * @interface IBolt12SendRequest + * @property {string|null} [offer] Bolt12SendRequest offer + * @property {Long|null} [amount_msat] Bolt12SendRequest amount_msat + * @property {Long|null} [quantity] Bolt12SendRequest quantity + * @property {string|null} [payer_note] Bolt12SendRequest payer_note + * @property {types.IRouteParametersConfig|null} [route_parameters] Bolt12SendRequest route_parameters + */ + + /** + * Constructs a new Bolt12SendRequest. + * @memberof api + * @classdesc Represents a Bolt12SendRequest. + * @implements IBolt12SendRequest + * @constructor + * @param {api.IBolt12SendRequest=} [properties] Properties to set + */ + function Bolt12SendRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt12SendRequest offer. + * @member {string} offer + * @memberof api.Bolt12SendRequest + * @instance + */ + Bolt12SendRequest.prototype.offer = ""; + + /** + * Bolt12SendRequest amount_msat. + * @member {Long|null|undefined} amount_msat + * @memberof api.Bolt12SendRequest + * @instance + */ + Bolt12SendRequest.prototype.amount_msat = null; + + /** + * Bolt12SendRequest quantity. + * @member {Long|null|undefined} quantity + * @memberof api.Bolt12SendRequest + * @instance + */ + Bolt12SendRequest.prototype.quantity = null; + + /** + * Bolt12SendRequest payer_note. + * @member {string|null|undefined} payer_note + * @memberof api.Bolt12SendRequest + * @instance + */ + Bolt12SendRequest.prototype.payer_note = null; + + /** + * Bolt12SendRequest route_parameters. + * @member {types.IRouteParametersConfig|null|undefined} route_parameters + * @memberof api.Bolt12SendRequest + * @instance + */ + Bolt12SendRequest.prototype.route_parameters = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12SendRequest.prototype, "_amount_msat", { + get: $util.oneOfGetter($oneOfFields = ["amount_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12SendRequest.prototype, "_quantity", { + get: $util.oneOfGetter($oneOfFields = ["quantity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12SendRequest.prototype, "_payer_note", { + get: $util.oneOfGetter($oneOfFields = ["payer_note"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12SendRequest.prototype, "_route_parameters", { + get: $util.oneOfGetter($oneOfFields = ["route_parameters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt12SendRequest instance using the specified properties. + * @function create + * @memberof api.Bolt12SendRequest + * @static + * @param {api.IBolt12SendRequest=} [properties] Properties to set + * @returns {api.Bolt12SendRequest} Bolt12SendRequest instance + */ + Bolt12SendRequest.create = function create(properties) { + return new Bolt12SendRequest(properties); + }; + + /** + * Encodes the specified Bolt12SendRequest message. Does not implicitly {@link api.Bolt12SendRequest.verify|verify} messages. + * @function encode + * @memberof api.Bolt12SendRequest + * @static + * @param {api.IBolt12SendRequest} message Bolt12SendRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt12SendRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.offer != null && Object.hasOwnProperty.call(message, "offer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.offer); + if (message.amount_msat != null && Object.hasOwnProperty.call(message, "amount_msat")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount_msat); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.quantity); + if (message.payer_note != null && Object.hasOwnProperty.call(message, "payer_note")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.payer_note); + if (message.route_parameters != null && Object.hasOwnProperty.call(message, "route_parameters")) + $root.types.RouteParametersConfig.encode(message.route_parameters, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Bolt12SendRequest message, length delimited. Does not implicitly {@link api.Bolt12SendRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.Bolt12SendRequest + * @static + * @param {api.IBolt12SendRequest} message Bolt12SendRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt12SendRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt12SendRequest message from the specified reader or buffer. + * @function decode + * @memberof api.Bolt12SendRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.Bolt12SendRequest} Bolt12SendRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt12SendRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt12SendRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.offer = reader.string(); + break; + } + case 2: { + message.amount_msat = reader.uint64(); + break; + } + case 3: { + message.quantity = reader.uint64(); + break; + } + case 4: { + message.payer_note = reader.string(); + break; + } + case 5: { + message.route_parameters = $root.types.RouteParametersConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt12SendRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.Bolt12SendRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.Bolt12SendRequest} Bolt12SendRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt12SendRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt12SendRequest message. + * @function verify + * @memberof api.Bolt12SendRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt12SendRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.offer != null && message.hasOwnProperty("offer")) + if (!$util.isString(message.offer)) + return "offer: string expected"; + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) { + properties._amount_msat = 1; + if (!$util.isInteger(message.amount_msat) && !(message.amount_msat && $util.isInteger(message.amount_msat.low) && $util.isInteger(message.amount_msat.high))) + return "amount_msat: integer|Long expected"; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) { + properties._quantity = 1; + if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) + return "quantity: integer|Long expected"; + } + if (message.payer_note != null && message.hasOwnProperty("payer_note")) { + properties._payer_note = 1; + if (!$util.isString(message.payer_note)) + return "payer_note: string expected"; + } + if (message.route_parameters != null && message.hasOwnProperty("route_parameters")) { + properties._route_parameters = 1; + { + let error = $root.types.RouteParametersConfig.verify(message.route_parameters, long + 1); + if (error) + return "route_parameters." + error; + } + } + return null; + }; + + /** + * Creates a Bolt12SendRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt12SendRequest + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt12SendRequest} Bolt12SendRequest + */ + Bolt12SendRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.Bolt12SendRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.Bolt12SendRequest(); + if (object.offer != null) + message.offer = String(object.offer); + if (object.amount_msat != null) + if ($util.Long) + (message.amount_msat = $util.Long.fromValue(object.amount_msat)).unsigned = true; + else if (typeof object.amount_msat === "string") + message.amount_msat = parseInt(object.amount_msat, 10); + else if (typeof object.amount_msat === "number") + message.amount_msat = object.amount_msat; + else if (typeof object.amount_msat === "object") + message.amount_msat = new $util.LongBits(object.amount_msat.low >>> 0, object.amount_msat.high >>> 0).toNumber(true); + if (object.quantity != null) + if ($util.Long) + (message.quantity = $util.Long.fromValue(object.quantity)).unsigned = true; + else if (typeof object.quantity === "string") + message.quantity = parseInt(object.quantity, 10); + else if (typeof object.quantity === "number") + message.quantity = object.quantity; + else if (typeof object.quantity === "object") + message.quantity = new $util.LongBits(object.quantity.low >>> 0, object.quantity.high >>> 0).toNumber(true); + if (object.payer_note != null) + message.payer_note = String(object.payer_note); + if (object.route_parameters != null) { + if (typeof object.route_parameters !== "object") + throw TypeError(".api.Bolt12SendRequest.route_parameters: object expected"); + message.route_parameters = $root.types.RouteParametersConfig.fromObject(object.route_parameters, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a Bolt12SendRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.Bolt12SendRequest + * @static + * @param {api.Bolt12SendRequest} message Bolt12SendRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt12SendRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.offer = ""; + if (message.offer != null && message.hasOwnProperty("offer")) + object.offer = message.offer; + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_msat = typeof message.amount_msat === "number" ? BigInt(message.amount_msat) : $util.Long.fromBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0, true).toBigInt(); + else if (typeof message.amount_msat === "number") + object.amount_msat = options.longs === String ? String(message.amount_msat) : message.amount_msat; + else + object.amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amount_msat) : options.longs === Number ? new $util.LongBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0).toNumber(true) : message.amount_msat; + if (options.oneofs) + object._amount_msat = "amount_msat"; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.quantity = typeof message.quantity === "number" ? BigInt(message.quantity) : $util.Long.fromBits(message.quantity.low >>> 0, message.quantity.high >>> 0, true).toBigInt(); + else if (typeof message.quantity === "number") + object.quantity = options.longs === String ? String(message.quantity) : message.quantity; + else + object.quantity = options.longs === String ? $util.Long.prototype.toString.call(message.quantity) : options.longs === Number ? new $util.LongBits(message.quantity.low >>> 0, message.quantity.high >>> 0).toNumber(true) : message.quantity; + if (options.oneofs) + object._quantity = "quantity"; + } + if (message.payer_note != null && message.hasOwnProperty("payer_note")) { + object.payer_note = message.payer_note; + if (options.oneofs) + object._payer_note = "payer_note"; + } + if (message.route_parameters != null && message.hasOwnProperty("route_parameters")) { + object.route_parameters = $root.types.RouteParametersConfig.toObject(message.route_parameters, options); + if (options.oneofs) + object._route_parameters = "route_parameters"; + } + return object; + }; + + /** + * Converts this Bolt12SendRequest to JSON. + * @function toJSON + * @memberof api.Bolt12SendRequest + * @instance + * @returns {Object.} JSON object + */ + Bolt12SendRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt12SendRequest + * @function getTypeUrl + * @memberof api.Bolt12SendRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt12SendRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt12SendRequest"; + }; + + return Bolt12SendRequest; + })(); + + api.Bolt12SendResponse = (function() { + + /** + * Properties of a Bolt12SendResponse. + * @memberof api + * @interface IBolt12SendResponse + * @property {string|null} [payment_id] Bolt12SendResponse payment_id + */ + + /** + * Constructs a new Bolt12SendResponse. + * @memberof api + * @classdesc Represents a Bolt12SendResponse. + * @implements IBolt12SendResponse + * @constructor + * @param {api.IBolt12SendResponse=} [properties] Properties to set + */ + function Bolt12SendResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt12SendResponse payment_id. + * @member {string} payment_id + * @memberof api.Bolt12SendResponse + * @instance + */ + Bolt12SendResponse.prototype.payment_id = ""; + + /** + * Creates a new Bolt12SendResponse instance using the specified properties. + * @function create + * @memberof api.Bolt12SendResponse + * @static + * @param {api.IBolt12SendResponse=} [properties] Properties to set + * @returns {api.Bolt12SendResponse} Bolt12SendResponse instance + */ + Bolt12SendResponse.create = function create(properties) { + return new Bolt12SendResponse(properties); + }; + + /** + * Encodes the specified Bolt12SendResponse message. Does not implicitly {@link api.Bolt12SendResponse.verify|verify} messages. + * @function encode + * @memberof api.Bolt12SendResponse + * @static + * @param {api.IBolt12SendResponse} message Bolt12SendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt12SendResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payment_id != null && Object.hasOwnProperty.call(message, "payment_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.payment_id); + return writer; + }; + + /** + * Encodes the specified Bolt12SendResponse message, length delimited. Does not implicitly {@link api.Bolt12SendResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.Bolt12SendResponse + * @static + * @param {api.IBolt12SendResponse} message Bolt12SendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt12SendResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt12SendResponse message from the specified reader or buffer. + * @function decode + * @memberof api.Bolt12SendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.Bolt12SendResponse} Bolt12SendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt12SendResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt12SendResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.payment_id = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt12SendResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.Bolt12SendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.Bolt12SendResponse} Bolt12SendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt12SendResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt12SendResponse message. + * @function verify + * @memberof api.Bolt12SendResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt12SendResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.payment_id != null && message.hasOwnProperty("payment_id")) + if (!$util.isString(message.payment_id)) + return "payment_id: string expected"; + return null; + }; + + /** + * Creates a Bolt12SendResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt12SendResponse + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt12SendResponse} Bolt12SendResponse + */ + Bolt12SendResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.Bolt12SendResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.Bolt12SendResponse(); + if (object.payment_id != null) + message.payment_id = String(object.payment_id); + return message; + }; + + /** + * Creates a plain object from a Bolt12SendResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.Bolt12SendResponse + * @static + * @param {api.Bolt12SendResponse} message Bolt12SendResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt12SendResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.payment_id = ""; + if (message.payment_id != null && message.hasOwnProperty("payment_id")) + object.payment_id = message.payment_id; + return object; + }; + + /** + * Converts this Bolt12SendResponse to JSON. + * @function toJSON + * @memberof api.Bolt12SendResponse + * @instance + * @returns {Object.} JSON object + */ + Bolt12SendResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt12SendResponse + * @function getTypeUrl + * @memberof api.Bolt12SendResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt12SendResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt12SendResponse"; + }; + + return Bolt12SendResponse; + })(); + + api.SpontaneousSendRequest = (function() { + + /** + * Properties of a SpontaneousSendRequest. + * @memberof api + * @interface ISpontaneousSendRequest + * @property {Long|null} [amount_msat] SpontaneousSendRequest amount_msat + * @property {string|null} [node_id] SpontaneousSendRequest node_id + * @property {types.IRouteParametersConfig|null} [route_parameters] SpontaneousSendRequest route_parameters + */ + + /** + * Constructs a new SpontaneousSendRequest. + * @memberof api + * @classdesc Represents a SpontaneousSendRequest. + * @implements ISpontaneousSendRequest + * @constructor + * @param {api.ISpontaneousSendRequest=} [properties] Properties to set + */ + function SpontaneousSendRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpontaneousSendRequest amount_msat. + * @member {Long} amount_msat + * @memberof api.SpontaneousSendRequest + * @instance + */ + SpontaneousSendRequest.prototype.amount_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * SpontaneousSendRequest node_id. + * @member {string} node_id + * @memberof api.SpontaneousSendRequest + * @instance + */ + SpontaneousSendRequest.prototype.node_id = ""; + + /** + * SpontaneousSendRequest route_parameters. + * @member {types.IRouteParametersConfig|null|undefined} route_parameters + * @memberof api.SpontaneousSendRequest + * @instance + */ + SpontaneousSendRequest.prototype.route_parameters = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SpontaneousSendRequest.prototype, "_route_parameters", { + get: $util.oneOfGetter($oneOfFields = ["route_parameters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SpontaneousSendRequest instance using the specified properties. + * @function create + * @memberof api.SpontaneousSendRequest + * @static + * @param {api.ISpontaneousSendRequest=} [properties] Properties to set + * @returns {api.SpontaneousSendRequest} SpontaneousSendRequest instance + */ + SpontaneousSendRequest.create = function create(properties) { + return new SpontaneousSendRequest(properties); + }; + + /** + * Encodes the specified SpontaneousSendRequest message. Does not implicitly {@link api.SpontaneousSendRequest.verify|verify} messages. + * @function encode + * @memberof api.SpontaneousSendRequest + * @static + * @param {api.ISpontaneousSendRequest} message SpontaneousSendRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpontaneousSendRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount_msat != null && Object.hasOwnProperty.call(message, "amount_msat")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amount_msat); + if (message.node_id != null && Object.hasOwnProperty.call(message, "node_id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.node_id); + if (message.route_parameters != null && Object.hasOwnProperty.call(message, "route_parameters")) + $root.types.RouteParametersConfig.encode(message.route_parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpontaneousSendRequest message, length delimited. Does not implicitly {@link api.SpontaneousSendRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.SpontaneousSendRequest + * @static + * @param {api.ISpontaneousSendRequest} message SpontaneousSendRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpontaneousSendRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpontaneousSendRequest message from the specified reader or buffer. + * @function decode + * @memberof api.SpontaneousSendRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.SpontaneousSendRequest} SpontaneousSendRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpontaneousSendRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.SpontaneousSendRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.amount_msat = reader.uint64(); + break; + } + case 2: { + message.node_id = reader.string(); + break; + } + case 3: { + message.route_parameters = $root.types.RouteParametersConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SpontaneousSendRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.SpontaneousSendRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.SpontaneousSendRequest} SpontaneousSendRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpontaneousSendRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpontaneousSendRequest message. + * @function verify + * @memberof api.SpontaneousSendRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpontaneousSendRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) + if (!$util.isInteger(message.amount_msat) && !(message.amount_msat && $util.isInteger(message.amount_msat.low) && $util.isInteger(message.amount_msat.high))) + return "amount_msat: integer|Long expected"; + if (message.node_id != null && message.hasOwnProperty("node_id")) + if (!$util.isString(message.node_id)) + return "node_id: string expected"; + if (message.route_parameters != null && message.hasOwnProperty("route_parameters")) { + properties._route_parameters = 1; + { + let error = $root.types.RouteParametersConfig.verify(message.route_parameters, long + 1); + if (error) + return "route_parameters." + error; + } + } + return null; + }; + + /** + * Creates a SpontaneousSendRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.SpontaneousSendRequest + * @static + * @param {Object.} object Plain object + * @returns {api.SpontaneousSendRequest} SpontaneousSendRequest + */ + SpontaneousSendRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.SpontaneousSendRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.SpontaneousSendRequest(); + if (object.amount_msat != null) + if ($util.Long) + (message.amount_msat = $util.Long.fromValue(object.amount_msat)).unsigned = true; + else if (typeof object.amount_msat === "string") + message.amount_msat = parseInt(object.amount_msat, 10); + else if (typeof object.amount_msat === "number") + message.amount_msat = object.amount_msat; + else if (typeof object.amount_msat === "object") + message.amount_msat = new $util.LongBits(object.amount_msat.low >>> 0, object.amount_msat.high >>> 0).toNumber(true); + if (object.node_id != null) + message.node_id = String(object.node_id); + if (object.route_parameters != null) { + if (typeof object.route_parameters !== "object") + throw TypeError(".api.SpontaneousSendRequest.route_parameters: object expected"); + message.route_parameters = $root.types.RouteParametersConfig.fromObject(object.route_parameters, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a SpontaneousSendRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.SpontaneousSendRequest + * @static + * @param {api.SpontaneousSendRequest} message SpontaneousSendRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpontaneousSendRequest.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.amount_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.amount_msat = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.node_id = ""; + } + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_msat = typeof message.amount_msat === "number" ? BigInt(message.amount_msat) : $util.Long.fromBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0, true).toBigInt(); + else if (typeof message.amount_msat === "number") + object.amount_msat = options.longs === String ? String(message.amount_msat) : message.amount_msat; + else + object.amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amount_msat) : options.longs === Number ? new $util.LongBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0).toNumber(true) : message.amount_msat; + if (message.node_id != null && message.hasOwnProperty("node_id")) + object.node_id = message.node_id; + if (message.route_parameters != null && message.hasOwnProperty("route_parameters")) { + object.route_parameters = $root.types.RouteParametersConfig.toObject(message.route_parameters, options); + if (options.oneofs) + object._route_parameters = "route_parameters"; + } + return object; + }; + + /** + * Converts this SpontaneousSendRequest to JSON. + * @function toJSON + * @memberof api.SpontaneousSendRequest + * @instance + * @returns {Object.} JSON object + */ + SpontaneousSendRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpontaneousSendRequest + * @function getTypeUrl + * @memberof api.SpontaneousSendRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpontaneousSendRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.SpontaneousSendRequest"; + }; + + return SpontaneousSendRequest; + })(); + + api.SpontaneousSendResponse = (function() { + + /** + * Properties of a SpontaneousSendResponse. + * @memberof api + * @interface ISpontaneousSendResponse + * @property {string|null} [payment_id] SpontaneousSendResponse payment_id + */ + + /** + * Constructs a new SpontaneousSendResponse. + * @memberof api + * @classdesc Represents a SpontaneousSendResponse. + * @implements ISpontaneousSendResponse + * @constructor + * @param {api.ISpontaneousSendResponse=} [properties] Properties to set + */ + function SpontaneousSendResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpontaneousSendResponse payment_id. + * @member {string} payment_id + * @memberof api.SpontaneousSendResponse + * @instance + */ + SpontaneousSendResponse.prototype.payment_id = ""; + + /** + * Creates a new SpontaneousSendResponse instance using the specified properties. + * @function create + * @memberof api.SpontaneousSendResponse + * @static + * @param {api.ISpontaneousSendResponse=} [properties] Properties to set + * @returns {api.SpontaneousSendResponse} SpontaneousSendResponse instance + */ + SpontaneousSendResponse.create = function create(properties) { + return new SpontaneousSendResponse(properties); + }; + + /** + * Encodes the specified SpontaneousSendResponse message. Does not implicitly {@link api.SpontaneousSendResponse.verify|verify} messages. + * @function encode + * @memberof api.SpontaneousSendResponse + * @static + * @param {api.ISpontaneousSendResponse} message SpontaneousSendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpontaneousSendResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payment_id != null && Object.hasOwnProperty.call(message, "payment_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.payment_id); + return writer; + }; + + /** + * Encodes the specified SpontaneousSendResponse message, length delimited. Does not implicitly {@link api.SpontaneousSendResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.SpontaneousSendResponse + * @static + * @param {api.ISpontaneousSendResponse} message SpontaneousSendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpontaneousSendResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpontaneousSendResponse message from the specified reader or buffer. + * @function decode + * @memberof api.SpontaneousSendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.SpontaneousSendResponse} SpontaneousSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpontaneousSendResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.SpontaneousSendResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.payment_id = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SpontaneousSendResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.SpontaneousSendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.SpontaneousSendResponse} SpontaneousSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpontaneousSendResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpontaneousSendResponse message. + * @function verify + * @memberof api.SpontaneousSendResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpontaneousSendResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.payment_id != null && message.hasOwnProperty("payment_id")) + if (!$util.isString(message.payment_id)) + return "payment_id: string expected"; + return null; + }; + + /** + * Creates a SpontaneousSendResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.SpontaneousSendResponse + * @static + * @param {Object.} object Plain object + * @returns {api.SpontaneousSendResponse} SpontaneousSendResponse + */ + SpontaneousSendResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.SpontaneousSendResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.SpontaneousSendResponse(); + if (object.payment_id != null) + message.payment_id = String(object.payment_id); + return message; + }; + + /** + * Creates a plain object from a SpontaneousSendResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.SpontaneousSendResponse + * @static + * @param {api.SpontaneousSendResponse} message SpontaneousSendResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpontaneousSendResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.payment_id = ""; + if (message.payment_id != null && message.hasOwnProperty("payment_id")) + object.payment_id = message.payment_id; + return object; + }; + + /** + * Converts this SpontaneousSendResponse to JSON. + * @function toJSON + * @memberof api.SpontaneousSendResponse + * @instance + * @returns {Object.} JSON object + */ + SpontaneousSendResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpontaneousSendResponse + * @function getTypeUrl + * @memberof api.SpontaneousSendResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpontaneousSendResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.SpontaneousSendResponse"; + }; + + return SpontaneousSendResponse; + })(); + + api.OpenChannelRequest = (function() { + + /** + * Properties of an OpenChannelRequest. + * @memberof api + * @interface IOpenChannelRequest + * @property {string|null} [node_pubkey] OpenChannelRequest node_pubkey + * @property {string|null} [address] OpenChannelRequest address + * @property {Long|null} [channel_amount_sats] OpenChannelRequest channel_amount_sats + * @property {Long|null} [push_to_counterparty_msat] OpenChannelRequest push_to_counterparty_msat + * @property {types.IChannelConfig|null} [channel_config] OpenChannelRequest channel_config + * @property {boolean|null} [announce_channel] OpenChannelRequest announce_channel + * @property {boolean|null} [disable_counterparty_reserve] OpenChannelRequest disable_counterparty_reserve + */ + + /** + * Constructs a new OpenChannelRequest. + * @memberof api + * @classdesc Represents an OpenChannelRequest. + * @implements IOpenChannelRequest + * @constructor + * @param {api.IOpenChannelRequest=} [properties] Properties to set + */ + function OpenChannelRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpenChannelRequest node_pubkey. + * @member {string} node_pubkey + * @memberof api.OpenChannelRequest + * @instance + */ + OpenChannelRequest.prototype.node_pubkey = ""; + + /** + * OpenChannelRequest address. + * @member {string} address + * @memberof api.OpenChannelRequest + * @instance + */ + OpenChannelRequest.prototype.address = ""; + + /** + * OpenChannelRequest channel_amount_sats. + * @member {Long} channel_amount_sats + * @memberof api.OpenChannelRequest + * @instance + */ + OpenChannelRequest.prototype.channel_amount_sats = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * OpenChannelRequest push_to_counterparty_msat. + * @member {Long|null|undefined} push_to_counterparty_msat + * @memberof api.OpenChannelRequest + * @instance + */ + OpenChannelRequest.prototype.push_to_counterparty_msat = null; + + /** + * OpenChannelRequest channel_config. + * @member {types.IChannelConfig|null|undefined} channel_config + * @memberof api.OpenChannelRequest + * @instance + */ + OpenChannelRequest.prototype.channel_config = null; + + /** + * OpenChannelRequest announce_channel. + * @member {boolean} announce_channel + * @memberof api.OpenChannelRequest + * @instance + */ + OpenChannelRequest.prototype.announce_channel = false; + + /** + * OpenChannelRequest disable_counterparty_reserve. + * @member {boolean} disable_counterparty_reserve + * @memberof api.OpenChannelRequest + * @instance + */ + OpenChannelRequest.prototype.disable_counterparty_reserve = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OpenChannelRequest.prototype, "_push_to_counterparty_msat", { + get: $util.oneOfGetter($oneOfFields = ["push_to_counterparty_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OpenChannelRequest.prototype, "_channel_config", { + get: $util.oneOfGetter($oneOfFields = ["channel_config"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OpenChannelRequest instance using the specified properties. + * @function create + * @memberof api.OpenChannelRequest + * @static + * @param {api.IOpenChannelRequest=} [properties] Properties to set + * @returns {api.OpenChannelRequest} OpenChannelRequest instance + */ + OpenChannelRequest.create = function create(properties) { + return new OpenChannelRequest(properties); + }; + + /** + * Encodes the specified OpenChannelRequest message. Does not implicitly {@link api.OpenChannelRequest.verify|verify} messages. + * @function encode + * @memberof api.OpenChannelRequest + * @static + * @param {api.IOpenChannelRequest} message OpenChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.node_pubkey != null && Object.hasOwnProperty.call(message, "node_pubkey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.node_pubkey); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.address); + if (message.channel_amount_sats != null && Object.hasOwnProperty.call(message, "channel_amount_sats")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.channel_amount_sats); + if (message.push_to_counterparty_msat != null && Object.hasOwnProperty.call(message, "push_to_counterparty_msat")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.push_to_counterparty_msat); + if (message.channel_config != null && Object.hasOwnProperty.call(message, "channel_config")) + $root.types.ChannelConfig.encode(message.channel_config, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.announce_channel != null && Object.hasOwnProperty.call(message, "announce_channel")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.announce_channel); + if (message.disable_counterparty_reserve != null && Object.hasOwnProperty.call(message, "disable_counterparty_reserve")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.disable_counterparty_reserve); + return writer; + }; + + /** + * Encodes the specified OpenChannelRequest message, length delimited. Does not implicitly {@link api.OpenChannelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.OpenChannelRequest + * @static + * @param {api.IOpenChannelRequest} message OpenChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenChannelRequest message from the specified reader or buffer. + * @function decode + * @memberof api.OpenChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.OpenChannelRequest} OpenChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenChannelRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.OpenChannelRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.node_pubkey = reader.string(); + break; + } + case 2: { + message.address = reader.string(); + break; + } + case 3: { + message.channel_amount_sats = reader.uint64(); + break; + } + case 4: { + message.push_to_counterparty_msat = reader.uint64(); + break; + } + case 5: { + message.channel_config = $root.types.ChannelConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.announce_channel = reader.bool(); + break; + } + case 7: { + message.disable_counterparty_reserve = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OpenChannelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.OpenChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.OpenChannelRequest} OpenChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenChannelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpenChannelRequest message. + * @function verify + * @memberof api.OpenChannelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenChannelRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.node_pubkey != null && message.hasOwnProperty("node_pubkey")) + if (!$util.isString(message.node_pubkey)) + return "node_pubkey: string expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.channel_amount_sats != null && message.hasOwnProperty("channel_amount_sats")) + if (!$util.isInteger(message.channel_amount_sats) && !(message.channel_amount_sats && $util.isInteger(message.channel_amount_sats.low) && $util.isInteger(message.channel_amount_sats.high))) + return "channel_amount_sats: integer|Long expected"; + if (message.push_to_counterparty_msat != null && message.hasOwnProperty("push_to_counterparty_msat")) { + properties._push_to_counterparty_msat = 1; + if (!$util.isInteger(message.push_to_counterparty_msat) && !(message.push_to_counterparty_msat && $util.isInteger(message.push_to_counterparty_msat.low) && $util.isInteger(message.push_to_counterparty_msat.high))) + return "push_to_counterparty_msat: integer|Long expected"; + } + if (message.channel_config != null && message.hasOwnProperty("channel_config")) { + properties._channel_config = 1; + { + let error = $root.types.ChannelConfig.verify(message.channel_config, long + 1); + if (error) + return "channel_config." + error; + } + } + if (message.announce_channel != null && message.hasOwnProperty("announce_channel")) + if (typeof message.announce_channel !== "boolean") + return "announce_channel: boolean expected"; + if (message.disable_counterparty_reserve != null && message.hasOwnProperty("disable_counterparty_reserve")) + if (typeof message.disable_counterparty_reserve !== "boolean") + return "disable_counterparty_reserve: boolean expected"; + return null; + }; + + /** + * Creates an OpenChannelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.OpenChannelRequest + * @static + * @param {Object.} object Plain object + * @returns {api.OpenChannelRequest} OpenChannelRequest + */ + OpenChannelRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.OpenChannelRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.OpenChannelRequest(); + if (object.node_pubkey != null) + message.node_pubkey = String(object.node_pubkey); + if (object.address != null) + message.address = String(object.address); + if (object.channel_amount_sats != null) + if ($util.Long) + (message.channel_amount_sats = $util.Long.fromValue(object.channel_amount_sats)).unsigned = true; + else if (typeof object.channel_amount_sats === "string") + message.channel_amount_sats = parseInt(object.channel_amount_sats, 10); + else if (typeof object.channel_amount_sats === "number") + message.channel_amount_sats = object.channel_amount_sats; + else if (typeof object.channel_amount_sats === "object") + message.channel_amount_sats = new $util.LongBits(object.channel_amount_sats.low >>> 0, object.channel_amount_sats.high >>> 0).toNumber(true); + if (object.push_to_counterparty_msat != null) + if ($util.Long) + (message.push_to_counterparty_msat = $util.Long.fromValue(object.push_to_counterparty_msat)).unsigned = true; + else if (typeof object.push_to_counterparty_msat === "string") + message.push_to_counterparty_msat = parseInt(object.push_to_counterparty_msat, 10); + else if (typeof object.push_to_counterparty_msat === "number") + message.push_to_counterparty_msat = object.push_to_counterparty_msat; + else if (typeof object.push_to_counterparty_msat === "object") + message.push_to_counterparty_msat = new $util.LongBits(object.push_to_counterparty_msat.low >>> 0, object.push_to_counterparty_msat.high >>> 0).toNumber(true); + if (object.channel_config != null) { + if (typeof object.channel_config !== "object") + throw TypeError(".api.OpenChannelRequest.channel_config: object expected"); + message.channel_config = $root.types.ChannelConfig.fromObject(object.channel_config, long + 1); + } + if (object.announce_channel != null) + message.announce_channel = Boolean(object.announce_channel); + if (object.disable_counterparty_reserve != null) + message.disable_counterparty_reserve = Boolean(object.disable_counterparty_reserve); + return message; + }; + + /** + * Creates a plain object from an OpenChannelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.OpenChannelRequest + * @static + * @param {api.OpenChannelRequest} message OpenChannelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenChannelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.node_pubkey = ""; + object.address = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.channel_amount_sats = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.channel_amount_sats = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.announce_channel = false; + object.disable_counterparty_reserve = false; + } + if (message.node_pubkey != null && message.hasOwnProperty("node_pubkey")) + object.node_pubkey = message.node_pubkey; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.channel_amount_sats != null && message.hasOwnProperty("channel_amount_sats")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.channel_amount_sats = typeof message.channel_amount_sats === "number" ? BigInt(message.channel_amount_sats) : $util.Long.fromBits(message.channel_amount_sats.low >>> 0, message.channel_amount_sats.high >>> 0, true).toBigInt(); + else if (typeof message.channel_amount_sats === "number") + object.channel_amount_sats = options.longs === String ? String(message.channel_amount_sats) : message.channel_amount_sats; + else + object.channel_amount_sats = options.longs === String ? $util.Long.prototype.toString.call(message.channel_amount_sats) : options.longs === Number ? new $util.LongBits(message.channel_amount_sats.low >>> 0, message.channel_amount_sats.high >>> 0).toNumber(true) : message.channel_amount_sats; + if (message.push_to_counterparty_msat != null && message.hasOwnProperty("push_to_counterparty_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.push_to_counterparty_msat = typeof message.push_to_counterparty_msat === "number" ? BigInt(message.push_to_counterparty_msat) : $util.Long.fromBits(message.push_to_counterparty_msat.low >>> 0, message.push_to_counterparty_msat.high >>> 0, true).toBigInt(); + else if (typeof message.push_to_counterparty_msat === "number") + object.push_to_counterparty_msat = options.longs === String ? String(message.push_to_counterparty_msat) : message.push_to_counterparty_msat; + else + object.push_to_counterparty_msat = options.longs === String ? $util.Long.prototype.toString.call(message.push_to_counterparty_msat) : options.longs === Number ? new $util.LongBits(message.push_to_counterparty_msat.low >>> 0, message.push_to_counterparty_msat.high >>> 0).toNumber(true) : message.push_to_counterparty_msat; + if (options.oneofs) + object._push_to_counterparty_msat = "push_to_counterparty_msat"; + } + if (message.channel_config != null && message.hasOwnProperty("channel_config")) { + object.channel_config = $root.types.ChannelConfig.toObject(message.channel_config, options); + if (options.oneofs) + object._channel_config = "channel_config"; + } + if (message.announce_channel != null && message.hasOwnProperty("announce_channel")) + object.announce_channel = message.announce_channel; + if (message.disable_counterparty_reserve != null && message.hasOwnProperty("disable_counterparty_reserve")) + object.disable_counterparty_reserve = message.disable_counterparty_reserve; + return object; + }; + + /** + * Converts this OpenChannelRequest to JSON. + * @function toJSON + * @memberof api.OpenChannelRequest + * @instance + * @returns {Object.} JSON object + */ + OpenChannelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OpenChannelRequest + * @function getTypeUrl + * @memberof api.OpenChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpenChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.OpenChannelRequest"; + }; + + return OpenChannelRequest; + })(); + + api.OpenChannelResponse = (function() { + + /** + * Properties of an OpenChannelResponse. + * @memberof api + * @interface IOpenChannelResponse + * @property {string|null} [user_channel_id] OpenChannelResponse user_channel_id + */ + + /** + * Constructs a new OpenChannelResponse. + * @memberof api + * @classdesc Represents an OpenChannelResponse. + * @implements IOpenChannelResponse + * @constructor + * @param {api.IOpenChannelResponse=} [properties] Properties to set + */ + function OpenChannelResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpenChannelResponse user_channel_id. + * @member {string} user_channel_id + * @memberof api.OpenChannelResponse + * @instance + */ + OpenChannelResponse.prototype.user_channel_id = ""; + + /** + * Creates a new OpenChannelResponse instance using the specified properties. + * @function create + * @memberof api.OpenChannelResponse + * @static + * @param {api.IOpenChannelResponse=} [properties] Properties to set + * @returns {api.OpenChannelResponse} OpenChannelResponse instance + */ + OpenChannelResponse.create = function create(properties) { + return new OpenChannelResponse(properties); + }; + + /** + * Encodes the specified OpenChannelResponse message. Does not implicitly {@link api.OpenChannelResponse.verify|verify} messages. + * @function encode + * @memberof api.OpenChannelResponse + * @static + * @param {api.IOpenChannelResponse} message OpenChannelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenChannelResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.user_channel_id != null && Object.hasOwnProperty.call(message, "user_channel_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.user_channel_id); + return writer; + }; + + /** + * Encodes the specified OpenChannelResponse message, length delimited. Does not implicitly {@link api.OpenChannelResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.OpenChannelResponse + * @static + * @param {api.IOpenChannelResponse} message OpenChannelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenChannelResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenChannelResponse message from the specified reader or buffer. + * @function decode + * @memberof api.OpenChannelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.OpenChannelResponse} OpenChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenChannelResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.OpenChannelResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.user_channel_id = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OpenChannelResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.OpenChannelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.OpenChannelResponse} OpenChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenChannelResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpenChannelResponse message. + * @function verify + * @memberof api.OpenChannelResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenChannelResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.user_channel_id != null && message.hasOwnProperty("user_channel_id")) + if (!$util.isString(message.user_channel_id)) + return "user_channel_id: string expected"; + return null; + }; + + /** + * Creates an OpenChannelResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.OpenChannelResponse + * @static + * @param {Object.} object Plain object + * @returns {api.OpenChannelResponse} OpenChannelResponse + */ + OpenChannelResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.OpenChannelResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.OpenChannelResponse(); + if (object.user_channel_id != null) + message.user_channel_id = String(object.user_channel_id); + return message; + }; + + /** + * Creates a plain object from an OpenChannelResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.OpenChannelResponse + * @static + * @param {api.OpenChannelResponse} message OpenChannelResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenChannelResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.user_channel_id = ""; + if (message.user_channel_id != null && message.hasOwnProperty("user_channel_id")) + object.user_channel_id = message.user_channel_id; + return object; + }; + + /** + * Converts this OpenChannelResponse to JSON. + * @function toJSON + * @memberof api.OpenChannelResponse + * @instance + * @returns {Object.} JSON object + */ + OpenChannelResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OpenChannelResponse + * @function getTypeUrl + * @memberof api.OpenChannelResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpenChannelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.OpenChannelResponse"; + }; + + return OpenChannelResponse; + })(); + + api.SpliceInRequest = (function() { + + /** + * Properties of a SpliceInRequest. + * @memberof api + * @interface ISpliceInRequest + * @property {string|null} [user_channel_id] SpliceInRequest user_channel_id + * @property {string|null} [counterparty_node_id] SpliceInRequest counterparty_node_id + * @property {Long|null} [splice_amount_sats] SpliceInRequest splice_amount_sats + */ + + /** + * Constructs a new SpliceInRequest. + * @memberof api + * @classdesc Represents a SpliceInRequest. + * @implements ISpliceInRequest + * @constructor + * @param {api.ISpliceInRequest=} [properties] Properties to set + */ + function SpliceInRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpliceInRequest user_channel_id. + * @member {string} user_channel_id + * @memberof api.SpliceInRequest + * @instance + */ + SpliceInRequest.prototype.user_channel_id = ""; + + /** + * SpliceInRequest counterparty_node_id. + * @member {string} counterparty_node_id + * @memberof api.SpliceInRequest + * @instance + */ + SpliceInRequest.prototype.counterparty_node_id = ""; + + /** + * SpliceInRequest splice_amount_sats. + * @member {Long} splice_amount_sats + * @memberof api.SpliceInRequest + * @instance + */ + SpliceInRequest.prototype.splice_amount_sats = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new SpliceInRequest instance using the specified properties. + * @function create + * @memberof api.SpliceInRequest + * @static + * @param {api.ISpliceInRequest=} [properties] Properties to set + * @returns {api.SpliceInRequest} SpliceInRequest instance + */ + SpliceInRequest.create = function create(properties) { + return new SpliceInRequest(properties); + }; + + /** + * Encodes the specified SpliceInRequest message. Does not implicitly {@link api.SpliceInRequest.verify|verify} messages. + * @function encode + * @memberof api.SpliceInRequest + * @static + * @param {api.ISpliceInRequest} message SpliceInRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpliceInRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.user_channel_id != null && Object.hasOwnProperty.call(message, "user_channel_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.user_channel_id); + if (message.counterparty_node_id != null && Object.hasOwnProperty.call(message, "counterparty_node_id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterparty_node_id); + if (message.splice_amount_sats != null && Object.hasOwnProperty.call(message, "splice_amount_sats")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.splice_amount_sats); + return writer; + }; + + /** + * Encodes the specified SpliceInRequest message, length delimited. Does not implicitly {@link api.SpliceInRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.SpliceInRequest + * @static + * @param {api.ISpliceInRequest} message SpliceInRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpliceInRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpliceInRequest message from the specified reader or buffer. + * @function decode + * @memberof api.SpliceInRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.SpliceInRequest} SpliceInRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpliceInRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.SpliceInRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.user_channel_id = reader.string(); + break; + } + case 2: { + message.counterparty_node_id = reader.string(); + break; + } + case 3: { + message.splice_amount_sats = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SpliceInRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.SpliceInRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.SpliceInRequest} SpliceInRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpliceInRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpliceInRequest message. + * @function verify + * @memberof api.SpliceInRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpliceInRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.user_channel_id != null && message.hasOwnProperty("user_channel_id")) + if (!$util.isString(message.user_channel_id)) + return "user_channel_id: string expected"; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + if (!$util.isString(message.counterparty_node_id)) + return "counterparty_node_id: string expected"; + if (message.splice_amount_sats != null && message.hasOwnProperty("splice_amount_sats")) + if (!$util.isInteger(message.splice_amount_sats) && !(message.splice_amount_sats && $util.isInteger(message.splice_amount_sats.low) && $util.isInteger(message.splice_amount_sats.high))) + return "splice_amount_sats: integer|Long expected"; + return null; + }; + + /** + * Creates a SpliceInRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.SpliceInRequest + * @static + * @param {Object.} object Plain object + * @returns {api.SpliceInRequest} SpliceInRequest + */ + SpliceInRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.SpliceInRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.SpliceInRequest(); + if (object.user_channel_id != null) + message.user_channel_id = String(object.user_channel_id); + if (object.counterparty_node_id != null) + message.counterparty_node_id = String(object.counterparty_node_id); + if (object.splice_amount_sats != null) + if ($util.Long) + (message.splice_amount_sats = $util.Long.fromValue(object.splice_amount_sats)).unsigned = true; + else if (typeof object.splice_amount_sats === "string") + message.splice_amount_sats = parseInt(object.splice_amount_sats, 10); + else if (typeof object.splice_amount_sats === "number") + message.splice_amount_sats = object.splice_amount_sats; + else if (typeof object.splice_amount_sats === "object") + message.splice_amount_sats = new $util.LongBits(object.splice_amount_sats.low >>> 0, object.splice_amount_sats.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a SpliceInRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.SpliceInRequest + * @static + * @param {api.SpliceInRequest} message SpliceInRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpliceInRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.user_channel_id = ""; + object.counterparty_node_id = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.splice_amount_sats = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.splice_amount_sats = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + } + if (message.user_channel_id != null && message.hasOwnProperty("user_channel_id")) + object.user_channel_id = message.user_channel_id; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + object.counterparty_node_id = message.counterparty_node_id; + if (message.splice_amount_sats != null && message.hasOwnProperty("splice_amount_sats")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.splice_amount_sats = typeof message.splice_amount_sats === "number" ? BigInt(message.splice_amount_sats) : $util.Long.fromBits(message.splice_amount_sats.low >>> 0, message.splice_amount_sats.high >>> 0, true).toBigInt(); + else if (typeof message.splice_amount_sats === "number") + object.splice_amount_sats = options.longs === String ? String(message.splice_amount_sats) : message.splice_amount_sats; + else + object.splice_amount_sats = options.longs === String ? $util.Long.prototype.toString.call(message.splice_amount_sats) : options.longs === Number ? new $util.LongBits(message.splice_amount_sats.low >>> 0, message.splice_amount_sats.high >>> 0).toNumber(true) : message.splice_amount_sats; + return object; + }; + + /** + * Converts this SpliceInRequest to JSON. + * @function toJSON + * @memberof api.SpliceInRequest + * @instance + * @returns {Object.} JSON object + */ + SpliceInRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpliceInRequest + * @function getTypeUrl + * @memberof api.SpliceInRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpliceInRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.SpliceInRequest"; + }; + + return SpliceInRequest; + })(); + + api.SpliceInResponse = (function() { + + /** + * Properties of a SpliceInResponse. + * @memberof api + * @interface ISpliceInResponse + */ + + /** + * Constructs a new SpliceInResponse. + * @memberof api + * @classdesc Represents a SpliceInResponse. + * @implements ISpliceInResponse + * @constructor + * @param {api.ISpliceInResponse=} [properties] Properties to set + */ + function SpliceInResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new SpliceInResponse instance using the specified properties. + * @function create + * @memberof api.SpliceInResponse + * @static + * @param {api.ISpliceInResponse=} [properties] Properties to set + * @returns {api.SpliceInResponse} SpliceInResponse instance + */ + SpliceInResponse.create = function create(properties) { + return new SpliceInResponse(properties); + }; + + /** + * Encodes the specified SpliceInResponse message. Does not implicitly {@link api.SpliceInResponse.verify|verify} messages. + * @function encode + * @memberof api.SpliceInResponse + * @static + * @param {api.ISpliceInResponse} message SpliceInResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpliceInResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified SpliceInResponse message, length delimited. Does not implicitly {@link api.SpliceInResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.SpliceInResponse + * @static + * @param {api.ISpliceInResponse} message SpliceInResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpliceInResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpliceInResponse message from the specified reader or buffer. + * @function decode + * @memberof api.SpliceInResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.SpliceInResponse} SpliceInResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpliceInResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.SpliceInResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SpliceInResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.SpliceInResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.SpliceInResponse} SpliceInResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpliceInResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpliceInResponse message. + * @function verify + * @memberof api.SpliceInResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpliceInResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a SpliceInResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.SpliceInResponse + * @static + * @param {Object.} object Plain object + * @returns {api.SpliceInResponse} SpliceInResponse + */ + SpliceInResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.SpliceInResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.api.SpliceInResponse(); + }; + + /** + * Creates a plain object from a SpliceInResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.SpliceInResponse + * @static + * @param {api.SpliceInResponse} message SpliceInResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpliceInResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this SpliceInResponse to JSON. + * @function toJSON + * @memberof api.SpliceInResponse + * @instance + * @returns {Object.} JSON object + */ + SpliceInResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpliceInResponse + * @function getTypeUrl + * @memberof api.SpliceInResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpliceInResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.SpliceInResponse"; + }; + + return SpliceInResponse; + })(); + + api.SpliceOutRequest = (function() { + + /** + * Properties of a SpliceOutRequest. + * @memberof api + * @interface ISpliceOutRequest + * @property {string|null} [user_channel_id] SpliceOutRequest user_channel_id + * @property {string|null} [counterparty_node_id] SpliceOutRequest counterparty_node_id + * @property {string|null} [address] SpliceOutRequest address + * @property {Long|null} [splice_amount_sats] SpliceOutRequest splice_amount_sats + */ + + /** + * Constructs a new SpliceOutRequest. + * @memberof api + * @classdesc Represents a SpliceOutRequest. + * @implements ISpliceOutRequest + * @constructor + * @param {api.ISpliceOutRequest=} [properties] Properties to set + */ + function SpliceOutRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpliceOutRequest user_channel_id. + * @member {string} user_channel_id + * @memberof api.SpliceOutRequest + * @instance + */ + SpliceOutRequest.prototype.user_channel_id = ""; + + /** + * SpliceOutRequest counterparty_node_id. + * @member {string} counterparty_node_id + * @memberof api.SpliceOutRequest + * @instance + */ + SpliceOutRequest.prototype.counterparty_node_id = ""; + + /** + * SpliceOutRequest address. + * @member {string|null|undefined} address + * @memberof api.SpliceOutRequest + * @instance + */ + SpliceOutRequest.prototype.address = null; + + /** + * SpliceOutRequest splice_amount_sats. + * @member {Long} splice_amount_sats + * @memberof api.SpliceOutRequest + * @instance + */ + SpliceOutRequest.prototype.splice_amount_sats = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SpliceOutRequest.prototype, "_address", { + get: $util.oneOfGetter($oneOfFields = ["address"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SpliceOutRequest instance using the specified properties. + * @function create + * @memberof api.SpliceOutRequest + * @static + * @param {api.ISpliceOutRequest=} [properties] Properties to set + * @returns {api.SpliceOutRequest} SpliceOutRequest instance + */ + SpliceOutRequest.create = function create(properties) { + return new SpliceOutRequest(properties); + }; + + /** + * Encodes the specified SpliceOutRequest message. Does not implicitly {@link api.SpliceOutRequest.verify|verify} messages. + * @function encode + * @memberof api.SpliceOutRequest + * @static + * @param {api.ISpliceOutRequest} message SpliceOutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpliceOutRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.user_channel_id != null && Object.hasOwnProperty.call(message, "user_channel_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.user_channel_id); + if (message.counterparty_node_id != null && Object.hasOwnProperty.call(message, "counterparty_node_id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterparty_node_id); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.address); + if (message.splice_amount_sats != null && Object.hasOwnProperty.call(message, "splice_amount_sats")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.splice_amount_sats); + return writer; + }; + + /** + * Encodes the specified SpliceOutRequest message, length delimited. Does not implicitly {@link api.SpliceOutRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.SpliceOutRequest + * @static + * @param {api.ISpliceOutRequest} message SpliceOutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpliceOutRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpliceOutRequest message from the specified reader or buffer. + * @function decode + * @memberof api.SpliceOutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.SpliceOutRequest} SpliceOutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpliceOutRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.SpliceOutRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.user_channel_id = reader.string(); + break; + } + case 2: { + message.counterparty_node_id = reader.string(); + break; + } + case 3: { + message.address = reader.string(); + break; + } + case 4: { + message.splice_amount_sats = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SpliceOutRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.SpliceOutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.SpliceOutRequest} SpliceOutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpliceOutRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpliceOutRequest message. + * @function verify + * @memberof api.SpliceOutRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpliceOutRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.user_channel_id != null && message.hasOwnProperty("user_channel_id")) + if (!$util.isString(message.user_channel_id)) + return "user_channel_id: string expected"; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + if (!$util.isString(message.counterparty_node_id)) + return "counterparty_node_id: string expected"; + if (message.address != null && message.hasOwnProperty("address")) { + properties._address = 1; + if (!$util.isString(message.address)) + return "address: string expected"; + } + if (message.splice_amount_sats != null && message.hasOwnProperty("splice_amount_sats")) + if (!$util.isInteger(message.splice_amount_sats) && !(message.splice_amount_sats && $util.isInteger(message.splice_amount_sats.low) && $util.isInteger(message.splice_amount_sats.high))) + return "splice_amount_sats: integer|Long expected"; + return null; + }; + + /** + * Creates a SpliceOutRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.SpliceOutRequest + * @static + * @param {Object.} object Plain object + * @returns {api.SpliceOutRequest} SpliceOutRequest + */ + SpliceOutRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.SpliceOutRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.SpliceOutRequest(); + if (object.user_channel_id != null) + message.user_channel_id = String(object.user_channel_id); + if (object.counterparty_node_id != null) + message.counterparty_node_id = String(object.counterparty_node_id); + if (object.address != null) + message.address = String(object.address); + if (object.splice_amount_sats != null) + if ($util.Long) + (message.splice_amount_sats = $util.Long.fromValue(object.splice_amount_sats)).unsigned = true; + else if (typeof object.splice_amount_sats === "string") + message.splice_amount_sats = parseInt(object.splice_amount_sats, 10); + else if (typeof object.splice_amount_sats === "number") + message.splice_amount_sats = object.splice_amount_sats; + else if (typeof object.splice_amount_sats === "object") + message.splice_amount_sats = new $util.LongBits(object.splice_amount_sats.low >>> 0, object.splice_amount_sats.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a SpliceOutRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.SpliceOutRequest + * @static + * @param {api.SpliceOutRequest} message SpliceOutRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpliceOutRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.user_channel_id = ""; + object.counterparty_node_id = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.splice_amount_sats = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.splice_amount_sats = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + } + if (message.user_channel_id != null && message.hasOwnProperty("user_channel_id")) + object.user_channel_id = message.user_channel_id; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + object.counterparty_node_id = message.counterparty_node_id; + if (message.address != null && message.hasOwnProperty("address")) { + object.address = message.address; + if (options.oneofs) + object._address = "address"; + } + if (message.splice_amount_sats != null && message.hasOwnProperty("splice_amount_sats")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.splice_amount_sats = typeof message.splice_amount_sats === "number" ? BigInt(message.splice_amount_sats) : $util.Long.fromBits(message.splice_amount_sats.low >>> 0, message.splice_amount_sats.high >>> 0, true).toBigInt(); + else if (typeof message.splice_amount_sats === "number") + object.splice_amount_sats = options.longs === String ? String(message.splice_amount_sats) : message.splice_amount_sats; + else + object.splice_amount_sats = options.longs === String ? $util.Long.prototype.toString.call(message.splice_amount_sats) : options.longs === Number ? new $util.LongBits(message.splice_amount_sats.low >>> 0, message.splice_amount_sats.high >>> 0).toNumber(true) : message.splice_amount_sats; + return object; + }; + + /** + * Converts this SpliceOutRequest to JSON. + * @function toJSON + * @memberof api.SpliceOutRequest + * @instance + * @returns {Object.} JSON object + */ + SpliceOutRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpliceOutRequest + * @function getTypeUrl + * @memberof api.SpliceOutRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpliceOutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.SpliceOutRequest"; + }; + + return SpliceOutRequest; + })(); + + api.SpliceOutResponse = (function() { + + /** + * Properties of a SpliceOutResponse. + * @memberof api + * @interface ISpliceOutResponse + * @property {string|null} [address] SpliceOutResponse address + */ + + /** + * Constructs a new SpliceOutResponse. + * @memberof api + * @classdesc Represents a SpliceOutResponse. + * @implements ISpliceOutResponse + * @constructor + * @param {api.ISpliceOutResponse=} [properties] Properties to set + */ + function SpliceOutResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpliceOutResponse address. + * @member {string} address + * @memberof api.SpliceOutResponse + * @instance + */ + SpliceOutResponse.prototype.address = ""; + + /** + * Creates a new SpliceOutResponse instance using the specified properties. + * @function create + * @memberof api.SpliceOutResponse + * @static + * @param {api.ISpliceOutResponse=} [properties] Properties to set + * @returns {api.SpliceOutResponse} SpliceOutResponse instance + */ + SpliceOutResponse.create = function create(properties) { + return new SpliceOutResponse(properties); + }; + + /** + * Encodes the specified SpliceOutResponse message. Does not implicitly {@link api.SpliceOutResponse.verify|verify} messages. + * @function encode + * @memberof api.SpliceOutResponse + * @static + * @param {api.ISpliceOutResponse} message SpliceOutResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpliceOutResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + return writer; + }; + + /** + * Encodes the specified SpliceOutResponse message, length delimited. Does not implicitly {@link api.SpliceOutResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.SpliceOutResponse + * @static + * @param {api.ISpliceOutResponse} message SpliceOutResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpliceOutResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpliceOutResponse message from the specified reader or buffer. + * @function decode + * @memberof api.SpliceOutResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.SpliceOutResponse} SpliceOutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpliceOutResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.SpliceOutResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.address = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SpliceOutResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.SpliceOutResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.SpliceOutResponse} SpliceOutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpliceOutResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpliceOutResponse message. + * @function verify + * @memberof api.SpliceOutResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpliceOutResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + return null; + }; + + /** + * Creates a SpliceOutResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.SpliceOutResponse + * @static + * @param {Object.} object Plain object + * @returns {api.SpliceOutResponse} SpliceOutResponse + */ + SpliceOutResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.SpliceOutResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.SpliceOutResponse(); + if (object.address != null) + message.address = String(object.address); + return message; + }; + + /** + * Creates a plain object from a SpliceOutResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.SpliceOutResponse + * @static + * @param {api.SpliceOutResponse} message SpliceOutResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpliceOutResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.address = ""; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + return object; + }; + + /** + * Converts this SpliceOutResponse to JSON. + * @function toJSON + * @memberof api.SpliceOutResponse + * @instance + * @returns {Object.} JSON object + */ + SpliceOutResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpliceOutResponse + * @function getTypeUrl + * @memberof api.SpliceOutResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpliceOutResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.SpliceOutResponse"; + }; + + return SpliceOutResponse; + })(); + + api.UpdateChannelConfigRequest = (function() { + + /** + * Properties of an UpdateChannelConfigRequest. + * @memberof api + * @interface IUpdateChannelConfigRequest + * @property {string|null} [user_channel_id] UpdateChannelConfigRequest user_channel_id + * @property {string|null} [counterparty_node_id] UpdateChannelConfigRequest counterparty_node_id + * @property {types.IChannelConfig|null} [channel_config] UpdateChannelConfigRequest channel_config + */ + + /** + * Constructs a new UpdateChannelConfigRequest. + * @memberof api + * @classdesc Represents an UpdateChannelConfigRequest. + * @implements IUpdateChannelConfigRequest + * @constructor + * @param {api.IUpdateChannelConfigRequest=} [properties] Properties to set + */ + function UpdateChannelConfigRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateChannelConfigRequest user_channel_id. + * @member {string} user_channel_id + * @memberof api.UpdateChannelConfigRequest + * @instance + */ + UpdateChannelConfigRequest.prototype.user_channel_id = ""; + + /** + * UpdateChannelConfigRequest counterparty_node_id. + * @member {string} counterparty_node_id + * @memberof api.UpdateChannelConfigRequest + * @instance + */ + UpdateChannelConfigRequest.prototype.counterparty_node_id = ""; + + /** + * UpdateChannelConfigRequest channel_config. + * @member {types.IChannelConfig|null|undefined} channel_config + * @memberof api.UpdateChannelConfigRequest + * @instance + */ + UpdateChannelConfigRequest.prototype.channel_config = null; + + /** + * Creates a new UpdateChannelConfigRequest instance using the specified properties. + * @function create + * @memberof api.UpdateChannelConfigRequest + * @static + * @param {api.IUpdateChannelConfigRequest=} [properties] Properties to set + * @returns {api.UpdateChannelConfigRequest} UpdateChannelConfigRequest instance + */ + UpdateChannelConfigRequest.create = function create(properties) { + return new UpdateChannelConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateChannelConfigRequest message. Does not implicitly {@link api.UpdateChannelConfigRequest.verify|verify} messages. + * @function encode + * @memberof api.UpdateChannelConfigRequest + * @static + * @param {api.IUpdateChannelConfigRequest} message UpdateChannelConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateChannelConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.user_channel_id != null && Object.hasOwnProperty.call(message, "user_channel_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.user_channel_id); + if (message.counterparty_node_id != null && Object.hasOwnProperty.call(message, "counterparty_node_id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterparty_node_id); + if (message.channel_config != null && Object.hasOwnProperty.call(message, "channel_config")) + $root.types.ChannelConfig.encode(message.channel_config, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateChannelConfigRequest message, length delimited. Does not implicitly {@link api.UpdateChannelConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.UpdateChannelConfigRequest + * @static + * @param {api.IUpdateChannelConfigRequest} message UpdateChannelConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateChannelConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateChannelConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof api.UpdateChannelConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.UpdateChannelConfigRequest} UpdateChannelConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateChannelConfigRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.UpdateChannelConfigRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.user_channel_id = reader.string(); + break; + } + case 2: { + message.counterparty_node_id = reader.string(); + break; + } + case 3: { + message.channel_config = $root.types.ChannelConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateChannelConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.UpdateChannelConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.UpdateChannelConfigRequest} UpdateChannelConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateChannelConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateChannelConfigRequest message. + * @function verify + * @memberof api.UpdateChannelConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateChannelConfigRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.user_channel_id != null && message.hasOwnProperty("user_channel_id")) + if (!$util.isString(message.user_channel_id)) + return "user_channel_id: string expected"; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + if (!$util.isString(message.counterparty_node_id)) + return "counterparty_node_id: string expected"; + if (message.channel_config != null && message.hasOwnProperty("channel_config")) { + let error = $root.types.ChannelConfig.verify(message.channel_config, long + 1); + if (error) + return "channel_config." + error; + } + return null; + }; + + /** + * Creates an UpdateChannelConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.UpdateChannelConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {api.UpdateChannelConfigRequest} UpdateChannelConfigRequest + */ + UpdateChannelConfigRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.UpdateChannelConfigRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.UpdateChannelConfigRequest(); + if (object.user_channel_id != null) + message.user_channel_id = String(object.user_channel_id); + if (object.counterparty_node_id != null) + message.counterparty_node_id = String(object.counterparty_node_id); + if (object.channel_config != null) { + if (typeof object.channel_config !== "object") + throw TypeError(".api.UpdateChannelConfigRequest.channel_config: object expected"); + message.channel_config = $root.types.ChannelConfig.fromObject(object.channel_config, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UpdateChannelConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.UpdateChannelConfigRequest + * @static + * @param {api.UpdateChannelConfigRequest} message UpdateChannelConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateChannelConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.user_channel_id = ""; + object.counterparty_node_id = ""; + object.channel_config = null; + } + if (message.user_channel_id != null && message.hasOwnProperty("user_channel_id")) + object.user_channel_id = message.user_channel_id; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + object.counterparty_node_id = message.counterparty_node_id; + if (message.channel_config != null && message.hasOwnProperty("channel_config")) + object.channel_config = $root.types.ChannelConfig.toObject(message.channel_config, options); + return object; + }; + + /** + * Converts this UpdateChannelConfigRequest to JSON. + * @function toJSON + * @memberof api.UpdateChannelConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateChannelConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateChannelConfigRequest + * @function getTypeUrl + * @memberof api.UpdateChannelConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateChannelConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.UpdateChannelConfigRequest"; + }; + + return UpdateChannelConfigRequest; + })(); + + api.UpdateChannelConfigResponse = (function() { + + /** + * Properties of an UpdateChannelConfigResponse. + * @memberof api + * @interface IUpdateChannelConfigResponse + */ + + /** + * Constructs a new UpdateChannelConfigResponse. + * @memberof api + * @classdesc Represents an UpdateChannelConfigResponse. + * @implements IUpdateChannelConfigResponse + * @constructor + * @param {api.IUpdateChannelConfigResponse=} [properties] Properties to set + */ + function UpdateChannelConfigResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new UpdateChannelConfigResponse instance using the specified properties. + * @function create + * @memberof api.UpdateChannelConfigResponse + * @static + * @param {api.IUpdateChannelConfigResponse=} [properties] Properties to set + * @returns {api.UpdateChannelConfigResponse} UpdateChannelConfigResponse instance + */ + UpdateChannelConfigResponse.create = function create(properties) { + return new UpdateChannelConfigResponse(properties); + }; + + /** + * Encodes the specified UpdateChannelConfigResponse message. Does not implicitly {@link api.UpdateChannelConfigResponse.verify|verify} messages. + * @function encode + * @memberof api.UpdateChannelConfigResponse + * @static + * @param {api.IUpdateChannelConfigResponse} message UpdateChannelConfigResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateChannelConfigResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified UpdateChannelConfigResponse message, length delimited. Does not implicitly {@link api.UpdateChannelConfigResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.UpdateChannelConfigResponse + * @static + * @param {api.IUpdateChannelConfigResponse} message UpdateChannelConfigResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateChannelConfigResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateChannelConfigResponse message from the specified reader or buffer. + * @function decode + * @memberof api.UpdateChannelConfigResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.UpdateChannelConfigResponse} UpdateChannelConfigResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateChannelConfigResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.UpdateChannelConfigResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateChannelConfigResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.UpdateChannelConfigResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.UpdateChannelConfigResponse} UpdateChannelConfigResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateChannelConfigResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateChannelConfigResponse message. + * @function verify + * @memberof api.UpdateChannelConfigResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateChannelConfigResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an UpdateChannelConfigResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.UpdateChannelConfigResponse + * @static + * @param {Object.} object Plain object + * @returns {api.UpdateChannelConfigResponse} UpdateChannelConfigResponse + */ + UpdateChannelConfigResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.UpdateChannelConfigResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.api.UpdateChannelConfigResponse(); + }; + + /** + * Creates a plain object from an UpdateChannelConfigResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.UpdateChannelConfigResponse + * @static + * @param {api.UpdateChannelConfigResponse} message UpdateChannelConfigResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateChannelConfigResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this UpdateChannelConfigResponse to JSON. + * @function toJSON + * @memberof api.UpdateChannelConfigResponse + * @instance + * @returns {Object.} JSON object + */ + UpdateChannelConfigResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateChannelConfigResponse + * @function getTypeUrl + * @memberof api.UpdateChannelConfigResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateChannelConfigResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.UpdateChannelConfigResponse"; + }; + + return UpdateChannelConfigResponse; + })(); + + api.CloseChannelRequest = (function() { + + /** + * Properties of a CloseChannelRequest. + * @memberof api + * @interface ICloseChannelRequest + * @property {string|null} [user_channel_id] CloseChannelRequest user_channel_id + * @property {string|null} [counterparty_node_id] CloseChannelRequest counterparty_node_id + */ + + /** + * Constructs a new CloseChannelRequest. + * @memberof api + * @classdesc Represents a CloseChannelRequest. + * @implements ICloseChannelRequest + * @constructor + * @param {api.ICloseChannelRequest=} [properties] Properties to set + */ + function CloseChannelRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloseChannelRequest user_channel_id. + * @member {string} user_channel_id + * @memberof api.CloseChannelRequest + * @instance + */ + CloseChannelRequest.prototype.user_channel_id = ""; + + /** + * CloseChannelRequest counterparty_node_id. + * @member {string} counterparty_node_id + * @memberof api.CloseChannelRequest + * @instance + */ + CloseChannelRequest.prototype.counterparty_node_id = ""; + + /** + * Creates a new CloseChannelRequest instance using the specified properties. + * @function create + * @memberof api.CloseChannelRequest + * @static + * @param {api.ICloseChannelRequest=} [properties] Properties to set + * @returns {api.CloseChannelRequest} CloseChannelRequest instance + */ + CloseChannelRequest.create = function create(properties) { + return new CloseChannelRequest(properties); + }; + + /** + * Encodes the specified CloseChannelRequest message. Does not implicitly {@link api.CloseChannelRequest.verify|verify} messages. + * @function encode + * @memberof api.CloseChannelRequest + * @static + * @param {api.ICloseChannelRequest} message CloseChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.user_channel_id != null && Object.hasOwnProperty.call(message, "user_channel_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.user_channel_id); + if (message.counterparty_node_id != null && Object.hasOwnProperty.call(message, "counterparty_node_id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterparty_node_id); + return writer; + }; + + /** + * Encodes the specified CloseChannelRequest message, length delimited. Does not implicitly {@link api.CloseChannelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.CloseChannelRequest + * @static + * @param {api.ICloseChannelRequest} message CloseChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloseChannelRequest message from the specified reader or buffer. + * @function decode + * @memberof api.CloseChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.CloseChannelRequest} CloseChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseChannelRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.CloseChannelRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.user_channel_id = reader.string(); + break; + } + case 2: { + message.counterparty_node_id = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CloseChannelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.CloseChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.CloseChannelRequest} CloseChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseChannelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloseChannelRequest message. + * @function verify + * @memberof api.CloseChannelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloseChannelRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.user_channel_id != null && message.hasOwnProperty("user_channel_id")) + if (!$util.isString(message.user_channel_id)) + return "user_channel_id: string expected"; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + if (!$util.isString(message.counterparty_node_id)) + return "counterparty_node_id: string expected"; + return null; + }; + + /** + * Creates a CloseChannelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.CloseChannelRequest + * @static + * @param {Object.} object Plain object + * @returns {api.CloseChannelRequest} CloseChannelRequest + */ + CloseChannelRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.CloseChannelRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.CloseChannelRequest(); + if (object.user_channel_id != null) + message.user_channel_id = String(object.user_channel_id); + if (object.counterparty_node_id != null) + message.counterparty_node_id = String(object.counterparty_node_id); + return message; + }; + + /** + * Creates a plain object from a CloseChannelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.CloseChannelRequest + * @static + * @param {api.CloseChannelRequest} message CloseChannelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloseChannelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.user_channel_id = ""; + object.counterparty_node_id = ""; + } + if (message.user_channel_id != null && message.hasOwnProperty("user_channel_id")) + object.user_channel_id = message.user_channel_id; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + object.counterparty_node_id = message.counterparty_node_id; + return object; + }; + + /** + * Converts this CloseChannelRequest to JSON. + * @function toJSON + * @memberof api.CloseChannelRequest + * @instance + * @returns {Object.} JSON object + */ + CloseChannelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloseChannelRequest + * @function getTypeUrl + * @memberof api.CloseChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloseChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.CloseChannelRequest"; + }; + + return CloseChannelRequest; + })(); + + api.CloseChannelResponse = (function() { + + /** + * Properties of a CloseChannelResponse. + * @memberof api + * @interface ICloseChannelResponse + */ + + /** + * Constructs a new CloseChannelResponse. + * @memberof api + * @classdesc Represents a CloseChannelResponse. + * @implements ICloseChannelResponse + * @constructor + * @param {api.ICloseChannelResponse=} [properties] Properties to set + */ + function CloseChannelResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new CloseChannelResponse instance using the specified properties. + * @function create + * @memberof api.CloseChannelResponse + * @static + * @param {api.ICloseChannelResponse=} [properties] Properties to set + * @returns {api.CloseChannelResponse} CloseChannelResponse instance + */ + CloseChannelResponse.create = function create(properties) { + return new CloseChannelResponse(properties); + }; + + /** + * Encodes the specified CloseChannelResponse message. Does not implicitly {@link api.CloseChannelResponse.verify|verify} messages. + * @function encode + * @memberof api.CloseChannelResponse + * @static + * @param {api.ICloseChannelResponse} message CloseChannelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseChannelResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CloseChannelResponse message, length delimited. Does not implicitly {@link api.CloseChannelResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.CloseChannelResponse + * @static + * @param {api.ICloseChannelResponse} message CloseChannelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloseChannelResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloseChannelResponse message from the specified reader or buffer. + * @function decode + * @memberof api.CloseChannelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.CloseChannelResponse} CloseChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseChannelResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.CloseChannelResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CloseChannelResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.CloseChannelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.CloseChannelResponse} CloseChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloseChannelResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloseChannelResponse message. + * @function verify + * @memberof api.CloseChannelResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloseChannelResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a CloseChannelResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.CloseChannelResponse + * @static + * @param {Object.} object Plain object + * @returns {api.CloseChannelResponse} CloseChannelResponse + */ + CloseChannelResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.CloseChannelResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.api.CloseChannelResponse(); + }; + + /** + * Creates a plain object from a CloseChannelResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.CloseChannelResponse + * @static + * @param {api.CloseChannelResponse} message CloseChannelResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloseChannelResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CloseChannelResponse to JSON. + * @function toJSON + * @memberof api.CloseChannelResponse + * @instance + * @returns {Object.} JSON object + */ + CloseChannelResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloseChannelResponse + * @function getTypeUrl + * @memberof api.CloseChannelResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloseChannelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.CloseChannelResponse"; + }; + + return CloseChannelResponse; + })(); + + api.ForceCloseChannelRequest = (function() { + + /** + * Properties of a ForceCloseChannelRequest. + * @memberof api + * @interface IForceCloseChannelRequest + * @property {string|null} [user_channel_id] ForceCloseChannelRequest user_channel_id + * @property {string|null} [counterparty_node_id] ForceCloseChannelRequest counterparty_node_id + * @property {string|null} [force_close_reason] ForceCloseChannelRequest force_close_reason + */ + + /** + * Constructs a new ForceCloseChannelRequest. + * @memberof api + * @classdesc Represents a ForceCloseChannelRequest. + * @implements IForceCloseChannelRequest + * @constructor + * @param {api.IForceCloseChannelRequest=} [properties] Properties to set + */ + function ForceCloseChannelRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ForceCloseChannelRequest user_channel_id. + * @member {string} user_channel_id + * @memberof api.ForceCloseChannelRequest + * @instance + */ + ForceCloseChannelRequest.prototype.user_channel_id = ""; + + /** + * ForceCloseChannelRequest counterparty_node_id. + * @member {string} counterparty_node_id + * @memberof api.ForceCloseChannelRequest + * @instance + */ + ForceCloseChannelRequest.prototype.counterparty_node_id = ""; + + /** + * ForceCloseChannelRequest force_close_reason. + * @member {string|null|undefined} force_close_reason + * @memberof api.ForceCloseChannelRequest + * @instance + */ + ForceCloseChannelRequest.prototype.force_close_reason = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ForceCloseChannelRequest.prototype, "_force_close_reason", { + get: $util.oneOfGetter($oneOfFields = ["force_close_reason"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ForceCloseChannelRequest instance using the specified properties. + * @function create + * @memberof api.ForceCloseChannelRequest + * @static + * @param {api.IForceCloseChannelRequest=} [properties] Properties to set + * @returns {api.ForceCloseChannelRequest} ForceCloseChannelRequest instance + */ + ForceCloseChannelRequest.create = function create(properties) { + return new ForceCloseChannelRequest(properties); + }; + + /** + * Encodes the specified ForceCloseChannelRequest message. Does not implicitly {@link api.ForceCloseChannelRequest.verify|verify} messages. + * @function encode + * @memberof api.ForceCloseChannelRequest + * @static + * @param {api.IForceCloseChannelRequest} message ForceCloseChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForceCloseChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.user_channel_id != null && Object.hasOwnProperty.call(message, "user_channel_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.user_channel_id); + if (message.counterparty_node_id != null && Object.hasOwnProperty.call(message, "counterparty_node_id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterparty_node_id); + if (message.force_close_reason != null && Object.hasOwnProperty.call(message, "force_close_reason")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.force_close_reason); + return writer; + }; + + /** + * Encodes the specified ForceCloseChannelRequest message, length delimited. Does not implicitly {@link api.ForceCloseChannelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.ForceCloseChannelRequest + * @static + * @param {api.IForceCloseChannelRequest} message ForceCloseChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForceCloseChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ForceCloseChannelRequest message from the specified reader or buffer. + * @function decode + * @memberof api.ForceCloseChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.ForceCloseChannelRequest} ForceCloseChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForceCloseChannelRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ForceCloseChannelRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.user_channel_id = reader.string(); + break; + } + case 2: { + message.counterparty_node_id = reader.string(); + break; + } + case 3: { + message.force_close_reason = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ForceCloseChannelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.ForceCloseChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.ForceCloseChannelRequest} ForceCloseChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForceCloseChannelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ForceCloseChannelRequest message. + * @function verify + * @memberof api.ForceCloseChannelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ForceCloseChannelRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.user_channel_id != null && message.hasOwnProperty("user_channel_id")) + if (!$util.isString(message.user_channel_id)) + return "user_channel_id: string expected"; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + if (!$util.isString(message.counterparty_node_id)) + return "counterparty_node_id: string expected"; + if (message.force_close_reason != null && message.hasOwnProperty("force_close_reason")) { + properties._force_close_reason = 1; + if (!$util.isString(message.force_close_reason)) + return "force_close_reason: string expected"; + } + return null; + }; + + /** + * Creates a ForceCloseChannelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.ForceCloseChannelRequest + * @static + * @param {Object.} object Plain object + * @returns {api.ForceCloseChannelRequest} ForceCloseChannelRequest + */ + ForceCloseChannelRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.ForceCloseChannelRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.ForceCloseChannelRequest(); + if (object.user_channel_id != null) + message.user_channel_id = String(object.user_channel_id); + if (object.counterparty_node_id != null) + message.counterparty_node_id = String(object.counterparty_node_id); + if (object.force_close_reason != null) + message.force_close_reason = String(object.force_close_reason); + return message; + }; + + /** + * Creates a plain object from a ForceCloseChannelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.ForceCloseChannelRequest + * @static + * @param {api.ForceCloseChannelRequest} message ForceCloseChannelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ForceCloseChannelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.user_channel_id = ""; + object.counterparty_node_id = ""; + } + if (message.user_channel_id != null && message.hasOwnProperty("user_channel_id")) + object.user_channel_id = message.user_channel_id; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + object.counterparty_node_id = message.counterparty_node_id; + if (message.force_close_reason != null && message.hasOwnProperty("force_close_reason")) { + object.force_close_reason = message.force_close_reason; + if (options.oneofs) + object._force_close_reason = "force_close_reason"; + } + return object; + }; + + /** + * Converts this ForceCloseChannelRequest to JSON. + * @function toJSON + * @memberof api.ForceCloseChannelRequest + * @instance + * @returns {Object.} JSON object + */ + ForceCloseChannelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ForceCloseChannelRequest + * @function getTypeUrl + * @memberof api.ForceCloseChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ForceCloseChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ForceCloseChannelRequest"; + }; + + return ForceCloseChannelRequest; + })(); + + api.ForceCloseChannelResponse = (function() { + + /** + * Properties of a ForceCloseChannelResponse. + * @memberof api + * @interface IForceCloseChannelResponse + */ + + /** + * Constructs a new ForceCloseChannelResponse. + * @memberof api + * @classdesc Represents a ForceCloseChannelResponse. + * @implements IForceCloseChannelResponse + * @constructor + * @param {api.IForceCloseChannelResponse=} [properties] Properties to set + */ + function ForceCloseChannelResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ForceCloseChannelResponse instance using the specified properties. + * @function create + * @memberof api.ForceCloseChannelResponse + * @static + * @param {api.IForceCloseChannelResponse=} [properties] Properties to set + * @returns {api.ForceCloseChannelResponse} ForceCloseChannelResponse instance + */ + ForceCloseChannelResponse.create = function create(properties) { + return new ForceCloseChannelResponse(properties); + }; + + /** + * Encodes the specified ForceCloseChannelResponse message. Does not implicitly {@link api.ForceCloseChannelResponse.verify|verify} messages. + * @function encode + * @memberof api.ForceCloseChannelResponse + * @static + * @param {api.IForceCloseChannelResponse} message ForceCloseChannelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForceCloseChannelResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ForceCloseChannelResponse message, length delimited. Does not implicitly {@link api.ForceCloseChannelResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.ForceCloseChannelResponse + * @static + * @param {api.IForceCloseChannelResponse} message ForceCloseChannelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForceCloseChannelResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ForceCloseChannelResponse message from the specified reader or buffer. + * @function decode + * @memberof api.ForceCloseChannelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.ForceCloseChannelResponse} ForceCloseChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForceCloseChannelResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ForceCloseChannelResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ForceCloseChannelResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.ForceCloseChannelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.ForceCloseChannelResponse} ForceCloseChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForceCloseChannelResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ForceCloseChannelResponse message. + * @function verify + * @memberof api.ForceCloseChannelResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ForceCloseChannelResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a ForceCloseChannelResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.ForceCloseChannelResponse + * @static + * @param {Object.} object Plain object + * @returns {api.ForceCloseChannelResponse} ForceCloseChannelResponse + */ + ForceCloseChannelResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.ForceCloseChannelResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.api.ForceCloseChannelResponse(); + }; + + /** + * Creates a plain object from a ForceCloseChannelResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.ForceCloseChannelResponse + * @static + * @param {api.ForceCloseChannelResponse} message ForceCloseChannelResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ForceCloseChannelResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ForceCloseChannelResponse to JSON. + * @function toJSON + * @memberof api.ForceCloseChannelResponse + * @instance + * @returns {Object.} JSON object + */ + ForceCloseChannelResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ForceCloseChannelResponse + * @function getTypeUrl + * @memberof api.ForceCloseChannelResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ForceCloseChannelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ForceCloseChannelResponse"; + }; + + return ForceCloseChannelResponse; + })(); + + api.ListChannelsRequest = (function() { + + /** + * Properties of a ListChannelsRequest. + * @memberof api + * @interface IListChannelsRequest + */ + + /** + * Constructs a new ListChannelsRequest. + * @memberof api + * @classdesc Represents a ListChannelsRequest. + * @implements IListChannelsRequest + * @constructor + * @param {api.IListChannelsRequest=} [properties] Properties to set + */ + function ListChannelsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ListChannelsRequest instance using the specified properties. + * @function create + * @memberof api.ListChannelsRequest + * @static + * @param {api.IListChannelsRequest=} [properties] Properties to set + * @returns {api.ListChannelsRequest} ListChannelsRequest instance + */ + ListChannelsRequest.create = function create(properties) { + return new ListChannelsRequest(properties); + }; + + /** + * Encodes the specified ListChannelsRequest message. Does not implicitly {@link api.ListChannelsRequest.verify|verify} messages. + * @function encode + * @memberof api.ListChannelsRequest + * @static + * @param {api.IListChannelsRequest} message ListChannelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChannelsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ListChannelsRequest message, length delimited. Does not implicitly {@link api.ListChannelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.ListChannelsRequest + * @static + * @param {api.IListChannelsRequest} message ListChannelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChannelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChannelsRequest message from the specified reader or buffer. + * @function decode + * @memberof api.ListChannelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.ListChannelsRequest} ListChannelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChannelsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ListChannelsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListChannelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.ListChannelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.ListChannelsRequest} ListChannelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChannelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChannelsRequest message. + * @function verify + * @memberof api.ListChannelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChannelsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a ListChannelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.ListChannelsRequest + * @static + * @param {Object.} object Plain object + * @returns {api.ListChannelsRequest} ListChannelsRequest + */ + ListChannelsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.ListChannelsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.api.ListChannelsRequest(); + }; + + /** + * Creates a plain object from a ListChannelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.ListChannelsRequest + * @static + * @param {api.ListChannelsRequest} message ListChannelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChannelsRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ListChannelsRequest to JSON. + * @function toJSON + * @memberof api.ListChannelsRequest + * @instance + * @returns {Object.} JSON object + */ + ListChannelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChannelsRequest + * @function getTypeUrl + * @memberof api.ListChannelsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChannelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ListChannelsRequest"; + }; + + return ListChannelsRequest; + })(); + + api.ListChannelsResponse = (function() { + + /** + * Properties of a ListChannelsResponse. + * @memberof api + * @interface IListChannelsResponse + * @property {Array.|null} [channels] ListChannelsResponse channels + */ + + /** + * Constructs a new ListChannelsResponse. + * @memberof api + * @classdesc Represents a ListChannelsResponse. + * @implements IListChannelsResponse + * @constructor + * @param {api.IListChannelsResponse=} [properties] Properties to set + */ + function ListChannelsResponse(properties) { + this.channels = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChannelsResponse channels. + * @member {Array.} channels + * @memberof api.ListChannelsResponse + * @instance + */ + ListChannelsResponse.prototype.channels = $util.emptyArray; + + /** + * Creates a new ListChannelsResponse instance using the specified properties. + * @function create + * @memberof api.ListChannelsResponse + * @static + * @param {api.IListChannelsResponse=} [properties] Properties to set + * @returns {api.ListChannelsResponse} ListChannelsResponse instance + */ + ListChannelsResponse.create = function create(properties) { + return new ListChannelsResponse(properties); + }; + + /** + * Encodes the specified ListChannelsResponse message. Does not implicitly {@link api.ListChannelsResponse.verify|verify} messages. + * @function encode + * @memberof api.ListChannelsResponse + * @static + * @param {api.IListChannelsResponse} message ListChannelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChannelsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channels != null && message.channels.length) + for (let i = 0; i < message.channels.length; ++i) + $root.types.Channel.encode(message.channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListChannelsResponse message, length delimited. Does not implicitly {@link api.ListChannelsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.ListChannelsResponse + * @static + * @param {api.IListChannelsResponse} message ListChannelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChannelsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChannelsResponse message from the specified reader or buffer. + * @function decode + * @memberof api.ListChannelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.ListChannelsResponse} ListChannelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChannelsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ListChannelsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.channels && message.channels.length)) + message.channels = []; + message.channels.push($root.types.Channel.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListChannelsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.ListChannelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.ListChannelsResponse} ListChannelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChannelsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChannelsResponse message. + * @function verify + * @memberof api.ListChannelsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChannelsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.channels != null && message.hasOwnProperty("channels")) { + if (!Array.isArray(message.channels)) + return "channels: array expected"; + for (let i = 0; i < message.channels.length; ++i) { + let error = $root.types.Channel.verify(message.channels[i], long + 1); + if (error) + return "channels." + error; + } + } + return null; + }; + + /** + * Creates a ListChannelsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.ListChannelsResponse + * @static + * @param {Object.} object Plain object + * @returns {api.ListChannelsResponse} ListChannelsResponse + */ + ListChannelsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.ListChannelsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.ListChannelsResponse(); + if (object.channels) { + if (!Array.isArray(object.channels)) + throw TypeError(".api.ListChannelsResponse.channels: array expected"); + message.channels = []; + for (let i = 0; i < object.channels.length; ++i) { + if (typeof object.channels[i] !== "object") + throw TypeError(".api.ListChannelsResponse.channels: object expected"); + message.channels[i] = $root.types.Channel.fromObject(object.channels[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a ListChannelsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.ListChannelsResponse + * @static + * @param {api.ListChannelsResponse} message ListChannelsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChannelsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.channels = []; + if (message.channels && message.channels.length) { + object.channels = []; + for (let j = 0; j < message.channels.length; ++j) + object.channels[j] = $root.types.Channel.toObject(message.channels[j], options); + } + return object; + }; + + /** + * Converts this ListChannelsResponse to JSON. + * @function toJSON + * @memberof api.ListChannelsResponse + * @instance + * @returns {Object.} JSON object + */ + ListChannelsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChannelsResponse + * @function getTypeUrl + * @memberof api.ListChannelsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChannelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ListChannelsResponse"; + }; + + return ListChannelsResponse; + })(); + + api.GetPaymentDetailsRequest = (function() { + + /** + * Properties of a GetPaymentDetailsRequest. + * @memberof api + * @interface IGetPaymentDetailsRequest + * @property {string|null} [payment_id] GetPaymentDetailsRequest payment_id + */ + + /** + * Constructs a new GetPaymentDetailsRequest. + * @memberof api + * @classdesc Represents a GetPaymentDetailsRequest. + * @implements IGetPaymentDetailsRequest + * @constructor + * @param {api.IGetPaymentDetailsRequest=} [properties] Properties to set + */ + function GetPaymentDetailsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPaymentDetailsRequest payment_id. + * @member {string} payment_id + * @memberof api.GetPaymentDetailsRequest + * @instance + */ + GetPaymentDetailsRequest.prototype.payment_id = ""; + + /** + * Creates a new GetPaymentDetailsRequest instance using the specified properties. + * @function create + * @memberof api.GetPaymentDetailsRequest + * @static + * @param {api.IGetPaymentDetailsRequest=} [properties] Properties to set + * @returns {api.GetPaymentDetailsRequest} GetPaymentDetailsRequest instance + */ + GetPaymentDetailsRequest.create = function create(properties) { + return new GetPaymentDetailsRequest(properties); + }; + + /** + * Encodes the specified GetPaymentDetailsRequest message. Does not implicitly {@link api.GetPaymentDetailsRequest.verify|verify} messages. + * @function encode + * @memberof api.GetPaymentDetailsRequest + * @static + * @param {api.IGetPaymentDetailsRequest} message GetPaymentDetailsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPaymentDetailsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payment_id != null && Object.hasOwnProperty.call(message, "payment_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.payment_id); + return writer; + }; + + /** + * Encodes the specified GetPaymentDetailsRequest message, length delimited. Does not implicitly {@link api.GetPaymentDetailsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.GetPaymentDetailsRequest + * @static + * @param {api.IGetPaymentDetailsRequest} message GetPaymentDetailsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPaymentDetailsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPaymentDetailsRequest message from the specified reader or buffer. + * @function decode + * @memberof api.GetPaymentDetailsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.GetPaymentDetailsRequest} GetPaymentDetailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPaymentDetailsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GetPaymentDetailsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.payment_id = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetPaymentDetailsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.GetPaymentDetailsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.GetPaymentDetailsRequest} GetPaymentDetailsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPaymentDetailsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPaymentDetailsRequest message. + * @function verify + * @memberof api.GetPaymentDetailsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPaymentDetailsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.payment_id != null && message.hasOwnProperty("payment_id")) + if (!$util.isString(message.payment_id)) + return "payment_id: string expected"; + return null; + }; + + /** + * Creates a GetPaymentDetailsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.GetPaymentDetailsRequest + * @static + * @param {Object.} object Plain object + * @returns {api.GetPaymentDetailsRequest} GetPaymentDetailsRequest + */ + GetPaymentDetailsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.GetPaymentDetailsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.GetPaymentDetailsRequest(); + if (object.payment_id != null) + message.payment_id = String(object.payment_id); + return message; + }; + + /** + * Creates a plain object from a GetPaymentDetailsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.GetPaymentDetailsRequest + * @static + * @param {api.GetPaymentDetailsRequest} message GetPaymentDetailsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPaymentDetailsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.payment_id = ""; + if (message.payment_id != null && message.hasOwnProperty("payment_id")) + object.payment_id = message.payment_id; + return object; + }; + + /** + * Converts this GetPaymentDetailsRequest to JSON. + * @function toJSON + * @memberof api.GetPaymentDetailsRequest + * @instance + * @returns {Object.} JSON object + */ + GetPaymentDetailsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPaymentDetailsRequest + * @function getTypeUrl + * @memberof api.GetPaymentDetailsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPaymentDetailsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GetPaymentDetailsRequest"; + }; + + return GetPaymentDetailsRequest; + })(); + + api.GetPaymentDetailsResponse = (function() { + + /** + * Properties of a GetPaymentDetailsResponse. + * @memberof api + * @interface IGetPaymentDetailsResponse + * @property {types.IPayment|null} [payment] GetPaymentDetailsResponse payment + */ + + /** + * Constructs a new GetPaymentDetailsResponse. + * @memberof api + * @classdesc Represents a GetPaymentDetailsResponse. + * @implements IGetPaymentDetailsResponse + * @constructor + * @param {api.IGetPaymentDetailsResponse=} [properties] Properties to set + */ + function GetPaymentDetailsResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPaymentDetailsResponse payment. + * @member {types.IPayment|null|undefined} payment + * @memberof api.GetPaymentDetailsResponse + * @instance + */ + GetPaymentDetailsResponse.prototype.payment = null; + + /** + * Creates a new GetPaymentDetailsResponse instance using the specified properties. + * @function create + * @memberof api.GetPaymentDetailsResponse + * @static + * @param {api.IGetPaymentDetailsResponse=} [properties] Properties to set + * @returns {api.GetPaymentDetailsResponse} GetPaymentDetailsResponse instance + */ + GetPaymentDetailsResponse.create = function create(properties) { + return new GetPaymentDetailsResponse(properties); + }; + + /** + * Encodes the specified GetPaymentDetailsResponse message. Does not implicitly {@link api.GetPaymentDetailsResponse.verify|verify} messages. + * @function encode + * @memberof api.GetPaymentDetailsResponse + * @static + * @param {api.IGetPaymentDetailsResponse} message GetPaymentDetailsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPaymentDetailsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payment != null && Object.hasOwnProperty.call(message, "payment")) + $root.types.Payment.encode(message.payment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetPaymentDetailsResponse message, length delimited. Does not implicitly {@link api.GetPaymentDetailsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.GetPaymentDetailsResponse + * @static + * @param {api.IGetPaymentDetailsResponse} message GetPaymentDetailsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPaymentDetailsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPaymentDetailsResponse message from the specified reader or buffer. + * @function decode + * @memberof api.GetPaymentDetailsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.GetPaymentDetailsResponse} GetPaymentDetailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPaymentDetailsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GetPaymentDetailsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.payment = $root.types.Payment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetPaymentDetailsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.GetPaymentDetailsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.GetPaymentDetailsResponse} GetPaymentDetailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPaymentDetailsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPaymentDetailsResponse message. + * @function verify + * @memberof api.GetPaymentDetailsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPaymentDetailsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.payment != null && message.hasOwnProperty("payment")) { + let error = $root.types.Payment.verify(message.payment, long + 1); + if (error) + return "payment." + error; + } + return null; + }; + + /** + * Creates a GetPaymentDetailsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.GetPaymentDetailsResponse + * @static + * @param {Object.} object Plain object + * @returns {api.GetPaymentDetailsResponse} GetPaymentDetailsResponse + */ + GetPaymentDetailsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.GetPaymentDetailsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.GetPaymentDetailsResponse(); + if (object.payment != null) { + if (typeof object.payment !== "object") + throw TypeError(".api.GetPaymentDetailsResponse.payment: object expected"); + message.payment = $root.types.Payment.fromObject(object.payment, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a GetPaymentDetailsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.GetPaymentDetailsResponse + * @static + * @param {api.GetPaymentDetailsResponse} message GetPaymentDetailsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPaymentDetailsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.payment = null; + if (message.payment != null && message.hasOwnProperty("payment")) + object.payment = $root.types.Payment.toObject(message.payment, options); + return object; + }; + + /** + * Converts this GetPaymentDetailsResponse to JSON. + * @function toJSON + * @memberof api.GetPaymentDetailsResponse + * @instance + * @returns {Object.} JSON object + */ + GetPaymentDetailsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPaymentDetailsResponse + * @function getTypeUrl + * @memberof api.GetPaymentDetailsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPaymentDetailsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GetPaymentDetailsResponse"; + }; + + return GetPaymentDetailsResponse; + })(); + + api.ListPaymentsRequest = (function() { + + /** + * Properties of a ListPaymentsRequest. + * @memberof api + * @interface IListPaymentsRequest + * @property {types.IPageToken|null} [page_token] ListPaymentsRequest page_token + */ + + /** + * Constructs a new ListPaymentsRequest. + * @memberof api + * @classdesc Represents a ListPaymentsRequest. + * @implements IListPaymentsRequest + * @constructor + * @param {api.IListPaymentsRequest=} [properties] Properties to set + */ + function ListPaymentsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPaymentsRequest page_token. + * @member {types.IPageToken|null|undefined} page_token + * @memberof api.ListPaymentsRequest + * @instance + */ + ListPaymentsRequest.prototype.page_token = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListPaymentsRequest.prototype, "_page_token", { + get: $util.oneOfGetter($oneOfFields = ["page_token"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListPaymentsRequest instance using the specified properties. + * @function create + * @memberof api.ListPaymentsRequest + * @static + * @param {api.IListPaymentsRequest=} [properties] Properties to set + * @returns {api.ListPaymentsRequest} ListPaymentsRequest instance + */ + ListPaymentsRequest.create = function create(properties) { + return new ListPaymentsRequest(properties); + }; + + /** + * Encodes the specified ListPaymentsRequest message. Does not implicitly {@link api.ListPaymentsRequest.verify|verify} messages. + * @function encode + * @memberof api.ListPaymentsRequest + * @static + * @param {api.IListPaymentsRequest} message ListPaymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPaymentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.page_token != null && Object.hasOwnProperty.call(message, "page_token")) + $root.types.PageToken.encode(message.page_token, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListPaymentsRequest message, length delimited. Does not implicitly {@link api.ListPaymentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.ListPaymentsRequest + * @static + * @param {api.IListPaymentsRequest} message ListPaymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPaymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPaymentsRequest message from the specified reader or buffer. + * @function decode + * @memberof api.ListPaymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.ListPaymentsRequest} ListPaymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPaymentsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ListPaymentsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.page_token = $root.types.PageToken.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListPaymentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.ListPaymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.ListPaymentsRequest} ListPaymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPaymentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPaymentsRequest message. + * @function verify + * @memberof api.ListPaymentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPaymentsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.page_token != null && message.hasOwnProperty("page_token")) { + properties._page_token = 1; + { + let error = $root.types.PageToken.verify(message.page_token, long + 1); + if (error) + return "page_token." + error; + } + } + return null; + }; + + /** + * Creates a ListPaymentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.ListPaymentsRequest + * @static + * @param {Object.} object Plain object + * @returns {api.ListPaymentsRequest} ListPaymentsRequest + */ + ListPaymentsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.ListPaymentsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.ListPaymentsRequest(); + if (object.page_token != null) { + if (typeof object.page_token !== "object") + throw TypeError(".api.ListPaymentsRequest.page_token: object expected"); + message.page_token = $root.types.PageToken.fromObject(object.page_token, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ListPaymentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.ListPaymentsRequest + * @static + * @param {api.ListPaymentsRequest} message ListPaymentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPaymentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.page_token != null && message.hasOwnProperty("page_token")) { + object.page_token = $root.types.PageToken.toObject(message.page_token, options); + if (options.oneofs) + object._page_token = "page_token"; + } + return object; + }; + + /** + * Converts this ListPaymentsRequest to JSON. + * @function toJSON + * @memberof api.ListPaymentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListPaymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPaymentsRequest + * @function getTypeUrl + * @memberof api.ListPaymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPaymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ListPaymentsRequest"; + }; + + return ListPaymentsRequest; + })(); + + api.ListPaymentsResponse = (function() { + + /** + * Properties of a ListPaymentsResponse. + * @memberof api + * @interface IListPaymentsResponse + * @property {Array.|null} [payments] ListPaymentsResponse payments + * @property {types.IPageToken|null} [next_page_token] ListPaymentsResponse next_page_token + */ + + /** + * Constructs a new ListPaymentsResponse. + * @memberof api + * @classdesc Represents a ListPaymentsResponse. + * @implements IListPaymentsResponse + * @constructor + * @param {api.IListPaymentsResponse=} [properties] Properties to set + */ + function ListPaymentsResponse(properties) { + this.payments = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPaymentsResponse payments. + * @member {Array.} payments + * @memberof api.ListPaymentsResponse + * @instance + */ + ListPaymentsResponse.prototype.payments = $util.emptyArray; + + /** + * ListPaymentsResponse next_page_token. + * @member {types.IPageToken|null|undefined} next_page_token + * @memberof api.ListPaymentsResponse + * @instance + */ + ListPaymentsResponse.prototype.next_page_token = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListPaymentsResponse.prototype, "_next_page_token", { + get: $util.oneOfGetter($oneOfFields = ["next_page_token"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListPaymentsResponse instance using the specified properties. + * @function create + * @memberof api.ListPaymentsResponse + * @static + * @param {api.IListPaymentsResponse=} [properties] Properties to set + * @returns {api.ListPaymentsResponse} ListPaymentsResponse instance + */ + ListPaymentsResponse.create = function create(properties) { + return new ListPaymentsResponse(properties); + }; + + /** + * Encodes the specified ListPaymentsResponse message. Does not implicitly {@link api.ListPaymentsResponse.verify|verify} messages. + * @function encode + * @memberof api.ListPaymentsResponse + * @static + * @param {api.IListPaymentsResponse} message ListPaymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPaymentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payments != null && message.payments.length) + for (let i = 0; i < message.payments.length; ++i) + $root.types.Payment.encode(message.payments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.next_page_token != null && Object.hasOwnProperty.call(message, "next_page_token")) + $root.types.PageToken.encode(message.next_page_token, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListPaymentsResponse message, length delimited. Does not implicitly {@link api.ListPaymentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.ListPaymentsResponse + * @static + * @param {api.IListPaymentsResponse} message ListPaymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPaymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPaymentsResponse message from the specified reader or buffer. + * @function decode + * @memberof api.ListPaymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.ListPaymentsResponse} ListPaymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPaymentsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ListPaymentsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.payments && message.payments.length)) + message.payments = []; + message.payments.push($root.types.Payment.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.next_page_token = $root.types.PageToken.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListPaymentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.ListPaymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.ListPaymentsResponse} ListPaymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPaymentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPaymentsResponse message. + * @function verify + * @memberof api.ListPaymentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPaymentsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.payments != null && message.hasOwnProperty("payments")) { + if (!Array.isArray(message.payments)) + return "payments: array expected"; + for (let i = 0; i < message.payments.length; ++i) { + let error = $root.types.Payment.verify(message.payments[i], long + 1); + if (error) + return "payments." + error; + } + } + if (message.next_page_token != null && message.hasOwnProperty("next_page_token")) { + properties._next_page_token = 1; + { + let error = $root.types.PageToken.verify(message.next_page_token, long + 1); + if (error) + return "next_page_token." + error; + } + } + return null; + }; + + /** + * Creates a ListPaymentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.ListPaymentsResponse + * @static + * @param {Object.} object Plain object + * @returns {api.ListPaymentsResponse} ListPaymentsResponse + */ + ListPaymentsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.ListPaymentsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.ListPaymentsResponse(); + if (object.payments) { + if (!Array.isArray(object.payments)) + throw TypeError(".api.ListPaymentsResponse.payments: array expected"); + message.payments = []; + for (let i = 0; i < object.payments.length; ++i) { + if (typeof object.payments[i] !== "object") + throw TypeError(".api.ListPaymentsResponse.payments: object expected"); + message.payments[i] = $root.types.Payment.fromObject(object.payments[i], long + 1); + } + } + if (object.next_page_token != null) { + if (typeof object.next_page_token !== "object") + throw TypeError(".api.ListPaymentsResponse.next_page_token: object expected"); + message.next_page_token = $root.types.PageToken.fromObject(object.next_page_token, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ListPaymentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.ListPaymentsResponse + * @static + * @param {api.ListPaymentsResponse} message ListPaymentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPaymentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.payments = []; + if (message.payments && message.payments.length) { + object.payments = []; + for (let j = 0; j < message.payments.length; ++j) + object.payments[j] = $root.types.Payment.toObject(message.payments[j], options); + } + if (message.next_page_token != null && message.hasOwnProperty("next_page_token")) { + object.next_page_token = $root.types.PageToken.toObject(message.next_page_token, options); + if (options.oneofs) + object._next_page_token = "next_page_token"; + } + return object; + }; + + /** + * Converts this ListPaymentsResponse to JSON. + * @function toJSON + * @memberof api.ListPaymentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListPaymentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPaymentsResponse + * @function getTypeUrl + * @memberof api.ListPaymentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPaymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ListPaymentsResponse"; + }; + + return ListPaymentsResponse; + })(); + + api.ListForwardedPaymentsRequest = (function() { + + /** + * Properties of a ListForwardedPaymentsRequest. + * @memberof api + * @interface IListForwardedPaymentsRequest + * @property {types.IPageToken|null} [page_token] ListForwardedPaymentsRequest page_token + */ + + /** + * Constructs a new ListForwardedPaymentsRequest. + * @memberof api + * @classdesc Represents a ListForwardedPaymentsRequest. + * @implements IListForwardedPaymentsRequest + * @constructor + * @param {api.IListForwardedPaymentsRequest=} [properties] Properties to set + */ + function ListForwardedPaymentsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListForwardedPaymentsRequest page_token. + * @member {types.IPageToken|null|undefined} page_token + * @memberof api.ListForwardedPaymentsRequest + * @instance + */ + ListForwardedPaymentsRequest.prototype.page_token = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListForwardedPaymentsRequest.prototype, "_page_token", { + get: $util.oneOfGetter($oneOfFields = ["page_token"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListForwardedPaymentsRequest instance using the specified properties. + * @function create + * @memberof api.ListForwardedPaymentsRequest + * @static + * @param {api.IListForwardedPaymentsRequest=} [properties] Properties to set + * @returns {api.ListForwardedPaymentsRequest} ListForwardedPaymentsRequest instance + */ + ListForwardedPaymentsRequest.create = function create(properties) { + return new ListForwardedPaymentsRequest(properties); + }; + + /** + * Encodes the specified ListForwardedPaymentsRequest message. Does not implicitly {@link api.ListForwardedPaymentsRequest.verify|verify} messages. + * @function encode + * @memberof api.ListForwardedPaymentsRequest + * @static + * @param {api.IListForwardedPaymentsRequest} message ListForwardedPaymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListForwardedPaymentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.page_token != null && Object.hasOwnProperty.call(message, "page_token")) + $root.types.PageToken.encode(message.page_token, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListForwardedPaymentsRequest message, length delimited. Does not implicitly {@link api.ListForwardedPaymentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.ListForwardedPaymentsRequest + * @static + * @param {api.IListForwardedPaymentsRequest} message ListForwardedPaymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListForwardedPaymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListForwardedPaymentsRequest message from the specified reader or buffer. + * @function decode + * @memberof api.ListForwardedPaymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.ListForwardedPaymentsRequest} ListForwardedPaymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListForwardedPaymentsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ListForwardedPaymentsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.page_token = $root.types.PageToken.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListForwardedPaymentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.ListForwardedPaymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.ListForwardedPaymentsRequest} ListForwardedPaymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListForwardedPaymentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListForwardedPaymentsRequest message. + * @function verify + * @memberof api.ListForwardedPaymentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListForwardedPaymentsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.page_token != null && message.hasOwnProperty("page_token")) { + properties._page_token = 1; + { + let error = $root.types.PageToken.verify(message.page_token, long + 1); + if (error) + return "page_token." + error; + } + } + return null; + }; + + /** + * Creates a ListForwardedPaymentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.ListForwardedPaymentsRequest + * @static + * @param {Object.} object Plain object + * @returns {api.ListForwardedPaymentsRequest} ListForwardedPaymentsRequest + */ + ListForwardedPaymentsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.ListForwardedPaymentsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.ListForwardedPaymentsRequest(); + if (object.page_token != null) { + if (typeof object.page_token !== "object") + throw TypeError(".api.ListForwardedPaymentsRequest.page_token: object expected"); + message.page_token = $root.types.PageToken.fromObject(object.page_token, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ListForwardedPaymentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.ListForwardedPaymentsRequest + * @static + * @param {api.ListForwardedPaymentsRequest} message ListForwardedPaymentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListForwardedPaymentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.page_token != null && message.hasOwnProperty("page_token")) { + object.page_token = $root.types.PageToken.toObject(message.page_token, options); + if (options.oneofs) + object._page_token = "page_token"; + } + return object; + }; + + /** + * Converts this ListForwardedPaymentsRequest to JSON. + * @function toJSON + * @memberof api.ListForwardedPaymentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListForwardedPaymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListForwardedPaymentsRequest + * @function getTypeUrl + * @memberof api.ListForwardedPaymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListForwardedPaymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ListForwardedPaymentsRequest"; + }; + + return ListForwardedPaymentsRequest; + })(); + + api.ListForwardedPaymentsResponse = (function() { + + /** + * Properties of a ListForwardedPaymentsResponse. + * @memberof api + * @interface IListForwardedPaymentsResponse + * @property {Array.|null} [forwarded_payments] ListForwardedPaymentsResponse forwarded_payments + * @property {types.IPageToken|null} [next_page_token] ListForwardedPaymentsResponse next_page_token + */ + + /** + * Constructs a new ListForwardedPaymentsResponse. + * @memberof api + * @classdesc Represents a ListForwardedPaymentsResponse. + * @implements IListForwardedPaymentsResponse + * @constructor + * @param {api.IListForwardedPaymentsResponse=} [properties] Properties to set + */ + function ListForwardedPaymentsResponse(properties) { + this.forwarded_payments = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListForwardedPaymentsResponse forwarded_payments. + * @member {Array.} forwarded_payments + * @memberof api.ListForwardedPaymentsResponse + * @instance + */ + ListForwardedPaymentsResponse.prototype.forwarded_payments = $util.emptyArray; + + /** + * ListForwardedPaymentsResponse next_page_token. + * @member {types.IPageToken|null|undefined} next_page_token + * @memberof api.ListForwardedPaymentsResponse + * @instance + */ + ListForwardedPaymentsResponse.prototype.next_page_token = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListForwardedPaymentsResponse.prototype, "_next_page_token", { + get: $util.oneOfGetter($oneOfFields = ["next_page_token"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListForwardedPaymentsResponse instance using the specified properties. + * @function create + * @memberof api.ListForwardedPaymentsResponse + * @static + * @param {api.IListForwardedPaymentsResponse=} [properties] Properties to set + * @returns {api.ListForwardedPaymentsResponse} ListForwardedPaymentsResponse instance + */ + ListForwardedPaymentsResponse.create = function create(properties) { + return new ListForwardedPaymentsResponse(properties); + }; + + /** + * Encodes the specified ListForwardedPaymentsResponse message. Does not implicitly {@link api.ListForwardedPaymentsResponse.verify|verify} messages. + * @function encode + * @memberof api.ListForwardedPaymentsResponse + * @static + * @param {api.IListForwardedPaymentsResponse} message ListForwardedPaymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListForwardedPaymentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.forwarded_payments != null && message.forwarded_payments.length) + for (let i = 0; i < message.forwarded_payments.length; ++i) + $root.types.ForwardedPayment.encode(message.forwarded_payments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.next_page_token != null && Object.hasOwnProperty.call(message, "next_page_token")) + $root.types.PageToken.encode(message.next_page_token, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListForwardedPaymentsResponse message, length delimited. Does not implicitly {@link api.ListForwardedPaymentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.ListForwardedPaymentsResponse + * @static + * @param {api.IListForwardedPaymentsResponse} message ListForwardedPaymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListForwardedPaymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListForwardedPaymentsResponse message from the specified reader or buffer. + * @function decode + * @memberof api.ListForwardedPaymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.ListForwardedPaymentsResponse} ListForwardedPaymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListForwardedPaymentsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ListForwardedPaymentsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.forwarded_payments && message.forwarded_payments.length)) + message.forwarded_payments = []; + message.forwarded_payments.push($root.types.ForwardedPayment.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 2: { + message.next_page_token = $root.types.PageToken.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListForwardedPaymentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.ListForwardedPaymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.ListForwardedPaymentsResponse} ListForwardedPaymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListForwardedPaymentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListForwardedPaymentsResponse message. + * @function verify + * @memberof api.ListForwardedPaymentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListForwardedPaymentsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.forwarded_payments != null && message.hasOwnProperty("forwarded_payments")) { + if (!Array.isArray(message.forwarded_payments)) + return "forwarded_payments: array expected"; + for (let i = 0; i < message.forwarded_payments.length; ++i) { + let error = $root.types.ForwardedPayment.verify(message.forwarded_payments[i], long + 1); + if (error) + return "forwarded_payments." + error; + } + } + if (message.next_page_token != null && message.hasOwnProperty("next_page_token")) { + properties._next_page_token = 1; + { + let error = $root.types.PageToken.verify(message.next_page_token, long + 1); + if (error) + return "next_page_token." + error; + } + } + return null; + }; + + /** + * Creates a ListForwardedPaymentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.ListForwardedPaymentsResponse + * @static + * @param {Object.} object Plain object + * @returns {api.ListForwardedPaymentsResponse} ListForwardedPaymentsResponse + */ + ListForwardedPaymentsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.ListForwardedPaymentsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.ListForwardedPaymentsResponse(); + if (object.forwarded_payments) { + if (!Array.isArray(object.forwarded_payments)) + throw TypeError(".api.ListForwardedPaymentsResponse.forwarded_payments: array expected"); + message.forwarded_payments = []; + for (let i = 0; i < object.forwarded_payments.length; ++i) { + if (typeof object.forwarded_payments[i] !== "object") + throw TypeError(".api.ListForwardedPaymentsResponse.forwarded_payments: object expected"); + message.forwarded_payments[i] = $root.types.ForwardedPayment.fromObject(object.forwarded_payments[i], long + 1); + } + } + if (object.next_page_token != null) { + if (typeof object.next_page_token !== "object") + throw TypeError(".api.ListForwardedPaymentsResponse.next_page_token: object expected"); + message.next_page_token = $root.types.PageToken.fromObject(object.next_page_token, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ListForwardedPaymentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.ListForwardedPaymentsResponse + * @static + * @param {api.ListForwardedPaymentsResponse} message ListForwardedPaymentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListForwardedPaymentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.forwarded_payments = []; + if (message.forwarded_payments && message.forwarded_payments.length) { + object.forwarded_payments = []; + for (let j = 0; j < message.forwarded_payments.length; ++j) + object.forwarded_payments[j] = $root.types.ForwardedPayment.toObject(message.forwarded_payments[j], options); + } + if (message.next_page_token != null && message.hasOwnProperty("next_page_token")) { + object.next_page_token = $root.types.PageToken.toObject(message.next_page_token, options); + if (options.oneofs) + object._next_page_token = "next_page_token"; + } + return object; + }; + + /** + * Converts this ListForwardedPaymentsResponse to JSON. + * @function toJSON + * @memberof api.ListForwardedPaymentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListForwardedPaymentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListForwardedPaymentsResponse + * @function getTypeUrl + * @memberof api.ListForwardedPaymentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListForwardedPaymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ListForwardedPaymentsResponse"; + }; + + return ListForwardedPaymentsResponse; + })(); + + api.SignMessageRequest = (function() { + + /** + * Properties of a SignMessageRequest. + * @memberof api + * @interface ISignMessageRequest + * @property {Uint8Array|null} [message] SignMessageRequest message + */ + + /** + * Constructs a new SignMessageRequest. + * @memberof api + * @classdesc Represents a SignMessageRequest. + * @implements ISignMessageRequest + * @constructor + * @param {api.ISignMessageRequest=} [properties] Properties to set + */ + function SignMessageRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SignMessageRequest message. + * @member {Uint8Array} message + * @memberof api.SignMessageRequest + * @instance + */ + SignMessageRequest.prototype.message = $util.newBuffer([]); + + /** + * Creates a new SignMessageRequest instance using the specified properties. + * @function create + * @memberof api.SignMessageRequest + * @static + * @param {api.ISignMessageRequest=} [properties] Properties to set + * @returns {api.SignMessageRequest} SignMessageRequest instance + */ + SignMessageRequest.create = function create(properties) { + return new SignMessageRequest(properties); + }; + + /** + * Encodes the specified SignMessageRequest message. Does not implicitly {@link api.SignMessageRequest.verify|verify} messages. + * @function encode + * @memberof api.SignMessageRequest + * @static + * @param {api.ISignMessageRequest} message SignMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignMessageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.message); + return writer; + }; + + /** + * Encodes the specified SignMessageRequest message, length delimited. Does not implicitly {@link api.SignMessageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.SignMessageRequest + * @static + * @param {api.ISignMessageRequest} message SignMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SignMessageRequest message from the specified reader or buffer. + * @function decode + * @memberof api.SignMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.SignMessageRequest} SignMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignMessageRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.SignMessageRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.message = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SignMessageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.SignMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.SignMessageRequest} SignMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignMessageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SignMessageRequest message. + * @function verify + * @memberof api.SignMessageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SignMessageRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.message != null && message.hasOwnProperty("message")) + if (!(message.message && typeof message.message.length === "number" || $util.isString(message.message))) + return "message: buffer expected"; + return null; + }; + + /** + * Creates a SignMessageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.SignMessageRequest + * @static + * @param {Object.} object Plain object + * @returns {api.SignMessageRequest} SignMessageRequest + */ + SignMessageRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.SignMessageRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.SignMessageRequest(); + if (object.message != null) + if (typeof object.message === "string") + $util.base64.decode(object.message, message.message = $util.newBuffer($util.base64.length(object.message)), 0); + else if (object.message.length >= 0) + message.message = object.message; + return message; + }; + + /** + * Creates a plain object from a SignMessageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.SignMessageRequest + * @static + * @param {api.SignMessageRequest} message SignMessageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignMessageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if (options.bytes === String) + object.message = ""; + else { + object.message = []; + if (options.bytes !== Array) + object.message = $util.newBuffer(object.message); + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = options.bytes === String ? $util.base64.encode(message.message, 0, message.message.length) : options.bytes === Array ? Array.prototype.slice.call(message.message) : message.message; + return object; + }; + + /** + * Converts this SignMessageRequest to JSON. + * @function toJSON + * @memberof api.SignMessageRequest + * @instance + * @returns {Object.} JSON object + */ + SignMessageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SignMessageRequest + * @function getTypeUrl + * @memberof api.SignMessageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.SignMessageRequest"; + }; + + return SignMessageRequest; + })(); + + api.SignMessageResponse = (function() { + + /** + * Properties of a SignMessageResponse. + * @memberof api + * @interface ISignMessageResponse + * @property {string|null} [signature] SignMessageResponse signature + */ + + /** + * Constructs a new SignMessageResponse. + * @memberof api + * @classdesc Represents a SignMessageResponse. + * @implements ISignMessageResponse + * @constructor + * @param {api.ISignMessageResponse=} [properties] Properties to set + */ + function SignMessageResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * SignMessageResponse signature. + * @member {string} signature + * @memberof api.SignMessageResponse + * @instance + */ + SignMessageResponse.prototype.signature = ""; + + /** + * Creates a new SignMessageResponse instance using the specified properties. + * @function create + * @memberof api.SignMessageResponse + * @static + * @param {api.ISignMessageResponse=} [properties] Properties to set + * @returns {api.SignMessageResponse} SignMessageResponse instance + */ + SignMessageResponse.create = function create(properties) { + return new SignMessageResponse(properties); + }; + + /** + * Encodes the specified SignMessageResponse message. Does not implicitly {@link api.SignMessageResponse.verify|verify} messages. + * @function encode + * @memberof api.SignMessageResponse + * @static + * @param {api.ISignMessageResponse} message SignMessageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignMessageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.signature); + return writer; + }; + + /** + * Encodes the specified SignMessageResponse message, length delimited. Does not implicitly {@link api.SignMessageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.SignMessageResponse + * @static + * @param {api.ISignMessageResponse} message SignMessageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignMessageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SignMessageResponse message from the specified reader or buffer. + * @function decode + * @memberof api.SignMessageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.SignMessageResponse} SignMessageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignMessageResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.SignMessageResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.signature = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SignMessageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.SignMessageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.SignMessageResponse} SignMessageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignMessageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SignMessageResponse message. + * @function verify + * @memberof api.SignMessageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SignMessageResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.signature != null && message.hasOwnProperty("signature")) + if (!$util.isString(message.signature)) + return "signature: string expected"; + return null; + }; + + /** + * Creates a SignMessageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.SignMessageResponse + * @static + * @param {Object.} object Plain object + * @returns {api.SignMessageResponse} SignMessageResponse + */ + SignMessageResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.SignMessageResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.SignMessageResponse(); + if (object.signature != null) + message.signature = String(object.signature); + return message; + }; + + /** + * Creates a plain object from a SignMessageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.SignMessageResponse + * @static + * @param {api.SignMessageResponse} message SignMessageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignMessageResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.signature = ""; + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = message.signature; + return object; + }; + + /** + * Converts this SignMessageResponse to JSON. + * @function toJSON + * @memberof api.SignMessageResponse + * @instance + * @returns {Object.} JSON object + */ + SignMessageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SignMessageResponse + * @function getTypeUrl + * @memberof api.SignMessageResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignMessageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.SignMessageResponse"; + }; + + return SignMessageResponse; + })(); + + api.VerifySignatureRequest = (function() { + + /** + * Properties of a VerifySignatureRequest. + * @memberof api + * @interface IVerifySignatureRequest + * @property {Uint8Array|null} [message] VerifySignatureRequest message + * @property {string|null} [signature] VerifySignatureRequest signature + * @property {string|null} [public_key] VerifySignatureRequest public_key + */ + + /** + * Constructs a new VerifySignatureRequest. + * @memberof api + * @classdesc Represents a VerifySignatureRequest. + * @implements IVerifySignatureRequest + * @constructor + * @param {api.IVerifySignatureRequest=} [properties] Properties to set + */ + function VerifySignatureRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VerifySignatureRequest message. + * @member {Uint8Array} message + * @memberof api.VerifySignatureRequest + * @instance + */ + VerifySignatureRequest.prototype.message = $util.newBuffer([]); + + /** + * VerifySignatureRequest signature. + * @member {string} signature + * @memberof api.VerifySignatureRequest + * @instance + */ + VerifySignatureRequest.prototype.signature = ""; + + /** + * VerifySignatureRequest public_key. + * @member {string} public_key + * @memberof api.VerifySignatureRequest + * @instance + */ + VerifySignatureRequest.prototype.public_key = ""; + + /** + * Creates a new VerifySignatureRequest instance using the specified properties. + * @function create + * @memberof api.VerifySignatureRequest + * @static + * @param {api.IVerifySignatureRequest=} [properties] Properties to set + * @returns {api.VerifySignatureRequest} VerifySignatureRequest instance + */ + VerifySignatureRequest.create = function create(properties) { + return new VerifySignatureRequest(properties); + }; + + /** + * Encodes the specified VerifySignatureRequest message. Does not implicitly {@link api.VerifySignatureRequest.verify|verify} messages. + * @function encode + * @memberof api.VerifySignatureRequest + * @static + * @param {api.IVerifySignatureRequest} message VerifySignatureRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VerifySignatureRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.message); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.signature); + if (message.public_key != null && Object.hasOwnProperty.call(message, "public_key")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.public_key); + return writer; + }; + + /** + * Encodes the specified VerifySignatureRequest message, length delimited. Does not implicitly {@link api.VerifySignatureRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.VerifySignatureRequest + * @static + * @param {api.IVerifySignatureRequest} message VerifySignatureRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VerifySignatureRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VerifySignatureRequest message from the specified reader or buffer. + * @function decode + * @memberof api.VerifySignatureRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.VerifySignatureRequest} VerifySignatureRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VerifySignatureRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.VerifySignatureRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.message = reader.bytes(); + break; + } + case 2: { + message.signature = reader.string(); + break; + } + case 3: { + message.public_key = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VerifySignatureRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.VerifySignatureRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.VerifySignatureRequest} VerifySignatureRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VerifySignatureRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VerifySignatureRequest message. + * @function verify + * @memberof api.VerifySignatureRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VerifySignatureRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.message != null && message.hasOwnProperty("message")) + if (!(message.message && typeof message.message.length === "number" || $util.isString(message.message))) + return "message: buffer expected"; + if (message.signature != null && message.hasOwnProperty("signature")) + if (!$util.isString(message.signature)) + return "signature: string expected"; + if (message.public_key != null && message.hasOwnProperty("public_key")) + if (!$util.isString(message.public_key)) + return "public_key: string expected"; + return null; + }; + + /** + * Creates a VerifySignatureRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.VerifySignatureRequest + * @static + * @param {Object.} object Plain object + * @returns {api.VerifySignatureRequest} VerifySignatureRequest + */ + VerifySignatureRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.VerifySignatureRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.VerifySignatureRequest(); + if (object.message != null) + if (typeof object.message === "string") + $util.base64.decode(object.message, message.message = $util.newBuffer($util.base64.length(object.message)), 0); + else if (object.message.length >= 0) + message.message = object.message; + if (object.signature != null) + message.signature = String(object.signature); + if (object.public_key != null) + message.public_key = String(object.public_key); + return message; + }; + + /** + * Creates a plain object from a VerifySignatureRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.VerifySignatureRequest + * @static + * @param {api.VerifySignatureRequest} message VerifySignatureRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VerifySignatureRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + if (options.bytes === String) + object.message = ""; + else { + object.message = []; + if (options.bytes !== Array) + object.message = $util.newBuffer(object.message); + } + object.signature = ""; + object.public_key = ""; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = options.bytes === String ? $util.base64.encode(message.message, 0, message.message.length) : options.bytes === Array ? Array.prototype.slice.call(message.message) : message.message; + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = message.signature; + if (message.public_key != null && message.hasOwnProperty("public_key")) + object.public_key = message.public_key; + return object; + }; + + /** + * Converts this VerifySignatureRequest to JSON. + * @function toJSON + * @memberof api.VerifySignatureRequest + * @instance + * @returns {Object.} JSON object + */ + VerifySignatureRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VerifySignatureRequest + * @function getTypeUrl + * @memberof api.VerifySignatureRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VerifySignatureRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.VerifySignatureRequest"; + }; + + return VerifySignatureRequest; + })(); + + api.VerifySignatureResponse = (function() { + + /** + * Properties of a VerifySignatureResponse. + * @memberof api + * @interface IVerifySignatureResponse + * @property {boolean|null} [valid] VerifySignatureResponse valid + */ + + /** + * Constructs a new VerifySignatureResponse. + * @memberof api + * @classdesc Represents a VerifySignatureResponse. + * @implements IVerifySignatureResponse + * @constructor + * @param {api.IVerifySignatureResponse=} [properties] Properties to set + */ + function VerifySignatureResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * VerifySignatureResponse valid. + * @member {boolean} valid + * @memberof api.VerifySignatureResponse + * @instance + */ + VerifySignatureResponse.prototype.valid = false; + + /** + * Creates a new VerifySignatureResponse instance using the specified properties. + * @function create + * @memberof api.VerifySignatureResponse + * @static + * @param {api.IVerifySignatureResponse=} [properties] Properties to set + * @returns {api.VerifySignatureResponse} VerifySignatureResponse instance + */ + VerifySignatureResponse.create = function create(properties) { + return new VerifySignatureResponse(properties); + }; + + /** + * Encodes the specified VerifySignatureResponse message. Does not implicitly {@link api.VerifySignatureResponse.verify|verify} messages. + * @function encode + * @memberof api.VerifySignatureResponse + * @static + * @param {api.IVerifySignatureResponse} message VerifySignatureResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VerifySignatureResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.valid != null && Object.hasOwnProperty.call(message, "valid")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.valid); + return writer; + }; + + /** + * Encodes the specified VerifySignatureResponse message, length delimited. Does not implicitly {@link api.VerifySignatureResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.VerifySignatureResponse + * @static + * @param {api.IVerifySignatureResponse} message VerifySignatureResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VerifySignatureResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VerifySignatureResponse message from the specified reader or buffer. + * @function decode + * @memberof api.VerifySignatureResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.VerifySignatureResponse} VerifySignatureResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VerifySignatureResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.VerifySignatureResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.valid = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a VerifySignatureResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.VerifySignatureResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.VerifySignatureResponse} VerifySignatureResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VerifySignatureResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VerifySignatureResponse message. + * @function verify + * @memberof api.VerifySignatureResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VerifySignatureResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.valid != null && message.hasOwnProperty("valid")) + if (typeof message.valid !== "boolean") + return "valid: boolean expected"; + return null; + }; + + /** + * Creates a VerifySignatureResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.VerifySignatureResponse + * @static + * @param {Object.} object Plain object + * @returns {api.VerifySignatureResponse} VerifySignatureResponse + */ + VerifySignatureResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.VerifySignatureResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.VerifySignatureResponse(); + if (object.valid != null) + message.valid = Boolean(object.valid); + return message; + }; + + /** + * Creates a plain object from a VerifySignatureResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.VerifySignatureResponse + * @static + * @param {api.VerifySignatureResponse} message VerifySignatureResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VerifySignatureResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.valid = false; + if (message.valid != null && message.hasOwnProperty("valid")) + object.valid = message.valid; + return object; + }; + + /** + * Converts this VerifySignatureResponse to JSON. + * @function toJSON + * @memberof api.VerifySignatureResponse + * @instance + * @returns {Object.} JSON object + */ + VerifySignatureResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VerifySignatureResponse + * @function getTypeUrl + * @memberof api.VerifySignatureResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VerifySignatureResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.VerifySignatureResponse"; + }; + + return VerifySignatureResponse; + })(); + + api.ExportPathfindingScoresRequest = (function() { + + /** + * Properties of an ExportPathfindingScoresRequest. + * @memberof api + * @interface IExportPathfindingScoresRequest + */ + + /** + * Constructs a new ExportPathfindingScoresRequest. + * @memberof api + * @classdesc Represents an ExportPathfindingScoresRequest. + * @implements IExportPathfindingScoresRequest + * @constructor + * @param {api.IExportPathfindingScoresRequest=} [properties] Properties to set + */ + function ExportPathfindingScoresRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ExportPathfindingScoresRequest instance using the specified properties. + * @function create + * @memberof api.ExportPathfindingScoresRequest + * @static + * @param {api.IExportPathfindingScoresRequest=} [properties] Properties to set + * @returns {api.ExportPathfindingScoresRequest} ExportPathfindingScoresRequest instance + */ + ExportPathfindingScoresRequest.create = function create(properties) { + return new ExportPathfindingScoresRequest(properties); + }; + + /** + * Encodes the specified ExportPathfindingScoresRequest message. Does not implicitly {@link api.ExportPathfindingScoresRequest.verify|verify} messages. + * @function encode + * @memberof api.ExportPathfindingScoresRequest + * @static + * @param {api.IExportPathfindingScoresRequest} message ExportPathfindingScoresRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportPathfindingScoresRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ExportPathfindingScoresRequest message, length delimited. Does not implicitly {@link api.ExportPathfindingScoresRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.ExportPathfindingScoresRequest + * @static + * @param {api.IExportPathfindingScoresRequest} message ExportPathfindingScoresRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportPathfindingScoresRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportPathfindingScoresRequest message from the specified reader or buffer. + * @function decode + * @memberof api.ExportPathfindingScoresRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.ExportPathfindingScoresRequest} ExportPathfindingScoresRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportPathfindingScoresRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ExportPathfindingScoresRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportPathfindingScoresRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.ExportPathfindingScoresRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.ExportPathfindingScoresRequest} ExportPathfindingScoresRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportPathfindingScoresRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportPathfindingScoresRequest message. + * @function verify + * @memberof api.ExportPathfindingScoresRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportPathfindingScoresRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an ExportPathfindingScoresRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.ExportPathfindingScoresRequest + * @static + * @param {Object.} object Plain object + * @returns {api.ExportPathfindingScoresRequest} ExportPathfindingScoresRequest + */ + ExportPathfindingScoresRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.ExportPathfindingScoresRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.api.ExportPathfindingScoresRequest(); + }; + + /** + * Creates a plain object from an ExportPathfindingScoresRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.ExportPathfindingScoresRequest + * @static + * @param {api.ExportPathfindingScoresRequest} message ExportPathfindingScoresRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportPathfindingScoresRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ExportPathfindingScoresRequest to JSON. + * @function toJSON + * @memberof api.ExportPathfindingScoresRequest + * @instance + * @returns {Object.} JSON object + */ + ExportPathfindingScoresRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportPathfindingScoresRequest + * @function getTypeUrl + * @memberof api.ExportPathfindingScoresRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportPathfindingScoresRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ExportPathfindingScoresRequest"; + }; + + return ExportPathfindingScoresRequest; + })(); + + api.ExportPathfindingScoresResponse = (function() { + + /** + * Properties of an ExportPathfindingScoresResponse. + * @memberof api + * @interface IExportPathfindingScoresResponse + * @property {Uint8Array|null} [scores] ExportPathfindingScoresResponse scores + */ + + /** + * Constructs a new ExportPathfindingScoresResponse. + * @memberof api + * @classdesc Represents an ExportPathfindingScoresResponse. + * @implements IExportPathfindingScoresResponse + * @constructor + * @param {api.IExportPathfindingScoresResponse=} [properties] Properties to set + */ + function ExportPathfindingScoresResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportPathfindingScoresResponse scores. + * @member {Uint8Array} scores + * @memberof api.ExportPathfindingScoresResponse + * @instance + */ + ExportPathfindingScoresResponse.prototype.scores = $util.newBuffer([]); + + /** + * Creates a new ExportPathfindingScoresResponse instance using the specified properties. + * @function create + * @memberof api.ExportPathfindingScoresResponse + * @static + * @param {api.IExportPathfindingScoresResponse=} [properties] Properties to set + * @returns {api.ExportPathfindingScoresResponse} ExportPathfindingScoresResponse instance + */ + ExportPathfindingScoresResponse.create = function create(properties) { + return new ExportPathfindingScoresResponse(properties); + }; + + /** + * Encodes the specified ExportPathfindingScoresResponse message. Does not implicitly {@link api.ExportPathfindingScoresResponse.verify|verify} messages. + * @function encode + * @memberof api.ExportPathfindingScoresResponse + * @static + * @param {api.IExportPathfindingScoresResponse} message ExportPathfindingScoresResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportPathfindingScoresResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scores != null && Object.hasOwnProperty.call(message, "scores")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.scores); + return writer; + }; + + /** + * Encodes the specified ExportPathfindingScoresResponse message, length delimited. Does not implicitly {@link api.ExportPathfindingScoresResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.ExportPathfindingScoresResponse + * @static + * @param {api.IExportPathfindingScoresResponse} message ExportPathfindingScoresResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportPathfindingScoresResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportPathfindingScoresResponse message from the specified reader or buffer. + * @function decode + * @memberof api.ExportPathfindingScoresResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.ExportPathfindingScoresResponse} ExportPathfindingScoresResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportPathfindingScoresResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ExportPathfindingScoresResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.scores = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ExportPathfindingScoresResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.ExportPathfindingScoresResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.ExportPathfindingScoresResponse} ExportPathfindingScoresResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportPathfindingScoresResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportPathfindingScoresResponse message. + * @function verify + * @memberof api.ExportPathfindingScoresResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportPathfindingScoresResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.scores != null && message.hasOwnProperty("scores")) + if (!(message.scores && typeof message.scores.length === "number" || $util.isString(message.scores))) + return "scores: buffer expected"; + return null; + }; + + /** + * Creates an ExportPathfindingScoresResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.ExportPathfindingScoresResponse + * @static + * @param {Object.} object Plain object + * @returns {api.ExportPathfindingScoresResponse} ExportPathfindingScoresResponse + */ + ExportPathfindingScoresResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.ExportPathfindingScoresResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.ExportPathfindingScoresResponse(); + if (object.scores != null) + if (typeof object.scores === "string") + $util.base64.decode(object.scores, message.scores = $util.newBuffer($util.base64.length(object.scores)), 0); + else if (object.scores.length >= 0) + message.scores = object.scores; + return message; + }; + + /** + * Creates a plain object from an ExportPathfindingScoresResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.ExportPathfindingScoresResponse + * @static + * @param {api.ExportPathfindingScoresResponse} message ExportPathfindingScoresResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportPathfindingScoresResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + if (options.bytes === String) + object.scores = ""; + else { + object.scores = []; + if (options.bytes !== Array) + object.scores = $util.newBuffer(object.scores); + } + if (message.scores != null && message.hasOwnProperty("scores")) + object.scores = options.bytes === String ? $util.base64.encode(message.scores, 0, message.scores.length) : options.bytes === Array ? Array.prototype.slice.call(message.scores) : message.scores; + return object; + }; + + /** + * Converts this ExportPathfindingScoresResponse to JSON. + * @function toJSON + * @memberof api.ExportPathfindingScoresResponse + * @instance + * @returns {Object.} JSON object + */ + ExportPathfindingScoresResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportPathfindingScoresResponse + * @function getTypeUrl + * @memberof api.ExportPathfindingScoresResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportPathfindingScoresResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ExportPathfindingScoresResponse"; + }; + + return ExportPathfindingScoresResponse; + })(); + + api.GetBalancesRequest = (function() { + + /** + * Properties of a GetBalancesRequest. + * @memberof api + * @interface IGetBalancesRequest + */ + + /** + * Constructs a new GetBalancesRequest. + * @memberof api + * @classdesc Represents a GetBalancesRequest. + * @implements IGetBalancesRequest + * @constructor + * @param {api.IGetBalancesRequest=} [properties] Properties to set + */ + function GetBalancesRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new GetBalancesRequest instance using the specified properties. + * @function create + * @memberof api.GetBalancesRequest + * @static + * @param {api.IGetBalancesRequest=} [properties] Properties to set + * @returns {api.GetBalancesRequest} GetBalancesRequest instance + */ + GetBalancesRequest.create = function create(properties) { + return new GetBalancesRequest(properties); + }; + + /** + * Encodes the specified GetBalancesRequest message. Does not implicitly {@link api.GetBalancesRequest.verify|verify} messages. + * @function encode + * @memberof api.GetBalancesRequest + * @static + * @param {api.IGetBalancesRequest} message GetBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBalancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GetBalancesRequest message, length delimited. Does not implicitly {@link api.GetBalancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.GetBalancesRequest + * @static + * @param {api.IGetBalancesRequest} message GetBalancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBalancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBalancesRequest message from the specified reader or buffer. + * @function decode + * @memberof api.GetBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.GetBalancesRequest} GetBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBalancesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GetBalancesRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetBalancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.GetBalancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.GetBalancesRequest} GetBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBalancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBalancesRequest message. + * @function verify + * @memberof api.GetBalancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBalancesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a GetBalancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.GetBalancesRequest + * @static + * @param {Object.} object Plain object + * @returns {api.GetBalancesRequest} GetBalancesRequest + */ + GetBalancesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.GetBalancesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.api.GetBalancesRequest(); + }; + + /** + * Creates a plain object from a GetBalancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.GetBalancesRequest + * @static + * @param {api.GetBalancesRequest} message GetBalancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBalancesRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GetBalancesRequest to JSON. + * @function toJSON + * @memberof api.GetBalancesRequest + * @instance + * @returns {Object.} JSON object + */ + GetBalancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBalancesRequest + * @function getTypeUrl + * @memberof api.GetBalancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBalancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GetBalancesRequest"; + }; + + return GetBalancesRequest; + })(); + + api.GetBalancesResponse = (function() { + + /** + * Properties of a GetBalancesResponse. + * @memberof api + * @interface IGetBalancesResponse + * @property {Long|null} [total_onchain_balance_sats] GetBalancesResponse total_onchain_balance_sats + * @property {Long|null} [spendable_onchain_balance_sats] GetBalancesResponse spendable_onchain_balance_sats + * @property {Long|null} [total_anchor_channels_reserve_sats] GetBalancesResponse total_anchor_channels_reserve_sats + * @property {Long|null} [total_lightning_balance_sats] GetBalancesResponse total_lightning_balance_sats + * @property {Array.|null} [lightning_balances] GetBalancesResponse lightning_balances + * @property {Array.|null} [pending_balances_from_channel_closures] GetBalancesResponse pending_balances_from_channel_closures + */ + + /** + * Constructs a new GetBalancesResponse. + * @memberof api + * @classdesc Represents a GetBalancesResponse. + * @implements IGetBalancesResponse + * @constructor + * @param {api.IGetBalancesResponse=} [properties] Properties to set + */ + function GetBalancesResponse(properties) { + this.lightning_balances = []; + this.pending_balances_from_channel_closures = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBalancesResponse total_onchain_balance_sats. + * @member {Long} total_onchain_balance_sats + * @memberof api.GetBalancesResponse + * @instance + */ + GetBalancesResponse.prototype.total_onchain_balance_sats = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetBalancesResponse spendable_onchain_balance_sats. + * @member {Long} spendable_onchain_balance_sats + * @memberof api.GetBalancesResponse + * @instance + */ + GetBalancesResponse.prototype.spendable_onchain_balance_sats = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetBalancesResponse total_anchor_channels_reserve_sats. + * @member {Long} total_anchor_channels_reserve_sats + * @memberof api.GetBalancesResponse + * @instance + */ + GetBalancesResponse.prototype.total_anchor_channels_reserve_sats = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetBalancesResponse total_lightning_balance_sats. + * @member {Long} total_lightning_balance_sats + * @memberof api.GetBalancesResponse + * @instance + */ + GetBalancesResponse.prototype.total_lightning_balance_sats = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetBalancesResponse lightning_balances. + * @member {Array.} lightning_balances + * @memberof api.GetBalancesResponse + * @instance + */ + GetBalancesResponse.prototype.lightning_balances = $util.emptyArray; + + /** + * GetBalancesResponse pending_balances_from_channel_closures. + * @member {Array.} pending_balances_from_channel_closures + * @memberof api.GetBalancesResponse + * @instance + */ + GetBalancesResponse.prototype.pending_balances_from_channel_closures = $util.emptyArray; + + /** + * Creates a new GetBalancesResponse instance using the specified properties. + * @function create + * @memberof api.GetBalancesResponse + * @static + * @param {api.IGetBalancesResponse=} [properties] Properties to set + * @returns {api.GetBalancesResponse} GetBalancesResponse instance + */ + GetBalancesResponse.create = function create(properties) { + return new GetBalancesResponse(properties); + }; + + /** + * Encodes the specified GetBalancesResponse message. Does not implicitly {@link api.GetBalancesResponse.verify|verify} messages. + * @function encode + * @memberof api.GetBalancesResponse + * @static + * @param {api.IGetBalancesResponse} message GetBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBalancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.total_onchain_balance_sats != null && Object.hasOwnProperty.call(message, "total_onchain_balance_sats")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.total_onchain_balance_sats); + if (message.spendable_onchain_balance_sats != null && Object.hasOwnProperty.call(message, "spendable_onchain_balance_sats")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.spendable_onchain_balance_sats); + if (message.total_anchor_channels_reserve_sats != null && Object.hasOwnProperty.call(message, "total_anchor_channels_reserve_sats")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.total_anchor_channels_reserve_sats); + if (message.total_lightning_balance_sats != null && Object.hasOwnProperty.call(message, "total_lightning_balance_sats")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.total_lightning_balance_sats); + if (message.lightning_balances != null && message.lightning_balances.length) + for (let i = 0; i < message.lightning_balances.length; ++i) + $root.types.LightningBalance.encode(message.lightning_balances[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pending_balances_from_channel_closures != null && message.pending_balances_from_channel_closures.length) + for (let i = 0; i < message.pending_balances_from_channel_closures.length; ++i) + $root.types.PendingSweepBalance.encode(message.pending_balances_from_channel_closures[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetBalancesResponse message, length delimited. Does not implicitly {@link api.GetBalancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.GetBalancesResponse + * @static + * @param {api.IGetBalancesResponse} message GetBalancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBalancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBalancesResponse message from the specified reader or buffer. + * @function decode + * @memberof api.GetBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.GetBalancesResponse} GetBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBalancesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GetBalancesResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.total_onchain_balance_sats = reader.uint64(); + break; + } + case 2: { + message.spendable_onchain_balance_sats = reader.uint64(); + break; + } + case 3: { + message.total_anchor_channels_reserve_sats = reader.uint64(); + break; + } + case 4: { + message.total_lightning_balance_sats = reader.uint64(); + break; + } + case 5: { + if (!(message.lightning_balances && message.lightning_balances.length)) + message.lightning_balances = []; + message.lightning_balances.push($root.types.LightningBalance.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 6: { + if (!(message.pending_balances_from_channel_closures && message.pending_balances_from_channel_closures.length)) + message.pending_balances_from_channel_closures = []; + message.pending_balances_from_channel_closures.push($root.types.PendingSweepBalance.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GetBalancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.GetBalancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.GetBalancesResponse} GetBalancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBalancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBalancesResponse message. + * @function verify + * @memberof api.GetBalancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBalancesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.total_onchain_balance_sats != null && message.hasOwnProperty("total_onchain_balance_sats")) + if (!$util.isInteger(message.total_onchain_balance_sats) && !(message.total_onchain_balance_sats && $util.isInteger(message.total_onchain_balance_sats.low) && $util.isInteger(message.total_onchain_balance_sats.high))) + return "total_onchain_balance_sats: integer|Long expected"; + if (message.spendable_onchain_balance_sats != null && message.hasOwnProperty("spendable_onchain_balance_sats")) + if (!$util.isInteger(message.spendable_onchain_balance_sats) && !(message.spendable_onchain_balance_sats && $util.isInteger(message.spendable_onchain_balance_sats.low) && $util.isInteger(message.spendable_onchain_balance_sats.high))) + return "spendable_onchain_balance_sats: integer|Long expected"; + if (message.total_anchor_channels_reserve_sats != null && message.hasOwnProperty("total_anchor_channels_reserve_sats")) + if (!$util.isInteger(message.total_anchor_channels_reserve_sats) && !(message.total_anchor_channels_reserve_sats && $util.isInteger(message.total_anchor_channels_reserve_sats.low) && $util.isInteger(message.total_anchor_channels_reserve_sats.high))) + return "total_anchor_channels_reserve_sats: integer|Long expected"; + if (message.total_lightning_balance_sats != null && message.hasOwnProperty("total_lightning_balance_sats")) + if (!$util.isInteger(message.total_lightning_balance_sats) && !(message.total_lightning_balance_sats && $util.isInteger(message.total_lightning_balance_sats.low) && $util.isInteger(message.total_lightning_balance_sats.high))) + return "total_lightning_balance_sats: integer|Long expected"; + if (message.lightning_balances != null && message.hasOwnProperty("lightning_balances")) { + if (!Array.isArray(message.lightning_balances)) + return "lightning_balances: array expected"; + for (let i = 0; i < message.lightning_balances.length; ++i) { + let error = $root.types.LightningBalance.verify(message.lightning_balances[i], long + 1); + if (error) + return "lightning_balances." + error; + } + } + if (message.pending_balances_from_channel_closures != null && message.hasOwnProperty("pending_balances_from_channel_closures")) { + if (!Array.isArray(message.pending_balances_from_channel_closures)) + return "pending_balances_from_channel_closures: array expected"; + for (let i = 0; i < message.pending_balances_from_channel_closures.length; ++i) { + let error = $root.types.PendingSweepBalance.verify(message.pending_balances_from_channel_closures[i], long + 1); + if (error) + return "pending_balances_from_channel_closures." + error; + } + } + return null; + }; + + /** + * Creates a GetBalancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.GetBalancesResponse + * @static + * @param {Object.} object Plain object + * @returns {api.GetBalancesResponse} GetBalancesResponse + */ + GetBalancesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.GetBalancesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.GetBalancesResponse(); + if (object.total_onchain_balance_sats != null) + if ($util.Long) + (message.total_onchain_balance_sats = $util.Long.fromValue(object.total_onchain_balance_sats)).unsigned = true; + else if (typeof object.total_onchain_balance_sats === "string") + message.total_onchain_balance_sats = parseInt(object.total_onchain_balance_sats, 10); + else if (typeof object.total_onchain_balance_sats === "number") + message.total_onchain_balance_sats = object.total_onchain_balance_sats; + else if (typeof object.total_onchain_balance_sats === "object") + message.total_onchain_balance_sats = new $util.LongBits(object.total_onchain_balance_sats.low >>> 0, object.total_onchain_balance_sats.high >>> 0).toNumber(true); + if (object.spendable_onchain_balance_sats != null) + if ($util.Long) + (message.spendable_onchain_balance_sats = $util.Long.fromValue(object.spendable_onchain_balance_sats)).unsigned = true; + else if (typeof object.spendable_onchain_balance_sats === "string") + message.spendable_onchain_balance_sats = parseInt(object.spendable_onchain_balance_sats, 10); + else if (typeof object.spendable_onchain_balance_sats === "number") + message.spendable_onchain_balance_sats = object.spendable_onchain_balance_sats; + else if (typeof object.spendable_onchain_balance_sats === "object") + message.spendable_onchain_balance_sats = new $util.LongBits(object.spendable_onchain_balance_sats.low >>> 0, object.spendable_onchain_balance_sats.high >>> 0).toNumber(true); + if (object.total_anchor_channels_reserve_sats != null) + if ($util.Long) + (message.total_anchor_channels_reserve_sats = $util.Long.fromValue(object.total_anchor_channels_reserve_sats)).unsigned = true; + else if (typeof object.total_anchor_channels_reserve_sats === "string") + message.total_anchor_channels_reserve_sats = parseInt(object.total_anchor_channels_reserve_sats, 10); + else if (typeof object.total_anchor_channels_reserve_sats === "number") + message.total_anchor_channels_reserve_sats = object.total_anchor_channels_reserve_sats; + else if (typeof object.total_anchor_channels_reserve_sats === "object") + message.total_anchor_channels_reserve_sats = new $util.LongBits(object.total_anchor_channels_reserve_sats.low >>> 0, object.total_anchor_channels_reserve_sats.high >>> 0).toNumber(true); + if (object.total_lightning_balance_sats != null) + if ($util.Long) + (message.total_lightning_balance_sats = $util.Long.fromValue(object.total_lightning_balance_sats)).unsigned = true; + else if (typeof object.total_lightning_balance_sats === "string") + message.total_lightning_balance_sats = parseInt(object.total_lightning_balance_sats, 10); + else if (typeof object.total_lightning_balance_sats === "number") + message.total_lightning_balance_sats = object.total_lightning_balance_sats; + else if (typeof object.total_lightning_balance_sats === "object") + message.total_lightning_balance_sats = new $util.LongBits(object.total_lightning_balance_sats.low >>> 0, object.total_lightning_balance_sats.high >>> 0).toNumber(true); + if (object.lightning_balances) { + if (!Array.isArray(object.lightning_balances)) + throw TypeError(".api.GetBalancesResponse.lightning_balances: array expected"); + message.lightning_balances = []; + for (let i = 0; i < object.lightning_balances.length; ++i) { + if (typeof object.lightning_balances[i] !== "object") + throw TypeError(".api.GetBalancesResponse.lightning_balances: object expected"); + message.lightning_balances[i] = $root.types.LightningBalance.fromObject(object.lightning_balances[i], long + 1); + } + } + if (object.pending_balances_from_channel_closures) { + if (!Array.isArray(object.pending_balances_from_channel_closures)) + throw TypeError(".api.GetBalancesResponse.pending_balances_from_channel_closures: array expected"); + message.pending_balances_from_channel_closures = []; + for (let i = 0; i < object.pending_balances_from_channel_closures.length; ++i) { + if (typeof object.pending_balances_from_channel_closures[i] !== "object") + throw TypeError(".api.GetBalancesResponse.pending_balances_from_channel_closures: object expected"); + message.pending_balances_from_channel_closures[i] = $root.types.PendingSweepBalance.fromObject(object.pending_balances_from_channel_closures[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a GetBalancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.GetBalancesResponse + * @static + * @param {api.GetBalancesResponse} message GetBalancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBalancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.lightning_balances = []; + object.pending_balances_from_channel_closures = []; + } + if (options.defaults) { + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.total_onchain_balance_sats = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.total_onchain_balance_sats = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.spendable_onchain_balance_sats = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.spendable_onchain_balance_sats = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.total_anchor_channels_reserve_sats = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.total_anchor_channels_reserve_sats = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.total_lightning_balance_sats = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.total_lightning_balance_sats = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + } + if (message.total_onchain_balance_sats != null && message.hasOwnProperty("total_onchain_balance_sats")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.total_onchain_balance_sats = typeof message.total_onchain_balance_sats === "number" ? BigInt(message.total_onchain_balance_sats) : $util.Long.fromBits(message.total_onchain_balance_sats.low >>> 0, message.total_onchain_balance_sats.high >>> 0, true).toBigInt(); + else if (typeof message.total_onchain_balance_sats === "number") + object.total_onchain_balance_sats = options.longs === String ? String(message.total_onchain_balance_sats) : message.total_onchain_balance_sats; + else + object.total_onchain_balance_sats = options.longs === String ? $util.Long.prototype.toString.call(message.total_onchain_balance_sats) : options.longs === Number ? new $util.LongBits(message.total_onchain_balance_sats.low >>> 0, message.total_onchain_balance_sats.high >>> 0).toNumber(true) : message.total_onchain_balance_sats; + if (message.spendable_onchain_balance_sats != null && message.hasOwnProperty("spendable_onchain_balance_sats")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.spendable_onchain_balance_sats = typeof message.spendable_onchain_balance_sats === "number" ? BigInt(message.spendable_onchain_balance_sats) : $util.Long.fromBits(message.spendable_onchain_balance_sats.low >>> 0, message.spendable_onchain_balance_sats.high >>> 0, true).toBigInt(); + else if (typeof message.spendable_onchain_balance_sats === "number") + object.spendable_onchain_balance_sats = options.longs === String ? String(message.spendable_onchain_balance_sats) : message.spendable_onchain_balance_sats; + else + object.spendable_onchain_balance_sats = options.longs === String ? $util.Long.prototype.toString.call(message.spendable_onchain_balance_sats) : options.longs === Number ? new $util.LongBits(message.spendable_onchain_balance_sats.low >>> 0, message.spendable_onchain_balance_sats.high >>> 0).toNumber(true) : message.spendable_onchain_balance_sats; + if (message.total_anchor_channels_reserve_sats != null && message.hasOwnProperty("total_anchor_channels_reserve_sats")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.total_anchor_channels_reserve_sats = typeof message.total_anchor_channels_reserve_sats === "number" ? BigInt(message.total_anchor_channels_reserve_sats) : $util.Long.fromBits(message.total_anchor_channels_reserve_sats.low >>> 0, message.total_anchor_channels_reserve_sats.high >>> 0, true).toBigInt(); + else if (typeof message.total_anchor_channels_reserve_sats === "number") + object.total_anchor_channels_reserve_sats = options.longs === String ? String(message.total_anchor_channels_reserve_sats) : message.total_anchor_channels_reserve_sats; + else + object.total_anchor_channels_reserve_sats = options.longs === String ? $util.Long.prototype.toString.call(message.total_anchor_channels_reserve_sats) : options.longs === Number ? new $util.LongBits(message.total_anchor_channels_reserve_sats.low >>> 0, message.total_anchor_channels_reserve_sats.high >>> 0).toNumber(true) : message.total_anchor_channels_reserve_sats; + if (message.total_lightning_balance_sats != null && message.hasOwnProperty("total_lightning_balance_sats")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.total_lightning_balance_sats = typeof message.total_lightning_balance_sats === "number" ? BigInt(message.total_lightning_balance_sats) : $util.Long.fromBits(message.total_lightning_balance_sats.low >>> 0, message.total_lightning_balance_sats.high >>> 0, true).toBigInt(); + else if (typeof message.total_lightning_balance_sats === "number") + object.total_lightning_balance_sats = options.longs === String ? String(message.total_lightning_balance_sats) : message.total_lightning_balance_sats; + else + object.total_lightning_balance_sats = options.longs === String ? $util.Long.prototype.toString.call(message.total_lightning_balance_sats) : options.longs === Number ? new $util.LongBits(message.total_lightning_balance_sats.low >>> 0, message.total_lightning_balance_sats.high >>> 0).toNumber(true) : message.total_lightning_balance_sats; + if (message.lightning_balances && message.lightning_balances.length) { + object.lightning_balances = []; + for (let j = 0; j < message.lightning_balances.length; ++j) + object.lightning_balances[j] = $root.types.LightningBalance.toObject(message.lightning_balances[j], options); + } + if (message.pending_balances_from_channel_closures && message.pending_balances_from_channel_closures.length) { + object.pending_balances_from_channel_closures = []; + for (let j = 0; j < message.pending_balances_from_channel_closures.length; ++j) + object.pending_balances_from_channel_closures[j] = $root.types.PendingSweepBalance.toObject(message.pending_balances_from_channel_closures[j], options); + } + return object; + }; + + /** + * Converts this GetBalancesResponse to JSON. + * @function toJSON + * @memberof api.GetBalancesResponse + * @instance + * @returns {Object.} JSON object + */ + GetBalancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBalancesResponse + * @function getTypeUrl + * @memberof api.GetBalancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBalancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GetBalancesResponse"; + }; + + return GetBalancesResponse; + })(); + + api.ConnectPeerRequest = (function() { + + /** + * Properties of a ConnectPeerRequest. + * @memberof api + * @interface IConnectPeerRequest + * @property {string|null} [node_pubkey] ConnectPeerRequest node_pubkey + * @property {string|null} [address] ConnectPeerRequest address + * @property {boolean|null} [persist] ConnectPeerRequest persist + */ + + /** + * Constructs a new ConnectPeerRequest. + * @memberof api + * @classdesc Represents a ConnectPeerRequest. + * @implements IConnectPeerRequest + * @constructor + * @param {api.IConnectPeerRequest=} [properties] Properties to set + */ + function ConnectPeerRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectPeerRequest node_pubkey. + * @member {string} node_pubkey + * @memberof api.ConnectPeerRequest + * @instance + */ + ConnectPeerRequest.prototype.node_pubkey = ""; + + /** + * ConnectPeerRequest address. + * @member {string} address + * @memberof api.ConnectPeerRequest + * @instance + */ + ConnectPeerRequest.prototype.address = ""; + + /** + * ConnectPeerRequest persist. + * @member {boolean} persist + * @memberof api.ConnectPeerRequest + * @instance + */ + ConnectPeerRequest.prototype.persist = false; + + /** + * Creates a new ConnectPeerRequest instance using the specified properties. + * @function create + * @memberof api.ConnectPeerRequest + * @static + * @param {api.IConnectPeerRequest=} [properties] Properties to set + * @returns {api.ConnectPeerRequest} ConnectPeerRequest instance + */ + ConnectPeerRequest.create = function create(properties) { + return new ConnectPeerRequest(properties); + }; + + /** + * Encodes the specified ConnectPeerRequest message. Does not implicitly {@link api.ConnectPeerRequest.verify|verify} messages. + * @function encode + * @memberof api.ConnectPeerRequest + * @static + * @param {api.IConnectPeerRequest} message ConnectPeerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectPeerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.node_pubkey != null && Object.hasOwnProperty.call(message, "node_pubkey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.node_pubkey); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.address); + if (message.persist != null && Object.hasOwnProperty.call(message, "persist")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.persist); + return writer; + }; + + /** + * Encodes the specified ConnectPeerRequest message, length delimited. Does not implicitly {@link api.ConnectPeerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.ConnectPeerRequest + * @static + * @param {api.IConnectPeerRequest} message ConnectPeerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectPeerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectPeerRequest message from the specified reader or buffer. + * @function decode + * @memberof api.ConnectPeerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.ConnectPeerRequest} ConnectPeerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectPeerRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ConnectPeerRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.node_pubkey = reader.string(); + break; + } + case 2: { + message.address = reader.string(); + break; + } + case 3: { + message.persist = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectPeerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.ConnectPeerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.ConnectPeerRequest} ConnectPeerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectPeerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectPeerRequest message. + * @function verify + * @memberof api.ConnectPeerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectPeerRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.node_pubkey != null && message.hasOwnProperty("node_pubkey")) + if (!$util.isString(message.node_pubkey)) + return "node_pubkey: string expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.persist != null && message.hasOwnProperty("persist")) + if (typeof message.persist !== "boolean") + return "persist: boolean expected"; + return null; + }; + + /** + * Creates a ConnectPeerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.ConnectPeerRequest + * @static + * @param {Object.} object Plain object + * @returns {api.ConnectPeerRequest} ConnectPeerRequest + */ + ConnectPeerRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.ConnectPeerRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.ConnectPeerRequest(); + if (object.node_pubkey != null) + message.node_pubkey = String(object.node_pubkey); + if (object.address != null) + message.address = String(object.address); + if (object.persist != null) + message.persist = Boolean(object.persist); + return message; + }; + + /** + * Creates a plain object from a ConnectPeerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.ConnectPeerRequest + * @static + * @param {api.ConnectPeerRequest} message ConnectPeerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectPeerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.node_pubkey = ""; + object.address = ""; + object.persist = false; + } + if (message.node_pubkey != null && message.hasOwnProperty("node_pubkey")) + object.node_pubkey = message.node_pubkey; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.persist != null && message.hasOwnProperty("persist")) + object.persist = message.persist; + return object; + }; + + /** + * Converts this ConnectPeerRequest to JSON. + * @function toJSON + * @memberof api.ConnectPeerRequest + * @instance + * @returns {Object.} JSON object + */ + ConnectPeerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectPeerRequest + * @function getTypeUrl + * @memberof api.ConnectPeerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectPeerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ConnectPeerRequest"; + }; + + return ConnectPeerRequest; + })(); + + api.ConnectPeerResponse = (function() { + + /** + * Properties of a ConnectPeerResponse. + * @memberof api + * @interface IConnectPeerResponse + */ + + /** + * Constructs a new ConnectPeerResponse. + * @memberof api + * @classdesc Represents a ConnectPeerResponse. + * @implements IConnectPeerResponse + * @constructor + * @param {api.IConnectPeerResponse=} [properties] Properties to set + */ + function ConnectPeerResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ConnectPeerResponse instance using the specified properties. + * @function create + * @memberof api.ConnectPeerResponse + * @static + * @param {api.IConnectPeerResponse=} [properties] Properties to set + * @returns {api.ConnectPeerResponse} ConnectPeerResponse instance + */ + ConnectPeerResponse.create = function create(properties) { + return new ConnectPeerResponse(properties); + }; + + /** + * Encodes the specified ConnectPeerResponse message. Does not implicitly {@link api.ConnectPeerResponse.verify|verify} messages. + * @function encode + * @memberof api.ConnectPeerResponse + * @static + * @param {api.IConnectPeerResponse} message ConnectPeerResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectPeerResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ConnectPeerResponse message, length delimited. Does not implicitly {@link api.ConnectPeerResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.ConnectPeerResponse + * @static + * @param {api.IConnectPeerResponse} message ConnectPeerResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectPeerResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectPeerResponse message from the specified reader or buffer. + * @function decode + * @memberof api.ConnectPeerResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.ConnectPeerResponse} ConnectPeerResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectPeerResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ConnectPeerResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectPeerResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.ConnectPeerResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.ConnectPeerResponse} ConnectPeerResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectPeerResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectPeerResponse message. + * @function verify + * @memberof api.ConnectPeerResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectPeerResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a ConnectPeerResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.ConnectPeerResponse + * @static + * @param {Object.} object Plain object + * @returns {api.ConnectPeerResponse} ConnectPeerResponse + */ + ConnectPeerResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.ConnectPeerResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.api.ConnectPeerResponse(); + }; + + /** + * Creates a plain object from a ConnectPeerResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.ConnectPeerResponse + * @static + * @param {api.ConnectPeerResponse} message ConnectPeerResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectPeerResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ConnectPeerResponse to JSON. + * @function toJSON + * @memberof api.ConnectPeerResponse + * @instance + * @returns {Object.} JSON object + */ + ConnectPeerResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectPeerResponse + * @function getTypeUrl + * @memberof api.ConnectPeerResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectPeerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ConnectPeerResponse"; + }; + + return ConnectPeerResponse; + })(); + + api.DisconnectPeerRequest = (function() { + + /** + * Properties of a DisconnectPeerRequest. + * @memberof api + * @interface IDisconnectPeerRequest + * @property {string|null} [node_pubkey] DisconnectPeerRequest node_pubkey + */ + + /** + * Constructs a new DisconnectPeerRequest. + * @memberof api + * @classdesc Represents a DisconnectPeerRequest. + * @implements IDisconnectPeerRequest + * @constructor + * @param {api.IDisconnectPeerRequest=} [properties] Properties to set + */ + function DisconnectPeerRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisconnectPeerRequest node_pubkey. + * @member {string} node_pubkey + * @memberof api.DisconnectPeerRequest + * @instance + */ + DisconnectPeerRequest.prototype.node_pubkey = ""; + + /** + * Creates a new DisconnectPeerRequest instance using the specified properties. + * @function create + * @memberof api.DisconnectPeerRequest + * @static + * @param {api.IDisconnectPeerRequest=} [properties] Properties to set + * @returns {api.DisconnectPeerRequest} DisconnectPeerRequest instance + */ + DisconnectPeerRequest.create = function create(properties) { + return new DisconnectPeerRequest(properties); + }; + + /** + * Encodes the specified DisconnectPeerRequest message. Does not implicitly {@link api.DisconnectPeerRequest.verify|verify} messages. + * @function encode + * @memberof api.DisconnectPeerRequest + * @static + * @param {api.IDisconnectPeerRequest} message DisconnectPeerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisconnectPeerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.node_pubkey != null && Object.hasOwnProperty.call(message, "node_pubkey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.node_pubkey); + return writer; + }; + + /** + * Encodes the specified DisconnectPeerRequest message, length delimited. Does not implicitly {@link api.DisconnectPeerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.DisconnectPeerRequest + * @static + * @param {api.IDisconnectPeerRequest} message DisconnectPeerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisconnectPeerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisconnectPeerRequest message from the specified reader or buffer. + * @function decode + * @memberof api.DisconnectPeerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.DisconnectPeerRequest} DisconnectPeerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisconnectPeerRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.DisconnectPeerRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.node_pubkey = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DisconnectPeerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.DisconnectPeerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.DisconnectPeerRequest} DisconnectPeerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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 api.DisconnectPeerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisconnectPeerRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.node_pubkey != null && message.hasOwnProperty("node_pubkey")) + if (!$util.isString(message.node_pubkey)) + return "node_pubkey: string expected"; + return null; + }; + + /** + * Creates a DisconnectPeerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.DisconnectPeerRequest + * @static + * @param {Object.} object Plain object + * @returns {api.DisconnectPeerRequest} DisconnectPeerRequest + */ + DisconnectPeerRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.DisconnectPeerRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.DisconnectPeerRequest(); + if (object.node_pubkey != null) + message.node_pubkey = String(object.node_pubkey); + return message; + }; + + /** + * Creates a plain object from a DisconnectPeerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.DisconnectPeerRequest + * @static + * @param {api.DisconnectPeerRequest} message DisconnectPeerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisconnectPeerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.node_pubkey = ""; + if (message.node_pubkey != null && message.hasOwnProperty("node_pubkey")) + object.node_pubkey = message.node_pubkey; + return object; + }; + + /** + * Converts this DisconnectPeerRequest to JSON. + * @function toJSON + * @memberof api.DisconnectPeerRequest + * @instance + * @returns {Object.} JSON object + */ + DisconnectPeerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisconnectPeerRequest + * @function getTypeUrl + * @memberof api.DisconnectPeerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisconnectPeerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.DisconnectPeerRequest"; + }; + + return DisconnectPeerRequest; + })(); + + api.DisconnectPeerResponse = (function() { + + /** + * Properties of a DisconnectPeerResponse. + * @memberof api + * @interface IDisconnectPeerResponse + */ + + /** + * Constructs a new DisconnectPeerResponse. + * @memberof api + * @classdesc Represents a DisconnectPeerResponse. + * @implements IDisconnectPeerResponse + * @constructor + * @param {api.IDisconnectPeerResponse=} [properties] Properties to set + */ + function DisconnectPeerResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new DisconnectPeerResponse instance using the specified properties. + * @function create + * @memberof api.DisconnectPeerResponse + * @static + * @param {api.IDisconnectPeerResponse=} [properties] Properties to set + * @returns {api.DisconnectPeerResponse} DisconnectPeerResponse instance + */ + DisconnectPeerResponse.create = function create(properties) { + return new DisconnectPeerResponse(properties); + }; + + /** + * Encodes the specified DisconnectPeerResponse message. Does not implicitly {@link api.DisconnectPeerResponse.verify|verify} messages. + * @function encode + * @memberof api.DisconnectPeerResponse + * @static + * @param {api.IDisconnectPeerResponse} message DisconnectPeerResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisconnectPeerResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DisconnectPeerResponse message, length delimited. Does not implicitly {@link api.DisconnectPeerResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.DisconnectPeerResponse + * @static + * @param {api.IDisconnectPeerResponse} message DisconnectPeerResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisconnectPeerResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisconnectPeerResponse message from the specified reader or buffer. + * @function decode + * @memberof api.DisconnectPeerResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.DisconnectPeerResponse} DisconnectPeerResponse + * @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, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.DisconnectPeerResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DisconnectPeerResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.DisconnectPeerResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.DisconnectPeerResponse} DisconnectPeerResponse + * @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) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisconnectPeerResponse message. + * @function verify + * @memberof api.DisconnectPeerResponse + * @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, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a DisconnectPeerResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.DisconnectPeerResponse + * @static + * @param {Object.} object Plain object + * @returns {api.DisconnectPeerResponse} DisconnectPeerResponse + */ + DisconnectPeerResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.DisconnectPeerResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.api.DisconnectPeerResponse(); + }; + + /** + * Creates a plain object from a DisconnectPeerResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.DisconnectPeerResponse + * @static + * @param {api.DisconnectPeerResponse} message DisconnectPeerResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisconnectPeerResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DisconnectPeerResponse to JSON. + * @function toJSON + * @memberof api.DisconnectPeerResponse + * @instance + * @returns {Object.} JSON object + */ + DisconnectPeerResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisconnectPeerResponse + * @function getTypeUrl + * @memberof api.DisconnectPeerResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisconnectPeerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.DisconnectPeerResponse"; + }; + + return DisconnectPeerResponse; + })(); + + api.ListPeersRequest = (function() { + + /** + * Properties of a ListPeersRequest. + * @memberof api + * @interface IListPeersRequest + */ + + /** + * Constructs a new ListPeersRequest. + * @memberof api + * @classdesc Represents a ListPeersRequest. + * @implements IListPeersRequest + * @constructor + * @param {api.IListPeersRequest=} [properties] Properties to set + */ + function ListPeersRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new ListPeersRequest instance using the specified properties. + * @function create + * @memberof api.ListPeersRequest + * @static + * @param {api.IListPeersRequest=} [properties] Properties to set + * @returns {api.ListPeersRequest} ListPeersRequest instance + */ + ListPeersRequest.create = function create(properties) { + return new ListPeersRequest(properties); + }; + + /** + * Encodes the specified ListPeersRequest message. Does not implicitly {@link api.ListPeersRequest.verify|verify} messages. + * @function encode + * @memberof api.ListPeersRequest + * @static + * @param {api.IListPeersRequest} message ListPeersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPeersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ListPeersRequest message, length delimited. Does not implicitly {@link api.ListPeersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.ListPeersRequest + * @static + * @param {api.IListPeersRequest} message ListPeersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPeersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPeersRequest message from the specified reader or buffer. + * @function decode + * @memberof api.ListPeersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.ListPeersRequest} ListPeersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPeersRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ListPeersRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListPeersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.ListPeersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.ListPeersRequest} ListPeersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPeersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPeersRequest message. + * @function verify + * @memberof api.ListPeersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPeersRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a ListPeersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.ListPeersRequest + * @static + * @param {Object.} object Plain object + * @returns {api.ListPeersRequest} ListPeersRequest + */ + ListPeersRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.ListPeersRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.api.ListPeersRequest(); + }; + + /** + * Creates a plain object from a ListPeersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.ListPeersRequest + * @static + * @param {api.ListPeersRequest} message ListPeersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPeersRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ListPeersRequest to JSON. + * @function toJSON + * @memberof api.ListPeersRequest + * @instance + * @returns {Object.} JSON object + */ + ListPeersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPeersRequest + * @function getTypeUrl + * @memberof api.ListPeersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPeersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ListPeersRequest"; + }; + + return ListPeersRequest; + })(); + + api.ListPeersResponse = (function() { + + /** + * Properties of a ListPeersResponse. + * @memberof api + * @interface IListPeersResponse + * @property {Array.|null} [peers] ListPeersResponse peers + */ + + /** + * Constructs a new ListPeersResponse. + * @memberof api + * @classdesc Represents a ListPeersResponse. + * @implements IListPeersResponse + * @constructor + * @param {api.IListPeersResponse=} [properties] Properties to set + */ + function ListPeersResponse(properties) { + this.peers = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPeersResponse peers. + * @member {Array.} peers + * @memberof api.ListPeersResponse + * @instance + */ + ListPeersResponse.prototype.peers = $util.emptyArray; + + /** + * Creates a new ListPeersResponse instance using the specified properties. + * @function create + * @memberof api.ListPeersResponse + * @static + * @param {api.IListPeersResponse=} [properties] Properties to set + * @returns {api.ListPeersResponse} ListPeersResponse instance + */ + ListPeersResponse.create = function create(properties) { + return new ListPeersResponse(properties); + }; + + /** + * Encodes the specified ListPeersResponse message. Does not implicitly {@link api.ListPeersResponse.verify|verify} messages. + * @function encode + * @memberof api.ListPeersResponse + * @static + * @param {api.IListPeersResponse} message ListPeersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPeersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.peers != null && message.peers.length) + for (let i = 0; i < message.peers.length; ++i) + $root.types.Peer.encode(message.peers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListPeersResponse message, length delimited. Does not implicitly {@link api.ListPeersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.ListPeersResponse + * @static + * @param {api.IListPeersResponse} message ListPeersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPeersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPeersResponse message from the specified reader or buffer. + * @function decode + * @memberof api.ListPeersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.ListPeersResponse} ListPeersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPeersResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ListPeersResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.peers && message.peers.length)) + message.peers = []; + message.peers.push($root.types.Peer.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ListPeersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.ListPeersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.ListPeersResponse} ListPeersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPeersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPeersResponse message. + * @function verify + * @memberof api.ListPeersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPeersResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + 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) { + let error = $root.types.Peer.verify(message.peers[i], long + 1); + if (error) + return "peers." + error; + } + } + return null; + }; + + /** + * Creates a ListPeersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.ListPeersResponse + * @static + * @param {Object.} object Plain object + * @returns {api.ListPeersResponse} ListPeersResponse + */ + ListPeersResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.ListPeersResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.ListPeersResponse(); + if (object.peers) { + if (!Array.isArray(object.peers)) + throw TypeError(".api.ListPeersResponse.peers: array expected"); + message.peers = []; + for (let i = 0; i < object.peers.length; ++i) { + if (typeof object.peers[i] !== "object") + throw TypeError(".api.ListPeersResponse.peers: object expected"); + message.peers[i] = $root.types.Peer.fromObject(object.peers[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a ListPeersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.ListPeersResponse + * @static + * @param {api.ListPeersResponse} message ListPeersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPeersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.peers = []; + if (message.peers && message.peers.length) { + object.peers = []; + for (let j = 0; j < message.peers.length; ++j) + object.peers[j] = $root.types.Peer.toObject(message.peers[j], options); + } + return object; + }; + + /** + * Converts this ListPeersResponse to JSON. + * @function toJSON + * @memberof api.ListPeersResponse + * @instance + * @returns {Object.} JSON object + */ + ListPeersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPeersResponse + * @function getTypeUrl + * @memberof api.ListPeersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPeersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ListPeersResponse"; + }; + + return ListPeersResponse; + })(); + + api.GraphListChannelsRequest = (function() { + + /** + * Properties of a GraphListChannelsRequest. + * @memberof api + * @interface IGraphListChannelsRequest + */ + + /** + * Constructs a new GraphListChannelsRequest. + * @memberof api + * @classdesc Represents a GraphListChannelsRequest. + * @implements IGraphListChannelsRequest + * @constructor + * @param {api.IGraphListChannelsRequest=} [properties] Properties to set + */ + function GraphListChannelsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new GraphListChannelsRequest instance using the specified properties. + * @function create + * @memberof api.GraphListChannelsRequest + * @static + * @param {api.IGraphListChannelsRequest=} [properties] Properties to set + * @returns {api.GraphListChannelsRequest} GraphListChannelsRequest instance + */ + GraphListChannelsRequest.create = function create(properties) { + return new GraphListChannelsRequest(properties); + }; + + /** + * Encodes the specified GraphListChannelsRequest message. Does not implicitly {@link api.GraphListChannelsRequest.verify|verify} messages. + * @function encode + * @memberof api.GraphListChannelsRequest + * @static + * @param {api.IGraphListChannelsRequest} message GraphListChannelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphListChannelsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GraphListChannelsRequest message, length delimited. Does not implicitly {@link api.GraphListChannelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.GraphListChannelsRequest + * @static + * @param {api.IGraphListChannelsRequest} message GraphListChannelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphListChannelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GraphListChannelsRequest message from the specified reader or buffer. + * @function decode + * @memberof api.GraphListChannelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.GraphListChannelsRequest} GraphListChannelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphListChannelsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GraphListChannelsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GraphListChannelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.GraphListChannelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.GraphListChannelsRequest} GraphListChannelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphListChannelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GraphListChannelsRequest message. + * @function verify + * @memberof api.GraphListChannelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GraphListChannelsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a GraphListChannelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.GraphListChannelsRequest + * @static + * @param {Object.} object Plain object + * @returns {api.GraphListChannelsRequest} GraphListChannelsRequest + */ + GraphListChannelsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.GraphListChannelsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.api.GraphListChannelsRequest(); + }; + + /** + * Creates a plain object from a GraphListChannelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.GraphListChannelsRequest + * @static + * @param {api.GraphListChannelsRequest} message GraphListChannelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GraphListChannelsRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GraphListChannelsRequest to JSON. + * @function toJSON + * @memberof api.GraphListChannelsRequest + * @instance + * @returns {Object.} JSON object + */ + GraphListChannelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GraphListChannelsRequest + * @function getTypeUrl + * @memberof api.GraphListChannelsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphListChannelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GraphListChannelsRequest"; + }; + + return GraphListChannelsRequest; + })(); + + api.GraphListChannelsResponse = (function() { + + /** + * Properties of a GraphListChannelsResponse. + * @memberof api + * @interface IGraphListChannelsResponse + * @property {Array.|null} [short_channel_ids] GraphListChannelsResponse short_channel_ids + */ + + /** + * Constructs a new GraphListChannelsResponse. + * @memberof api + * @classdesc Represents a GraphListChannelsResponse. + * @implements IGraphListChannelsResponse + * @constructor + * @param {api.IGraphListChannelsResponse=} [properties] Properties to set + */ + function GraphListChannelsResponse(properties) { + this.short_channel_ids = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphListChannelsResponse short_channel_ids. + * @member {Array.} short_channel_ids + * @memberof api.GraphListChannelsResponse + * @instance + */ + GraphListChannelsResponse.prototype.short_channel_ids = $util.emptyArray; + + /** + * Creates a new GraphListChannelsResponse instance using the specified properties. + * @function create + * @memberof api.GraphListChannelsResponse + * @static + * @param {api.IGraphListChannelsResponse=} [properties] Properties to set + * @returns {api.GraphListChannelsResponse} GraphListChannelsResponse instance + */ + GraphListChannelsResponse.create = function create(properties) { + return new GraphListChannelsResponse(properties); + }; + + /** + * Encodes the specified GraphListChannelsResponse message. Does not implicitly {@link api.GraphListChannelsResponse.verify|verify} messages. + * @function encode + * @memberof api.GraphListChannelsResponse + * @static + * @param {api.IGraphListChannelsResponse} message GraphListChannelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphListChannelsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.short_channel_ids != null && message.short_channel_ids.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (let i = 0; i < message.short_channel_ids.length; ++i) + writer.uint64(message.short_channel_ids[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified GraphListChannelsResponse message, length delimited. Does not implicitly {@link api.GraphListChannelsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.GraphListChannelsResponse + * @static + * @param {api.IGraphListChannelsResponse} message GraphListChannelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphListChannelsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GraphListChannelsResponse message from the specified reader or buffer. + * @function decode + * @memberof api.GraphListChannelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.GraphListChannelsResponse} GraphListChannelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphListChannelsResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GraphListChannelsResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.short_channel_ids && message.short_channel_ids.length)) + message.short_channel_ids = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.short_channel_ids.push(reader.uint64()); + } else + message.short_channel_ids.push(reader.uint64()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GraphListChannelsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.GraphListChannelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.GraphListChannelsResponse} GraphListChannelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphListChannelsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GraphListChannelsResponse message. + * @function verify + * @memberof api.GraphListChannelsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GraphListChannelsResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.short_channel_ids != null && message.hasOwnProperty("short_channel_ids")) { + if (!Array.isArray(message.short_channel_ids)) + return "short_channel_ids: array expected"; + for (let i = 0; i < message.short_channel_ids.length; ++i) + if (!$util.isInteger(message.short_channel_ids[i]) && !(message.short_channel_ids[i] && $util.isInteger(message.short_channel_ids[i].low) && $util.isInteger(message.short_channel_ids[i].high))) + return "short_channel_ids: integer|Long[] expected"; + } + return null; + }; + + /** + * Creates a GraphListChannelsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.GraphListChannelsResponse + * @static + * @param {Object.} object Plain object + * @returns {api.GraphListChannelsResponse} GraphListChannelsResponse + */ + GraphListChannelsResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.GraphListChannelsResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.GraphListChannelsResponse(); + if (object.short_channel_ids) { + if (!Array.isArray(object.short_channel_ids)) + throw TypeError(".api.GraphListChannelsResponse.short_channel_ids: array expected"); + message.short_channel_ids = []; + for (let i = 0; i < object.short_channel_ids.length; ++i) + if ($util.Long) + (message.short_channel_ids[i] = $util.Long.fromValue(object.short_channel_ids[i])).unsigned = true; + else if (typeof object.short_channel_ids[i] === "string") + message.short_channel_ids[i] = parseInt(object.short_channel_ids[i], 10); + else if (typeof object.short_channel_ids[i] === "number") + message.short_channel_ids[i] = object.short_channel_ids[i]; + else if (typeof object.short_channel_ids[i] === "object") + message.short_channel_ids[i] = new $util.LongBits(object.short_channel_ids[i].low >>> 0, object.short_channel_ids[i].high >>> 0).toNumber(true); + } + return message; + }; + + /** + * Creates a plain object from a GraphListChannelsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.GraphListChannelsResponse + * @static + * @param {api.GraphListChannelsResponse} message GraphListChannelsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GraphListChannelsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.short_channel_ids = []; + if (message.short_channel_ids && message.short_channel_ids.length) { + object.short_channel_ids = []; + for (let j = 0; j < message.short_channel_ids.length; ++j) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.short_channel_ids[j] = typeof message.short_channel_ids[j] === "number" ? BigInt(message.short_channel_ids[j]) : $util.Long.fromBits(message.short_channel_ids[j].low >>> 0, message.short_channel_ids[j].high >>> 0, true).toBigInt(); + else if (typeof message.short_channel_ids[j] === "number") + object.short_channel_ids[j] = options.longs === String ? String(message.short_channel_ids[j]) : message.short_channel_ids[j]; + else + object.short_channel_ids[j] = options.longs === String ? $util.Long.prototype.toString.call(message.short_channel_ids[j]) : options.longs === Number ? new $util.LongBits(message.short_channel_ids[j].low >>> 0, message.short_channel_ids[j].high >>> 0).toNumber(true) : message.short_channel_ids[j]; + } + return object; + }; + + /** + * Converts this GraphListChannelsResponse to JSON. + * @function toJSON + * @memberof api.GraphListChannelsResponse + * @instance + * @returns {Object.} JSON object + */ + GraphListChannelsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GraphListChannelsResponse + * @function getTypeUrl + * @memberof api.GraphListChannelsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphListChannelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GraphListChannelsResponse"; + }; + + return GraphListChannelsResponse; + })(); + + api.GraphGetChannelRequest = (function() { + + /** + * Properties of a GraphGetChannelRequest. + * @memberof api + * @interface IGraphGetChannelRequest + * @property {Long|null} [short_channel_id] GraphGetChannelRequest short_channel_id + */ + + /** + * Constructs a new GraphGetChannelRequest. + * @memberof api + * @classdesc Represents a GraphGetChannelRequest. + * @implements IGraphGetChannelRequest + * @constructor + * @param {api.IGraphGetChannelRequest=} [properties] Properties to set + */ + function GraphGetChannelRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphGetChannelRequest short_channel_id. + * @member {Long} short_channel_id + * @memberof api.GraphGetChannelRequest + * @instance + */ + GraphGetChannelRequest.prototype.short_channel_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new GraphGetChannelRequest instance using the specified properties. + * @function create + * @memberof api.GraphGetChannelRequest + * @static + * @param {api.IGraphGetChannelRequest=} [properties] Properties to set + * @returns {api.GraphGetChannelRequest} GraphGetChannelRequest instance + */ + GraphGetChannelRequest.create = function create(properties) { + return new GraphGetChannelRequest(properties); + }; + + /** + * Encodes the specified GraphGetChannelRequest message. Does not implicitly {@link api.GraphGetChannelRequest.verify|verify} messages. + * @function encode + * @memberof api.GraphGetChannelRequest + * @static + * @param {api.IGraphGetChannelRequest} message GraphGetChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphGetChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.short_channel_id != null && Object.hasOwnProperty.call(message, "short_channel_id")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.short_channel_id); + return writer; + }; + + /** + * Encodes the specified GraphGetChannelRequest message, length delimited. Does not implicitly {@link api.GraphGetChannelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.GraphGetChannelRequest + * @static + * @param {api.IGraphGetChannelRequest} message GraphGetChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphGetChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GraphGetChannelRequest message from the specified reader or buffer. + * @function decode + * @memberof api.GraphGetChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.GraphGetChannelRequest} GraphGetChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphGetChannelRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GraphGetChannelRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.short_channel_id = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GraphGetChannelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.GraphGetChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.GraphGetChannelRequest} GraphGetChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphGetChannelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GraphGetChannelRequest message. + * @function verify + * @memberof api.GraphGetChannelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GraphGetChannelRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.short_channel_id != null && message.hasOwnProperty("short_channel_id")) + if (!$util.isInteger(message.short_channel_id) && !(message.short_channel_id && $util.isInteger(message.short_channel_id.low) && $util.isInteger(message.short_channel_id.high))) + return "short_channel_id: integer|Long expected"; + return null; + }; + + /** + * Creates a GraphGetChannelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.GraphGetChannelRequest + * @static + * @param {Object.} object Plain object + * @returns {api.GraphGetChannelRequest} GraphGetChannelRequest + */ + GraphGetChannelRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.GraphGetChannelRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.GraphGetChannelRequest(); + if (object.short_channel_id != null) + if ($util.Long) + (message.short_channel_id = $util.Long.fromValue(object.short_channel_id)).unsigned = true; + else if (typeof object.short_channel_id === "string") + message.short_channel_id = parseInt(object.short_channel_id, 10); + else if (typeof object.short_channel_id === "number") + message.short_channel_id = object.short_channel_id; + else if (typeof object.short_channel_id === "object") + message.short_channel_id = new $util.LongBits(object.short_channel_id.low >>> 0, object.short_channel_id.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a GraphGetChannelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.GraphGetChannelRequest + * @static + * @param {api.GraphGetChannelRequest} message GraphGetChannelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GraphGetChannelRequest.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.short_channel_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.short_channel_id = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if (message.short_channel_id != null && message.hasOwnProperty("short_channel_id")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.short_channel_id = typeof message.short_channel_id === "number" ? BigInt(message.short_channel_id) : $util.Long.fromBits(message.short_channel_id.low >>> 0, message.short_channel_id.high >>> 0, true).toBigInt(); + else if (typeof message.short_channel_id === "number") + object.short_channel_id = options.longs === String ? String(message.short_channel_id) : message.short_channel_id; + else + object.short_channel_id = options.longs === String ? $util.Long.prototype.toString.call(message.short_channel_id) : options.longs === Number ? new $util.LongBits(message.short_channel_id.low >>> 0, message.short_channel_id.high >>> 0).toNumber(true) : message.short_channel_id; + return object; + }; + + /** + * Converts this GraphGetChannelRequest to JSON. + * @function toJSON + * @memberof api.GraphGetChannelRequest + * @instance + * @returns {Object.} JSON object + */ + GraphGetChannelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GraphGetChannelRequest + * @function getTypeUrl + * @memberof api.GraphGetChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphGetChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GraphGetChannelRequest"; + }; + + return GraphGetChannelRequest; + })(); + + api.GraphGetChannelResponse = (function() { + + /** + * Properties of a GraphGetChannelResponse. + * @memberof api + * @interface IGraphGetChannelResponse + * @property {types.IGraphChannel|null} [channel] GraphGetChannelResponse channel + */ + + /** + * Constructs a new GraphGetChannelResponse. + * @memberof api + * @classdesc Represents a GraphGetChannelResponse. + * @implements IGraphGetChannelResponse + * @constructor + * @param {api.IGraphGetChannelResponse=} [properties] Properties to set + */ + function GraphGetChannelResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphGetChannelResponse channel. + * @member {types.IGraphChannel|null|undefined} channel + * @memberof api.GraphGetChannelResponse + * @instance + */ + GraphGetChannelResponse.prototype.channel = null; + + /** + * Creates a new GraphGetChannelResponse instance using the specified properties. + * @function create + * @memberof api.GraphGetChannelResponse + * @static + * @param {api.IGraphGetChannelResponse=} [properties] Properties to set + * @returns {api.GraphGetChannelResponse} GraphGetChannelResponse instance + */ + GraphGetChannelResponse.create = function create(properties) { + return new GraphGetChannelResponse(properties); + }; + + /** + * Encodes the specified GraphGetChannelResponse message. Does not implicitly {@link api.GraphGetChannelResponse.verify|verify} messages. + * @function encode + * @memberof api.GraphGetChannelResponse + * @static + * @param {api.IGraphGetChannelResponse} message GraphGetChannelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphGetChannelResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channel != null && Object.hasOwnProperty.call(message, "channel")) + $root.types.GraphChannel.encode(message.channel, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GraphGetChannelResponse message, length delimited. Does not implicitly {@link api.GraphGetChannelResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.GraphGetChannelResponse + * @static + * @param {api.IGraphGetChannelResponse} message GraphGetChannelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphGetChannelResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GraphGetChannelResponse message from the specified reader or buffer. + * @function decode + * @memberof api.GraphGetChannelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.GraphGetChannelResponse} GraphGetChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphGetChannelResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GraphGetChannelResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.channel = $root.types.GraphChannel.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GraphGetChannelResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.GraphGetChannelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.GraphGetChannelResponse} GraphGetChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphGetChannelResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GraphGetChannelResponse message. + * @function verify + * @memberof api.GraphGetChannelResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GraphGetChannelResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.channel != null && message.hasOwnProperty("channel")) { + let error = $root.types.GraphChannel.verify(message.channel, long + 1); + if (error) + return "channel." + error; + } + return null; + }; + + /** + * Creates a GraphGetChannelResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.GraphGetChannelResponse + * @static + * @param {Object.} object Plain object + * @returns {api.GraphGetChannelResponse} GraphGetChannelResponse + */ + GraphGetChannelResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.GraphGetChannelResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.GraphGetChannelResponse(); + if (object.channel != null) { + if (typeof object.channel !== "object") + throw TypeError(".api.GraphGetChannelResponse.channel: object expected"); + message.channel = $root.types.GraphChannel.fromObject(object.channel, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a GraphGetChannelResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.GraphGetChannelResponse + * @static + * @param {api.GraphGetChannelResponse} message GraphGetChannelResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GraphGetChannelResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.channel = null; + if (message.channel != null && message.hasOwnProperty("channel")) + object.channel = $root.types.GraphChannel.toObject(message.channel, options); + return object; + }; + + /** + * Converts this GraphGetChannelResponse to JSON. + * @function toJSON + * @memberof api.GraphGetChannelResponse + * @instance + * @returns {Object.} JSON object + */ + GraphGetChannelResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GraphGetChannelResponse + * @function getTypeUrl + * @memberof api.GraphGetChannelResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphGetChannelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GraphGetChannelResponse"; + }; + + return GraphGetChannelResponse; + })(); + + api.GraphListNodesRequest = (function() { + + /** + * Properties of a GraphListNodesRequest. + * @memberof api + * @interface IGraphListNodesRequest + */ + + /** + * Constructs a new GraphListNodesRequest. + * @memberof api + * @classdesc Represents a GraphListNodesRequest. + * @implements IGraphListNodesRequest + * @constructor + * @param {api.IGraphListNodesRequest=} [properties] Properties to set + */ + function GraphListNodesRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new GraphListNodesRequest instance using the specified properties. + * @function create + * @memberof api.GraphListNodesRequest + * @static + * @param {api.IGraphListNodesRequest=} [properties] Properties to set + * @returns {api.GraphListNodesRequest} GraphListNodesRequest instance + */ + GraphListNodesRequest.create = function create(properties) { + return new GraphListNodesRequest(properties); + }; + + /** + * Encodes the specified GraphListNodesRequest message. Does not implicitly {@link api.GraphListNodesRequest.verify|verify} messages. + * @function encode + * @memberof api.GraphListNodesRequest + * @static + * @param {api.IGraphListNodesRequest} message GraphListNodesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphListNodesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GraphListNodesRequest message, length delimited. Does not implicitly {@link api.GraphListNodesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.GraphListNodesRequest + * @static + * @param {api.IGraphListNodesRequest} message GraphListNodesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphListNodesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GraphListNodesRequest message from the specified reader or buffer. + * @function decode + * @memberof api.GraphListNodesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.GraphListNodesRequest} GraphListNodesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphListNodesRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GraphListNodesRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GraphListNodesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.GraphListNodesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.GraphListNodesRequest} GraphListNodesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphListNodesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GraphListNodesRequest message. + * @function verify + * @memberof api.GraphListNodesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GraphListNodesRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a GraphListNodesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.GraphListNodesRequest + * @static + * @param {Object.} object Plain object + * @returns {api.GraphListNodesRequest} GraphListNodesRequest + */ + GraphListNodesRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.GraphListNodesRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.api.GraphListNodesRequest(); + }; + + /** + * Creates a plain object from a GraphListNodesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.GraphListNodesRequest + * @static + * @param {api.GraphListNodesRequest} message GraphListNodesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GraphListNodesRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GraphListNodesRequest to JSON. + * @function toJSON + * @memberof api.GraphListNodesRequest + * @instance + * @returns {Object.} JSON object + */ + GraphListNodesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GraphListNodesRequest + * @function getTypeUrl + * @memberof api.GraphListNodesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphListNodesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GraphListNodesRequest"; + }; + + return GraphListNodesRequest; + })(); + + api.GraphListNodesResponse = (function() { + + /** + * Properties of a GraphListNodesResponse. + * @memberof api + * @interface IGraphListNodesResponse + * @property {Array.|null} [node_ids] GraphListNodesResponse node_ids + */ + + /** + * Constructs a new GraphListNodesResponse. + * @memberof api + * @classdesc Represents a GraphListNodesResponse. + * @implements IGraphListNodesResponse + * @constructor + * @param {api.IGraphListNodesResponse=} [properties] Properties to set + */ + function GraphListNodesResponse(properties) { + this.node_ids = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphListNodesResponse node_ids. + * @member {Array.} node_ids + * @memberof api.GraphListNodesResponse + * @instance + */ + GraphListNodesResponse.prototype.node_ids = $util.emptyArray; + + /** + * Creates a new GraphListNodesResponse instance using the specified properties. + * @function create + * @memberof api.GraphListNodesResponse + * @static + * @param {api.IGraphListNodesResponse=} [properties] Properties to set + * @returns {api.GraphListNodesResponse} GraphListNodesResponse instance + */ + GraphListNodesResponse.create = function create(properties) { + return new GraphListNodesResponse(properties); + }; + + /** + * Encodes the specified GraphListNodesResponse message. Does not implicitly {@link api.GraphListNodesResponse.verify|verify} messages. + * @function encode + * @memberof api.GraphListNodesResponse + * @static + * @param {api.IGraphListNodesResponse} message GraphListNodesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphListNodesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.node_ids != null && message.node_ids.length) + for (let i = 0; i < message.node_ids.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.node_ids[i]); + return writer; + }; + + /** + * Encodes the specified GraphListNodesResponse message, length delimited. Does not implicitly {@link api.GraphListNodesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.GraphListNodesResponse + * @static + * @param {api.IGraphListNodesResponse} message GraphListNodesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphListNodesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GraphListNodesResponse message from the specified reader or buffer. + * @function decode + * @memberof api.GraphListNodesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.GraphListNodesResponse} GraphListNodesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphListNodesResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GraphListNodesResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.node_ids && message.node_ids.length)) + message.node_ids = []; + message.node_ids.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GraphListNodesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.GraphListNodesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.GraphListNodesResponse} GraphListNodesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphListNodesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GraphListNodesResponse message. + * @function verify + * @memberof api.GraphListNodesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GraphListNodesResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.node_ids != null && message.hasOwnProperty("node_ids")) { + if (!Array.isArray(message.node_ids)) + return "node_ids: array expected"; + for (let i = 0; i < message.node_ids.length; ++i) + if (!$util.isString(message.node_ids[i])) + return "node_ids: string[] expected"; + } + return null; + }; + + /** + * Creates a GraphListNodesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.GraphListNodesResponse + * @static + * @param {Object.} object Plain object + * @returns {api.GraphListNodesResponse} GraphListNodesResponse + */ + GraphListNodesResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.GraphListNodesResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.GraphListNodesResponse(); + if (object.node_ids) { + if (!Array.isArray(object.node_ids)) + throw TypeError(".api.GraphListNodesResponse.node_ids: array expected"); + message.node_ids = []; + for (let i = 0; i < object.node_ids.length; ++i) + message.node_ids[i] = String(object.node_ids[i]); + } + return message; + }; + + /** + * Creates a plain object from a GraphListNodesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.GraphListNodesResponse + * @static + * @param {api.GraphListNodesResponse} message GraphListNodesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GraphListNodesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.node_ids = []; + if (message.node_ids && message.node_ids.length) { + object.node_ids = []; + for (let j = 0; j < message.node_ids.length; ++j) + object.node_ids[j] = message.node_ids[j]; + } + return object; + }; + + /** + * Converts this GraphListNodesResponse to JSON. + * @function toJSON + * @memberof api.GraphListNodesResponse + * @instance + * @returns {Object.} JSON object + */ + GraphListNodesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GraphListNodesResponse + * @function getTypeUrl + * @memberof api.GraphListNodesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphListNodesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GraphListNodesResponse"; + }; + + return GraphListNodesResponse; + })(); + + api.UnifiedSendRequest = (function() { + + /** + * Properties of an UnifiedSendRequest. + * @memberof api + * @interface IUnifiedSendRequest + * @property {string|null} [uri] UnifiedSendRequest uri + * @property {Long|null} [amount_msat] UnifiedSendRequest amount_msat + * @property {types.IRouteParametersConfig|null} [route_parameters] UnifiedSendRequest route_parameters + */ + + /** + * Constructs a new UnifiedSendRequest. + * @memberof api + * @classdesc Represents an UnifiedSendRequest. + * @implements IUnifiedSendRequest + * @constructor + * @param {api.IUnifiedSendRequest=} [properties] Properties to set + */ + function UnifiedSendRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnifiedSendRequest uri. + * @member {string} uri + * @memberof api.UnifiedSendRequest + * @instance + */ + UnifiedSendRequest.prototype.uri = ""; + + /** + * UnifiedSendRequest amount_msat. + * @member {Long|null|undefined} amount_msat + * @memberof api.UnifiedSendRequest + * @instance + */ + UnifiedSendRequest.prototype.amount_msat = null; + + /** + * UnifiedSendRequest route_parameters. + * @member {types.IRouteParametersConfig|null|undefined} route_parameters + * @memberof api.UnifiedSendRequest + * @instance + */ + UnifiedSendRequest.prototype.route_parameters = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UnifiedSendRequest.prototype, "_amount_msat", { + get: $util.oneOfGetter($oneOfFields = ["amount_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UnifiedSendRequest.prototype, "_route_parameters", { + get: $util.oneOfGetter($oneOfFields = ["route_parameters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UnifiedSendRequest instance using the specified properties. + * @function create + * @memberof api.UnifiedSendRequest + * @static + * @param {api.IUnifiedSendRequest=} [properties] Properties to set + * @returns {api.UnifiedSendRequest} UnifiedSendRequest instance + */ + UnifiedSendRequest.create = function create(properties) { + return new UnifiedSendRequest(properties); + }; + + /** + * Encodes the specified UnifiedSendRequest message. Does not implicitly {@link api.UnifiedSendRequest.verify|verify} messages. + * @function encode + * @memberof api.UnifiedSendRequest + * @static + * @param {api.IUnifiedSendRequest} message UnifiedSendRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnifiedSendRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.amount_msat != null && Object.hasOwnProperty.call(message, "amount_msat")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount_msat); + if (message.route_parameters != null && Object.hasOwnProperty.call(message, "route_parameters")) + $root.types.RouteParametersConfig.encode(message.route_parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UnifiedSendRequest message, length delimited. Does not implicitly {@link api.UnifiedSendRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.UnifiedSendRequest + * @static + * @param {api.IUnifiedSendRequest} message UnifiedSendRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnifiedSendRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnifiedSendRequest message from the specified reader or buffer. + * @function decode + * @memberof api.UnifiedSendRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.UnifiedSendRequest} UnifiedSendRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnifiedSendRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.UnifiedSendRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.amount_msat = reader.uint64(); + break; + } + case 3: { + message.route_parameters = $root.types.RouteParametersConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UnifiedSendRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.UnifiedSendRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.UnifiedSendRequest} UnifiedSendRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnifiedSendRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnifiedSendRequest message. + * @function verify + * @memberof api.UnifiedSendRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnifiedSendRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) { + properties._amount_msat = 1; + if (!$util.isInteger(message.amount_msat) && !(message.amount_msat && $util.isInteger(message.amount_msat.low) && $util.isInteger(message.amount_msat.high))) + return "amount_msat: integer|Long expected"; + } + if (message.route_parameters != null && message.hasOwnProperty("route_parameters")) { + properties._route_parameters = 1; + { + let error = $root.types.RouteParametersConfig.verify(message.route_parameters, long + 1); + if (error) + return "route_parameters." + error; + } + } + return null; + }; + + /** + * Creates an UnifiedSendRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.UnifiedSendRequest + * @static + * @param {Object.} object Plain object + * @returns {api.UnifiedSendRequest} UnifiedSendRequest + */ + UnifiedSendRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.UnifiedSendRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.UnifiedSendRequest(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.amount_msat != null) + if ($util.Long) + (message.amount_msat = $util.Long.fromValue(object.amount_msat)).unsigned = true; + else if (typeof object.amount_msat === "string") + message.amount_msat = parseInt(object.amount_msat, 10); + else if (typeof object.amount_msat === "number") + message.amount_msat = object.amount_msat; + else if (typeof object.amount_msat === "object") + message.amount_msat = new $util.LongBits(object.amount_msat.low >>> 0, object.amount_msat.high >>> 0).toNumber(true); + if (object.route_parameters != null) { + if (typeof object.route_parameters !== "object") + throw TypeError(".api.UnifiedSendRequest.route_parameters: object expected"); + message.route_parameters = $root.types.RouteParametersConfig.fromObject(object.route_parameters, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an UnifiedSendRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.UnifiedSendRequest + * @static + * @param {api.UnifiedSendRequest} message UnifiedSendRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnifiedSendRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_msat = typeof message.amount_msat === "number" ? BigInt(message.amount_msat) : $util.Long.fromBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0, true).toBigInt(); + else if (typeof message.amount_msat === "number") + object.amount_msat = options.longs === String ? String(message.amount_msat) : message.amount_msat; + else + object.amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amount_msat) : options.longs === Number ? new $util.LongBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0).toNumber(true) : message.amount_msat; + if (options.oneofs) + object._amount_msat = "amount_msat"; + } + if (message.route_parameters != null && message.hasOwnProperty("route_parameters")) { + object.route_parameters = $root.types.RouteParametersConfig.toObject(message.route_parameters, options); + if (options.oneofs) + object._route_parameters = "route_parameters"; + } + return object; + }; + + /** + * Converts this UnifiedSendRequest to JSON. + * @function toJSON + * @memberof api.UnifiedSendRequest + * @instance + * @returns {Object.} JSON object + */ + UnifiedSendRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UnifiedSendRequest + * @function getTypeUrl + * @memberof api.UnifiedSendRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UnifiedSendRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.UnifiedSendRequest"; + }; + + return UnifiedSendRequest; + })(); + + api.UnifiedSendResponse = (function() { + + /** + * Properties of an UnifiedSendResponse. + * @memberof api + * @interface IUnifiedSendResponse + * @property {string|null} [txid] UnifiedSendResponse txid + * @property {string|null} [bolt11_payment_id] UnifiedSendResponse bolt11_payment_id + * @property {string|null} [bolt12_payment_id] UnifiedSendResponse bolt12_payment_id + */ + + /** + * Constructs a new UnifiedSendResponse. + * @memberof api + * @classdesc Represents an UnifiedSendResponse. + * @implements IUnifiedSendResponse + * @constructor + * @param {api.IUnifiedSendResponse=} [properties] Properties to set + */ + function UnifiedSendResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnifiedSendResponse txid. + * @member {string|null|undefined} txid + * @memberof api.UnifiedSendResponse + * @instance + */ + UnifiedSendResponse.prototype.txid = null; + + /** + * UnifiedSendResponse bolt11_payment_id. + * @member {string|null|undefined} bolt11_payment_id + * @memberof api.UnifiedSendResponse + * @instance + */ + UnifiedSendResponse.prototype.bolt11_payment_id = null; + + /** + * UnifiedSendResponse bolt12_payment_id. + * @member {string|null|undefined} bolt12_payment_id + * @memberof api.UnifiedSendResponse + * @instance + */ + UnifiedSendResponse.prototype.bolt12_payment_id = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * UnifiedSendResponse payment_result. + * @member {"txid"|"bolt11_payment_id"|"bolt12_payment_id"|undefined} payment_result + * @memberof api.UnifiedSendResponse + * @instance + */ + Object.defineProperty(UnifiedSendResponse.prototype, "payment_result", { + get: $util.oneOfGetter($oneOfFields = ["txid", "bolt11_payment_id", "bolt12_payment_id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UnifiedSendResponse instance using the specified properties. + * @function create + * @memberof api.UnifiedSendResponse + * @static + * @param {api.IUnifiedSendResponse=} [properties] Properties to set + * @returns {api.UnifiedSendResponse} UnifiedSendResponse instance + */ + UnifiedSendResponse.create = function create(properties) { + return new UnifiedSendResponse(properties); + }; + + /** + * Encodes the specified UnifiedSendResponse message. Does not implicitly {@link api.UnifiedSendResponse.verify|verify} messages. + * @function encode + * @memberof api.UnifiedSendResponse + * @static + * @param {api.IUnifiedSendResponse} message UnifiedSendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnifiedSendResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.txid != null && Object.hasOwnProperty.call(message, "txid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.txid); + if (message.bolt11_payment_id != null && Object.hasOwnProperty.call(message, "bolt11_payment_id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bolt11_payment_id); + if (message.bolt12_payment_id != null && Object.hasOwnProperty.call(message, "bolt12_payment_id")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.bolt12_payment_id); + return writer; + }; + + /** + * Encodes the specified UnifiedSendResponse message, length delimited. Does not implicitly {@link api.UnifiedSendResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.UnifiedSendResponse + * @static + * @param {api.IUnifiedSendResponse} message UnifiedSendResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnifiedSendResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnifiedSendResponse message from the specified reader or buffer. + * @function decode + * @memberof api.UnifiedSendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.UnifiedSendResponse} UnifiedSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnifiedSendResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.UnifiedSendResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.txid = reader.string(); + break; + } + case 2: { + message.bolt11_payment_id = reader.string(); + break; + } + case 3: { + message.bolt12_payment_id = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an UnifiedSendResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.UnifiedSendResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.UnifiedSendResponse} UnifiedSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnifiedSendResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnifiedSendResponse message. + * @function verify + * @memberof api.UnifiedSendResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnifiedSendResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.txid != null && message.hasOwnProperty("txid")) { + properties.payment_result = 1; + if (!$util.isString(message.txid)) + return "txid: string expected"; + } + if (message.bolt11_payment_id != null && message.hasOwnProperty("bolt11_payment_id")) { + if (properties.payment_result === 1) + return "payment_result: multiple values"; + properties.payment_result = 1; + if (!$util.isString(message.bolt11_payment_id)) + return "bolt11_payment_id: string expected"; + } + if (message.bolt12_payment_id != null && message.hasOwnProperty("bolt12_payment_id")) { + if (properties.payment_result === 1) + return "payment_result: multiple values"; + properties.payment_result = 1; + if (!$util.isString(message.bolt12_payment_id)) + return "bolt12_payment_id: string expected"; + } + return null; + }; + + /** + * Creates an UnifiedSendResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.UnifiedSendResponse + * @static + * @param {Object.} object Plain object + * @returns {api.UnifiedSendResponse} UnifiedSendResponse + */ + UnifiedSendResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.UnifiedSendResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.UnifiedSendResponse(); + if (object.txid != null) + message.txid = String(object.txid); + if (object.bolt11_payment_id != null) + message.bolt11_payment_id = String(object.bolt11_payment_id); + if (object.bolt12_payment_id != null) + message.bolt12_payment_id = String(object.bolt12_payment_id); + return message; + }; + + /** + * Creates a plain object from an UnifiedSendResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.UnifiedSendResponse + * @static + * @param {api.UnifiedSendResponse} message UnifiedSendResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnifiedSendResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.txid != null && message.hasOwnProperty("txid")) { + object.txid = message.txid; + if (options.oneofs) + object.payment_result = "txid"; + } + if (message.bolt11_payment_id != null && message.hasOwnProperty("bolt11_payment_id")) { + object.bolt11_payment_id = message.bolt11_payment_id; + if (options.oneofs) + object.payment_result = "bolt11_payment_id"; + } + if (message.bolt12_payment_id != null && message.hasOwnProperty("bolt12_payment_id")) { + object.bolt12_payment_id = message.bolt12_payment_id; + if (options.oneofs) + object.payment_result = "bolt12_payment_id"; + } + return object; + }; + + /** + * Converts this UnifiedSendResponse to JSON. + * @function toJSON + * @memberof api.UnifiedSendResponse + * @instance + * @returns {Object.} JSON object + */ + UnifiedSendResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UnifiedSendResponse + * @function getTypeUrl + * @memberof api.UnifiedSendResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UnifiedSendResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.UnifiedSendResponse"; + }; + + return UnifiedSendResponse; + })(); + + api.GraphGetNodeRequest = (function() { + + /** + * Properties of a GraphGetNodeRequest. + * @memberof api + * @interface IGraphGetNodeRequest + * @property {string|null} [node_id] GraphGetNodeRequest node_id + */ + + /** + * Constructs a new GraphGetNodeRequest. + * @memberof api + * @classdesc Represents a GraphGetNodeRequest. + * @implements IGraphGetNodeRequest + * @constructor + * @param {api.IGraphGetNodeRequest=} [properties] Properties to set + */ + function GraphGetNodeRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphGetNodeRequest node_id. + * @member {string} node_id + * @memberof api.GraphGetNodeRequest + * @instance + */ + GraphGetNodeRequest.prototype.node_id = ""; + + /** + * Creates a new GraphGetNodeRequest instance using the specified properties. + * @function create + * @memberof api.GraphGetNodeRequest + * @static + * @param {api.IGraphGetNodeRequest=} [properties] Properties to set + * @returns {api.GraphGetNodeRequest} GraphGetNodeRequest instance + */ + GraphGetNodeRequest.create = function create(properties) { + return new GraphGetNodeRequest(properties); + }; + + /** + * Encodes the specified GraphGetNodeRequest message. Does not implicitly {@link api.GraphGetNodeRequest.verify|verify} messages. + * @function encode + * @memberof api.GraphGetNodeRequest + * @static + * @param {api.IGraphGetNodeRequest} message GraphGetNodeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphGetNodeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.node_id != null && Object.hasOwnProperty.call(message, "node_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.node_id); + return writer; + }; + + /** + * Encodes the specified GraphGetNodeRequest message, length delimited. Does not implicitly {@link api.GraphGetNodeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.GraphGetNodeRequest + * @static + * @param {api.IGraphGetNodeRequest} message GraphGetNodeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphGetNodeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GraphGetNodeRequest message from the specified reader or buffer. + * @function decode + * @memberof api.GraphGetNodeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.GraphGetNodeRequest} GraphGetNodeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphGetNodeRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GraphGetNodeRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.node_id = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GraphGetNodeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.GraphGetNodeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.GraphGetNodeRequest} GraphGetNodeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphGetNodeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GraphGetNodeRequest message. + * @function verify + * @memberof api.GraphGetNodeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GraphGetNodeRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.node_id != null && message.hasOwnProperty("node_id")) + if (!$util.isString(message.node_id)) + return "node_id: string expected"; + return null; + }; + + /** + * Creates a GraphGetNodeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.GraphGetNodeRequest + * @static + * @param {Object.} object Plain object + * @returns {api.GraphGetNodeRequest} GraphGetNodeRequest + */ + GraphGetNodeRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.GraphGetNodeRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.GraphGetNodeRequest(); + if (object.node_id != null) + message.node_id = String(object.node_id); + return message; + }; + + /** + * Creates a plain object from a GraphGetNodeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.GraphGetNodeRequest + * @static + * @param {api.GraphGetNodeRequest} message GraphGetNodeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GraphGetNodeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.node_id = ""; + if (message.node_id != null && message.hasOwnProperty("node_id")) + object.node_id = message.node_id; + return object; + }; + + /** + * Converts this GraphGetNodeRequest to JSON. + * @function toJSON + * @memberof api.GraphGetNodeRequest + * @instance + * @returns {Object.} JSON object + */ + GraphGetNodeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GraphGetNodeRequest + * @function getTypeUrl + * @memberof api.GraphGetNodeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphGetNodeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GraphGetNodeRequest"; + }; + + return GraphGetNodeRequest; + })(); + + api.GraphGetNodeResponse = (function() { + + /** + * Properties of a GraphGetNodeResponse. + * @memberof api + * @interface IGraphGetNodeResponse + * @property {types.IGraphNode|null} [node] GraphGetNodeResponse node + */ + + /** + * Constructs a new GraphGetNodeResponse. + * @memberof api + * @classdesc Represents a GraphGetNodeResponse. + * @implements IGraphGetNodeResponse + * @constructor + * @param {api.IGraphGetNodeResponse=} [properties] Properties to set + */ + function GraphGetNodeResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphGetNodeResponse node. + * @member {types.IGraphNode|null|undefined} node + * @memberof api.GraphGetNodeResponse + * @instance + */ + GraphGetNodeResponse.prototype.node = null; + + /** + * Creates a new GraphGetNodeResponse instance using the specified properties. + * @function create + * @memberof api.GraphGetNodeResponse + * @static + * @param {api.IGraphGetNodeResponse=} [properties] Properties to set + * @returns {api.GraphGetNodeResponse} GraphGetNodeResponse instance + */ + GraphGetNodeResponse.create = function create(properties) { + return new GraphGetNodeResponse(properties); + }; + + /** + * Encodes the specified GraphGetNodeResponse message. Does not implicitly {@link api.GraphGetNodeResponse.verify|verify} messages. + * @function encode + * @memberof api.GraphGetNodeResponse + * @static + * @param {api.IGraphGetNodeResponse} message GraphGetNodeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphGetNodeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.node != null && Object.hasOwnProperty.call(message, "node")) + $root.types.GraphNode.encode(message.node, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GraphGetNodeResponse message, length delimited. Does not implicitly {@link api.GraphGetNodeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.GraphGetNodeResponse + * @static + * @param {api.IGraphGetNodeResponse} message GraphGetNodeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphGetNodeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GraphGetNodeResponse message from the specified reader or buffer. + * @function decode + * @memberof api.GraphGetNodeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.GraphGetNodeResponse} GraphGetNodeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphGetNodeResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GraphGetNodeResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.node = $root.types.GraphNode.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GraphGetNodeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.GraphGetNodeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.GraphGetNodeResponse} GraphGetNodeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphGetNodeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GraphGetNodeResponse message. + * @function verify + * @memberof api.GraphGetNodeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GraphGetNodeResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.node != null && message.hasOwnProperty("node")) { + let error = $root.types.GraphNode.verify(message.node, long + 1); + if (error) + return "node." + error; + } + return null; + }; + + /** + * Creates a GraphGetNodeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.GraphGetNodeResponse + * @static + * @param {Object.} object Plain object + * @returns {api.GraphGetNodeResponse} GraphGetNodeResponse + */ + GraphGetNodeResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.GraphGetNodeResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.GraphGetNodeResponse(); + if (object.node != null) { + if (typeof object.node !== "object") + throw TypeError(".api.GraphGetNodeResponse.node: object expected"); + message.node = $root.types.GraphNode.fromObject(object.node, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a GraphGetNodeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.GraphGetNodeResponse + * @static + * @param {api.GraphGetNodeResponse} message GraphGetNodeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GraphGetNodeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.node = null; + if (message.node != null && message.hasOwnProperty("node")) + object.node = $root.types.GraphNode.toObject(message.node, options); + return object; + }; + + /** + * Converts this GraphGetNodeResponse to JSON. + * @function toJSON + * @memberof api.GraphGetNodeResponse + * @instance + * @returns {Object.} JSON object + */ + GraphGetNodeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GraphGetNodeResponse + * @function getTypeUrl + * @memberof api.GraphGetNodeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphGetNodeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GraphGetNodeResponse"; + }; + + return GraphGetNodeResponse; + })(); + + api.DecodeInvoiceRequest = (function() { + + /** + * Properties of a DecodeInvoiceRequest. + * @memberof api + * @interface IDecodeInvoiceRequest + * @property {string|null} [invoice] DecodeInvoiceRequest invoice + */ + + /** + * Constructs a new DecodeInvoiceRequest. + * @memberof api + * @classdesc Represents a DecodeInvoiceRequest. + * @implements IDecodeInvoiceRequest + * @constructor + * @param {api.IDecodeInvoiceRequest=} [properties] Properties to set + */ + function DecodeInvoiceRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DecodeInvoiceRequest invoice. + * @member {string} invoice + * @memberof api.DecodeInvoiceRequest + * @instance + */ + DecodeInvoiceRequest.prototype.invoice = ""; + + /** + * Creates a new DecodeInvoiceRequest instance using the specified properties. + * @function create + * @memberof api.DecodeInvoiceRequest + * @static + * @param {api.IDecodeInvoiceRequest=} [properties] Properties to set + * @returns {api.DecodeInvoiceRequest} DecodeInvoiceRequest instance + */ + DecodeInvoiceRequest.create = function create(properties) { + return new DecodeInvoiceRequest(properties); + }; + + /** + * Encodes the specified DecodeInvoiceRequest message. Does not implicitly {@link api.DecodeInvoiceRequest.verify|verify} messages. + * @function encode + * @memberof api.DecodeInvoiceRequest + * @static + * @param {api.IDecodeInvoiceRequest} message DecodeInvoiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecodeInvoiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.invoice != null && Object.hasOwnProperty.call(message, "invoice")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.invoice); + return writer; + }; + + /** + * Encodes the specified DecodeInvoiceRequest message, length delimited. Does not implicitly {@link api.DecodeInvoiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.DecodeInvoiceRequest + * @static + * @param {api.IDecodeInvoiceRequest} message DecodeInvoiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecodeInvoiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DecodeInvoiceRequest message from the specified reader or buffer. + * @function decode + * @memberof api.DecodeInvoiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.DecodeInvoiceRequest} DecodeInvoiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecodeInvoiceRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.DecodeInvoiceRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.invoice = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DecodeInvoiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.DecodeInvoiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.DecodeInvoiceRequest} DecodeInvoiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecodeInvoiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DecodeInvoiceRequest message. + * @function verify + * @memberof api.DecodeInvoiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DecodeInvoiceRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.invoice != null && message.hasOwnProperty("invoice")) + if (!$util.isString(message.invoice)) + return "invoice: string expected"; + return null; + }; + + /** + * Creates a DecodeInvoiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.DecodeInvoiceRequest + * @static + * @param {Object.} object Plain object + * @returns {api.DecodeInvoiceRequest} DecodeInvoiceRequest + */ + DecodeInvoiceRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.DecodeInvoiceRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.DecodeInvoiceRequest(); + if (object.invoice != null) + message.invoice = String(object.invoice); + return message; + }; + + /** + * Creates a plain object from a DecodeInvoiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.DecodeInvoiceRequest + * @static + * @param {api.DecodeInvoiceRequest} message DecodeInvoiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DecodeInvoiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.invoice = ""; + if (message.invoice != null && message.hasOwnProperty("invoice")) + object.invoice = message.invoice; + return object; + }; + + /** + * Converts this DecodeInvoiceRequest to JSON. + * @function toJSON + * @memberof api.DecodeInvoiceRequest + * @instance + * @returns {Object.} JSON object + */ + DecodeInvoiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DecodeInvoiceRequest + * @function getTypeUrl + * @memberof api.DecodeInvoiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DecodeInvoiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.DecodeInvoiceRequest"; + }; + + return DecodeInvoiceRequest; + })(); + + api.DecodeInvoiceResponse = (function() { + + /** + * Properties of a DecodeInvoiceResponse. + * @memberof api + * @interface IDecodeInvoiceResponse + * @property {string|null} [destination] DecodeInvoiceResponse destination + * @property {string|null} [payment_hash] DecodeInvoiceResponse payment_hash + * @property {Long|null} [amount_msat] DecodeInvoiceResponse amount_msat + * @property {Long|null} [timestamp] DecodeInvoiceResponse timestamp + * @property {Long|null} [expiry] DecodeInvoiceResponse expiry + * @property {string|null} [description] DecodeInvoiceResponse description + * @property {string|null} [description_hash] DecodeInvoiceResponse description_hash + * @property {string|null} [fallback_address] DecodeInvoiceResponse fallback_address + * @property {Long|null} [min_final_cltv_expiry_delta] DecodeInvoiceResponse min_final_cltv_expiry_delta + * @property {string|null} [payment_secret] DecodeInvoiceResponse payment_secret + * @property {Array.|null} [route_hints] DecodeInvoiceResponse route_hints + * @property {Object.|null} [features] DecodeInvoiceResponse features + * @property {string|null} [currency] DecodeInvoiceResponse currency + * @property {string|null} [payment_metadata] DecodeInvoiceResponse payment_metadata + * @property {boolean|null} [is_expired] DecodeInvoiceResponse is_expired + */ + + /** + * Constructs a new DecodeInvoiceResponse. + * @memberof api + * @classdesc Represents a DecodeInvoiceResponse. + * @implements IDecodeInvoiceResponse + * @constructor + * @param {api.IDecodeInvoiceResponse=} [properties] Properties to set + */ + function DecodeInvoiceResponse(properties) { + this.route_hints = []; + this.features = {}; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DecodeInvoiceResponse destination. + * @member {string} destination + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.destination = ""; + + /** + * DecodeInvoiceResponse payment_hash. + * @member {string} payment_hash + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.payment_hash = ""; + + /** + * DecodeInvoiceResponse amount_msat. + * @member {Long|null|undefined} amount_msat + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.amount_msat = null; + + /** + * DecodeInvoiceResponse timestamp. + * @member {Long} timestamp + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * DecodeInvoiceResponse expiry. + * @member {Long} expiry + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.expiry = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * DecodeInvoiceResponse description. + * @member {string|null|undefined} description + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.description = null; + + /** + * DecodeInvoiceResponse description_hash. + * @member {string|null|undefined} description_hash + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.description_hash = null; + + /** + * DecodeInvoiceResponse fallback_address. + * @member {string|null|undefined} fallback_address + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.fallback_address = null; + + /** + * DecodeInvoiceResponse min_final_cltv_expiry_delta. + * @member {Long} min_final_cltv_expiry_delta + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.min_final_cltv_expiry_delta = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * DecodeInvoiceResponse payment_secret. + * @member {string} payment_secret + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.payment_secret = ""; + + /** + * DecodeInvoiceResponse route_hints. + * @member {Array.} route_hints + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.route_hints = $util.emptyArray; + + /** + * DecodeInvoiceResponse features. + * @member {Object.} features + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.features = $util.emptyObject; + + /** + * DecodeInvoiceResponse currency. + * @member {string} currency + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.currency = ""; + + /** + * DecodeInvoiceResponse payment_metadata. + * @member {string|null|undefined} payment_metadata + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.payment_metadata = null; + + /** + * DecodeInvoiceResponse is_expired. + * @member {boolean} is_expired + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.is_expired = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeInvoiceResponse.prototype, "_amount_msat", { + get: $util.oneOfGetter($oneOfFields = ["amount_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeInvoiceResponse.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeInvoiceResponse.prototype, "_description_hash", { + get: $util.oneOfGetter($oneOfFields = ["description_hash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeInvoiceResponse.prototype, "_fallback_address", { + get: $util.oneOfGetter($oneOfFields = ["fallback_address"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeInvoiceResponse.prototype, "_payment_metadata", { + get: $util.oneOfGetter($oneOfFields = ["payment_metadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DecodeInvoiceResponse instance using the specified properties. + * @function create + * @memberof api.DecodeInvoiceResponse + * @static + * @param {api.IDecodeInvoiceResponse=} [properties] Properties to set + * @returns {api.DecodeInvoiceResponse} DecodeInvoiceResponse instance + */ + DecodeInvoiceResponse.create = function create(properties) { + return new DecodeInvoiceResponse(properties); + }; + + /** + * Encodes the specified DecodeInvoiceResponse message. Does not implicitly {@link api.DecodeInvoiceResponse.verify|verify} messages. + * @function encode + * @memberof api.DecodeInvoiceResponse + * @static + * @param {api.IDecodeInvoiceResponse} message DecodeInvoiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecodeInvoiceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.destination); + if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.payment_hash); + if (message.amount_msat != null && Object.hasOwnProperty.call(message, "amount_msat")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.amount_msat); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.timestamp); + if (message.expiry != null && Object.hasOwnProperty.call(message, "expiry")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.expiry); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.fallback_address != null && Object.hasOwnProperty.call(message, "fallback_address")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.fallback_address); + if (message.min_final_cltv_expiry_delta != null && Object.hasOwnProperty.call(message, "min_final_cltv_expiry_delta")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.min_final_cltv_expiry_delta); + if (message.payment_secret != null && Object.hasOwnProperty.call(message, "payment_secret")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.payment_secret); + if (message.route_hints != null && message.route_hints.length) + for (let i = 0; i < message.route_hints.length; ++i) + $root.types.Bolt11RouteHint.encode(message.route_hints[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + for (let keys = Object.keys(message.features), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]); + $root.types.Bolt11Feature.encode(message.features[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.currency != null && Object.hasOwnProperty.call(message, "currency")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.currency); + if (message.payment_metadata != null && Object.hasOwnProperty.call(message, "payment_metadata")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.payment_metadata); + if (message.description_hash != null && Object.hasOwnProperty.call(message, "description_hash")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.description_hash); + if (message.is_expired != null && Object.hasOwnProperty.call(message, "is_expired")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.is_expired); + return writer; + }; + + /** + * Encodes the specified DecodeInvoiceResponse message, length delimited. Does not implicitly {@link api.DecodeInvoiceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.DecodeInvoiceResponse + * @static + * @param {api.IDecodeInvoiceResponse} message DecodeInvoiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecodeInvoiceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DecodeInvoiceResponse message from the specified reader or buffer. + * @function decode + * @memberof api.DecodeInvoiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.DecodeInvoiceResponse} DecodeInvoiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecodeInvoiceResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.DecodeInvoiceResponse(), key, value; + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.destination = reader.string(); + break; + } + case 2: { + message.payment_hash = reader.string(); + break; + } + case 3: { + message.amount_msat = reader.uint64(); + break; + } + case 4: { + message.timestamp = reader.uint64(); + break; + } + case 5: { + message.expiry = reader.uint64(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 14: { + message.description_hash = reader.string(); + break; + } + case 7: { + message.fallback_address = reader.string(); + break; + } + case 8: { + message.min_final_cltv_expiry_delta = reader.uint64(); + break; + } + case 9: { + message.payment_secret = reader.string(); + break; + } + case 10: { + if (!(message.route_hints && message.route_hints.length)) + message.route_hints = []; + message.route_hints.push($root.types.Bolt11RouteHint.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 11: { + if (message.features === $util.emptyObject) + message.features = {}; + let end2 = reader.uint32() + reader.pos; + key = 0; + value = null; + while (reader.pos < end2) { + let tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint32(); + break; + case 2: + value = $root.types.Bolt11Feature.decode(reader, reader.uint32(), undefined, long + 1); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + message.features[key] = value; + break; + } + case 12: { + message.currency = reader.string(); + break; + } + case 13: { + message.payment_metadata = reader.string(); + break; + } + case 15: { + message.is_expired = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DecodeInvoiceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.DecodeInvoiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.DecodeInvoiceResponse} DecodeInvoiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecodeInvoiceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DecodeInvoiceResponse message. + * @function verify + * @memberof api.DecodeInvoiceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DecodeInvoiceResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.destination != null && message.hasOwnProperty("destination")) + if (!$util.isString(message.destination)) + return "destination: string expected"; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + if (!$util.isString(message.payment_hash)) + return "payment_hash: string expected"; + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) { + properties._amount_msat = 1; + if (!$util.isInteger(message.amount_msat) && !(message.amount_msat && $util.isInteger(message.amount_msat.low) && $util.isInteger(message.amount_msat.high))) + return "amount_msat: integer|Long expected"; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; + if (message.expiry != null && message.hasOwnProperty("expiry")) + if (!$util.isInteger(message.expiry) && !(message.expiry && $util.isInteger(message.expiry.low) && $util.isInteger(message.expiry.high))) + return "expiry: integer|Long expected"; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.description_hash != null && message.hasOwnProperty("description_hash")) { + properties._description_hash = 1; + if (!$util.isString(message.description_hash)) + return "description_hash: string expected"; + } + if (message.fallback_address != null && message.hasOwnProperty("fallback_address")) { + properties._fallback_address = 1; + if (!$util.isString(message.fallback_address)) + return "fallback_address: string expected"; + } + if (message.min_final_cltv_expiry_delta != null && message.hasOwnProperty("min_final_cltv_expiry_delta")) + if (!$util.isInteger(message.min_final_cltv_expiry_delta) && !(message.min_final_cltv_expiry_delta && $util.isInteger(message.min_final_cltv_expiry_delta.low) && $util.isInteger(message.min_final_cltv_expiry_delta.high))) + return "min_final_cltv_expiry_delta: integer|Long expected"; + if (message.payment_secret != null && message.hasOwnProperty("payment_secret")) + if (!$util.isString(message.payment_secret)) + return "payment_secret: string 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.types.Bolt11RouteHint.verify(message.route_hints[i], long + 1); + if (error) + return "route_hints." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + if (!$util.isObject(message.features)) + return "features: object expected"; + let key = Object.keys(message.features); + for (let i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "features: integer key{k:uint32} expected"; + { + let error = $root.types.Bolt11Feature.verify(message.features[key[i]], long + 1); + if (error) + return "features." + error; + } + } + } + if (message.currency != null && message.hasOwnProperty("currency")) + if (!$util.isString(message.currency)) + return "currency: string expected"; + if (message.payment_metadata != null && message.hasOwnProperty("payment_metadata")) { + properties._payment_metadata = 1; + if (!$util.isString(message.payment_metadata)) + return "payment_metadata: string expected"; + } + if (message.is_expired != null && message.hasOwnProperty("is_expired")) + if (typeof message.is_expired !== "boolean") + return "is_expired: boolean expected"; + return null; + }; + + /** + * Creates a DecodeInvoiceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.DecodeInvoiceResponse + * @static + * @param {Object.} object Plain object + * @returns {api.DecodeInvoiceResponse} DecodeInvoiceResponse + */ + DecodeInvoiceResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.DecodeInvoiceResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.DecodeInvoiceResponse(); + if (object.destination != null) + message.destination = String(object.destination); + if (object.payment_hash != null) + message.payment_hash = String(object.payment_hash); + if (object.amount_msat != null) + if ($util.Long) + (message.amount_msat = $util.Long.fromValue(object.amount_msat)).unsigned = true; + else if (typeof object.amount_msat === "string") + message.amount_msat = parseInt(object.amount_msat, 10); + else if (typeof object.amount_msat === "number") + message.amount_msat = object.amount_msat; + else if (typeof object.amount_msat === "object") + message.amount_msat = new $util.LongBits(object.amount_msat.low >>> 0, object.amount_msat.high >>> 0).toNumber(true); + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); + if (object.expiry != null) + if ($util.Long) + (message.expiry = $util.Long.fromValue(object.expiry)).unsigned = true; + else if (typeof object.expiry === "string") + message.expiry = parseInt(object.expiry, 10); + else if (typeof object.expiry === "number") + message.expiry = object.expiry; + else if (typeof object.expiry === "object") + message.expiry = new $util.LongBits(object.expiry.low >>> 0, object.expiry.high >>> 0).toNumber(true); + if (object.description != null) + message.description = String(object.description); + if (object.description_hash != null) + message.description_hash = String(object.description_hash); + if (object.fallback_address != null) + message.fallback_address = String(object.fallback_address); + if (object.min_final_cltv_expiry_delta != null) + if ($util.Long) + (message.min_final_cltv_expiry_delta = $util.Long.fromValue(object.min_final_cltv_expiry_delta)).unsigned = true; + else if (typeof object.min_final_cltv_expiry_delta === "string") + message.min_final_cltv_expiry_delta = parseInt(object.min_final_cltv_expiry_delta, 10); + else if (typeof object.min_final_cltv_expiry_delta === "number") + message.min_final_cltv_expiry_delta = object.min_final_cltv_expiry_delta; + else if (typeof object.min_final_cltv_expiry_delta === "object") + message.min_final_cltv_expiry_delta = new $util.LongBits(object.min_final_cltv_expiry_delta.low >>> 0, object.min_final_cltv_expiry_delta.high >>> 0).toNumber(true); + if (object.payment_secret != null) + message.payment_secret = String(object.payment_secret); + if (object.route_hints) { + if (!Array.isArray(object.route_hints)) + throw TypeError(".api.DecodeInvoiceResponse.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(".api.DecodeInvoiceResponse.route_hints: object expected"); + message.route_hints[i] = $root.types.Bolt11RouteHint.fromObject(object.route_hints[i], long + 1); + } + } + if (object.features) { + if (typeof object.features !== "object") + throw TypeError(".api.DecodeInvoiceResponse.features: object expected"); + message.features = {}; + for (let keys = Object.keys(object.features), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.features, keys[i]); + if (typeof object.features[keys[i]] !== "object") + throw TypeError(".api.DecodeInvoiceResponse.features: object expected"); + message.features[keys[i]] = $root.types.Bolt11Feature.fromObject(object.features[keys[i]], long + 1); + } + } + if (object.currency != null) + message.currency = String(object.currency); + if (object.payment_metadata != null) + message.payment_metadata = String(object.payment_metadata); + if (object.is_expired != null) + message.is_expired = Boolean(object.is_expired); + return message; + }; + + /** + * Creates a plain object from a DecodeInvoiceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.DecodeInvoiceResponse + * @static + * @param {api.DecodeInvoiceResponse} message DecodeInvoiceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DecodeInvoiceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.route_hints = []; + if (options.objects || options.defaults) + object.features = {}; + if (options.defaults) { + object.destination = ""; + object.payment_hash = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.timestamp = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.expiry = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.expiry = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.min_final_cltv_expiry_delta = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.min_final_cltv_expiry_delta = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.payment_secret = ""; + object.currency = ""; + object.is_expired = false; + } + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = message.destination; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + object.payment_hash = message.payment_hash; + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_msat = typeof message.amount_msat === "number" ? BigInt(message.amount_msat) : $util.Long.fromBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0, true).toBigInt(); + else if (typeof message.amount_msat === "number") + object.amount_msat = options.longs === String ? String(message.amount_msat) : message.amount_msat; + else + object.amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amount_msat) : options.longs === Number ? new $util.LongBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0).toNumber(true) : message.amount_msat; + if (options.oneofs) + object._amount_msat = "amount_msat"; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.timestamp = typeof message.timestamp === "number" ? BigInt(message.timestamp) : $util.Long.fromBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0, true).toBigInt(); + else if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; + if (message.expiry != null && message.hasOwnProperty("expiry")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.expiry = typeof message.expiry === "number" ? BigInt(message.expiry) : $util.Long.fromBits(message.expiry.low >>> 0, message.expiry.high >>> 0, true).toBigInt(); + else if (typeof message.expiry === "number") + object.expiry = options.longs === String ? String(message.expiry) : message.expiry; + else + object.expiry = options.longs === String ? $util.Long.prototype.toString.call(message.expiry) : options.longs === Number ? new $util.LongBits(message.expiry.low >>> 0, message.expiry.high >>> 0).toNumber(true) : message.expiry; + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.fallback_address != null && message.hasOwnProperty("fallback_address")) { + object.fallback_address = message.fallback_address; + if (options.oneofs) + object._fallback_address = "fallback_address"; + } + if (message.min_final_cltv_expiry_delta != null && message.hasOwnProperty("min_final_cltv_expiry_delta")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.min_final_cltv_expiry_delta = typeof message.min_final_cltv_expiry_delta === "number" ? BigInt(message.min_final_cltv_expiry_delta) : $util.Long.fromBits(message.min_final_cltv_expiry_delta.low >>> 0, message.min_final_cltv_expiry_delta.high >>> 0, true).toBigInt(); + else if (typeof message.min_final_cltv_expiry_delta === "number") + object.min_final_cltv_expiry_delta = options.longs === String ? String(message.min_final_cltv_expiry_delta) : message.min_final_cltv_expiry_delta; + else + object.min_final_cltv_expiry_delta = options.longs === String ? $util.Long.prototype.toString.call(message.min_final_cltv_expiry_delta) : options.longs === Number ? new $util.LongBits(message.min_final_cltv_expiry_delta.low >>> 0, message.min_final_cltv_expiry_delta.high >>> 0).toNumber(true) : message.min_final_cltv_expiry_delta; + if (message.payment_secret != null && message.hasOwnProperty("payment_secret")) + object.payment_secret = message.payment_secret; + 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.types.Bolt11RouteHint.toObject(message.route_hints[j], options); + } + let keys2; + if (message.features && (keys2 = Object.keys(message.features)).length) { + object.features = {}; + for (let j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.features, keys2[j]); + object.features[keys2[j]] = $root.types.Bolt11Feature.toObject(message.features[keys2[j]], options); + } + } + if (message.currency != null && message.hasOwnProperty("currency")) + object.currency = message.currency; + if (message.payment_metadata != null && message.hasOwnProperty("payment_metadata")) { + object.payment_metadata = message.payment_metadata; + if (options.oneofs) + object._payment_metadata = "payment_metadata"; + } + if (message.description_hash != null && message.hasOwnProperty("description_hash")) { + object.description_hash = message.description_hash; + if (options.oneofs) + object._description_hash = "description_hash"; + } + if (message.is_expired != null && message.hasOwnProperty("is_expired")) + object.is_expired = message.is_expired; + return object; + }; + + /** + * Converts this DecodeInvoiceResponse to JSON. + * @function toJSON + * @memberof api.DecodeInvoiceResponse + * @instance + * @returns {Object.} JSON object + */ + DecodeInvoiceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DecodeInvoiceResponse + * @function getTypeUrl + * @memberof api.DecodeInvoiceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DecodeInvoiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.DecodeInvoiceResponse"; + }; + + return DecodeInvoiceResponse; + })(); + + api.DecodeOfferRequest = (function() { + + /** + * Properties of a DecodeOfferRequest. + * @memberof api + * @interface IDecodeOfferRequest + * @property {string|null} [offer] DecodeOfferRequest offer + */ + + /** + * Constructs a new DecodeOfferRequest. + * @memberof api + * @classdesc Represents a DecodeOfferRequest. + * @implements IDecodeOfferRequest + * @constructor + * @param {api.IDecodeOfferRequest=} [properties] Properties to set + */ + function DecodeOfferRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DecodeOfferRequest offer. + * @member {string} offer + * @memberof api.DecodeOfferRequest + * @instance + */ + DecodeOfferRequest.prototype.offer = ""; + + /** + * Creates a new DecodeOfferRequest instance using the specified properties. + * @function create + * @memberof api.DecodeOfferRequest + * @static + * @param {api.IDecodeOfferRequest=} [properties] Properties to set + * @returns {api.DecodeOfferRequest} DecodeOfferRequest instance + */ + DecodeOfferRequest.create = function create(properties) { + return new DecodeOfferRequest(properties); + }; + + /** + * Encodes the specified DecodeOfferRequest message. Does not implicitly {@link api.DecodeOfferRequest.verify|verify} messages. + * @function encode + * @memberof api.DecodeOfferRequest + * @static + * @param {api.IDecodeOfferRequest} message DecodeOfferRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecodeOfferRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.offer != null && Object.hasOwnProperty.call(message, "offer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.offer); + return writer; + }; + + /** + * Encodes the specified DecodeOfferRequest message, length delimited. Does not implicitly {@link api.DecodeOfferRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.DecodeOfferRequest + * @static + * @param {api.IDecodeOfferRequest} message DecodeOfferRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecodeOfferRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DecodeOfferRequest message from the specified reader or buffer. + * @function decode + * @memberof api.DecodeOfferRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.DecodeOfferRequest} DecodeOfferRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecodeOfferRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.DecodeOfferRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.offer = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DecodeOfferRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.DecodeOfferRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.DecodeOfferRequest} DecodeOfferRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecodeOfferRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DecodeOfferRequest message. + * @function verify + * @memberof api.DecodeOfferRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DecodeOfferRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.offer != null && message.hasOwnProperty("offer")) + if (!$util.isString(message.offer)) + return "offer: string expected"; + return null; + }; + + /** + * Creates a DecodeOfferRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.DecodeOfferRequest + * @static + * @param {Object.} object Plain object + * @returns {api.DecodeOfferRequest} DecodeOfferRequest + */ + DecodeOfferRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.DecodeOfferRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.DecodeOfferRequest(); + if (object.offer != null) + message.offer = String(object.offer); + return message; + }; + + /** + * Creates a plain object from a DecodeOfferRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.DecodeOfferRequest + * @static + * @param {api.DecodeOfferRequest} message DecodeOfferRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DecodeOfferRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.offer = ""; + if (message.offer != null && message.hasOwnProperty("offer")) + object.offer = message.offer; + return object; + }; + + /** + * Converts this DecodeOfferRequest to JSON. + * @function toJSON + * @memberof api.DecodeOfferRequest + * @instance + * @returns {Object.} JSON object + */ + DecodeOfferRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DecodeOfferRequest + * @function getTypeUrl + * @memberof api.DecodeOfferRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DecodeOfferRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.DecodeOfferRequest"; + }; + + return DecodeOfferRequest; + })(); + + api.DecodeOfferResponse = (function() { + + /** + * Properties of a DecodeOfferResponse. + * @memberof api + * @interface IDecodeOfferResponse + * @property {string|null} [offer_id] DecodeOfferResponse offer_id + * @property {string|null} [description] DecodeOfferResponse description + * @property {string|null} [issuer] DecodeOfferResponse issuer + * @property {types.IOfferAmount|null} [amount] DecodeOfferResponse amount + * @property {string|null} [issuer_signing_pubkey] DecodeOfferResponse issuer_signing_pubkey + * @property {Long|null} [absolute_expiry] DecodeOfferResponse absolute_expiry + * @property {types.IOfferQuantity|null} [quantity] DecodeOfferResponse quantity + * @property {Array.|null} [paths] DecodeOfferResponse paths + * @property {Object.|null} [features] DecodeOfferResponse features + * @property {Array.|null} [chains] DecodeOfferResponse chains + * @property {string|null} [metadata] DecodeOfferResponse metadata + * @property {boolean|null} [is_expired] DecodeOfferResponse is_expired + */ + + /** + * Constructs a new DecodeOfferResponse. + * @memberof api + * @classdesc Represents a DecodeOfferResponse. + * @implements IDecodeOfferResponse + * @constructor + * @param {api.IDecodeOfferResponse=} [properties] Properties to set + */ + function DecodeOfferResponse(properties) { + this.paths = []; + this.features = {}; + this.chains = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DecodeOfferResponse offer_id. + * @member {string} offer_id + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.offer_id = ""; + + /** + * DecodeOfferResponse description. + * @member {string|null|undefined} description + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.description = null; + + /** + * DecodeOfferResponse issuer. + * @member {string|null|undefined} issuer + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.issuer = null; + + /** + * DecodeOfferResponse amount. + * @member {types.IOfferAmount|null|undefined} amount + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.amount = null; + + /** + * DecodeOfferResponse issuer_signing_pubkey. + * @member {string|null|undefined} issuer_signing_pubkey + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.issuer_signing_pubkey = null; + + /** + * DecodeOfferResponse absolute_expiry. + * @member {Long|null|undefined} absolute_expiry + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.absolute_expiry = null; + + /** + * DecodeOfferResponse quantity. + * @member {types.IOfferQuantity|null|undefined} quantity + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.quantity = null; + + /** + * DecodeOfferResponse paths. + * @member {Array.} paths + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.paths = $util.emptyArray; + + /** + * DecodeOfferResponse features. + * @member {Object.} features + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.features = $util.emptyObject; + + /** + * DecodeOfferResponse chains. + * @member {Array.} chains + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.chains = $util.emptyArray; + + /** + * DecodeOfferResponse metadata. + * @member {string|null|undefined} metadata + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.metadata = null; + + /** + * DecodeOfferResponse is_expired. + * @member {boolean} is_expired + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.is_expired = false; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeOfferResponse.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeOfferResponse.prototype, "_issuer", { + get: $util.oneOfGetter($oneOfFields = ["issuer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeOfferResponse.prototype, "_issuer_signing_pubkey", { + get: $util.oneOfGetter($oneOfFields = ["issuer_signing_pubkey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeOfferResponse.prototype, "_absolute_expiry", { + get: $util.oneOfGetter($oneOfFields = ["absolute_expiry"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeOfferResponse.prototype, "_metadata", { + get: $util.oneOfGetter($oneOfFields = ["metadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DecodeOfferResponse instance using the specified properties. + * @function create + * @memberof api.DecodeOfferResponse + * @static + * @param {api.IDecodeOfferResponse=} [properties] Properties to set + * @returns {api.DecodeOfferResponse} DecodeOfferResponse instance + */ + DecodeOfferResponse.create = function create(properties) { + return new DecodeOfferResponse(properties); + }; + + /** + * Encodes the specified DecodeOfferResponse message. Does not implicitly {@link api.DecodeOfferResponse.verify|verify} messages. + * @function encode + * @memberof api.DecodeOfferResponse + * @static + * @param {api.IDecodeOfferResponse} message DecodeOfferResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecodeOfferResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.offer_id != null && Object.hasOwnProperty.call(message, "offer_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.offer_id); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.issuer != null && Object.hasOwnProperty.call(message, "issuer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.issuer); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + $root.types.OfferAmount.encode(message.amount, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.issuer_signing_pubkey != null && Object.hasOwnProperty.call(message, "issuer_signing_pubkey")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.issuer_signing_pubkey); + if (message.absolute_expiry != null && Object.hasOwnProperty.call(message, "absolute_expiry")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.absolute_expiry); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + $root.types.OfferQuantity.encode(message.quantity, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.paths != null && message.paths.length) + for (let i = 0; i < message.paths.length; ++i) + $root.types.BlindedPath.encode(message.paths[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + for (let keys = Object.keys(message.features), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]); + $root.types.Bolt11Feature.encode(message.features[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.chains != null && message.chains.length) + for (let i = 0; i < message.chains.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.chains[i]); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.metadata); + if (message.is_expired != null && Object.hasOwnProperty.call(message, "is_expired")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.is_expired); + return writer; + }; + + /** + * Encodes the specified DecodeOfferResponse message, length delimited. Does not implicitly {@link api.DecodeOfferResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.DecodeOfferResponse + * @static + * @param {api.IDecodeOfferResponse} message DecodeOfferResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecodeOfferResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DecodeOfferResponse message from the specified reader or buffer. + * @function decode + * @memberof api.DecodeOfferResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.DecodeOfferResponse} DecodeOfferResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecodeOfferResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.DecodeOfferResponse(), key, value; + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.offer_id = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.issuer = reader.string(); + break; + } + case 4: { + message.amount = $root.types.OfferAmount.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.issuer_signing_pubkey = reader.string(); + break; + } + case 6: { + message.absolute_expiry = reader.uint64(); + break; + } + case 7: { + message.quantity = $root.types.OfferQuantity.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push($root.types.BlindedPath.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + case 9: { + if (message.features === $util.emptyObject) + message.features = {}; + let end2 = reader.uint32() + reader.pos; + key = 0; + value = null; + while (reader.pos < end2) { + let tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint32(); + break; + case 2: + value = $root.types.Bolt11Feature.decode(reader, reader.uint32(), undefined, long + 1); + break; + default: + reader.skipType(tag2 & 7, long); + break; + } + } + message.features[key] = value; + break; + } + case 10: { + if (!(message.chains && message.chains.length)) + message.chains = []; + message.chains.push(reader.string()); + break; + } + case 11: { + message.metadata = reader.string(); + break; + } + case 12: { + message.is_expired = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DecodeOfferResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.DecodeOfferResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.DecodeOfferResponse} DecodeOfferResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecodeOfferResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DecodeOfferResponse message. + * @function verify + * @memberof api.DecodeOfferResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DecodeOfferResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.offer_id != null && message.hasOwnProperty("offer_id")) + if (!$util.isString(message.offer_id)) + return "offer_id: string expected"; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.issuer != null && message.hasOwnProperty("issuer")) { + properties._issuer = 1; + if (!$util.isString(message.issuer)) + return "issuer: string expected"; + } + if (message.amount != null && message.hasOwnProperty("amount")) { + let error = $root.types.OfferAmount.verify(message.amount, long + 1); + if (error) + return "amount." + error; + } + if (message.issuer_signing_pubkey != null && message.hasOwnProperty("issuer_signing_pubkey")) { + properties._issuer_signing_pubkey = 1; + if (!$util.isString(message.issuer_signing_pubkey)) + return "issuer_signing_pubkey: string expected"; + } + if (message.absolute_expiry != null && message.hasOwnProperty("absolute_expiry")) { + properties._absolute_expiry = 1; + if (!$util.isInteger(message.absolute_expiry) && !(message.absolute_expiry && $util.isInteger(message.absolute_expiry.low) && $util.isInteger(message.absolute_expiry.high))) + return "absolute_expiry: integer|Long expected"; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) { + let error = $root.types.OfferQuantity.verify(message.quantity, long + 1); + if (error) + return "quantity." + error; + } + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (let i = 0; i < message.paths.length; ++i) { + let error = $root.types.BlindedPath.verify(message.paths[i], long + 1); + if (error) + return "paths." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + if (!$util.isObject(message.features)) + return "features: object expected"; + let key = Object.keys(message.features); + for (let i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "features: integer key{k:uint32} expected"; + { + let error = $root.types.Bolt11Feature.verify(message.features[key[i]], long + 1); + if (error) + return "features." + error; + } + } + } + if (message.chains != null && message.hasOwnProperty("chains")) { + if (!Array.isArray(message.chains)) + return "chains: array expected"; + for (let i = 0; i < message.chains.length; ++i) + if (!$util.isString(message.chains[i])) + return "chains: string[] expected"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + properties._metadata = 1; + if (!$util.isString(message.metadata)) + return "metadata: string expected"; + } + if (message.is_expired != null && message.hasOwnProperty("is_expired")) + if (typeof message.is_expired !== "boolean") + return "is_expired: boolean expected"; + return null; + }; + + /** + * Creates a DecodeOfferResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.DecodeOfferResponse + * @static + * @param {Object.} object Plain object + * @returns {api.DecodeOfferResponse} DecodeOfferResponse + */ + DecodeOfferResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.DecodeOfferResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.api.DecodeOfferResponse(); + if (object.offer_id != null) + message.offer_id = String(object.offer_id); + if (object.description != null) + message.description = String(object.description); + if (object.issuer != null) + message.issuer = String(object.issuer); + if (object.amount != null) { + if (typeof object.amount !== "object") + throw TypeError(".api.DecodeOfferResponse.amount: object expected"); + message.amount = $root.types.OfferAmount.fromObject(object.amount, long + 1); + } + if (object.issuer_signing_pubkey != null) + message.issuer_signing_pubkey = String(object.issuer_signing_pubkey); + if (object.absolute_expiry != null) + if ($util.Long) + (message.absolute_expiry = $util.Long.fromValue(object.absolute_expiry)).unsigned = true; + else if (typeof object.absolute_expiry === "string") + message.absolute_expiry = parseInt(object.absolute_expiry, 10); + else if (typeof object.absolute_expiry === "number") + message.absolute_expiry = object.absolute_expiry; + else if (typeof object.absolute_expiry === "object") + message.absolute_expiry = new $util.LongBits(object.absolute_expiry.low >>> 0, object.absolute_expiry.high >>> 0).toNumber(true); + if (object.quantity != null) { + if (typeof object.quantity !== "object") + throw TypeError(".api.DecodeOfferResponse.quantity: object expected"); + message.quantity = $root.types.OfferQuantity.fromObject(object.quantity, long + 1); + } + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".api.DecodeOfferResponse.paths: array expected"); + message.paths = []; + for (let i = 0; i < object.paths.length; ++i) { + if (typeof object.paths[i] !== "object") + throw TypeError(".api.DecodeOfferResponse.paths: object expected"); + message.paths[i] = $root.types.BlindedPath.fromObject(object.paths[i], long + 1); + } + } + if (object.features) { + if (typeof object.features !== "object") + throw TypeError(".api.DecodeOfferResponse.features: object expected"); + message.features = {}; + for (let keys = Object.keys(object.features), i = 0; i < keys.length; ++i) { + if (keys[i] === "__proto__") + $util.makeProp(message.features, keys[i]); + if (typeof object.features[keys[i]] !== "object") + throw TypeError(".api.DecodeOfferResponse.features: object expected"); + message.features[keys[i]] = $root.types.Bolt11Feature.fromObject(object.features[keys[i]], long + 1); + } + } + if (object.chains) { + if (!Array.isArray(object.chains)) + throw TypeError(".api.DecodeOfferResponse.chains: array expected"); + message.chains = []; + for (let i = 0; i < object.chains.length; ++i) + message.chains[i] = String(object.chains[i]); + } + if (object.metadata != null) + message.metadata = String(object.metadata); + if (object.is_expired != null) + message.is_expired = Boolean(object.is_expired); + return message; + }; + + /** + * Creates a plain object from a DecodeOfferResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.DecodeOfferResponse + * @static + * @param {api.DecodeOfferResponse} message DecodeOfferResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DecodeOfferResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) { + object.paths = []; + object.chains = []; + } + if (options.objects || options.defaults) + object.features = {}; + if (options.defaults) { + object.offer_id = ""; + object.amount = null; + object.quantity = null; + object.is_expired = false; + } + if (message.offer_id != null && message.hasOwnProperty("offer_id")) + object.offer_id = message.offer_id; + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.issuer != null && message.hasOwnProperty("issuer")) { + object.issuer = message.issuer; + if (options.oneofs) + object._issuer = "issuer"; + } + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = $root.types.OfferAmount.toObject(message.amount, options); + if (message.issuer_signing_pubkey != null && message.hasOwnProperty("issuer_signing_pubkey")) { + object.issuer_signing_pubkey = message.issuer_signing_pubkey; + if (options.oneofs) + object._issuer_signing_pubkey = "issuer_signing_pubkey"; + } + if (message.absolute_expiry != null && message.hasOwnProperty("absolute_expiry")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.absolute_expiry = typeof message.absolute_expiry === "number" ? BigInt(message.absolute_expiry) : $util.Long.fromBits(message.absolute_expiry.low >>> 0, message.absolute_expiry.high >>> 0, true).toBigInt(); + else if (typeof message.absolute_expiry === "number") + object.absolute_expiry = options.longs === String ? String(message.absolute_expiry) : message.absolute_expiry; + else + object.absolute_expiry = options.longs === String ? $util.Long.prototype.toString.call(message.absolute_expiry) : options.longs === Number ? new $util.LongBits(message.absolute_expiry.low >>> 0, message.absolute_expiry.high >>> 0).toNumber(true) : message.absolute_expiry; + if (options.oneofs) + object._absolute_expiry = "absolute_expiry"; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) + object.quantity = $root.types.OfferQuantity.toObject(message.quantity, options); + if (message.paths && message.paths.length) { + object.paths = []; + for (let j = 0; j < message.paths.length; ++j) + object.paths[j] = $root.types.BlindedPath.toObject(message.paths[j], options); + } + let keys2; + if (message.features && (keys2 = Object.keys(message.features)).length) { + object.features = {}; + for (let j = 0; j < keys2.length; ++j) { + if (keys2[j] === "__proto__") + $util.makeProp(object.features, keys2[j]); + object.features[keys2[j]] = $root.types.Bolt11Feature.toObject(message.features[keys2[j]], options); + } + } + if (message.chains && message.chains.length) { + object.chains = []; + for (let j = 0; j < message.chains.length; ++j) + object.chains[j] = message.chains[j]; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + object.metadata = message.metadata; + if (options.oneofs) + object._metadata = "metadata"; + } + if (message.is_expired != null && message.hasOwnProperty("is_expired")) + object.is_expired = message.is_expired; + return object; + }; + + /** + * Converts this DecodeOfferResponse to JSON. + * @function toJSON + * @memberof api.DecodeOfferResponse + * @instance + * @returns {Object.} JSON object + */ + DecodeOfferResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DecodeOfferResponse + * @function getTypeUrl + * @memberof api.DecodeOfferResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DecodeOfferResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.DecodeOfferResponse"; + }; + + return DecodeOfferResponse; + })(); + + api.SubscribeEventsRequest = (function() { + + /** + * Properties of a SubscribeEventsRequest. + * @memberof api + * @interface ISubscribeEventsRequest + */ + + /** + * Constructs a new SubscribeEventsRequest. + * @memberof api + * @classdesc Represents a SubscribeEventsRequest. + * @implements ISubscribeEventsRequest + * @constructor + * @param {api.ISubscribeEventsRequest=} [properties] Properties to set + */ + function SubscribeEventsRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new SubscribeEventsRequest instance using the specified properties. + * @function create + * @memberof api.SubscribeEventsRequest + * @static + * @param {api.ISubscribeEventsRequest=} [properties] Properties to set + * @returns {api.SubscribeEventsRequest} SubscribeEventsRequest instance + */ + SubscribeEventsRequest.create = function create(properties) { + return new SubscribeEventsRequest(properties); + }; + + /** + * Encodes the specified SubscribeEventsRequest message. Does not implicitly {@link api.SubscribeEventsRequest.verify|verify} messages. + * @function encode + * @memberof api.SubscribeEventsRequest + * @static + * @param {api.ISubscribeEventsRequest} message SubscribeEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeEventsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified SubscribeEventsRequest message, length delimited. Does not implicitly {@link api.SubscribeEventsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.SubscribeEventsRequest + * @static + * @param {api.ISubscribeEventsRequest} message SubscribeEventsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscribeEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscribeEventsRequest message from the specified reader or buffer. + * @function decode + * @memberof api.SubscribeEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.SubscribeEventsRequest} SubscribeEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeEventsRequest.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.SubscribeEventsRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a SubscribeEventsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.SubscribeEventsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.SubscribeEventsRequest} SubscribeEventsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscribeEventsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscribeEventsRequest message. + * @function verify + * @memberof api.SubscribeEventsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscribeEventsRequest.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates a SubscribeEventsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.SubscribeEventsRequest + * @static + * @param {Object.} object Plain object + * @returns {api.SubscribeEventsRequest} SubscribeEventsRequest + */ + SubscribeEventsRequest.fromObject = function fromObject(object, long) { + if (object instanceof $root.api.SubscribeEventsRequest) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.api.SubscribeEventsRequest(); + }; + + /** + * Creates a plain object from a SubscribeEventsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.SubscribeEventsRequest + * @static + * @param {api.SubscribeEventsRequest} message SubscribeEventsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscribeEventsRequest.toObject = function toObject() { + return {}; + }; + + /** + * Converts this SubscribeEventsRequest to JSON. + * @function toJSON + * @memberof api.SubscribeEventsRequest + * @instance + * @returns {Object.} JSON object + */ + SubscribeEventsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubscribeEventsRequest + * @function getTypeUrl + * @memberof api.SubscribeEventsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubscribeEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.SubscribeEventsRequest"; + }; + + return SubscribeEventsRequest; + })(); + + api.LightningNode = (function() { + + /** + * Constructs a new LightningNode service. + * @memberof api + * @classdesc Represents a LightningNode + * @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 LightningNode(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (LightningNode.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LightningNode; + + /** + * Creates new LightningNode service using the specified rpc implementation. + * @function create + * @memberof api.LightningNode + * @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 {LightningNode} RPC service. Useful where requests and/or responses are streamed. + */ + LightningNode.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link api.LightningNode#getNodeInfo}. + * @memberof api.LightningNode + * @typedef GetNodeInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.GetNodeInfoResponse} [response] GetNodeInfoResponse + */ + + /** + * Calls GetNodeInfo. + * @function getNodeInfo + * @memberof api.LightningNode + * @instance + * @param {api.IGetNodeInfoRequest} request GetNodeInfoRequest message or plain object + * @param {api.LightningNode.GetNodeInfoCallback} callback Node-style callback called with the error, if any, and GetNodeInfoResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.getNodeInfo = function getNodeInfo(request, callback) { + return this.rpcCall(getNodeInfo, $root.api.GetNodeInfoRequest, $root.api.GetNodeInfoResponse, request, callback); + }, "name", { value: "GetNodeInfo" }); + + /** + * Calls GetNodeInfo. + * @function getNodeInfo + * @memberof api.LightningNode + * @instance + * @param {api.IGetNodeInfoRequest} request GetNodeInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#getBalances}. + * @memberof api.LightningNode + * @typedef GetBalancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.GetBalancesResponse} [response] GetBalancesResponse + */ + + /** + * Calls GetBalances. + * @function getBalances + * @memberof api.LightningNode + * @instance + * @param {api.IGetBalancesRequest} request GetBalancesRequest message or plain object + * @param {api.LightningNode.GetBalancesCallback} callback Node-style callback called with the error, if any, and GetBalancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.getBalances = function getBalances(request, callback) { + return this.rpcCall(getBalances, $root.api.GetBalancesRequest, $root.api.GetBalancesResponse, request, callback); + }, "name", { value: "GetBalances" }); + + /** + * Calls GetBalances. + * @function getBalances + * @memberof api.LightningNode + * @instance + * @param {api.IGetBalancesRequest} request GetBalancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#onchainReceive}. + * @memberof api.LightningNode + * @typedef OnchainReceiveCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.OnchainReceiveResponse} [response] OnchainReceiveResponse + */ + + /** + * Calls OnchainReceive. + * @function onchainReceive + * @memberof api.LightningNode + * @instance + * @param {api.IOnchainReceiveRequest} request OnchainReceiveRequest message or plain object + * @param {api.LightningNode.OnchainReceiveCallback} callback Node-style callback called with the error, if any, and OnchainReceiveResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.onchainReceive = function onchainReceive(request, callback) { + return this.rpcCall(onchainReceive, $root.api.OnchainReceiveRequest, $root.api.OnchainReceiveResponse, request, callback); + }, "name", { value: "OnchainReceive" }); + + /** + * Calls OnchainReceive. + * @function onchainReceive + * @memberof api.LightningNode + * @instance + * @param {api.IOnchainReceiveRequest} request OnchainReceiveRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#onchainSend}. + * @memberof api.LightningNode + * @typedef OnchainSendCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.OnchainSendResponse} [response] OnchainSendResponse + */ + + /** + * Calls OnchainSend. + * @function onchainSend + * @memberof api.LightningNode + * @instance + * @param {api.IOnchainSendRequest} request OnchainSendRequest message or plain object + * @param {api.LightningNode.OnchainSendCallback} callback Node-style callback called with the error, if any, and OnchainSendResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.onchainSend = function onchainSend(request, callback) { + return this.rpcCall(onchainSend, $root.api.OnchainSendRequest, $root.api.OnchainSendResponse, request, callback); + }, "name", { value: "OnchainSend" }); + + /** + * Calls OnchainSend. + * @function onchainSend + * @memberof api.LightningNode + * @instance + * @param {api.IOnchainSendRequest} request OnchainSendRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#bolt11Receive}. + * @memberof api.LightningNode + * @typedef Bolt11ReceiveCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.Bolt11ReceiveResponse} [response] Bolt11ReceiveResponse + */ + + /** + * Calls Bolt11Receive. + * @function bolt11Receive + * @memberof api.LightningNode + * @instance + * @param {api.IBolt11ReceiveRequest} request Bolt11ReceiveRequest message or plain object + * @param {api.LightningNode.Bolt11ReceiveCallback} callback Node-style callback called with the error, if any, and Bolt11ReceiveResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.bolt11Receive = function bolt11Receive(request, callback) { + return this.rpcCall(bolt11Receive, $root.api.Bolt11ReceiveRequest, $root.api.Bolt11ReceiveResponse, request, callback); + }, "name", { value: "Bolt11Receive" }); + + /** + * Calls Bolt11Receive. + * @function bolt11Receive + * @memberof api.LightningNode + * @instance + * @param {api.IBolt11ReceiveRequest} request Bolt11ReceiveRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#bolt11ReceiveForHash}. + * @memberof api.LightningNode + * @typedef Bolt11ReceiveForHashCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.Bolt11ReceiveForHashResponse} [response] Bolt11ReceiveForHashResponse + */ + + /** + * Calls Bolt11ReceiveForHash. + * @function bolt11ReceiveForHash + * @memberof api.LightningNode + * @instance + * @param {api.IBolt11ReceiveForHashRequest} request Bolt11ReceiveForHashRequest message or plain object + * @param {api.LightningNode.Bolt11ReceiveForHashCallback} callback Node-style callback called with the error, if any, and Bolt11ReceiveForHashResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.bolt11ReceiveForHash = function bolt11ReceiveForHash(request, callback) { + return this.rpcCall(bolt11ReceiveForHash, $root.api.Bolt11ReceiveForHashRequest, $root.api.Bolt11ReceiveForHashResponse, request, callback); + }, "name", { value: "Bolt11ReceiveForHash" }); + + /** + * Calls Bolt11ReceiveForHash. + * @function bolt11ReceiveForHash + * @memberof api.LightningNode + * @instance + * @param {api.IBolt11ReceiveForHashRequest} request Bolt11ReceiveForHashRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#bolt11ClaimForHash}. + * @memberof api.LightningNode + * @typedef Bolt11ClaimForHashCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.Bolt11ClaimForHashResponse} [response] Bolt11ClaimForHashResponse + */ + + /** + * Calls Bolt11ClaimForHash. + * @function bolt11ClaimForHash + * @memberof api.LightningNode + * @instance + * @param {api.IBolt11ClaimForHashRequest} request Bolt11ClaimForHashRequest message or plain object + * @param {api.LightningNode.Bolt11ClaimForHashCallback} callback Node-style callback called with the error, if any, and Bolt11ClaimForHashResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.bolt11ClaimForHash = function bolt11ClaimForHash(request, callback) { + return this.rpcCall(bolt11ClaimForHash, $root.api.Bolt11ClaimForHashRequest, $root.api.Bolt11ClaimForHashResponse, request, callback); + }, "name", { value: "Bolt11ClaimForHash" }); + + /** + * Calls Bolt11ClaimForHash. + * @function bolt11ClaimForHash + * @memberof api.LightningNode + * @instance + * @param {api.IBolt11ClaimForHashRequest} request Bolt11ClaimForHashRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#bolt11FailForHash}. + * @memberof api.LightningNode + * @typedef Bolt11FailForHashCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.Bolt11FailForHashResponse} [response] Bolt11FailForHashResponse + */ + + /** + * Calls Bolt11FailForHash. + * @function bolt11FailForHash + * @memberof api.LightningNode + * @instance + * @param {api.IBolt11FailForHashRequest} request Bolt11FailForHashRequest message or plain object + * @param {api.LightningNode.Bolt11FailForHashCallback} callback Node-style callback called with the error, if any, and Bolt11FailForHashResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.bolt11FailForHash = function bolt11FailForHash(request, callback) { + return this.rpcCall(bolt11FailForHash, $root.api.Bolt11FailForHashRequest, $root.api.Bolt11FailForHashResponse, request, callback); + }, "name", { value: "Bolt11FailForHash" }); + + /** + * Calls Bolt11FailForHash. + * @function bolt11FailForHash + * @memberof api.LightningNode + * @instance + * @param {api.IBolt11FailForHashRequest} request Bolt11FailForHashRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#bolt11ReceiveViaJitChannel}. + * @memberof api.LightningNode + * @typedef Bolt11ReceiveViaJitChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.Bolt11ReceiveViaJitChannelResponse} [response] Bolt11ReceiveViaJitChannelResponse + */ + + /** + * Calls Bolt11ReceiveViaJitChannel. + * @function bolt11ReceiveViaJitChannel + * @memberof api.LightningNode + * @instance + * @param {api.IBolt11ReceiveViaJitChannelRequest} request Bolt11ReceiveViaJitChannelRequest message or plain object + * @param {api.LightningNode.Bolt11ReceiveViaJitChannelCallback} callback Node-style callback called with the error, if any, and Bolt11ReceiveViaJitChannelResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.bolt11ReceiveViaJitChannel = function bolt11ReceiveViaJitChannel(request, callback) { + return this.rpcCall(bolt11ReceiveViaJitChannel, $root.api.Bolt11ReceiveViaJitChannelRequest, $root.api.Bolt11ReceiveViaJitChannelResponse, request, callback); + }, "name", { value: "Bolt11ReceiveViaJitChannel" }); + + /** + * Calls Bolt11ReceiveViaJitChannel. + * @function bolt11ReceiveViaJitChannel + * @memberof api.LightningNode + * @instance + * @param {api.IBolt11ReceiveViaJitChannelRequest} request Bolt11ReceiveViaJitChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#bolt11ReceiveVariableAmountViaJitChannel}. + * @memberof api.LightningNode + * @typedef Bolt11ReceiveVariableAmountViaJitChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.Bolt11ReceiveVariableAmountViaJitChannelResponse} [response] Bolt11ReceiveVariableAmountViaJitChannelResponse + */ + + /** + * Calls Bolt11ReceiveVariableAmountViaJitChannel. + * @function bolt11ReceiveVariableAmountViaJitChannel + * @memberof api.LightningNode + * @instance + * @param {api.IBolt11ReceiveVariableAmountViaJitChannelRequest} request Bolt11ReceiveVariableAmountViaJitChannelRequest message or plain object + * @param {api.LightningNode.Bolt11ReceiveVariableAmountViaJitChannelCallback} callback Node-style callback called with the error, if any, and Bolt11ReceiveVariableAmountViaJitChannelResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.bolt11ReceiveVariableAmountViaJitChannel = function bolt11ReceiveVariableAmountViaJitChannel(request, callback) { + return this.rpcCall(bolt11ReceiveVariableAmountViaJitChannel, $root.api.Bolt11ReceiveVariableAmountViaJitChannelRequest, $root.api.Bolt11ReceiveVariableAmountViaJitChannelResponse, request, callback); + }, "name", { value: "Bolt11ReceiveVariableAmountViaJitChannel" }); + + /** + * Calls Bolt11ReceiveVariableAmountViaJitChannel. + * @function bolt11ReceiveVariableAmountViaJitChannel + * @memberof api.LightningNode + * @instance + * @param {api.IBolt11ReceiveVariableAmountViaJitChannelRequest} request Bolt11ReceiveVariableAmountViaJitChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#bolt11Send}. + * @memberof api.LightningNode + * @typedef Bolt11SendCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.Bolt11SendResponse} [response] Bolt11SendResponse + */ + + /** + * Calls Bolt11Send. + * @function bolt11Send + * @memberof api.LightningNode + * @instance + * @param {api.IBolt11SendRequest} request Bolt11SendRequest message or plain object + * @param {api.LightningNode.Bolt11SendCallback} callback Node-style callback called with the error, if any, and Bolt11SendResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.bolt11Send = function bolt11Send(request, callback) { + return this.rpcCall(bolt11Send, $root.api.Bolt11SendRequest, $root.api.Bolt11SendResponse, request, callback); + }, "name", { value: "Bolt11Send" }); + + /** + * Calls Bolt11Send. + * @function bolt11Send + * @memberof api.LightningNode + * @instance + * @param {api.IBolt11SendRequest} request Bolt11SendRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#bolt12Receive}. + * @memberof api.LightningNode + * @typedef Bolt12ReceiveCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.Bolt12ReceiveResponse} [response] Bolt12ReceiveResponse + */ + + /** + * Calls Bolt12Receive. + * @function bolt12Receive + * @memberof api.LightningNode + * @instance + * @param {api.IBolt12ReceiveRequest} request Bolt12ReceiveRequest message or plain object + * @param {api.LightningNode.Bolt12ReceiveCallback} callback Node-style callback called with the error, if any, and Bolt12ReceiveResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.bolt12Receive = function bolt12Receive(request, callback) { + return this.rpcCall(bolt12Receive, $root.api.Bolt12ReceiveRequest, $root.api.Bolt12ReceiveResponse, request, callback); + }, "name", { value: "Bolt12Receive" }); + + /** + * Calls Bolt12Receive. + * @function bolt12Receive + * @memberof api.LightningNode + * @instance + * @param {api.IBolt12ReceiveRequest} request Bolt12ReceiveRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#bolt12Send}. + * @memberof api.LightningNode + * @typedef Bolt12SendCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.Bolt12SendResponse} [response] Bolt12SendResponse + */ + + /** + * Calls Bolt12Send. + * @function bolt12Send + * @memberof api.LightningNode + * @instance + * @param {api.IBolt12SendRequest} request Bolt12SendRequest message or plain object + * @param {api.LightningNode.Bolt12SendCallback} callback Node-style callback called with the error, if any, and Bolt12SendResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.bolt12Send = function bolt12Send(request, callback) { + return this.rpcCall(bolt12Send, $root.api.Bolt12SendRequest, $root.api.Bolt12SendResponse, request, callback); + }, "name", { value: "Bolt12Send" }); + + /** + * Calls Bolt12Send. + * @function bolt12Send + * @memberof api.LightningNode + * @instance + * @param {api.IBolt12SendRequest} request Bolt12SendRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#spontaneousSend}. + * @memberof api.LightningNode + * @typedef SpontaneousSendCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.SpontaneousSendResponse} [response] SpontaneousSendResponse + */ + + /** + * Calls SpontaneousSend. + * @function spontaneousSend + * @memberof api.LightningNode + * @instance + * @param {api.ISpontaneousSendRequest} request SpontaneousSendRequest message or plain object + * @param {api.LightningNode.SpontaneousSendCallback} callback Node-style callback called with the error, if any, and SpontaneousSendResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.spontaneousSend = function spontaneousSend(request, callback) { + return this.rpcCall(spontaneousSend, $root.api.SpontaneousSendRequest, $root.api.SpontaneousSendResponse, request, callback); + }, "name", { value: "SpontaneousSend" }); + + /** + * Calls SpontaneousSend. + * @function spontaneousSend + * @memberof api.LightningNode + * @instance + * @param {api.ISpontaneousSendRequest} request SpontaneousSendRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#openChannel}. + * @memberof api.LightningNode + * @typedef OpenChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.OpenChannelResponse} [response] OpenChannelResponse + */ + + /** + * Calls OpenChannel. + * @function openChannel + * @memberof api.LightningNode + * @instance + * @param {api.IOpenChannelRequest} request OpenChannelRequest message or plain object + * @param {api.LightningNode.OpenChannelCallback} callback Node-style callback called with the error, if any, and OpenChannelResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.openChannel = function openChannel(request, callback) { + return this.rpcCall(openChannel, $root.api.OpenChannelRequest, $root.api.OpenChannelResponse, request, callback); + }, "name", { value: "OpenChannel" }); + + /** + * Calls OpenChannel. + * @function openChannel + * @memberof api.LightningNode + * @instance + * @param {api.IOpenChannelRequest} request OpenChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#spliceIn}. + * @memberof api.LightningNode + * @typedef SpliceInCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.SpliceInResponse} [response] SpliceInResponse + */ + + /** + * Calls SpliceIn. + * @function spliceIn + * @memberof api.LightningNode + * @instance + * @param {api.ISpliceInRequest} request SpliceInRequest message or plain object + * @param {api.LightningNode.SpliceInCallback} callback Node-style callback called with the error, if any, and SpliceInResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.spliceIn = function spliceIn(request, callback) { + return this.rpcCall(spliceIn, $root.api.SpliceInRequest, $root.api.SpliceInResponse, request, callback); + }, "name", { value: "SpliceIn" }); + + /** + * Calls SpliceIn. + * @function spliceIn + * @memberof api.LightningNode + * @instance + * @param {api.ISpliceInRequest} request SpliceInRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#spliceOut}. + * @memberof api.LightningNode + * @typedef SpliceOutCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.SpliceOutResponse} [response] SpliceOutResponse + */ + + /** + * Calls SpliceOut. + * @function spliceOut + * @memberof api.LightningNode + * @instance + * @param {api.ISpliceOutRequest} request SpliceOutRequest message or plain object + * @param {api.LightningNode.SpliceOutCallback} callback Node-style callback called with the error, if any, and SpliceOutResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.spliceOut = function spliceOut(request, callback) { + return this.rpcCall(spliceOut, $root.api.SpliceOutRequest, $root.api.SpliceOutResponse, request, callback); + }, "name", { value: "SpliceOut" }); + + /** + * Calls SpliceOut. + * @function spliceOut + * @memberof api.LightningNode + * @instance + * @param {api.ISpliceOutRequest} request SpliceOutRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#updateChannelConfig}. + * @memberof api.LightningNode + * @typedef UpdateChannelConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.UpdateChannelConfigResponse} [response] UpdateChannelConfigResponse + */ + + /** + * Calls UpdateChannelConfig. + * @function updateChannelConfig + * @memberof api.LightningNode + * @instance + * @param {api.IUpdateChannelConfigRequest} request UpdateChannelConfigRequest message or plain object + * @param {api.LightningNode.UpdateChannelConfigCallback} callback Node-style callback called with the error, if any, and UpdateChannelConfigResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.updateChannelConfig = function updateChannelConfig(request, callback) { + return this.rpcCall(updateChannelConfig, $root.api.UpdateChannelConfigRequest, $root.api.UpdateChannelConfigResponse, request, callback); + }, "name", { value: "UpdateChannelConfig" }); + + /** + * Calls UpdateChannelConfig. + * @function updateChannelConfig + * @memberof api.LightningNode + * @instance + * @param {api.IUpdateChannelConfigRequest} request UpdateChannelConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#closeChannel}. + * @memberof api.LightningNode + * @typedef CloseChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.CloseChannelResponse} [response] CloseChannelResponse + */ + + /** + * Calls CloseChannel. + * @function closeChannel + * @memberof api.LightningNode + * @instance + * @param {api.ICloseChannelRequest} request CloseChannelRequest message or plain object + * @param {api.LightningNode.CloseChannelCallback} callback Node-style callback called with the error, if any, and CloseChannelResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.closeChannel = function closeChannel(request, callback) { + return this.rpcCall(closeChannel, $root.api.CloseChannelRequest, $root.api.CloseChannelResponse, request, callback); + }, "name", { value: "CloseChannel" }); + + /** + * Calls CloseChannel. + * @function closeChannel + * @memberof api.LightningNode + * @instance + * @param {api.ICloseChannelRequest} request CloseChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#forceCloseChannel}. + * @memberof api.LightningNode + * @typedef ForceCloseChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.ForceCloseChannelResponse} [response] ForceCloseChannelResponse + */ + + /** + * Calls ForceCloseChannel. + * @function forceCloseChannel + * @memberof api.LightningNode + * @instance + * @param {api.IForceCloseChannelRequest} request ForceCloseChannelRequest message or plain object + * @param {api.LightningNode.ForceCloseChannelCallback} callback Node-style callback called with the error, if any, and ForceCloseChannelResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.forceCloseChannel = function forceCloseChannel(request, callback) { + return this.rpcCall(forceCloseChannel, $root.api.ForceCloseChannelRequest, $root.api.ForceCloseChannelResponse, request, callback); + }, "name", { value: "ForceCloseChannel" }); + + /** + * Calls ForceCloseChannel. + * @function forceCloseChannel + * @memberof api.LightningNode + * @instance + * @param {api.IForceCloseChannelRequest} request ForceCloseChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#listChannels}. + * @memberof api.LightningNode + * @typedef ListChannelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.ListChannelsResponse} [response] ListChannelsResponse + */ + + /** + * Calls ListChannels. + * @function listChannels + * @memberof api.LightningNode + * @instance + * @param {api.IListChannelsRequest} request ListChannelsRequest message or plain object + * @param {api.LightningNode.ListChannelsCallback} callback Node-style callback called with the error, if any, and ListChannelsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.listChannels = function listChannels(request, callback) { + return this.rpcCall(listChannels, $root.api.ListChannelsRequest, $root.api.ListChannelsResponse, request, callback); + }, "name", { value: "ListChannels" }); + + /** + * Calls ListChannels. + * @function listChannels + * @memberof api.LightningNode + * @instance + * @param {api.IListChannelsRequest} request ListChannelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#getPaymentDetails}. + * @memberof api.LightningNode + * @typedef GetPaymentDetailsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.GetPaymentDetailsResponse} [response] GetPaymentDetailsResponse + */ + + /** + * Calls GetPaymentDetails. + * @function getPaymentDetails + * @memberof api.LightningNode + * @instance + * @param {api.IGetPaymentDetailsRequest} request GetPaymentDetailsRequest message or plain object + * @param {api.LightningNode.GetPaymentDetailsCallback} callback Node-style callback called with the error, if any, and GetPaymentDetailsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.getPaymentDetails = function getPaymentDetails(request, callback) { + return this.rpcCall(getPaymentDetails, $root.api.GetPaymentDetailsRequest, $root.api.GetPaymentDetailsResponse, request, callback); + }, "name", { value: "GetPaymentDetails" }); + + /** + * Calls GetPaymentDetails. + * @function getPaymentDetails + * @memberof api.LightningNode + * @instance + * @param {api.IGetPaymentDetailsRequest} request GetPaymentDetailsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#listPayments}. + * @memberof api.LightningNode + * @typedef ListPaymentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.ListPaymentsResponse} [response] ListPaymentsResponse + */ + + /** + * Calls ListPayments. + * @function listPayments + * @memberof api.LightningNode + * @instance + * @param {api.IListPaymentsRequest} request ListPaymentsRequest message or plain object + * @param {api.LightningNode.ListPaymentsCallback} callback Node-style callback called with the error, if any, and ListPaymentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.listPayments = function listPayments(request, callback) { + return this.rpcCall(listPayments, $root.api.ListPaymentsRequest, $root.api.ListPaymentsResponse, request, callback); + }, "name", { value: "ListPayments" }); + + /** + * Calls ListPayments. + * @function listPayments + * @memberof api.LightningNode + * @instance + * @param {api.IListPaymentsRequest} request ListPaymentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#listForwardedPayments}. + * @memberof api.LightningNode + * @typedef ListForwardedPaymentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.ListForwardedPaymentsResponse} [response] ListForwardedPaymentsResponse + */ + + /** + * Calls ListForwardedPayments. + * @function listForwardedPayments + * @memberof api.LightningNode + * @instance + * @param {api.IListForwardedPaymentsRequest} request ListForwardedPaymentsRequest message or plain object + * @param {api.LightningNode.ListForwardedPaymentsCallback} callback Node-style callback called with the error, if any, and ListForwardedPaymentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.listForwardedPayments = function listForwardedPayments(request, callback) { + return this.rpcCall(listForwardedPayments, $root.api.ListForwardedPaymentsRequest, $root.api.ListForwardedPaymentsResponse, request, callback); + }, "name", { value: "ListForwardedPayments" }); + + /** + * Calls ListForwardedPayments. + * @function listForwardedPayments + * @memberof api.LightningNode + * @instance + * @param {api.IListForwardedPaymentsRequest} request ListForwardedPaymentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#connectPeer}. + * @memberof api.LightningNode + * @typedef ConnectPeerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.ConnectPeerResponse} [response] ConnectPeerResponse + */ + + /** + * Calls ConnectPeer. + * @function connectPeer + * @memberof api.LightningNode + * @instance + * @param {api.IConnectPeerRequest} request ConnectPeerRequest message or plain object + * @param {api.LightningNode.ConnectPeerCallback} callback Node-style callback called with the error, if any, and ConnectPeerResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.connectPeer = function connectPeer(request, callback) { + return this.rpcCall(connectPeer, $root.api.ConnectPeerRequest, $root.api.ConnectPeerResponse, request, callback); + }, "name", { value: "ConnectPeer" }); + + /** + * Calls ConnectPeer. + * @function connectPeer + * @memberof api.LightningNode + * @instance + * @param {api.IConnectPeerRequest} request ConnectPeerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#disconnectPeer}. + * @memberof api.LightningNode + * @typedef DisconnectPeerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.DisconnectPeerResponse} [response] DisconnectPeerResponse + */ + + /** + * Calls DisconnectPeer. + * @function disconnectPeer + * @memberof api.LightningNode + * @instance + * @param {api.IDisconnectPeerRequest} request DisconnectPeerRequest message or plain object + * @param {api.LightningNode.DisconnectPeerCallback} callback Node-style callback called with the error, if any, and DisconnectPeerResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.disconnectPeer = function disconnectPeer(request, callback) { + return this.rpcCall(disconnectPeer, $root.api.DisconnectPeerRequest, $root.api.DisconnectPeerResponse, request, callback); + }, "name", { value: "DisconnectPeer" }); + + /** + * Calls DisconnectPeer. + * @function disconnectPeer + * @memberof api.LightningNode + * @instance + * @param {api.IDisconnectPeerRequest} request DisconnectPeerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#listPeers}. + * @memberof api.LightningNode + * @typedef ListPeersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.ListPeersResponse} [response] ListPeersResponse + */ + + /** + * Calls ListPeers. + * @function listPeers + * @memberof api.LightningNode + * @instance + * @param {api.IListPeersRequest} request ListPeersRequest message or plain object + * @param {api.LightningNode.ListPeersCallback} callback Node-style callback called with the error, if any, and ListPeersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.listPeers = function listPeers(request, callback) { + return this.rpcCall(listPeers, $root.api.ListPeersRequest, $root.api.ListPeersResponse, request, callback); + }, "name", { value: "ListPeers" }); + + /** + * Calls ListPeers. + * @function listPeers + * @memberof api.LightningNode + * @instance + * @param {api.IListPeersRequest} request ListPeersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#signMessage}. + * @memberof api.LightningNode + * @typedef SignMessageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.SignMessageResponse} [response] SignMessageResponse + */ + + /** + * Calls SignMessage. + * @function signMessage + * @memberof api.LightningNode + * @instance + * @param {api.ISignMessageRequest} request SignMessageRequest message or plain object + * @param {api.LightningNode.SignMessageCallback} callback Node-style callback called with the error, if any, and SignMessageResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.signMessage = function signMessage(request, callback) { + return this.rpcCall(signMessage, $root.api.SignMessageRequest, $root.api.SignMessageResponse, request, callback); + }, "name", { value: "SignMessage" }); + + /** + * Calls SignMessage. + * @function signMessage + * @memberof api.LightningNode + * @instance + * @param {api.ISignMessageRequest} request SignMessageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#verifySignature}. + * @memberof api.LightningNode + * @typedef VerifySignatureCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.VerifySignatureResponse} [response] VerifySignatureResponse + */ + + /** + * Calls VerifySignature. + * @function verifySignature + * @memberof api.LightningNode + * @instance + * @param {api.IVerifySignatureRequest} request VerifySignatureRequest message or plain object + * @param {api.LightningNode.VerifySignatureCallback} callback Node-style callback called with the error, if any, and VerifySignatureResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.verifySignature = function verifySignature(request, callback) { + return this.rpcCall(verifySignature, $root.api.VerifySignatureRequest, $root.api.VerifySignatureResponse, request, callback); + }, "name", { value: "VerifySignature" }); + + /** + * Calls VerifySignature. + * @function verifySignature + * @memberof api.LightningNode + * @instance + * @param {api.IVerifySignatureRequest} request VerifySignatureRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#exportPathfindingScores}. + * @memberof api.LightningNode + * @typedef ExportPathfindingScoresCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.ExportPathfindingScoresResponse} [response] ExportPathfindingScoresResponse + */ + + /** + * Calls ExportPathfindingScores. + * @function exportPathfindingScores + * @memberof api.LightningNode + * @instance + * @param {api.IExportPathfindingScoresRequest} request ExportPathfindingScoresRequest message or plain object + * @param {api.LightningNode.ExportPathfindingScoresCallback} callback Node-style callback called with the error, if any, and ExportPathfindingScoresResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.exportPathfindingScores = function exportPathfindingScores(request, callback) { + return this.rpcCall(exportPathfindingScores, $root.api.ExportPathfindingScoresRequest, $root.api.ExportPathfindingScoresResponse, request, callback); + }, "name", { value: "ExportPathfindingScores" }); + + /** + * Calls ExportPathfindingScores. + * @function exportPathfindingScores + * @memberof api.LightningNode + * @instance + * @param {api.IExportPathfindingScoresRequest} request ExportPathfindingScoresRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#unifiedSend}. + * @memberof api.LightningNode + * @typedef UnifiedSendCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.UnifiedSendResponse} [response] UnifiedSendResponse + */ + + /** + * Calls UnifiedSend. + * @function unifiedSend + * @memberof api.LightningNode + * @instance + * @param {api.IUnifiedSendRequest} request UnifiedSendRequest message or plain object + * @param {api.LightningNode.UnifiedSendCallback} callback Node-style callback called with the error, if any, and UnifiedSendResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.unifiedSend = function unifiedSend(request, callback) { + return this.rpcCall(unifiedSend, $root.api.UnifiedSendRequest, $root.api.UnifiedSendResponse, request, callback); + }, "name", { value: "UnifiedSend" }); + + /** + * Calls UnifiedSend. + * @function unifiedSend + * @memberof api.LightningNode + * @instance + * @param {api.IUnifiedSendRequest} request UnifiedSendRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#decodeInvoice}. + * @memberof api.LightningNode + * @typedef DecodeInvoiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.DecodeInvoiceResponse} [response] DecodeInvoiceResponse + */ + + /** + * Calls DecodeInvoice. + * @function decodeInvoice + * @memberof api.LightningNode + * @instance + * @param {api.IDecodeInvoiceRequest} request DecodeInvoiceRequest message or plain object + * @param {api.LightningNode.DecodeInvoiceCallback} callback Node-style callback called with the error, if any, and DecodeInvoiceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.decodeInvoice = function decodeInvoice(request, callback) { + return this.rpcCall(decodeInvoice, $root.api.DecodeInvoiceRequest, $root.api.DecodeInvoiceResponse, request, callback); + }, "name", { value: "DecodeInvoice" }); + + /** + * Calls DecodeInvoice. + * @function decodeInvoice + * @memberof api.LightningNode + * @instance + * @param {api.IDecodeInvoiceRequest} request DecodeInvoiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#decodeOffer}. + * @memberof api.LightningNode + * @typedef DecodeOfferCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.DecodeOfferResponse} [response] DecodeOfferResponse + */ + + /** + * Calls DecodeOffer. + * @function decodeOffer + * @memberof api.LightningNode + * @instance + * @param {api.IDecodeOfferRequest} request DecodeOfferRequest message or plain object + * @param {api.LightningNode.DecodeOfferCallback} callback Node-style callback called with the error, if any, and DecodeOfferResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.decodeOffer = function decodeOffer(request, callback) { + return this.rpcCall(decodeOffer, $root.api.DecodeOfferRequest, $root.api.DecodeOfferResponse, request, callback); + }, "name", { value: "DecodeOffer" }); + + /** + * Calls DecodeOffer. + * @function decodeOffer + * @memberof api.LightningNode + * @instance + * @param {api.IDecodeOfferRequest} request DecodeOfferRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#graphListChannels}. + * @memberof api.LightningNode + * @typedef GraphListChannelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.GraphListChannelsResponse} [response] GraphListChannelsResponse + */ + + /** + * Calls GraphListChannels. + * @function graphListChannels + * @memberof api.LightningNode + * @instance + * @param {api.IGraphListChannelsRequest} request GraphListChannelsRequest message or plain object + * @param {api.LightningNode.GraphListChannelsCallback} callback Node-style callback called with the error, if any, and GraphListChannelsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.graphListChannels = function graphListChannels(request, callback) { + return this.rpcCall(graphListChannels, $root.api.GraphListChannelsRequest, $root.api.GraphListChannelsResponse, request, callback); + }, "name", { value: "GraphListChannels" }); + + /** + * Calls GraphListChannels. + * @function graphListChannels + * @memberof api.LightningNode + * @instance + * @param {api.IGraphListChannelsRequest} request GraphListChannelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#graphGetChannel}. + * @memberof api.LightningNode + * @typedef GraphGetChannelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.GraphGetChannelResponse} [response] GraphGetChannelResponse + */ + + /** + * Calls GraphGetChannel. + * @function graphGetChannel + * @memberof api.LightningNode + * @instance + * @param {api.IGraphGetChannelRequest} request GraphGetChannelRequest message or plain object + * @param {api.LightningNode.GraphGetChannelCallback} callback Node-style callback called with the error, if any, and GraphGetChannelResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.graphGetChannel = function graphGetChannel(request, callback) { + return this.rpcCall(graphGetChannel, $root.api.GraphGetChannelRequest, $root.api.GraphGetChannelResponse, request, callback); + }, "name", { value: "GraphGetChannel" }); + + /** + * Calls GraphGetChannel. + * @function graphGetChannel + * @memberof api.LightningNode + * @instance + * @param {api.IGraphGetChannelRequest} request GraphGetChannelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#graphListNodes}. + * @memberof api.LightningNode + * @typedef GraphListNodesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.GraphListNodesResponse} [response] GraphListNodesResponse + */ + + /** + * Calls GraphListNodes. + * @function graphListNodes + * @memberof api.LightningNode + * @instance + * @param {api.IGraphListNodesRequest} request GraphListNodesRequest message or plain object + * @param {api.LightningNode.GraphListNodesCallback} callback Node-style callback called with the error, if any, and GraphListNodesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.graphListNodes = function graphListNodes(request, callback) { + return this.rpcCall(graphListNodes, $root.api.GraphListNodesRequest, $root.api.GraphListNodesResponse, request, callback); + }, "name", { value: "GraphListNodes" }); + + /** + * Calls GraphListNodes. + * @function graphListNodes + * @memberof api.LightningNode + * @instance + * @param {api.IGraphListNodesRequest} request GraphListNodesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#graphGetNode}. + * @memberof api.LightningNode + * @typedef GraphGetNodeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {api.GraphGetNodeResponse} [response] GraphGetNodeResponse + */ + + /** + * Calls GraphGetNode. + * @function graphGetNode + * @memberof api.LightningNode + * @instance + * @param {api.IGraphGetNodeRequest} request GraphGetNodeRequest message or plain object + * @param {api.LightningNode.GraphGetNodeCallback} callback Node-style callback called with the error, if any, and GraphGetNodeResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.graphGetNode = function graphGetNode(request, callback) { + return this.rpcCall(graphGetNode, $root.api.GraphGetNodeRequest, $root.api.GraphGetNodeResponse, request, callback); + }, "name", { value: "GraphGetNode" }); + + /** + * Calls GraphGetNode. + * @function graphGetNode + * @memberof api.LightningNode + * @instance + * @param {api.IGraphGetNodeRequest} request GraphGetNodeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link api.LightningNode#subscribeEvents}. + * @memberof api.LightningNode + * @typedef SubscribeEventsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {events.EventEnvelope} [response] EventEnvelope + */ + + /** + * Calls SubscribeEvents. + * @function subscribeEvents + * @memberof api.LightningNode + * @instance + * @param {api.ISubscribeEventsRequest} request SubscribeEventsRequest message or plain object + * @param {api.LightningNode.SubscribeEventsCallback} callback Node-style callback called with the error, if any, and EventEnvelope + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LightningNode.prototype.subscribeEvents = function subscribeEvents(request, callback) { + return this.rpcCall(subscribeEvents, $root.api.SubscribeEventsRequest, $root.events.EventEnvelope, request, callback); + }, "name", { value: "SubscribeEvents" }); + + /** + * Calls SubscribeEvents. + * @function subscribeEvents + * @memberof api.LightningNode + * @instance + * @param {api.ISubscribeEventsRequest} request SubscribeEventsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return LightningNode; + })(); + + return api; +})(); + +export const types = $root.types = (() => { + + /** + * Namespace types. + * @exports types + * @namespace + */ + const types = {}; + + types.Payment = (function() { + + /** + * Properties of a Payment. + * @memberof types + * @interface IPayment + * @property {string|null} [id] Payment id + * @property {types.IPaymentKind|null} [kind] Payment kind + * @property {Long|null} [amount_msat] Payment amount_msat + * @property {Long|null} [fee_paid_msat] Payment fee_paid_msat + * @property {types.PaymentDirection|null} [direction] Payment direction + * @property {types.PaymentStatus|null} [status] Payment status + * @property {Long|null} [latest_update_timestamp] Payment latest_update_timestamp + */ + + /** + * Constructs a new Payment. + * @memberof types + * @classdesc Represents a Payment. + * @implements IPayment + * @constructor + * @param {types.IPayment=} [properties] Properties to set + */ + function Payment(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Payment id. + * @member {string} id + * @memberof types.Payment + * @instance + */ + Payment.prototype.id = ""; + + /** + * Payment kind. + * @member {types.IPaymentKind|null|undefined} kind + * @memberof types.Payment + * @instance + */ + Payment.prototype.kind = null; + + /** + * Payment amount_msat. + * @member {Long|null|undefined} amount_msat + * @memberof types.Payment + * @instance + */ + Payment.prototype.amount_msat = null; + + /** + * Payment fee_paid_msat. + * @member {Long|null|undefined} fee_paid_msat + * @memberof types.Payment + * @instance + */ + Payment.prototype.fee_paid_msat = null; + + /** + * Payment direction. + * @member {types.PaymentDirection} direction + * @memberof types.Payment + * @instance + */ + Payment.prototype.direction = 0; + + /** + * Payment status. + * @member {types.PaymentStatus} status + * @memberof types.Payment + * @instance + */ + Payment.prototype.status = 0; + + /** + * Payment latest_update_timestamp. + * @member {Long} latest_update_timestamp + * @memberof types.Payment + * @instance + */ + Payment.prototype.latest_update_timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Payment.prototype, "_amount_msat", { + get: $util.oneOfGetter($oneOfFields = ["amount_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Payment.prototype, "_fee_paid_msat", { + get: $util.oneOfGetter($oneOfFields = ["fee_paid_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Payment instance using the specified properties. + * @function create + * @memberof types.Payment + * @static + * @param {types.IPayment=} [properties] Properties to set + * @returns {types.Payment} Payment instance + */ + Payment.create = function create(properties) { + return new Payment(properties); + }; + + /** + * Encodes the specified Payment message. Does not implicitly {@link types.Payment.verify|verify} messages. + * @function encode + * @memberof types.Payment + * @static + * @param {types.IPayment} message Payment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Payment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + $root.types.PaymentKind.encode(message.kind, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.amount_msat != null && Object.hasOwnProperty.call(message, "amount_msat")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.amount_msat); + if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.direction); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.status); + if (message.latest_update_timestamp != null && Object.hasOwnProperty.call(message, "latest_update_timestamp")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.latest_update_timestamp); + if (message.fee_paid_msat != null && Object.hasOwnProperty.call(message, "fee_paid_msat")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.fee_paid_msat); + return writer; + }; + + /** + * Encodes the specified Payment message, length delimited. Does not implicitly {@link types.Payment.verify|verify} messages. + * @function encodeDelimited + * @memberof types.Payment + * @static + * @param {types.IPayment} message Payment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Payment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Payment message from the specified reader or buffer. + * @function decode + * @memberof types.Payment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.Payment} Payment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Payment.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Payment(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.kind = $root.types.PaymentKind.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.amount_msat = reader.uint64(); + break; + } + case 7: { + message.fee_paid_msat = reader.uint64(); + break; + } + case 4: { + message.direction = reader.int32(); + break; + } + case 5: { + message.status = reader.int32(); + break; + } + case 6: { + message.latest_update_timestamp = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Payment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.Payment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.Payment} Payment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Payment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Payment message. + * @function verify + * @memberof types.Payment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Payment.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.kind != null && message.hasOwnProperty("kind")) { + let error = $root.types.PaymentKind.verify(message.kind, long + 1); + if (error) + return "kind." + error; + } + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) { + properties._amount_msat = 1; + if (!$util.isInteger(message.amount_msat) && !(message.amount_msat && $util.isInteger(message.amount_msat.low) && $util.isInteger(message.amount_msat.high))) + return "amount_msat: integer|Long expected"; + } + if (message.fee_paid_msat != null && message.hasOwnProperty("fee_paid_msat")) { + properties._fee_paid_msat = 1; + if (!$util.isInteger(message.fee_paid_msat) && !(message.fee_paid_msat && $util.isInteger(message.fee_paid_msat.low) && $util.isInteger(message.fee_paid_msat.high))) + return "fee_paid_msat: integer|Long expected"; + } + if (message.direction != null && message.hasOwnProperty("direction")) + switch (message.direction) { + default: + return "direction: enum value expected"; + case 0: + case 1: + break; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.latest_update_timestamp != null && message.hasOwnProperty("latest_update_timestamp")) + if (!$util.isInteger(message.latest_update_timestamp) && !(message.latest_update_timestamp && $util.isInteger(message.latest_update_timestamp.low) && $util.isInteger(message.latest_update_timestamp.high))) + return "latest_update_timestamp: integer|Long expected"; + return null; + }; + + /** + * Creates a Payment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Payment + * @static + * @param {Object.} object Plain object + * @returns {types.Payment} Payment + */ + Payment.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.Payment) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.Payment(); + if (object.id != null) + message.id = String(object.id); + if (object.kind != null) { + if (typeof object.kind !== "object") + throw TypeError(".types.Payment.kind: object expected"); + message.kind = $root.types.PaymentKind.fromObject(object.kind, long + 1); + } + if (object.amount_msat != null) + if ($util.Long) + (message.amount_msat = $util.Long.fromValue(object.amount_msat)).unsigned = true; + else if (typeof object.amount_msat === "string") + message.amount_msat = parseInt(object.amount_msat, 10); + else if (typeof object.amount_msat === "number") + message.amount_msat = object.amount_msat; + else if (typeof object.amount_msat === "object") + message.amount_msat = new $util.LongBits(object.amount_msat.low >>> 0, object.amount_msat.high >>> 0).toNumber(true); + if (object.fee_paid_msat != null) + if ($util.Long) + (message.fee_paid_msat = $util.Long.fromValue(object.fee_paid_msat)).unsigned = true; + else if (typeof object.fee_paid_msat === "string") + message.fee_paid_msat = parseInt(object.fee_paid_msat, 10); + else if (typeof object.fee_paid_msat === "number") + message.fee_paid_msat = object.fee_paid_msat; + else if (typeof object.fee_paid_msat === "object") + message.fee_paid_msat = new $util.LongBits(object.fee_paid_msat.low >>> 0, object.fee_paid_msat.high >>> 0).toNumber(true); + switch (object.direction) { + default: + if (typeof object.direction === "number") { + message.direction = object.direction; + break; + } + break; + case "INBOUND": + case 0: + message.direction = 0; + break; + case "OUTBOUND": + case 1: + message.direction = 1; + break; + } + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "PENDING": + case 0: + message.status = 0; + break; + case "SUCCEEDED": + case 1: + message.status = 1; + break; + case "FAILED": + case 2: + message.status = 2; + break; + } + if (object.latest_update_timestamp != null) + if ($util.Long) + (message.latest_update_timestamp = $util.Long.fromValue(object.latest_update_timestamp)).unsigned = true; + else if (typeof object.latest_update_timestamp === "string") + message.latest_update_timestamp = parseInt(object.latest_update_timestamp, 10); + else if (typeof object.latest_update_timestamp === "number") + message.latest_update_timestamp = object.latest_update_timestamp; + else if (typeof object.latest_update_timestamp === "object") + message.latest_update_timestamp = new $util.LongBits(object.latest_update_timestamp.low >>> 0, object.latest_update_timestamp.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Payment message. Also converts values to other types if specified. + * @function toObject + * @memberof types.Payment + * @static + * @param {types.Payment} message Payment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Payment.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.id = ""; + object.kind = null; + object.direction = options.enums === String ? "INBOUND" : 0; + object.status = options.enums === String ? "PENDING" : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.latest_update_timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.latest_update_timestamp = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = $root.types.PaymentKind.toObject(message.kind, options); + if (message.amount_msat != null && message.hasOwnProperty("amount_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_msat = typeof message.amount_msat === "number" ? BigInt(message.amount_msat) : $util.Long.fromBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0, true).toBigInt(); + else if (typeof message.amount_msat === "number") + object.amount_msat = options.longs === String ? String(message.amount_msat) : message.amount_msat; + else + object.amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amount_msat) : options.longs === Number ? new $util.LongBits(message.amount_msat.low >>> 0, message.amount_msat.high >>> 0).toNumber(true) : message.amount_msat; + if (options.oneofs) + object._amount_msat = "amount_msat"; + } + if (message.direction != null && message.hasOwnProperty("direction")) + object.direction = options.enums === String ? $root.types.PaymentDirection[message.direction] === undefined ? message.direction : $root.types.PaymentDirection[message.direction] : message.direction; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.types.PaymentStatus[message.status] === undefined ? message.status : $root.types.PaymentStatus[message.status] : message.status; + if (message.latest_update_timestamp != null && message.hasOwnProperty("latest_update_timestamp")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.latest_update_timestamp = typeof message.latest_update_timestamp === "number" ? BigInt(message.latest_update_timestamp) : $util.Long.fromBits(message.latest_update_timestamp.low >>> 0, message.latest_update_timestamp.high >>> 0, true).toBigInt(); + else if (typeof message.latest_update_timestamp === "number") + object.latest_update_timestamp = options.longs === String ? String(message.latest_update_timestamp) : message.latest_update_timestamp; + else + object.latest_update_timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.latest_update_timestamp) : options.longs === Number ? new $util.LongBits(message.latest_update_timestamp.low >>> 0, message.latest_update_timestamp.high >>> 0).toNumber(true) : message.latest_update_timestamp; + if (message.fee_paid_msat != null && message.hasOwnProperty("fee_paid_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.fee_paid_msat = typeof message.fee_paid_msat === "number" ? BigInt(message.fee_paid_msat) : $util.Long.fromBits(message.fee_paid_msat.low >>> 0, message.fee_paid_msat.high >>> 0, true).toBigInt(); + else if (typeof message.fee_paid_msat === "number") + object.fee_paid_msat = options.longs === String ? String(message.fee_paid_msat) : message.fee_paid_msat; + else + object.fee_paid_msat = options.longs === String ? $util.Long.prototype.toString.call(message.fee_paid_msat) : options.longs === Number ? new $util.LongBits(message.fee_paid_msat.low >>> 0, message.fee_paid_msat.high >>> 0).toNumber(true) : message.fee_paid_msat; + if (options.oneofs) + object._fee_paid_msat = "fee_paid_msat"; + } + return object; + }; + + /** + * Converts this Payment to JSON. + * @function toJSON + * @memberof types.Payment + * @instance + * @returns {Object.} JSON object + */ + Payment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Payment + * @function getTypeUrl + * @memberof types.Payment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Payment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Payment"; + }; + + return Payment; + })(); + + types.PaymentKind = (function() { + + /** + * Properties of a PaymentKind. + * @memberof types + * @interface IPaymentKind + * @property {types.IOnchain|null} [onchain] PaymentKind onchain + * @property {types.IBolt11|null} [bolt11] PaymentKind bolt11 + * @property {types.IBolt11Jit|null} [bolt11_jit] PaymentKind bolt11_jit + * @property {types.IBolt12Offer|null} [bolt12_offer] PaymentKind bolt12_offer + * @property {types.IBolt12Refund|null} [bolt12_refund] PaymentKind bolt12_refund + * @property {types.ISpontaneous|null} [spontaneous] PaymentKind spontaneous + */ + + /** + * Constructs a new PaymentKind. + * @memberof types + * @classdesc Represents a PaymentKind. + * @implements IPaymentKind + * @constructor + * @param {types.IPaymentKind=} [properties] Properties to set + */ + function PaymentKind(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PaymentKind onchain. + * @member {types.IOnchain|null|undefined} onchain + * @memberof types.PaymentKind + * @instance + */ + PaymentKind.prototype.onchain = null; + + /** + * PaymentKind bolt11. + * @member {types.IBolt11|null|undefined} bolt11 + * @memberof types.PaymentKind + * @instance + */ + PaymentKind.prototype.bolt11 = null; + + /** + * PaymentKind bolt11_jit. + * @member {types.IBolt11Jit|null|undefined} bolt11_jit + * @memberof types.PaymentKind + * @instance + */ + PaymentKind.prototype.bolt11_jit = null; + + /** + * PaymentKind bolt12_offer. + * @member {types.IBolt12Offer|null|undefined} bolt12_offer + * @memberof types.PaymentKind + * @instance + */ + PaymentKind.prototype.bolt12_offer = null; + + /** + * PaymentKind bolt12_refund. + * @member {types.IBolt12Refund|null|undefined} bolt12_refund + * @memberof types.PaymentKind + * @instance + */ + PaymentKind.prototype.bolt12_refund = null; + + /** + * PaymentKind spontaneous. + * @member {types.ISpontaneous|null|undefined} spontaneous + * @memberof types.PaymentKind + * @instance + */ + PaymentKind.prototype.spontaneous = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PaymentKind kind. + * @member {"onchain"|"bolt11"|"bolt11_jit"|"bolt12_offer"|"bolt12_refund"|"spontaneous"|undefined} kind + * @memberof types.PaymentKind + * @instance + */ + Object.defineProperty(PaymentKind.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["onchain", "bolt11", "bolt11_jit", "bolt12_offer", "bolt12_refund", "spontaneous"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PaymentKind instance using the specified properties. + * @function create + * @memberof types.PaymentKind + * @static + * @param {types.IPaymentKind=} [properties] Properties to set + * @returns {types.PaymentKind} PaymentKind instance + */ + PaymentKind.create = function create(properties) { + return new PaymentKind(properties); + }; + + /** + * Encodes the specified PaymentKind message. Does not implicitly {@link types.PaymentKind.verify|verify} messages. + * @function encode + * @memberof types.PaymentKind + * @static + * @param {types.IPaymentKind} message PaymentKind message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PaymentKind.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.onchain != null && Object.hasOwnProperty.call(message, "onchain")) + $root.types.Onchain.encode(message.onchain, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bolt11 != null && Object.hasOwnProperty.call(message, "bolt11")) + $root.types.Bolt11.encode(message.bolt11, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.bolt11_jit != null && Object.hasOwnProperty.call(message, "bolt11_jit")) + $root.types.Bolt11Jit.encode(message.bolt11_jit, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.bolt12_offer != null && Object.hasOwnProperty.call(message, "bolt12_offer")) + $root.types.Bolt12Offer.encode(message.bolt12_offer, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.bolt12_refund != null && Object.hasOwnProperty.call(message, "bolt12_refund")) + $root.types.Bolt12Refund.encode(message.bolt12_refund, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.spontaneous != null && Object.hasOwnProperty.call(message, "spontaneous")) + $root.types.Spontaneous.encode(message.spontaneous, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PaymentKind message, length delimited. Does not implicitly {@link types.PaymentKind.verify|verify} messages. + * @function encodeDelimited + * @memberof types.PaymentKind + * @static + * @param {types.IPaymentKind} message PaymentKind message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PaymentKind.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PaymentKind message from the specified reader or buffer. + * @function decode + * @memberof types.PaymentKind + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.PaymentKind} PaymentKind + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PaymentKind.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.PaymentKind(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.onchain = $root.types.Onchain.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.bolt11 = $root.types.Bolt11.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.bolt11_jit = $root.types.Bolt11Jit.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.bolt12_offer = $root.types.Bolt12Offer.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.bolt12_refund = $root.types.Bolt12Refund.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.spontaneous = $root.types.Spontaneous.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PaymentKind message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.PaymentKind + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.PaymentKind} PaymentKind + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PaymentKind.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PaymentKind message. + * @function verify + * @memberof types.PaymentKind + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PaymentKind.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.onchain != null && message.hasOwnProperty("onchain")) { + properties.kind = 1; + { + let error = $root.types.Onchain.verify(message.onchain, long + 1); + if (error) + return "onchain." + error; + } + } + if (message.bolt11 != null && message.hasOwnProperty("bolt11")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + let error = $root.types.Bolt11.verify(message.bolt11, long + 1); + if (error) + return "bolt11." + error; + } + } + if (message.bolt11_jit != null && message.hasOwnProperty("bolt11_jit")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + let error = $root.types.Bolt11Jit.verify(message.bolt11_jit, long + 1); + if (error) + return "bolt11_jit." + error; + } + } + if (message.bolt12_offer != null && message.hasOwnProperty("bolt12_offer")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + let error = $root.types.Bolt12Offer.verify(message.bolt12_offer, long + 1); + if (error) + return "bolt12_offer." + error; + } + } + if (message.bolt12_refund != null && message.hasOwnProperty("bolt12_refund")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + let error = $root.types.Bolt12Refund.verify(message.bolt12_refund, long + 1); + if (error) + return "bolt12_refund." + error; + } + } + if (message.spontaneous != null && message.hasOwnProperty("spontaneous")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + let error = $root.types.Spontaneous.verify(message.spontaneous, long + 1); + if (error) + return "spontaneous." + error; + } + } + return null; + }; + + /** + * Creates a PaymentKind message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.PaymentKind + * @static + * @param {Object.} object Plain object + * @returns {types.PaymentKind} PaymentKind + */ + PaymentKind.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.PaymentKind) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.PaymentKind(); + if (object.onchain != null) { + if (typeof object.onchain !== "object") + throw TypeError(".types.PaymentKind.onchain: object expected"); + message.onchain = $root.types.Onchain.fromObject(object.onchain, long + 1); + } + if (object.bolt11 != null) { + if (typeof object.bolt11 !== "object") + throw TypeError(".types.PaymentKind.bolt11: object expected"); + message.bolt11 = $root.types.Bolt11.fromObject(object.bolt11, long + 1); + } + if (object.bolt11_jit != null) { + if (typeof object.bolt11_jit !== "object") + throw TypeError(".types.PaymentKind.bolt11_jit: object expected"); + message.bolt11_jit = $root.types.Bolt11Jit.fromObject(object.bolt11_jit, long + 1); + } + if (object.bolt12_offer != null) { + if (typeof object.bolt12_offer !== "object") + throw TypeError(".types.PaymentKind.bolt12_offer: object expected"); + message.bolt12_offer = $root.types.Bolt12Offer.fromObject(object.bolt12_offer, long + 1); + } + if (object.bolt12_refund != null) { + if (typeof object.bolt12_refund !== "object") + throw TypeError(".types.PaymentKind.bolt12_refund: object expected"); + message.bolt12_refund = $root.types.Bolt12Refund.fromObject(object.bolt12_refund, long + 1); + } + if (object.spontaneous != null) { + if (typeof object.spontaneous !== "object") + throw TypeError(".types.PaymentKind.spontaneous: object expected"); + message.spontaneous = $root.types.Spontaneous.fromObject(object.spontaneous, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PaymentKind message. Also converts values to other types if specified. + * @function toObject + * @memberof types.PaymentKind + * @static + * @param {types.PaymentKind} message PaymentKind + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PaymentKind.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.onchain != null && message.hasOwnProperty("onchain")) { + object.onchain = $root.types.Onchain.toObject(message.onchain, options); + if (options.oneofs) + object.kind = "onchain"; + } + if (message.bolt11 != null && message.hasOwnProperty("bolt11")) { + object.bolt11 = $root.types.Bolt11.toObject(message.bolt11, options); + if (options.oneofs) + object.kind = "bolt11"; + } + if (message.bolt11_jit != null && message.hasOwnProperty("bolt11_jit")) { + object.bolt11_jit = $root.types.Bolt11Jit.toObject(message.bolt11_jit, options); + if (options.oneofs) + object.kind = "bolt11_jit"; + } + if (message.bolt12_offer != null && message.hasOwnProperty("bolt12_offer")) { + object.bolt12_offer = $root.types.Bolt12Offer.toObject(message.bolt12_offer, options); + if (options.oneofs) + object.kind = "bolt12_offer"; + } + if (message.bolt12_refund != null && message.hasOwnProperty("bolt12_refund")) { + object.bolt12_refund = $root.types.Bolt12Refund.toObject(message.bolt12_refund, options); + if (options.oneofs) + object.kind = "bolt12_refund"; + } + if (message.spontaneous != null && message.hasOwnProperty("spontaneous")) { + object.spontaneous = $root.types.Spontaneous.toObject(message.spontaneous, options); + if (options.oneofs) + object.kind = "spontaneous"; + } + return object; + }; + + /** + * Converts this PaymentKind to JSON. + * @function toJSON + * @memberof types.PaymentKind + * @instance + * @returns {Object.} JSON object + */ + PaymentKind.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PaymentKind + * @function getTypeUrl + * @memberof types.PaymentKind + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PaymentKind.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.PaymentKind"; + }; + + return PaymentKind; + })(); + + types.Onchain = (function() { + + /** + * Properties of an Onchain. + * @memberof types + * @interface IOnchain + * @property {string|null} [txid] Onchain txid + * @property {types.IConfirmationStatus|null} [status] Onchain status + */ + + /** + * Constructs a new Onchain. + * @memberof types + * @classdesc Represents an Onchain. + * @implements IOnchain + * @constructor + * @param {types.IOnchain=} [properties] Properties to set + */ + function Onchain(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Onchain txid. + * @member {string} txid + * @memberof types.Onchain + * @instance + */ + Onchain.prototype.txid = ""; + + /** + * Onchain status. + * @member {types.IConfirmationStatus|null|undefined} status + * @memberof types.Onchain + * @instance + */ + Onchain.prototype.status = null; + + /** + * Creates a new Onchain instance using the specified properties. + * @function create + * @memberof types.Onchain + * @static + * @param {types.IOnchain=} [properties] Properties to set + * @returns {types.Onchain} Onchain instance + */ + Onchain.create = function create(properties) { + return new Onchain(properties); + }; + + /** + * Encodes the specified Onchain message. Does not implicitly {@link types.Onchain.verify|verify} messages. + * @function encode + * @memberof types.Onchain + * @static + * @param {types.IOnchain} message Onchain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Onchain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.txid != null && Object.hasOwnProperty.call(message, "txid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.txid); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.types.ConfirmationStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Onchain message, length delimited. Does not implicitly {@link types.Onchain.verify|verify} messages. + * @function encodeDelimited + * @memberof types.Onchain + * @static + * @param {types.IOnchain} message Onchain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Onchain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Onchain message from the specified reader or buffer. + * @function decode + * @memberof types.Onchain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.Onchain} Onchain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Onchain.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Onchain(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.txid = reader.string(); + break; + } + case 2: { + message.status = $root.types.ConfirmationStatus.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Onchain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.Onchain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.Onchain} Onchain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Onchain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Onchain message. + * @function verify + * @memberof types.Onchain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Onchain.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.txid != null && message.hasOwnProperty("txid")) + if (!$util.isString(message.txid)) + return "txid: string expected"; + if (message.status != null && message.hasOwnProperty("status")) { + let error = $root.types.ConfirmationStatus.verify(message.status, long + 1); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates an Onchain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Onchain + * @static + * @param {Object.} object Plain object + * @returns {types.Onchain} Onchain + */ + Onchain.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.Onchain) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.Onchain(); + if (object.txid != null) + message.txid = String(object.txid); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".types.Onchain.status: object expected"); + message.status = $root.types.ConfirmationStatus.fromObject(object.status, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an Onchain message. Also converts values to other types if specified. + * @function toObject + * @memberof types.Onchain + * @static + * @param {types.Onchain} message Onchain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Onchain.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.txid = ""; + object.status = null; + } + if (message.txid != null && message.hasOwnProperty("txid")) + object.txid = message.txid; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.types.ConfirmationStatus.toObject(message.status, options); + return object; + }; + + /** + * Converts this Onchain to JSON. + * @function toJSON + * @memberof types.Onchain + * @instance + * @returns {Object.} JSON object + */ + Onchain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Onchain + * @function getTypeUrl + * @memberof types.Onchain + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Onchain.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Onchain"; + }; + + return Onchain; + })(); + + types.ConfirmationStatus = (function() { + + /** + * Properties of a ConfirmationStatus. + * @memberof types + * @interface IConfirmationStatus + * @property {types.IConfirmed|null} [confirmed] ConfirmationStatus confirmed + * @property {types.IUnconfirmed|null} [unconfirmed] ConfirmationStatus unconfirmed + */ + + /** + * Constructs a new ConfirmationStatus. + * @memberof types + * @classdesc Represents a ConfirmationStatus. + * @implements IConfirmationStatus + * @constructor + * @param {types.IConfirmationStatus=} [properties] Properties to set + */ + function ConfirmationStatus(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfirmationStatus confirmed. + * @member {types.IConfirmed|null|undefined} confirmed + * @memberof types.ConfirmationStatus + * @instance + */ + ConfirmationStatus.prototype.confirmed = null; + + /** + * ConfirmationStatus unconfirmed. + * @member {types.IUnconfirmed|null|undefined} unconfirmed + * @memberof types.ConfirmationStatus + * @instance + */ + ConfirmationStatus.prototype.unconfirmed = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ConfirmationStatus status. + * @member {"confirmed"|"unconfirmed"|undefined} status + * @memberof types.ConfirmationStatus + * @instance + */ + Object.defineProperty(ConfirmationStatus.prototype, "status", { + get: $util.oneOfGetter($oneOfFields = ["confirmed", "unconfirmed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ConfirmationStatus instance using the specified properties. + * @function create + * @memberof types.ConfirmationStatus + * @static + * @param {types.IConfirmationStatus=} [properties] Properties to set + * @returns {types.ConfirmationStatus} ConfirmationStatus instance + */ + ConfirmationStatus.create = function create(properties) { + return new ConfirmationStatus(properties); + }; + + /** + * Encodes the specified ConfirmationStatus message. Does not implicitly {@link types.ConfirmationStatus.verify|verify} messages. + * @function encode + * @memberof types.ConfirmationStatus + * @static + * @param {types.IConfirmationStatus} message ConfirmationStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfirmationStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.confirmed != null && Object.hasOwnProperty.call(message, "confirmed")) + $root.types.Confirmed.encode(message.confirmed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.unconfirmed != null && Object.hasOwnProperty.call(message, "unconfirmed")) + $root.types.Unconfirmed.encode(message.unconfirmed, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConfirmationStatus message, length delimited. Does not implicitly {@link types.ConfirmationStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof types.ConfirmationStatus + * @static + * @param {types.IConfirmationStatus} message ConfirmationStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfirmationStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfirmationStatus message from the specified reader or buffer. + * @function decode + * @memberof types.ConfirmationStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.ConfirmationStatus} ConfirmationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfirmationStatus.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.ConfirmationStatus(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.confirmed = $root.types.Confirmed.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.unconfirmed = $root.types.Unconfirmed.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ConfirmationStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.ConfirmationStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.ConfirmationStatus} ConfirmationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfirmationStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfirmationStatus message. + * @function verify + * @memberof types.ConfirmationStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfirmationStatus.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.confirmed != null && message.hasOwnProperty("confirmed")) { + properties.status = 1; + { + let error = $root.types.Confirmed.verify(message.confirmed, long + 1); + if (error) + return "confirmed." + error; + } + } + if (message.unconfirmed != null && message.hasOwnProperty("unconfirmed")) { + if (properties.status === 1) + return "status: multiple values"; + properties.status = 1; + { + let error = $root.types.Unconfirmed.verify(message.unconfirmed, long + 1); + if (error) + return "unconfirmed." + error; + } + } + return null; + }; + + /** + * Creates a ConfirmationStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.ConfirmationStatus + * @static + * @param {Object.} object Plain object + * @returns {types.ConfirmationStatus} ConfirmationStatus + */ + ConfirmationStatus.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.ConfirmationStatus) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.ConfirmationStatus(); + if (object.confirmed != null) { + if (typeof object.confirmed !== "object") + throw TypeError(".types.ConfirmationStatus.confirmed: object expected"); + message.confirmed = $root.types.Confirmed.fromObject(object.confirmed, long + 1); + } + if (object.unconfirmed != null) { + if (typeof object.unconfirmed !== "object") + throw TypeError(".types.ConfirmationStatus.unconfirmed: object expected"); + message.unconfirmed = $root.types.Unconfirmed.fromObject(object.unconfirmed, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ConfirmationStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof types.ConfirmationStatus + * @static + * @param {types.ConfirmationStatus} message ConfirmationStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfirmationStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.confirmed != null && message.hasOwnProperty("confirmed")) { + object.confirmed = $root.types.Confirmed.toObject(message.confirmed, options); + if (options.oneofs) + object.status = "confirmed"; + } + if (message.unconfirmed != null && message.hasOwnProperty("unconfirmed")) { + object.unconfirmed = $root.types.Unconfirmed.toObject(message.unconfirmed, options); + if (options.oneofs) + object.status = "unconfirmed"; + } + return object; + }; + + /** + * Converts this ConfirmationStatus to JSON. + * @function toJSON + * @memberof types.ConfirmationStatus + * @instance + * @returns {Object.} JSON object + */ + ConfirmationStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfirmationStatus + * @function getTypeUrl + * @memberof types.ConfirmationStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfirmationStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.ConfirmationStatus"; + }; + + return ConfirmationStatus; + })(); + + types.Confirmed = (function() { + + /** + * Properties of a Confirmed. + * @memberof types + * @interface IConfirmed + * @property {string|null} [block_hash] Confirmed block_hash + * @property {number|null} [height] Confirmed height + * @property {Long|null} [timestamp] Confirmed timestamp + */ + + /** + * Constructs a new Confirmed. + * @memberof types + * @classdesc Represents a Confirmed. + * @implements IConfirmed + * @constructor + * @param {types.IConfirmed=} [properties] Properties to set + */ + function Confirmed(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Confirmed block_hash. + * @member {string} block_hash + * @memberof types.Confirmed + * @instance + */ + Confirmed.prototype.block_hash = ""; + + /** + * Confirmed height. + * @member {number} height + * @memberof types.Confirmed + * @instance + */ + Confirmed.prototype.height = 0; + + /** + * Confirmed timestamp. + * @member {Long} timestamp + * @memberof types.Confirmed + * @instance + */ + Confirmed.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Confirmed instance using the specified properties. + * @function create + * @memberof types.Confirmed + * @static + * @param {types.IConfirmed=} [properties] Properties to set + * @returns {types.Confirmed} Confirmed instance + */ + Confirmed.create = function create(properties) { + return new Confirmed(properties); + }; + + /** + * Encodes the specified Confirmed message. Does not implicitly {@link types.Confirmed.verify|verify} messages. + * @function encode + * @memberof types.Confirmed + * @static + * @param {types.IConfirmed} message Confirmed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Confirmed.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.block_hash != null && Object.hasOwnProperty.call(message, "block_hash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.block_hash); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.height); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.timestamp); + return writer; + }; + + /** + * Encodes the specified Confirmed message, length delimited. Does not implicitly {@link types.Confirmed.verify|verify} messages. + * @function encodeDelimited + * @memberof types.Confirmed + * @static + * @param {types.IConfirmed} message Confirmed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Confirmed.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Confirmed message from the specified reader or buffer. + * @function decode + * @memberof types.Confirmed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.Confirmed} Confirmed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Confirmed.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Confirmed(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.block_hash = reader.string(); + break; + } + case 2: { + message.height = reader.uint32(); + break; + } + case 3: { + message.timestamp = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Confirmed message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.Confirmed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.Confirmed} Confirmed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Confirmed.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Confirmed message. + * @function verify + * @memberof types.Confirmed + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Confirmed.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.block_hash != null && message.hasOwnProperty("block_hash")) + if (!$util.isString(message.block_hash)) + return "block_hash: string expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; + return null; + }; + + /** + * Creates a Confirmed message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Confirmed + * @static + * @param {Object.} object Plain object + * @returns {types.Confirmed} Confirmed + */ + Confirmed.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.Confirmed) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.Confirmed(); + if (object.block_hash != null) + message.block_hash = String(object.block_hash); + if (object.height != null) + message.height = object.height >>> 0; + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Confirmed message. Also converts values to other types if specified. + * @function toObject + * @memberof types.Confirmed + * @static + * @param {types.Confirmed} message Confirmed + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Confirmed.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.block_hash = ""; + object.height = 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.timestamp = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + } + if (message.block_hash != null && message.hasOwnProperty("block_hash")) + object.block_hash = message.block_hash; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.timestamp = typeof message.timestamp === "number" ? BigInt(message.timestamp) : $util.Long.fromBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0, true).toBigInt(); + else if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; + return object; + }; + + /** + * Converts this Confirmed to JSON. + * @function toJSON + * @memberof types.Confirmed + * @instance + * @returns {Object.} JSON object + */ + Confirmed.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Confirmed + * @function getTypeUrl + * @memberof types.Confirmed + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Confirmed.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Confirmed"; + }; + + return Confirmed; + })(); + + types.Unconfirmed = (function() { + + /** + * Properties of an Unconfirmed. + * @memberof types + * @interface IUnconfirmed + */ + + /** + * Constructs a new Unconfirmed. + * @memberof types + * @classdesc Represents an Unconfirmed. + * @implements IUnconfirmed + * @constructor + * @param {types.IUnconfirmed=} [properties] Properties to set + */ + function Unconfirmed(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Unconfirmed instance using the specified properties. + * @function create + * @memberof types.Unconfirmed + * @static + * @param {types.IUnconfirmed=} [properties] Properties to set + * @returns {types.Unconfirmed} Unconfirmed instance + */ + Unconfirmed.create = function create(properties) { + return new Unconfirmed(properties); + }; + + /** + * Encodes the specified Unconfirmed message. Does not implicitly {@link types.Unconfirmed.verify|verify} messages. + * @function encode + * @memberof types.Unconfirmed + * @static + * @param {types.IUnconfirmed} message Unconfirmed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Unconfirmed.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Unconfirmed message, length delimited. Does not implicitly {@link types.Unconfirmed.verify|verify} messages. + * @function encodeDelimited + * @memberof types.Unconfirmed + * @static + * @param {types.IUnconfirmed} message Unconfirmed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Unconfirmed.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Unconfirmed message from the specified reader or buffer. + * @function decode + * @memberof types.Unconfirmed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.Unconfirmed} Unconfirmed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Unconfirmed.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Unconfirmed(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an Unconfirmed message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.Unconfirmed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.Unconfirmed} Unconfirmed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Unconfirmed.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Unconfirmed message. + * @function verify + * @memberof types.Unconfirmed + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Unconfirmed.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + return null; + }; + + /** + * Creates an Unconfirmed message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Unconfirmed + * @static + * @param {Object.} object Plain object + * @returns {types.Unconfirmed} Unconfirmed + */ + Unconfirmed.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.Unconfirmed) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + return new $root.types.Unconfirmed(); + }; + + /** + * Creates a plain object from an Unconfirmed message. Also converts values to other types if specified. + * @function toObject + * @memberof types.Unconfirmed + * @static + * @param {types.Unconfirmed} message Unconfirmed + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Unconfirmed.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Unconfirmed to JSON. + * @function toJSON + * @memberof types.Unconfirmed + * @instance + * @returns {Object.} JSON object + */ + Unconfirmed.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Unconfirmed + * @function getTypeUrl + * @memberof types.Unconfirmed + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Unconfirmed.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Unconfirmed"; + }; + + return Unconfirmed; + })(); + + types.Bolt11 = (function() { + + /** + * Properties of a Bolt11. + * @memberof types + * @interface IBolt11 + * @property {string|null} [hash] Bolt11 hash + * @property {string|null} [preimage] Bolt11 preimage + * @property {Uint8Array|null} [secret] Bolt11 secret + */ + + /** + * Constructs a new Bolt11. + * @memberof types + * @classdesc Represents a Bolt11. + * @implements IBolt11 + * @constructor + * @param {types.IBolt11=} [properties] Properties to set + */ + function Bolt11(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11 hash. + * @member {string} hash + * @memberof types.Bolt11 + * @instance + */ + Bolt11.prototype.hash = ""; + + /** + * Bolt11 preimage. + * @member {string|null|undefined} preimage + * @memberof types.Bolt11 + * @instance + */ + Bolt11.prototype.preimage = null; + + /** + * Bolt11 secret. + * @member {Uint8Array|null|undefined} secret + * @memberof types.Bolt11 + * @instance + */ + Bolt11.prototype.secret = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11.prototype, "_preimage", { + get: $util.oneOfGetter($oneOfFields = ["preimage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11.prototype, "_secret", { + get: $util.oneOfGetter($oneOfFields = ["secret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt11 instance using the specified properties. + * @function create + * @memberof types.Bolt11 + * @static + * @param {types.IBolt11=} [properties] Properties to set + * @returns {types.Bolt11} Bolt11 instance + */ + Bolt11.create = function create(properties) { + return new Bolt11(properties); + }; + + /** + * Encodes the specified Bolt11 message. Does not implicitly {@link types.Bolt11.verify|verify} messages. + * @function encode + * @memberof types.Bolt11 + * @static + * @param {types.IBolt11} message Bolt11 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11.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.preimage != null && Object.hasOwnProperty.call(message, "preimage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.preimage); + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.secret); + return writer; + }; + + /** + * Encodes the specified Bolt11 message, length delimited. Does not implicitly {@link types.Bolt11.verify|verify} messages. + * @function encodeDelimited + * @memberof types.Bolt11 + * @static + * @param {types.IBolt11} message Bolt11 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11 message from the specified reader or buffer. + * @function decode + * @memberof types.Bolt11 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.Bolt11} Bolt11 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Bolt11(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.hash = reader.string(); + break; + } + case 2: { + message.preimage = reader.string(); + break; + } + case 3: { + message.secret = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.Bolt11 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.Bolt11} Bolt11 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11 message. + * @function verify + * @memberof types.Bolt11 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + if (message.preimage != null && message.hasOwnProperty("preimage")) { + properties._preimage = 1; + if (!$util.isString(message.preimage)) + return "preimage: string expected"; + } + if (message.secret != null && message.hasOwnProperty("secret")) { + properties._secret = 1; + if (!(message.secret && typeof message.secret.length === "number" || $util.isString(message.secret))) + return "secret: buffer expected"; + } + return null; + }; + + /** + * Creates a Bolt11 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Bolt11 + * @static + * @param {Object.} object Plain object + * @returns {types.Bolt11} Bolt11 + */ + Bolt11.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.Bolt11) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.Bolt11(); + if (object.hash != null) + message.hash = String(object.hash); + if (object.preimage != null) + message.preimage = String(object.preimage); + if (object.secret != null) + if (typeof object.secret === "string") + $util.base64.decode(object.secret, message.secret = $util.newBuffer($util.base64.length(object.secret)), 0); + else if (object.secret.length >= 0) + message.secret = object.secret; + return message; + }; + + /** + * Creates a plain object from a Bolt11 message. Also converts values to other types if specified. + * @function toObject + * @memberof types.Bolt11 + * @static + * @param {types.Bolt11} message Bolt11 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11.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; + if (message.preimage != null && message.hasOwnProperty("preimage")) { + object.preimage = message.preimage; + if (options.oneofs) + object._preimage = "preimage"; + } + if (message.secret != null && message.hasOwnProperty("secret")) { + object.secret = options.bytes === String ? $util.base64.encode(message.secret, 0, message.secret.length) : options.bytes === Array ? Array.prototype.slice.call(message.secret) : message.secret; + if (options.oneofs) + object._secret = "secret"; + } + return object; + }; + + /** + * Converts this Bolt11 to JSON. + * @function toJSON + * @memberof types.Bolt11 + * @instance + * @returns {Object.} JSON object + */ + Bolt11.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11 + * @function getTypeUrl + * @memberof types.Bolt11 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Bolt11"; + }; + + return Bolt11; + })(); + + types.Bolt11Jit = (function() { + + /** + * Properties of a Bolt11Jit. + * @memberof types + * @interface IBolt11Jit + * @property {string|null} [hash] Bolt11Jit hash + * @property {string|null} [preimage] Bolt11Jit preimage + * @property {Uint8Array|null} [secret] Bolt11Jit secret + * @property {types.ILSPFeeLimits|null} [lsp_fee_limits] Bolt11Jit lsp_fee_limits + * @property {Long|null} [counterparty_skimmed_fee_msat] Bolt11Jit counterparty_skimmed_fee_msat + */ + + /** + * Constructs a new Bolt11Jit. + * @memberof types + * @classdesc Represents a Bolt11Jit. + * @implements IBolt11Jit + * @constructor + * @param {types.IBolt11Jit=} [properties] Properties to set + */ + function Bolt11Jit(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11Jit hash. + * @member {string} hash + * @memberof types.Bolt11Jit + * @instance + */ + Bolt11Jit.prototype.hash = ""; + + /** + * Bolt11Jit preimage. + * @member {string|null|undefined} preimage + * @memberof types.Bolt11Jit + * @instance + */ + Bolt11Jit.prototype.preimage = null; + + /** + * Bolt11Jit secret. + * @member {Uint8Array|null|undefined} secret + * @memberof types.Bolt11Jit + * @instance + */ + Bolt11Jit.prototype.secret = null; + + /** + * Bolt11Jit lsp_fee_limits. + * @member {types.ILSPFeeLimits|null|undefined} lsp_fee_limits + * @memberof types.Bolt11Jit + * @instance + */ + Bolt11Jit.prototype.lsp_fee_limits = null; + + /** + * Bolt11Jit counterparty_skimmed_fee_msat. + * @member {Long|null|undefined} counterparty_skimmed_fee_msat + * @memberof types.Bolt11Jit + * @instance + */ + Bolt11Jit.prototype.counterparty_skimmed_fee_msat = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11Jit.prototype, "_preimage", { + get: $util.oneOfGetter($oneOfFields = ["preimage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11Jit.prototype, "_secret", { + get: $util.oneOfGetter($oneOfFields = ["secret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11Jit.prototype, "_counterparty_skimmed_fee_msat", { + get: $util.oneOfGetter($oneOfFields = ["counterparty_skimmed_fee_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt11Jit instance using the specified properties. + * @function create + * @memberof types.Bolt11Jit + * @static + * @param {types.IBolt11Jit=} [properties] Properties to set + * @returns {types.Bolt11Jit} Bolt11Jit instance + */ + Bolt11Jit.create = function create(properties) { + return new Bolt11Jit(properties); + }; + + /** + * Encodes the specified Bolt11Jit message. Does not implicitly {@link types.Bolt11Jit.verify|verify} messages. + * @function encode + * @memberof types.Bolt11Jit + * @static + * @param {types.IBolt11Jit} message Bolt11Jit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11Jit.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.preimage != null && Object.hasOwnProperty.call(message, "preimage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.preimage); + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.secret); + if (message.lsp_fee_limits != null && Object.hasOwnProperty.call(message, "lsp_fee_limits")) + $root.types.LSPFeeLimits.encode(message.lsp_fee_limits, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.counterparty_skimmed_fee_msat != null && Object.hasOwnProperty.call(message, "counterparty_skimmed_fee_msat")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.counterparty_skimmed_fee_msat); + return writer; + }; + + /** + * Encodes the specified Bolt11Jit message, length delimited. Does not implicitly {@link types.Bolt11Jit.verify|verify} messages. + * @function encodeDelimited + * @memberof types.Bolt11Jit + * @static + * @param {types.IBolt11Jit} message Bolt11Jit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11Jit.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11Jit message from the specified reader or buffer. + * @function decode + * @memberof types.Bolt11Jit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.Bolt11Jit} Bolt11Jit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11Jit.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Bolt11Jit(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.hash = reader.string(); + break; + } + case 2: { + message.preimage = reader.string(); + break; + } + case 3: { + message.secret = reader.bytes(); + break; + } + case 4: { + message.lsp_fee_limits = $root.types.LSPFeeLimits.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.counterparty_skimmed_fee_msat = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11Jit message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.Bolt11Jit + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.Bolt11Jit} Bolt11Jit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11Jit.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11Jit message. + * @function verify + * @memberof types.Bolt11Jit + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11Jit.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + if (message.preimage != null && message.hasOwnProperty("preimage")) { + properties._preimage = 1; + if (!$util.isString(message.preimage)) + return "preimage: string expected"; + } + if (message.secret != null && message.hasOwnProperty("secret")) { + properties._secret = 1; + if (!(message.secret && typeof message.secret.length === "number" || $util.isString(message.secret))) + return "secret: buffer expected"; + } + if (message.lsp_fee_limits != null && message.hasOwnProperty("lsp_fee_limits")) { + let error = $root.types.LSPFeeLimits.verify(message.lsp_fee_limits, long + 1); + if (error) + return "lsp_fee_limits." + error; + } + if (message.counterparty_skimmed_fee_msat != null && message.hasOwnProperty("counterparty_skimmed_fee_msat")) { + properties._counterparty_skimmed_fee_msat = 1; + if (!$util.isInteger(message.counterparty_skimmed_fee_msat) && !(message.counterparty_skimmed_fee_msat && $util.isInteger(message.counterparty_skimmed_fee_msat.low) && $util.isInteger(message.counterparty_skimmed_fee_msat.high))) + return "counterparty_skimmed_fee_msat: integer|Long expected"; + } + return null; + }; + + /** + * Creates a Bolt11Jit message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Bolt11Jit + * @static + * @param {Object.} object Plain object + * @returns {types.Bolt11Jit} Bolt11Jit + */ + Bolt11Jit.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.Bolt11Jit) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.Bolt11Jit(); + if (object.hash != null) + message.hash = String(object.hash); + if (object.preimage != null) + message.preimage = String(object.preimage); + if (object.secret != null) + if (typeof object.secret === "string") + $util.base64.decode(object.secret, message.secret = $util.newBuffer($util.base64.length(object.secret)), 0); + else if (object.secret.length >= 0) + message.secret = object.secret; + if (object.lsp_fee_limits != null) { + if (typeof object.lsp_fee_limits !== "object") + throw TypeError(".types.Bolt11Jit.lsp_fee_limits: object expected"); + message.lsp_fee_limits = $root.types.LSPFeeLimits.fromObject(object.lsp_fee_limits, long + 1); + } + if (object.counterparty_skimmed_fee_msat != null) + if ($util.Long) + (message.counterparty_skimmed_fee_msat = $util.Long.fromValue(object.counterparty_skimmed_fee_msat)).unsigned = true; + else if (typeof object.counterparty_skimmed_fee_msat === "string") + message.counterparty_skimmed_fee_msat = parseInt(object.counterparty_skimmed_fee_msat, 10); + else if (typeof object.counterparty_skimmed_fee_msat === "number") + message.counterparty_skimmed_fee_msat = object.counterparty_skimmed_fee_msat; + else if (typeof object.counterparty_skimmed_fee_msat === "object") + message.counterparty_skimmed_fee_msat = new $util.LongBits(object.counterparty_skimmed_fee_msat.low >>> 0, object.counterparty_skimmed_fee_msat.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Bolt11Jit message. Also converts values to other types if specified. + * @function toObject + * @memberof types.Bolt11Jit + * @static + * @param {types.Bolt11Jit} message Bolt11Jit + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11Jit.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.hash = ""; + object.lsp_fee_limits = null; + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + if (message.preimage != null && message.hasOwnProperty("preimage")) { + object.preimage = message.preimage; + if (options.oneofs) + object._preimage = "preimage"; + } + if (message.secret != null && message.hasOwnProperty("secret")) { + object.secret = options.bytes === String ? $util.base64.encode(message.secret, 0, message.secret.length) : options.bytes === Array ? Array.prototype.slice.call(message.secret) : message.secret; + if (options.oneofs) + object._secret = "secret"; + } + if (message.lsp_fee_limits != null && message.hasOwnProperty("lsp_fee_limits")) + object.lsp_fee_limits = $root.types.LSPFeeLimits.toObject(message.lsp_fee_limits, options); + if (message.counterparty_skimmed_fee_msat != null && message.hasOwnProperty("counterparty_skimmed_fee_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.counterparty_skimmed_fee_msat = typeof message.counterparty_skimmed_fee_msat === "number" ? BigInt(message.counterparty_skimmed_fee_msat) : $util.Long.fromBits(message.counterparty_skimmed_fee_msat.low >>> 0, message.counterparty_skimmed_fee_msat.high >>> 0, true).toBigInt(); + else if (typeof message.counterparty_skimmed_fee_msat === "number") + object.counterparty_skimmed_fee_msat = options.longs === String ? String(message.counterparty_skimmed_fee_msat) : message.counterparty_skimmed_fee_msat; + else + object.counterparty_skimmed_fee_msat = options.longs === String ? $util.Long.prototype.toString.call(message.counterparty_skimmed_fee_msat) : options.longs === Number ? new $util.LongBits(message.counterparty_skimmed_fee_msat.low >>> 0, message.counterparty_skimmed_fee_msat.high >>> 0).toNumber(true) : message.counterparty_skimmed_fee_msat; + if (options.oneofs) + object._counterparty_skimmed_fee_msat = "counterparty_skimmed_fee_msat"; + } + return object; + }; + + /** + * Converts this Bolt11Jit to JSON. + * @function toJSON + * @memberof types.Bolt11Jit + * @instance + * @returns {Object.} JSON object + */ + Bolt11Jit.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11Jit + * @function getTypeUrl + * @memberof types.Bolt11Jit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11Jit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Bolt11Jit"; + }; + + return Bolt11Jit; + })(); + + types.Bolt12Offer = (function() { + + /** + * Properties of a Bolt12Offer. + * @memberof types + * @interface IBolt12Offer + * @property {string|null} [hash] Bolt12Offer hash + * @property {string|null} [preimage] Bolt12Offer preimage + * @property {Uint8Array|null} [secret] Bolt12Offer secret + * @property {string|null} [offer_id] Bolt12Offer offer_id + * @property {string|null} [payer_note] Bolt12Offer payer_note + * @property {Long|null} [quantity] Bolt12Offer quantity + */ + + /** + * Constructs a new Bolt12Offer. + * @memberof types + * @classdesc Represents a Bolt12Offer. + * @implements IBolt12Offer + * @constructor + * @param {types.IBolt12Offer=} [properties] Properties to set + */ + function Bolt12Offer(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt12Offer hash. + * @member {string|null|undefined} hash + * @memberof types.Bolt12Offer + * @instance + */ + Bolt12Offer.prototype.hash = null; + + /** + * Bolt12Offer preimage. + * @member {string|null|undefined} preimage + * @memberof types.Bolt12Offer + * @instance + */ + Bolt12Offer.prototype.preimage = null; + + /** + * Bolt12Offer secret. + * @member {Uint8Array|null|undefined} secret + * @memberof types.Bolt12Offer + * @instance + */ + Bolt12Offer.prototype.secret = null; + + /** + * Bolt12Offer offer_id. + * @member {string} offer_id + * @memberof types.Bolt12Offer + * @instance + */ + Bolt12Offer.prototype.offer_id = ""; + + /** + * Bolt12Offer payer_note. + * @member {string|null|undefined} payer_note + * @memberof types.Bolt12Offer + * @instance + */ + Bolt12Offer.prototype.payer_note = null; + + /** + * Bolt12Offer quantity. + * @member {Long|null|undefined} quantity + * @memberof types.Bolt12Offer + * @instance + */ + Bolt12Offer.prototype.quantity = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Offer.prototype, "_hash", { + get: $util.oneOfGetter($oneOfFields = ["hash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Offer.prototype, "_preimage", { + get: $util.oneOfGetter($oneOfFields = ["preimage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Offer.prototype, "_secret", { + get: $util.oneOfGetter($oneOfFields = ["secret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Offer.prototype, "_payer_note", { + get: $util.oneOfGetter($oneOfFields = ["payer_note"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Offer.prototype, "_quantity", { + get: $util.oneOfGetter($oneOfFields = ["quantity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt12Offer instance using the specified properties. + * @function create + * @memberof types.Bolt12Offer + * @static + * @param {types.IBolt12Offer=} [properties] Properties to set + * @returns {types.Bolt12Offer} Bolt12Offer instance + */ + Bolt12Offer.create = function create(properties) { + return new Bolt12Offer(properties); + }; + + /** + * Encodes the specified Bolt12Offer message. Does not implicitly {@link types.Bolt12Offer.verify|verify} messages. + * @function encode + * @memberof types.Bolt12Offer + * @static + * @param {types.IBolt12Offer} message Bolt12Offer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt12Offer.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.preimage != null && Object.hasOwnProperty.call(message, "preimage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.preimage); + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.secret); + if (message.offer_id != null && Object.hasOwnProperty.call(message, "offer_id")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.offer_id); + if (message.payer_note != null && Object.hasOwnProperty.call(message, "payer_note")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.payer_note); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.quantity); + return writer; + }; + + /** + * Encodes the specified Bolt12Offer message, length delimited. Does not implicitly {@link types.Bolt12Offer.verify|verify} messages. + * @function encodeDelimited + * @memberof types.Bolt12Offer + * @static + * @param {types.IBolt12Offer} message Bolt12Offer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt12Offer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt12Offer message from the specified reader or buffer. + * @function decode + * @memberof types.Bolt12Offer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.Bolt12Offer} Bolt12Offer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt12Offer.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Bolt12Offer(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.hash = reader.string(); + break; + } + case 2: { + message.preimage = reader.string(); + break; + } + case 3: { + message.secret = reader.bytes(); + break; + } + case 4: { + message.offer_id = reader.string(); + break; + } + case 5: { + message.payer_note = reader.string(); + break; + } + case 6: { + message.quantity = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt12Offer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.Bolt12Offer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.Bolt12Offer} Bolt12Offer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt12Offer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt12Offer message. + * @function verify + * @memberof types.Bolt12Offer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt12Offer.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.hash != null && message.hasOwnProperty("hash")) { + properties._hash = 1; + if (!$util.isString(message.hash)) + return "hash: string expected"; + } + if (message.preimage != null && message.hasOwnProperty("preimage")) { + properties._preimage = 1; + if (!$util.isString(message.preimage)) + return "preimage: string expected"; + } + if (message.secret != null && message.hasOwnProperty("secret")) { + properties._secret = 1; + if (!(message.secret && typeof message.secret.length === "number" || $util.isString(message.secret))) + return "secret: buffer expected"; + } + if (message.offer_id != null && message.hasOwnProperty("offer_id")) + if (!$util.isString(message.offer_id)) + return "offer_id: string expected"; + if (message.payer_note != null && message.hasOwnProperty("payer_note")) { + properties._payer_note = 1; + if (!$util.isString(message.payer_note)) + return "payer_note: string expected"; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) { + properties._quantity = 1; + if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) + return "quantity: integer|Long expected"; + } + return null; + }; + + /** + * Creates a Bolt12Offer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Bolt12Offer + * @static + * @param {Object.} object Plain object + * @returns {types.Bolt12Offer} Bolt12Offer + */ + Bolt12Offer.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.Bolt12Offer) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.Bolt12Offer(); + if (object.hash != null) + message.hash = String(object.hash); + if (object.preimage != null) + message.preimage = String(object.preimage); + if (object.secret != null) + if (typeof object.secret === "string") + $util.base64.decode(object.secret, message.secret = $util.newBuffer($util.base64.length(object.secret)), 0); + else if (object.secret.length >= 0) + message.secret = object.secret; + if (object.offer_id != null) + message.offer_id = String(object.offer_id); + if (object.payer_note != null) + message.payer_note = String(object.payer_note); + if (object.quantity != null) + if ($util.Long) + (message.quantity = $util.Long.fromValue(object.quantity)).unsigned = true; + else if (typeof object.quantity === "string") + message.quantity = parseInt(object.quantity, 10); + else if (typeof object.quantity === "number") + message.quantity = object.quantity; + else if (typeof object.quantity === "object") + message.quantity = new $util.LongBits(object.quantity.low >>> 0, object.quantity.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Bolt12Offer message. Also converts values to other types if specified. + * @function toObject + * @memberof types.Bolt12Offer + * @static + * @param {types.Bolt12Offer} message Bolt12Offer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt12Offer.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.offer_id = ""; + if (message.hash != null && message.hasOwnProperty("hash")) { + object.hash = message.hash; + if (options.oneofs) + object._hash = "hash"; + } + if (message.preimage != null && message.hasOwnProperty("preimage")) { + object.preimage = message.preimage; + if (options.oneofs) + object._preimage = "preimage"; + } + if (message.secret != null && message.hasOwnProperty("secret")) { + object.secret = options.bytes === String ? $util.base64.encode(message.secret, 0, message.secret.length) : options.bytes === Array ? Array.prototype.slice.call(message.secret) : message.secret; + if (options.oneofs) + object._secret = "secret"; + } + if (message.offer_id != null && message.hasOwnProperty("offer_id")) + object.offer_id = message.offer_id; + if (message.payer_note != null && message.hasOwnProperty("payer_note")) { + object.payer_note = message.payer_note; + if (options.oneofs) + object._payer_note = "payer_note"; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.quantity = typeof message.quantity === "number" ? BigInt(message.quantity) : $util.Long.fromBits(message.quantity.low >>> 0, message.quantity.high >>> 0, true).toBigInt(); + else if (typeof message.quantity === "number") + object.quantity = options.longs === String ? String(message.quantity) : message.quantity; + else + object.quantity = options.longs === String ? $util.Long.prototype.toString.call(message.quantity) : options.longs === Number ? new $util.LongBits(message.quantity.low >>> 0, message.quantity.high >>> 0).toNumber(true) : message.quantity; + if (options.oneofs) + object._quantity = "quantity"; + } + return object; + }; + + /** + * Converts this Bolt12Offer to JSON. + * @function toJSON + * @memberof types.Bolt12Offer + * @instance + * @returns {Object.} JSON object + */ + Bolt12Offer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt12Offer + * @function getTypeUrl + * @memberof types.Bolt12Offer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt12Offer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Bolt12Offer"; + }; + + return Bolt12Offer; + })(); + + types.Bolt12Refund = (function() { + + /** + * Properties of a Bolt12Refund. + * @memberof types + * @interface IBolt12Refund + * @property {string|null} [hash] Bolt12Refund hash + * @property {string|null} [preimage] Bolt12Refund preimage + * @property {Uint8Array|null} [secret] Bolt12Refund secret + * @property {string|null} [payer_note] Bolt12Refund payer_note + * @property {Long|null} [quantity] Bolt12Refund quantity + */ + + /** + * Constructs a new Bolt12Refund. + * @memberof types + * @classdesc Represents a Bolt12Refund. + * @implements IBolt12Refund + * @constructor + * @param {types.IBolt12Refund=} [properties] Properties to set + */ + function Bolt12Refund(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt12Refund hash. + * @member {string|null|undefined} hash + * @memberof types.Bolt12Refund + * @instance + */ + Bolt12Refund.prototype.hash = null; + + /** + * Bolt12Refund preimage. + * @member {string|null|undefined} preimage + * @memberof types.Bolt12Refund + * @instance + */ + Bolt12Refund.prototype.preimage = null; + + /** + * Bolt12Refund secret. + * @member {Uint8Array|null|undefined} secret + * @memberof types.Bolt12Refund + * @instance + */ + Bolt12Refund.prototype.secret = null; + + /** + * Bolt12Refund payer_note. + * @member {string|null|undefined} payer_note + * @memberof types.Bolt12Refund + * @instance + */ + Bolt12Refund.prototype.payer_note = null; + + /** + * Bolt12Refund quantity. + * @member {Long|null|undefined} quantity + * @memberof types.Bolt12Refund + * @instance + */ + Bolt12Refund.prototype.quantity = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Refund.prototype, "_hash", { + get: $util.oneOfGetter($oneOfFields = ["hash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Refund.prototype, "_preimage", { + get: $util.oneOfGetter($oneOfFields = ["preimage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Refund.prototype, "_secret", { + get: $util.oneOfGetter($oneOfFields = ["secret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Refund.prototype, "_payer_note", { + get: $util.oneOfGetter($oneOfFields = ["payer_note"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Refund.prototype, "_quantity", { + get: $util.oneOfGetter($oneOfFields = ["quantity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt12Refund instance using the specified properties. + * @function create + * @memberof types.Bolt12Refund + * @static + * @param {types.IBolt12Refund=} [properties] Properties to set + * @returns {types.Bolt12Refund} Bolt12Refund instance + */ + Bolt12Refund.create = function create(properties) { + return new Bolt12Refund(properties); + }; + + /** + * Encodes the specified Bolt12Refund message. Does not implicitly {@link types.Bolt12Refund.verify|verify} messages. + * @function encode + * @memberof types.Bolt12Refund + * @static + * @param {types.IBolt12Refund} message Bolt12Refund message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt12Refund.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.preimage != null && Object.hasOwnProperty.call(message, "preimage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.preimage); + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.secret); + if (message.payer_note != null && Object.hasOwnProperty.call(message, "payer_note")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.payer_note); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.quantity); + return writer; + }; + + /** + * Encodes the specified Bolt12Refund message, length delimited. Does not implicitly {@link types.Bolt12Refund.verify|verify} messages. + * @function encodeDelimited + * @memberof types.Bolt12Refund + * @static + * @param {types.IBolt12Refund} message Bolt12Refund message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt12Refund.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt12Refund message from the specified reader or buffer. + * @function decode + * @memberof types.Bolt12Refund + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.Bolt12Refund} Bolt12Refund + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt12Refund.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Bolt12Refund(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.hash = reader.string(); + break; + } + case 2: { + message.preimage = reader.string(); + break; + } + case 3: { + message.secret = reader.bytes(); + break; + } + case 5: { + message.payer_note = reader.string(); + break; + } + case 6: { + message.quantity = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt12Refund message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.Bolt12Refund + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.Bolt12Refund} Bolt12Refund + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt12Refund.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt12Refund message. + * @function verify + * @memberof types.Bolt12Refund + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt12Refund.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.hash != null && message.hasOwnProperty("hash")) { + properties._hash = 1; + if (!$util.isString(message.hash)) + return "hash: string expected"; + } + if (message.preimage != null && message.hasOwnProperty("preimage")) { + properties._preimage = 1; + if (!$util.isString(message.preimage)) + return "preimage: string expected"; + } + if (message.secret != null && message.hasOwnProperty("secret")) { + properties._secret = 1; + if (!(message.secret && typeof message.secret.length === "number" || $util.isString(message.secret))) + return "secret: buffer expected"; + } + if (message.payer_note != null && message.hasOwnProperty("payer_note")) { + properties._payer_note = 1; + if (!$util.isString(message.payer_note)) + return "payer_note: string expected"; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) { + properties._quantity = 1; + if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) + return "quantity: integer|Long expected"; + } + return null; + }; + + /** + * Creates a Bolt12Refund message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Bolt12Refund + * @static + * @param {Object.} object Plain object + * @returns {types.Bolt12Refund} Bolt12Refund + */ + Bolt12Refund.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.Bolt12Refund) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.Bolt12Refund(); + if (object.hash != null) + message.hash = String(object.hash); + if (object.preimage != null) + message.preimage = String(object.preimage); + if (object.secret != null) + if (typeof object.secret === "string") + $util.base64.decode(object.secret, message.secret = $util.newBuffer($util.base64.length(object.secret)), 0); + else if (object.secret.length >= 0) + message.secret = object.secret; + if (object.payer_note != null) + message.payer_note = String(object.payer_note); + if (object.quantity != null) + if ($util.Long) + (message.quantity = $util.Long.fromValue(object.quantity)).unsigned = true; + else if (typeof object.quantity === "string") + message.quantity = parseInt(object.quantity, 10); + else if (typeof object.quantity === "number") + message.quantity = object.quantity; + else if (typeof object.quantity === "object") + message.quantity = new $util.LongBits(object.quantity.low >>> 0, object.quantity.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a Bolt12Refund message. Also converts values to other types if specified. + * @function toObject + * @memberof types.Bolt12Refund + * @static + * @param {types.Bolt12Refund} message Bolt12Refund + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt12Refund.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.hash != null && message.hasOwnProperty("hash")) { + object.hash = message.hash; + if (options.oneofs) + object._hash = "hash"; + } + if (message.preimage != null && message.hasOwnProperty("preimage")) { + object.preimage = message.preimage; + if (options.oneofs) + object._preimage = "preimage"; + } + if (message.secret != null && message.hasOwnProperty("secret")) { + object.secret = options.bytes === String ? $util.base64.encode(message.secret, 0, message.secret.length) : options.bytes === Array ? Array.prototype.slice.call(message.secret) : message.secret; + if (options.oneofs) + object._secret = "secret"; + } + if (message.payer_note != null && message.hasOwnProperty("payer_note")) { + object.payer_note = message.payer_note; + if (options.oneofs) + object._payer_note = "payer_note"; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.quantity = typeof message.quantity === "number" ? BigInt(message.quantity) : $util.Long.fromBits(message.quantity.low >>> 0, message.quantity.high >>> 0, true).toBigInt(); + else if (typeof message.quantity === "number") + object.quantity = options.longs === String ? String(message.quantity) : message.quantity; + else + object.quantity = options.longs === String ? $util.Long.prototype.toString.call(message.quantity) : options.longs === Number ? new $util.LongBits(message.quantity.low >>> 0, message.quantity.high >>> 0).toNumber(true) : message.quantity; + if (options.oneofs) + object._quantity = "quantity"; + } + return object; + }; + + /** + * Converts this Bolt12Refund to JSON. + * @function toJSON + * @memberof types.Bolt12Refund + * @instance + * @returns {Object.} JSON object + */ + Bolt12Refund.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt12Refund + * @function getTypeUrl + * @memberof types.Bolt12Refund + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt12Refund.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Bolt12Refund"; + }; + + return Bolt12Refund; + })(); + + types.Spontaneous = (function() { + + /** + * Properties of a Spontaneous. + * @memberof types + * @interface ISpontaneous + * @property {string|null} [hash] Spontaneous hash + * @property {string|null} [preimage] Spontaneous preimage + */ + + /** + * Constructs a new Spontaneous. + * @memberof types + * @classdesc Represents a Spontaneous. + * @implements ISpontaneous + * @constructor + * @param {types.ISpontaneous=} [properties] Properties to set + */ + function Spontaneous(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Spontaneous hash. + * @member {string} hash + * @memberof types.Spontaneous + * @instance + */ + Spontaneous.prototype.hash = ""; + + /** + * Spontaneous preimage. + * @member {string|null|undefined} preimage + * @memberof types.Spontaneous + * @instance + */ + Spontaneous.prototype.preimage = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Spontaneous.prototype, "_preimage", { + get: $util.oneOfGetter($oneOfFields = ["preimage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Spontaneous instance using the specified properties. + * @function create + * @memberof types.Spontaneous + * @static + * @param {types.ISpontaneous=} [properties] Properties to set + * @returns {types.Spontaneous} Spontaneous instance + */ + Spontaneous.create = function create(properties) { + return new Spontaneous(properties); + }; + + /** + * Encodes the specified Spontaneous message. Does not implicitly {@link types.Spontaneous.verify|verify} messages. + * @function encode + * @memberof types.Spontaneous + * @static + * @param {types.ISpontaneous} message Spontaneous message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Spontaneous.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.preimage != null && Object.hasOwnProperty.call(message, "preimage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.preimage); + return writer; + }; + + /** + * Encodes the specified Spontaneous message, length delimited. Does not implicitly {@link types.Spontaneous.verify|verify} messages. + * @function encodeDelimited + * @memberof types.Spontaneous + * @static + * @param {types.ISpontaneous} message Spontaneous message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Spontaneous.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Spontaneous message from the specified reader or buffer. + * @function decode + * @memberof types.Spontaneous + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.Spontaneous} Spontaneous + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Spontaneous.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Spontaneous(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.hash = reader.string(); + break; + } + case 2: { + message.preimage = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Spontaneous message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.Spontaneous + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.Spontaneous} Spontaneous + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Spontaneous.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Spontaneous message. + * @function verify + * @memberof types.Spontaneous + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Spontaneous.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + if (message.preimage != null && message.hasOwnProperty("preimage")) { + properties._preimage = 1; + if (!$util.isString(message.preimage)) + return "preimage: string expected"; + } + return null; + }; + + /** + * Creates a Spontaneous message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Spontaneous + * @static + * @param {Object.} object Plain object + * @returns {types.Spontaneous} Spontaneous + */ + Spontaneous.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.Spontaneous) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.Spontaneous(); + if (object.hash != null) + message.hash = String(object.hash); + if (object.preimage != null) + message.preimage = String(object.preimage); + return message; + }; + + /** + * Creates a plain object from a Spontaneous message. Also converts values to other types if specified. + * @function toObject + * @memberof types.Spontaneous + * @static + * @param {types.Spontaneous} message Spontaneous + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Spontaneous.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; + if (message.preimage != null && message.hasOwnProperty("preimage")) { + object.preimage = message.preimage; + if (options.oneofs) + object._preimage = "preimage"; + } + return object; + }; + + /** + * Converts this Spontaneous to JSON. + * @function toJSON + * @memberof types.Spontaneous + * @instance + * @returns {Object.} JSON object + */ + Spontaneous.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Spontaneous + * @function getTypeUrl + * @memberof types.Spontaneous + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Spontaneous.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Spontaneous"; + }; + + return Spontaneous; + })(); + + types.LSPFeeLimits = (function() { + + /** + * Properties of a LSPFeeLimits. + * @memberof types + * @interface ILSPFeeLimits + * @property {Long|null} [max_total_opening_fee_msat] LSPFeeLimits max_total_opening_fee_msat + * @property {Long|null} [max_proportional_opening_fee_ppm_msat] LSPFeeLimits max_proportional_opening_fee_ppm_msat + */ + + /** + * Constructs a new LSPFeeLimits. + * @memberof types + * @classdesc Represents a LSPFeeLimits. + * @implements ILSPFeeLimits + * @constructor + * @param {types.ILSPFeeLimits=} [properties] Properties to set + */ + function LSPFeeLimits(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LSPFeeLimits max_total_opening_fee_msat. + * @member {Long|null|undefined} max_total_opening_fee_msat + * @memberof types.LSPFeeLimits + * @instance + */ + LSPFeeLimits.prototype.max_total_opening_fee_msat = null; + + /** + * LSPFeeLimits max_proportional_opening_fee_ppm_msat. + * @member {Long|null|undefined} max_proportional_opening_fee_ppm_msat + * @memberof types.LSPFeeLimits + * @instance + */ + LSPFeeLimits.prototype.max_proportional_opening_fee_ppm_msat = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LSPFeeLimits.prototype, "_max_total_opening_fee_msat", { + get: $util.oneOfGetter($oneOfFields = ["max_total_opening_fee_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LSPFeeLimits.prototype, "_max_proportional_opening_fee_ppm_msat", { + get: $util.oneOfGetter($oneOfFields = ["max_proportional_opening_fee_ppm_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LSPFeeLimits instance using the specified properties. + * @function create + * @memberof types.LSPFeeLimits + * @static + * @param {types.ILSPFeeLimits=} [properties] Properties to set + * @returns {types.LSPFeeLimits} LSPFeeLimits instance + */ + LSPFeeLimits.create = function create(properties) { + return new LSPFeeLimits(properties); + }; + + /** + * Encodes the specified LSPFeeLimits message. Does not implicitly {@link types.LSPFeeLimits.verify|verify} messages. + * @function encode + * @memberof types.LSPFeeLimits + * @static + * @param {types.ILSPFeeLimits} message LSPFeeLimits message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LSPFeeLimits.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.max_total_opening_fee_msat != null && Object.hasOwnProperty.call(message, "max_total_opening_fee_msat")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.max_total_opening_fee_msat); + if (message.max_proportional_opening_fee_ppm_msat != null && Object.hasOwnProperty.call(message, "max_proportional_opening_fee_ppm_msat")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.max_proportional_opening_fee_ppm_msat); + return writer; + }; + + /** + * Encodes the specified LSPFeeLimits message, length delimited. Does not implicitly {@link types.LSPFeeLimits.verify|verify} messages. + * @function encodeDelimited + * @memberof types.LSPFeeLimits + * @static + * @param {types.ILSPFeeLimits} message LSPFeeLimits message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LSPFeeLimits.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LSPFeeLimits message from the specified reader or buffer. + * @function decode + * @memberof types.LSPFeeLimits + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.LSPFeeLimits} LSPFeeLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LSPFeeLimits.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.LSPFeeLimits(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.max_total_opening_fee_msat = reader.uint64(); + break; + } + case 2: { + message.max_proportional_opening_fee_ppm_msat = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LSPFeeLimits message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.LSPFeeLimits + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.LSPFeeLimits} LSPFeeLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LSPFeeLimits.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LSPFeeLimits message. + * @function verify + * @memberof types.LSPFeeLimits + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LSPFeeLimits.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.max_total_opening_fee_msat != null && message.hasOwnProperty("max_total_opening_fee_msat")) { + properties._max_total_opening_fee_msat = 1; + if (!$util.isInteger(message.max_total_opening_fee_msat) && !(message.max_total_opening_fee_msat && $util.isInteger(message.max_total_opening_fee_msat.low) && $util.isInteger(message.max_total_opening_fee_msat.high))) + return "max_total_opening_fee_msat: integer|Long expected"; + } + if (message.max_proportional_opening_fee_ppm_msat != null && message.hasOwnProperty("max_proportional_opening_fee_ppm_msat")) { + properties._max_proportional_opening_fee_ppm_msat = 1; + if (!$util.isInteger(message.max_proportional_opening_fee_ppm_msat) && !(message.max_proportional_opening_fee_ppm_msat && $util.isInteger(message.max_proportional_opening_fee_ppm_msat.low) && $util.isInteger(message.max_proportional_opening_fee_ppm_msat.high))) + return "max_proportional_opening_fee_ppm_msat: integer|Long expected"; + } + return null; + }; + + /** + * Creates a LSPFeeLimits message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.LSPFeeLimits + * @static + * @param {Object.} object Plain object + * @returns {types.LSPFeeLimits} LSPFeeLimits + */ + LSPFeeLimits.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.LSPFeeLimits) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.LSPFeeLimits(); + if (object.max_total_opening_fee_msat != null) + if ($util.Long) + (message.max_total_opening_fee_msat = $util.Long.fromValue(object.max_total_opening_fee_msat)).unsigned = true; + else if (typeof object.max_total_opening_fee_msat === "string") + message.max_total_opening_fee_msat = parseInt(object.max_total_opening_fee_msat, 10); + else if (typeof object.max_total_opening_fee_msat === "number") + message.max_total_opening_fee_msat = object.max_total_opening_fee_msat; + else if (typeof object.max_total_opening_fee_msat === "object") + message.max_total_opening_fee_msat = new $util.LongBits(object.max_total_opening_fee_msat.low >>> 0, object.max_total_opening_fee_msat.high >>> 0).toNumber(true); + if (object.max_proportional_opening_fee_ppm_msat != null) + if ($util.Long) + (message.max_proportional_opening_fee_ppm_msat = $util.Long.fromValue(object.max_proportional_opening_fee_ppm_msat)).unsigned = true; + else if (typeof object.max_proportional_opening_fee_ppm_msat === "string") + message.max_proportional_opening_fee_ppm_msat = parseInt(object.max_proportional_opening_fee_ppm_msat, 10); + else if (typeof object.max_proportional_opening_fee_ppm_msat === "number") + message.max_proportional_opening_fee_ppm_msat = object.max_proportional_opening_fee_ppm_msat; + else if (typeof object.max_proportional_opening_fee_ppm_msat === "object") + message.max_proportional_opening_fee_ppm_msat = new $util.LongBits(object.max_proportional_opening_fee_ppm_msat.low >>> 0, object.max_proportional_opening_fee_ppm_msat.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a LSPFeeLimits message. Also converts values to other types if specified. + * @function toObject + * @memberof types.LSPFeeLimits + * @static + * @param {types.LSPFeeLimits} message LSPFeeLimits + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LSPFeeLimits.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.max_total_opening_fee_msat != null && message.hasOwnProperty("max_total_opening_fee_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.max_total_opening_fee_msat = typeof message.max_total_opening_fee_msat === "number" ? BigInt(message.max_total_opening_fee_msat) : $util.Long.fromBits(message.max_total_opening_fee_msat.low >>> 0, message.max_total_opening_fee_msat.high >>> 0, true).toBigInt(); + else if (typeof message.max_total_opening_fee_msat === "number") + object.max_total_opening_fee_msat = options.longs === String ? String(message.max_total_opening_fee_msat) : message.max_total_opening_fee_msat; + else + object.max_total_opening_fee_msat = options.longs === String ? $util.Long.prototype.toString.call(message.max_total_opening_fee_msat) : options.longs === Number ? new $util.LongBits(message.max_total_opening_fee_msat.low >>> 0, message.max_total_opening_fee_msat.high >>> 0).toNumber(true) : message.max_total_opening_fee_msat; + if (options.oneofs) + object._max_total_opening_fee_msat = "max_total_opening_fee_msat"; + } + if (message.max_proportional_opening_fee_ppm_msat != null && message.hasOwnProperty("max_proportional_opening_fee_ppm_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.max_proportional_opening_fee_ppm_msat = typeof message.max_proportional_opening_fee_ppm_msat === "number" ? BigInt(message.max_proportional_opening_fee_ppm_msat) : $util.Long.fromBits(message.max_proportional_opening_fee_ppm_msat.low >>> 0, message.max_proportional_opening_fee_ppm_msat.high >>> 0, true).toBigInt(); + else if (typeof message.max_proportional_opening_fee_ppm_msat === "number") + object.max_proportional_opening_fee_ppm_msat = options.longs === String ? String(message.max_proportional_opening_fee_ppm_msat) : message.max_proportional_opening_fee_ppm_msat; + else + object.max_proportional_opening_fee_ppm_msat = options.longs === String ? $util.Long.prototype.toString.call(message.max_proportional_opening_fee_ppm_msat) : options.longs === Number ? new $util.LongBits(message.max_proportional_opening_fee_ppm_msat.low >>> 0, message.max_proportional_opening_fee_ppm_msat.high >>> 0).toNumber(true) : message.max_proportional_opening_fee_ppm_msat; + if (options.oneofs) + object._max_proportional_opening_fee_ppm_msat = "max_proportional_opening_fee_ppm_msat"; + } + return object; + }; + + /** + * Converts this LSPFeeLimits to JSON. + * @function toJSON + * @memberof types.LSPFeeLimits + * @instance + * @returns {Object.} JSON object + */ + LSPFeeLimits.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LSPFeeLimits + * @function getTypeUrl + * @memberof types.LSPFeeLimits + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LSPFeeLimits.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.LSPFeeLimits"; + }; + + return LSPFeeLimits; + })(); + + /** + * PaymentDirection enum. + * @name types.PaymentDirection + * @enum {number} + * @property {number} INBOUND=0 INBOUND value + * @property {number} OUTBOUND=1 OUTBOUND value + */ + types.PaymentDirection = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INBOUND"] = 0; + values[valuesById[1] = "OUTBOUND"] = 1; + return values; + })(); + + /** + * PaymentStatus enum. + * @name types.PaymentStatus + * @enum {number} + * @property {number} PENDING=0 PENDING value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED=2 FAILED value + */ + types.PaymentStatus = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PENDING"] = 0; + values[valuesById[1] = "SUCCEEDED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + return values; + })(); + + /** + * Network enum. + * @name types.Network + * @enum {number} + * @property {number} BITCOIN=0 BITCOIN value + * @property {number} TESTNET=1 TESTNET value + * @property {number} TESTNET4=2 TESTNET4 value + * @property {number} SIGNET=3 SIGNET value + * @property {number} REGTEST=4 REGTEST value + */ + types.Network = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BITCOIN"] = 0; + values[valuesById[1] = "TESTNET"] = 1; + values[valuesById[2] = "TESTNET4"] = 2; + values[valuesById[3] = "SIGNET"] = 3; + values[valuesById[4] = "REGTEST"] = 4; + return values; + })(); + + types.ForwardedPayment = (function() { + + /** + * Properties of a ForwardedPayment. + * @memberof types + * @interface IForwardedPayment + * @property {string|null} [prev_channel_id] ForwardedPayment prev_channel_id + * @property {string|null} [next_channel_id] ForwardedPayment next_channel_id + * @property {string|null} [prev_user_channel_id] ForwardedPayment prev_user_channel_id + * @property {string|null} [prev_node_id] ForwardedPayment prev_node_id + * @property {string|null} [next_node_id] ForwardedPayment next_node_id + * @property {string|null} [next_user_channel_id] ForwardedPayment next_user_channel_id + * @property {Long|null} [total_fee_earned_msat] ForwardedPayment total_fee_earned_msat + * @property {Long|null} [skimmed_fee_msat] ForwardedPayment skimmed_fee_msat + * @property {boolean|null} [claim_from_onchain_tx] ForwardedPayment claim_from_onchain_tx + * @property {Long|null} [outbound_amount_forwarded_msat] ForwardedPayment outbound_amount_forwarded_msat + */ + + /** + * Constructs a new ForwardedPayment. + * @memberof types + * @classdesc Represents a ForwardedPayment. + * @implements IForwardedPayment + * @constructor + * @param {types.IForwardedPayment=} [properties] Properties to set + */ + function ForwardedPayment(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ForwardedPayment prev_channel_id. + * @member {string} prev_channel_id + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.prev_channel_id = ""; + + /** + * ForwardedPayment next_channel_id. + * @member {string} next_channel_id + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.next_channel_id = ""; + + /** + * ForwardedPayment prev_user_channel_id. + * @member {string} prev_user_channel_id + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.prev_user_channel_id = ""; + + /** + * ForwardedPayment prev_node_id. + * @member {string} prev_node_id + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.prev_node_id = ""; + + /** + * ForwardedPayment next_node_id. + * @member {string} next_node_id + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.next_node_id = ""; + + /** + * ForwardedPayment next_user_channel_id. + * @member {string|null|undefined} next_user_channel_id + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.next_user_channel_id = null; + + /** + * ForwardedPayment total_fee_earned_msat. + * @member {Long|null|undefined} total_fee_earned_msat + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.total_fee_earned_msat = null; + + /** + * ForwardedPayment skimmed_fee_msat. + * @member {Long|null|undefined} skimmed_fee_msat + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.skimmed_fee_msat = null; + + /** + * ForwardedPayment claim_from_onchain_tx. + * @member {boolean} claim_from_onchain_tx + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.claim_from_onchain_tx = false; + + /** + * ForwardedPayment outbound_amount_forwarded_msat. + * @member {Long|null|undefined} outbound_amount_forwarded_msat + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.outbound_amount_forwarded_msat = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ForwardedPayment.prototype, "_next_user_channel_id", { + get: $util.oneOfGetter($oneOfFields = ["next_user_channel_id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ForwardedPayment.prototype, "_total_fee_earned_msat", { + get: $util.oneOfGetter($oneOfFields = ["total_fee_earned_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ForwardedPayment.prototype, "_skimmed_fee_msat", { + get: $util.oneOfGetter($oneOfFields = ["skimmed_fee_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ForwardedPayment.prototype, "_outbound_amount_forwarded_msat", { + get: $util.oneOfGetter($oneOfFields = ["outbound_amount_forwarded_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ForwardedPayment instance using the specified properties. + * @function create + * @memberof types.ForwardedPayment + * @static + * @param {types.IForwardedPayment=} [properties] Properties to set + * @returns {types.ForwardedPayment} ForwardedPayment instance + */ + ForwardedPayment.create = function create(properties) { + return new ForwardedPayment(properties); + }; + + /** + * Encodes the specified ForwardedPayment message. Does not implicitly {@link types.ForwardedPayment.verify|verify} messages. + * @function encode + * @memberof types.ForwardedPayment + * @static + * @param {types.IForwardedPayment} message ForwardedPayment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForwardedPayment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prev_channel_id != null && Object.hasOwnProperty.call(message, "prev_channel_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.prev_channel_id); + if (message.next_channel_id != null && Object.hasOwnProperty.call(message, "next_channel_id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.next_channel_id); + if (message.prev_user_channel_id != null && Object.hasOwnProperty.call(message, "prev_user_channel_id")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.prev_user_channel_id); + if (message.next_user_channel_id != null && Object.hasOwnProperty.call(message, "next_user_channel_id")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.next_user_channel_id); + if (message.total_fee_earned_msat != null && Object.hasOwnProperty.call(message, "total_fee_earned_msat")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.total_fee_earned_msat); + if (message.skimmed_fee_msat != null && Object.hasOwnProperty.call(message, "skimmed_fee_msat")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.skimmed_fee_msat); + if (message.claim_from_onchain_tx != null && Object.hasOwnProperty.call(message, "claim_from_onchain_tx")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.claim_from_onchain_tx); + if (message.outbound_amount_forwarded_msat != null && Object.hasOwnProperty.call(message, "outbound_amount_forwarded_msat")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.outbound_amount_forwarded_msat); + if (message.prev_node_id != null && Object.hasOwnProperty.call(message, "prev_node_id")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.prev_node_id); + if (message.next_node_id != null && Object.hasOwnProperty.call(message, "next_node_id")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.next_node_id); + return writer; + }; + + /** + * Encodes the specified ForwardedPayment message, length delimited. Does not implicitly {@link types.ForwardedPayment.verify|verify} messages. + * @function encodeDelimited + * @memberof types.ForwardedPayment + * @static + * @param {types.IForwardedPayment} message ForwardedPayment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForwardedPayment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ForwardedPayment message from the specified reader or buffer. + * @function decode + * @memberof types.ForwardedPayment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.ForwardedPayment} ForwardedPayment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForwardedPayment.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.ForwardedPayment(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.prev_channel_id = reader.string(); + break; + } + case 2: { + message.next_channel_id = reader.string(); + break; + } + case 3: { + message.prev_user_channel_id = reader.string(); + break; + } + case 9: { + message.prev_node_id = reader.string(); + break; + } + case 10: { + message.next_node_id = reader.string(); + break; + } + case 4: { + message.next_user_channel_id = reader.string(); + break; + } + case 5: { + message.total_fee_earned_msat = reader.uint64(); + break; + } + case 6: { + message.skimmed_fee_msat = reader.uint64(); + break; + } + case 7: { + message.claim_from_onchain_tx = reader.bool(); + break; + } + case 8: { + message.outbound_amount_forwarded_msat = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ForwardedPayment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.ForwardedPayment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.ForwardedPayment} ForwardedPayment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForwardedPayment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ForwardedPayment message. + * @function verify + * @memberof types.ForwardedPayment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ForwardedPayment.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.prev_channel_id != null && message.hasOwnProperty("prev_channel_id")) + if (!$util.isString(message.prev_channel_id)) + return "prev_channel_id: string expected"; + if (message.next_channel_id != null && message.hasOwnProperty("next_channel_id")) + if (!$util.isString(message.next_channel_id)) + return "next_channel_id: string expected"; + if (message.prev_user_channel_id != null && message.hasOwnProperty("prev_user_channel_id")) + if (!$util.isString(message.prev_user_channel_id)) + return "prev_user_channel_id: string expected"; + if (message.prev_node_id != null && message.hasOwnProperty("prev_node_id")) + if (!$util.isString(message.prev_node_id)) + return "prev_node_id: string expected"; + if (message.next_node_id != null && message.hasOwnProperty("next_node_id")) + if (!$util.isString(message.next_node_id)) + return "next_node_id: string expected"; + if (message.next_user_channel_id != null && message.hasOwnProperty("next_user_channel_id")) { + properties._next_user_channel_id = 1; + if (!$util.isString(message.next_user_channel_id)) + return "next_user_channel_id: string expected"; + } + if (message.total_fee_earned_msat != null && message.hasOwnProperty("total_fee_earned_msat")) { + properties._total_fee_earned_msat = 1; + if (!$util.isInteger(message.total_fee_earned_msat) && !(message.total_fee_earned_msat && $util.isInteger(message.total_fee_earned_msat.low) && $util.isInteger(message.total_fee_earned_msat.high))) + return "total_fee_earned_msat: integer|Long expected"; + } + if (message.skimmed_fee_msat != null && message.hasOwnProperty("skimmed_fee_msat")) { + properties._skimmed_fee_msat = 1; + if (!$util.isInteger(message.skimmed_fee_msat) && !(message.skimmed_fee_msat && $util.isInteger(message.skimmed_fee_msat.low) && $util.isInteger(message.skimmed_fee_msat.high))) + return "skimmed_fee_msat: integer|Long expected"; + } + if (message.claim_from_onchain_tx != null && message.hasOwnProperty("claim_from_onchain_tx")) + if (typeof message.claim_from_onchain_tx !== "boolean") + return "claim_from_onchain_tx: boolean expected"; + if (message.outbound_amount_forwarded_msat != null && message.hasOwnProperty("outbound_amount_forwarded_msat")) { + properties._outbound_amount_forwarded_msat = 1; + if (!$util.isInteger(message.outbound_amount_forwarded_msat) && !(message.outbound_amount_forwarded_msat && $util.isInteger(message.outbound_amount_forwarded_msat.low) && $util.isInteger(message.outbound_amount_forwarded_msat.high))) + return "outbound_amount_forwarded_msat: integer|Long expected"; + } + return null; + }; + + /** + * Creates a ForwardedPayment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.ForwardedPayment + * @static + * @param {Object.} object Plain object + * @returns {types.ForwardedPayment} ForwardedPayment + */ + ForwardedPayment.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.ForwardedPayment) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.ForwardedPayment(); + if (object.prev_channel_id != null) + message.prev_channel_id = String(object.prev_channel_id); + if (object.next_channel_id != null) + message.next_channel_id = String(object.next_channel_id); + if (object.prev_user_channel_id != null) + message.prev_user_channel_id = String(object.prev_user_channel_id); + if (object.prev_node_id != null) + message.prev_node_id = String(object.prev_node_id); + if (object.next_node_id != null) + message.next_node_id = String(object.next_node_id); + if (object.next_user_channel_id != null) + message.next_user_channel_id = String(object.next_user_channel_id); + if (object.total_fee_earned_msat != null) + if ($util.Long) + (message.total_fee_earned_msat = $util.Long.fromValue(object.total_fee_earned_msat)).unsigned = true; + else if (typeof object.total_fee_earned_msat === "string") + message.total_fee_earned_msat = parseInt(object.total_fee_earned_msat, 10); + else if (typeof object.total_fee_earned_msat === "number") + message.total_fee_earned_msat = object.total_fee_earned_msat; + else if (typeof object.total_fee_earned_msat === "object") + message.total_fee_earned_msat = new $util.LongBits(object.total_fee_earned_msat.low >>> 0, object.total_fee_earned_msat.high >>> 0).toNumber(true); + if (object.skimmed_fee_msat != null) + if ($util.Long) + (message.skimmed_fee_msat = $util.Long.fromValue(object.skimmed_fee_msat)).unsigned = true; + else if (typeof object.skimmed_fee_msat === "string") + message.skimmed_fee_msat = parseInt(object.skimmed_fee_msat, 10); + else if (typeof object.skimmed_fee_msat === "number") + message.skimmed_fee_msat = object.skimmed_fee_msat; + else if (typeof object.skimmed_fee_msat === "object") + message.skimmed_fee_msat = new $util.LongBits(object.skimmed_fee_msat.low >>> 0, object.skimmed_fee_msat.high >>> 0).toNumber(true); + if (object.claim_from_onchain_tx != null) + message.claim_from_onchain_tx = Boolean(object.claim_from_onchain_tx); + if (object.outbound_amount_forwarded_msat != null) + if ($util.Long) + (message.outbound_amount_forwarded_msat = $util.Long.fromValue(object.outbound_amount_forwarded_msat)).unsigned = true; + else if (typeof object.outbound_amount_forwarded_msat === "string") + message.outbound_amount_forwarded_msat = parseInt(object.outbound_amount_forwarded_msat, 10); + else if (typeof object.outbound_amount_forwarded_msat === "number") + message.outbound_amount_forwarded_msat = object.outbound_amount_forwarded_msat; + else if (typeof object.outbound_amount_forwarded_msat === "object") + message.outbound_amount_forwarded_msat = new $util.LongBits(object.outbound_amount_forwarded_msat.low >>> 0, object.outbound_amount_forwarded_msat.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a ForwardedPayment message. Also converts values to other types if specified. + * @function toObject + * @memberof types.ForwardedPayment + * @static + * @param {types.ForwardedPayment} message ForwardedPayment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ForwardedPayment.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.prev_channel_id = ""; + object.next_channel_id = ""; + object.prev_user_channel_id = ""; + object.claim_from_onchain_tx = false; + object.prev_node_id = ""; + object.next_node_id = ""; + } + if (message.prev_channel_id != null && message.hasOwnProperty("prev_channel_id")) + object.prev_channel_id = message.prev_channel_id; + if (message.next_channel_id != null && message.hasOwnProperty("next_channel_id")) + object.next_channel_id = message.next_channel_id; + if (message.prev_user_channel_id != null && message.hasOwnProperty("prev_user_channel_id")) + object.prev_user_channel_id = message.prev_user_channel_id; + if (message.next_user_channel_id != null && message.hasOwnProperty("next_user_channel_id")) { + object.next_user_channel_id = message.next_user_channel_id; + if (options.oneofs) + object._next_user_channel_id = "next_user_channel_id"; + } + if (message.total_fee_earned_msat != null && message.hasOwnProperty("total_fee_earned_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.total_fee_earned_msat = typeof message.total_fee_earned_msat === "number" ? BigInt(message.total_fee_earned_msat) : $util.Long.fromBits(message.total_fee_earned_msat.low >>> 0, message.total_fee_earned_msat.high >>> 0, true).toBigInt(); + else if (typeof message.total_fee_earned_msat === "number") + object.total_fee_earned_msat = options.longs === String ? String(message.total_fee_earned_msat) : message.total_fee_earned_msat; + else + object.total_fee_earned_msat = options.longs === String ? $util.Long.prototype.toString.call(message.total_fee_earned_msat) : options.longs === Number ? new $util.LongBits(message.total_fee_earned_msat.low >>> 0, message.total_fee_earned_msat.high >>> 0).toNumber(true) : message.total_fee_earned_msat; + if (options.oneofs) + object._total_fee_earned_msat = "total_fee_earned_msat"; + } + if (message.skimmed_fee_msat != null && message.hasOwnProperty("skimmed_fee_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.skimmed_fee_msat = typeof message.skimmed_fee_msat === "number" ? BigInt(message.skimmed_fee_msat) : $util.Long.fromBits(message.skimmed_fee_msat.low >>> 0, message.skimmed_fee_msat.high >>> 0, true).toBigInt(); + else if (typeof message.skimmed_fee_msat === "number") + object.skimmed_fee_msat = options.longs === String ? String(message.skimmed_fee_msat) : message.skimmed_fee_msat; + else + object.skimmed_fee_msat = options.longs === String ? $util.Long.prototype.toString.call(message.skimmed_fee_msat) : options.longs === Number ? new $util.LongBits(message.skimmed_fee_msat.low >>> 0, message.skimmed_fee_msat.high >>> 0).toNumber(true) : message.skimmed_fee_msat; + if (options.oneofs) + object._skimmed_fee_msat = "skimmed_fee_msat"; + } + if (message.claim_from_onchain_tx != null && message.hasOwnProperty("claim_from_onchain_tx")) + object.claim_from_onchain_tx = message.claim_from_onchain_tx; + if (message.outbound_amount_forwarded_msat != null && message.hasOwnProperty("outbound_amount_forwarded_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.outbound_amount_forwarded_msat = typeof message.outbound_amount_forwarded_msat === "number" ? BigInt(message.outbound_amount_forwarded_msat) : $util.Long.fromBits(message.outbound_amount_forwarded_msat.low >>> 0, message.outbound_amount_forwarded_msat.high >>> 0, true).toBigInt(); + else if (typeof message.outbound_amount_forwarded_msat === "number") + object.outbound_amount_forwarded_msat = options.longs === String ? String(message.outbound_amount_forwarded_msat) : message.outbound_amount_forwarded_msat; + else + object.outbound_amount_forwarded_msat = options.longs === String ? $util.Long.prototype.toString.call(message.outbound_amount_forwarded_msat) : options.longs === Number ? new $util.LongBits(message.outbound_amount_forwarded_msat.low >>> 0, message.outbound_amount_forwarded_msat.high >>> 0).toNumber(true) : message.outbound_amount_forwarded_msat; + if (options.oneofs) + object._outbound_amount_forwarded_msat = "outbound_amount_forwarded_msat"; + } + if (message.prev_node_id != null && message.hasOwnProperty("prev_node_id")) + object.prev_node_id = message.prev_node_id; + if (message.next_node_id != null && message.hasOwnProperty("next_node_id")) + object.next_node_id = message.next_node_id; + return object; + }; + + /** + * Converts this ForwardedPayment to JSON. + * @function toJSON + * @memberof types.ForwardedPayment + * @instance + * @returns {Object.} JSON object + */ + ForwardedPayment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ForwardedPayment + * @function getTypeUrl + * @memberof types.ForwardedPayment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ForwardedPayment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.ForwardedPayment"; + }; + + return ForwardedPayment; + })(); + + types.Channel = (function() { + + /** + * Properties of a Channel. + * @memberof types + * @interface IChannel + * @property {string|null} [channel_id] Channel channel_id + * @property {string|null} [counterparty_node_id] Channel counterparty_node_id + * @property {types.IOutPoint|null} [funding_txo] Channel funding_txo + * @property {string|null} [user_channel_id] Channel user_channel_id + * @property {Long|null} [unspendable_punishment_reserve] Channel unspendable_punishment_reserve + * @property {Long|null} [channel_value_sats] Channel channel_value_sats + * @property {number|null} [feerate_sat_per_1000_weight] Channel feerate_sat_per_1000_weight + * @property {Long|null} [outbound_capacity_msat] Channel outbound_capacity_msat + * @property {Long|null} [inbound_capacity_msat] Channel inbound_capacity_msat + * @property {number|null} [confirmations_required] Channel confirmations_required + * @property {number|null} [confirmations] Channel confirmations + * @property {boolean|null} [is_outbound] Channel is_outbound + * @property {boolean|null} [is_channel_ready] Channel is_channel_ready + * @property {boolean|null} [is_usable] Channel is_usable + * @property {boolean|null} [is_announced] Channel is_announced + * @property {types.IChannelConfig|null} [channel_config] Channel channel_config + * @property {Long|null} [next_outbound_htlc_limit_msat] Channel next_outbound_htlc_limit_msat + * @property {Long|null} [next_outbound_htlc_minimum_msat] Channel next_outbound_htlc_minimum_msat + * @property {number|null} [force_close_spend_delay] Channel force_close_spend_delay + * @property {Long|null} [counterparty_outbound_htlc_minimum_msat] Channel counterparty_outbound_htlc_minimum_msat + * @property {Long|null} [counterparty_outbound_htlc_maximum_msat] Channel counterparty_outbound_htlc_maximum_msat + * @property {Long|null} [counterparty_unspendable_punishment_reserve] Channel counterparty_unspendable_punishment_reserve + * @property {number|null} [counterparty_forwarding_info_fee_base_msat] Channel counterparty_forwarding_info_fee_base_msat + * @property {number|null} [counterparty_forwarding_info_fee_proportional_millionths] Channel counterparty_forwarding_info_fee_proportional_millionths + * @property {number|null} [counterparty_forwarding_info_cltv_expiry_delta] Channel counterparty_forwarding_info_cltv_expiry_delta + */ + + /** + * Constructs a new Channel. + * @memberof types + * @classdesc Represents a Channel. + * @implements IChannel + * @constructor + * @param {types.IChannel=} [properties] Properties to set + */ + function Channel(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Channel channel_id. + * @member {string} channel_id + * @memberof types.Channel + * @instance + */ + Channel.prototype.channel_id = ""; + + /** + * Channel counterparty_node_id. + * @member {string} counterparty_node_id + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterparty_node_id = ""; + + /** + * Channel funding_txo. + * @member {types.IOutPoint|null|undefined} funding_txo + * @memberof types.Channel + * @instance + */ + Channel.prototype.funding_txo = null; + + /** + * Channel user_channel_id. + * @member {string} user_channel_id + * @memberof types.Channel + * @instance + */ + Channel.prototype.user_channel_id = ""; + + /** + * Channel unspendable_punishment_reserve. + * @member {Long|null|undefined} unspendable_punishment_reserve + * @memberof types.Channel + * @instance + */ + Channel.prototype.unspendable_punishment_reserve = null; + + /** + * Channel channel_value_sats. + * @member {Long} channel_value_sats + * @memberof types.Channel + * @instance + */ + Channel.prototype.channel_value_sats = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Channel feerate_sat_per_1000_weight. + * @member {number} feerate_sat_per_1000_weight + * @memberof types.Channel + * @instance + */ + Channel.prototype.feerate_sat_per_1000_weight = 0; + + /** + * Channel outbound_capacity_msat. + * @member {Long} outbound_capacity_msat + * @memberof types.Channel + * @instance + */ + Channel.prototype.outbound_capacity_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Channel inbound_capacity_msat. + * @member {Long} inbound_capacity_msat + * @memberof types.Channel + * @instance + */ + Channel.prototype.inbound_capacity_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Channel confirmations_required. + * @member {number|null|undefined} confirmations_required + * @memberof types.Channel + * @instance + */ + Channel.prototype.confirmations_required = null; + + /** + * Channel confirmations. + * @member {number|null|undefined} confirmations + * @memberof types.Channel + * @instance + */ + Channel.prototype.confirmations = null; + + /** + * Channel is_outbound. + * @member {boolean} is_outbound + * @memberof types.Channel + * @instance + */ + Channel.prototype.is_outbound = false; + + /** + * Channel is_channel_ready. + * @member {boolean} is_channel_ready + * @memberof types.Channel + * @instance + */ + Channel.prototype.is_channel_ready = false; + + /** + * Channel is_usable. + * @member {boolean} is_usable + * @memberof types.Channel + * @instance + */ + Channel.prototype.is_usable = false; + + /** + * Channel is_announced. + * @member {boolean} is_announced + * @memberof types.Channel + * @instance + */ + Channel.prototype.is_announced = false; + + /** + * Channel channel_config. + * @member {types.IChannelConfig|null|undefined} channel_config + * @memberof types.Channel + * @instance + */ + Channel.prototype.channel_config = null; + + /** + * Channel next_outbound_htlc_limit_msat. + * @member {Long} next_outbound_htlc_limit_msat + * @memberof types.Channel + * @instance + */ + Channel.prototype.next_outbound_htlc_limit_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Channel next_outbound_htlc_minimum_msat. + * @member {Long} next_outbound_htlc_minimum_msat + * @memberof types.Channel + * @instance + */ + Channel.prototype.next_outbound_htlc_minimum_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Channel force_close_spend_delay. + * @member {number|null|undefined} force_close_spend_delay + * @memberof types.Channel + * @instance + */ + Channel.prototype.force_close_spend_delay = null; + + /** + * Channel counterparty_outbound_htlc_minimum_msat. + * @member {Long|null|undefined} counterparty_outbound_htlc_minimum_msat + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterparty_outbound_htlc_minimum_msat = null; + + /** + * Channel counterparty_outbound_htlc_maximum_msat. + * @member {Long|null|undefined} counterparty_outbound_htlc_maximum_msat + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterparty_outbound_htlc_maximum_msat = null; + + /** + * Channel counterparty_unspendable_punishment_reserve. + * @member {Long} counterparty_unspendable_punishment_reserve + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterparty_unspendable_punishment_reserve = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Channel counterparty_forwarding_info_fee_base_msat. + * @member {number|null|undefined} counterparty_forwarding_info_fee_base_msat + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterparty_forwarding_info_fee_base_msat = null; + + /** + * Channel counterparty_forwarding_info_fee_proportional_millionths. + * @member {number|null|undefined} counterparty_forwarding_info_fee_proportional_millionths + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterparty_forwarding_info_fee_proportional_millionths = null; + + /** + * Channel counterparty_forwarding_info_cltv_expiry_delta. + * @member {number|null|undefined} counterparty_forwarding_info_cltv_expiry_delta + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterparty_forwarding_info_cltv_expiry_delta = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_funding_txo", { + get: $util.oneOfGetter($oneOfFields = ["funding_txo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_unspendable_punishment_reserve", { + get: $util.oneOfGetter($oneOfFields = ["unspendable_punishment_reserve"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_confirmations_required", { + get: $util.oneOfGetter($oneOfFields = ["confirmations_required"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_confirmations", { + get: $util.oneOfGetter($oneOfFields = ["confirmations"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_force_close_spend_delay", { + get: $util.oneOfGetter($oneOfFields = ["force_close_spend_delay"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_counterparty_outbound_htlc_minimum_msat", { + get: $util.oneOfGetter($oneOfFields = ["counterparty_outbound_htlc_minimum_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_counterparty_outbound_htlc_maximum_msat", { + get: $util.oneOfGetter($oneOfFields = ["counterparty_outbound_htlc_maximum_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_counterparty_forwarding_info_fee_base_msat", { + get: $util.oneOfGetter($oneOfFields = ["counterparty_forwarding_info_fee_base_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_counterparty_forwarding_info_fee_proportional_millionths", { + get: $util.oneOfGetter($oneOfFields = ["counterparty_forwarding_info_fee_proportional_millionths"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_counterparty_forwarding_info_cltv_expiry_delta", { + get: $util.oneOfGetter($oneOfFields = ["counterparty_forwarding_info_cltv_expiry_delta"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Channel instance using the specified properties. + * @function create + * @memberof types.Channel + * @static + * @param {types.IChannel=} [properties] Properties to set + * @returns {types.Channel} Channel instance + */ + Channel.create = function create(properties) { + return new Channel(properties); + }; + + /** + * Encodes the specified Channel message. Does not implicitly {@link types.Channel.verify|verify} messages. + * @function encode + * @memberof types.Channel + * @static + * @param {types.IChannel} message Channel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Channel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); + if (message.counterparty_node_id != null && Object.hasOwnProperty.call(message, "counterparty_node_id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterparty_node_id); + if (message.funding_txo != null && Object.hasOwnProperty.call(message, "funding_txo")) + $root.types.OutPoint.encode(message.funding_txo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.user_channel_id != null && Object.hasOwnProperty.call(message, "user_channel_id")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.user_channel_id); + if (message.unspendable_punishment_reserve != null && Object.hasOwnProperty.call(message, "unspendable_punishment_reserve")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.unspendable_punishment_reserve); + if (message.channel_value_sats != null && Object.hasOwnProperty.call(message, "channel_value_sats")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.channel_value_sats); + if (message.feerate_sat_per_1000_weight != null && Object.hasOwnProperty.call(message, "feerate_sat_per_1000_weight")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.feerate_sat_per_1000_weight); + if (message.outbound_capacity_msat != null && Object.hasOwnProperty.call(message, "outbound_capacity_msat")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.outbound_capacity_msat); + if (message.inbound_capacity_msat != null && Object.hasOwnProperty.call(message, "inbound_capacity_msat")) + writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.inbound_capacity_msat); + if (message.confirmations_required != null && Object.hasOwnProperty.call(message, "confirmations_required")) + writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.confirmations_required); + if (message.confirmations != null && Object.hasOwnProperty.call(message, "confirmations")) + writer.uint32(/* id 11, wireType 0 =*/88).uint32(message.confirmations); + if (message.is_outbound != null && Object.hasOwnProperty.call(message, "is_outbound")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.is_outbound); + if (message.is_channel_ready != null && Object.hasOwnProperty.call(message, "is_channel_ready")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.is_channel_ready); + if (message.is_usable != null && Object.hasOwnProperty.call(message, "is_usable")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.is_usable); + if (message.is_announced != null && Object.hasOwnProperty.call(message, "is_announced")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.is_announced); + if (message.channel_config != null && Object.hasOwnProperty.call(message, "channel_config")) + $root.types.ChannelConfig.encode(message.channel_config, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.next_outbound_htlc_limit_msat != null && Object.hasOwnProperty.call(message, "next_outbound_htlc_limit_msat")) + writer.uint32(/* id 17, wireType 0 =*/136).uint64(message.next_outbound_htlc_limit_msat); + if (message.next_outbound_htlc_minimum_msat != null && Object.hasOwnProperty.call(message, "next_outbound_htlc_minimum_msat")) + writer.uint32(/* id 18, wireType 0 =*/144).uint64(message.next_outbound_htlc_minimum_msat); + if (message.force_close_spend_delay != null && Object.hasOwnProperty.call(message, "force_close_spend_delay")) + writer.uint32(/* id 19, wireType 0 =*/152).uint32(message.force_close_spend_delay); + if (message.counterparty_outbound_htlc_minimum_msat != null && Object.hasOwnProperty.call(message, "counterparty_outbound_htlc_minimum_msat")) + writer.uint32(/* id 20, wireType 0 =*/160).uint64(message.counterparty_outbound_htlc_minimum_msat); + if (message.counterparty_outbound_htlc_maximum_msat != null && Object.hasOwnProperty.call(message, "counterparty_outbound_htlc_maximum_msat")) + writer.uint32(/* id 21, wireType 0 =*/168).uint64(message.counterparty_outbound_htlc_maximum_msat); + if (message.counterparty_unspendable_punishment_reserve != null && Object.hasOwnProperty.call(message, "counterparty_unspendable_punishment_reserve")) + writer.uint32(/* id 22, wireType 0 =*/176).uint64(message.counterparty_unspendable_punishment_reserve); + if (message.counterparty_forwarding_info_fee_base_msat != null && Object.hasOwnProperty.call(message, "counterparty_forwarding_info_fee_base_msat")) + writer.uint32(/* id 23, wireType 0 =*/184).uint32(message.counterparty_forwarding_info_fee_base_msat); + if (message.counterparty_forwarding_info_fee_proportional_millionths != null && Object.hasOwnProperty.call(message, "counterparty_forwarding_info_fee_proportional_millionths")) + writer.uint32(/* id 24, wireType 0 =*/192).uint32(message.counterparty_forwarding_info_fee_proportional_millionths); + if (message.counterparty_forwarding_info_cltv_expiry_delta != null && Object.hasOwnProperty.call(message, "counterparty_forwarding_info_cltv_expiry_delta")) + writer.uint32(/* id 25, wireType 0 =*/200).uint32(message.counterparty_forwarding_info_cltv_expiry_delta); + return writer; + }; + + /** + * Encodes the specified Channel message, length delimited. Does not implicitly {@link types.Channel.verify|verify} messages. + * @function encodeDelimited + * @memberof types.Channel + * @static + * @param {types.IChannel} message Channel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Channel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Channel message from the specified reader or buffer. + * @function decode + * @memberof types.Channel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.Channel} Channel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Channel.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Channel(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.channel_id = reader.string(); + break; + } + case 2: { + message.counterparty_node_id = reader.string(); + break; + } + case 3: { + message.funding_txo = $root.types.OutPoint.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.user_channel_id = reader.string(); + break; + } + case 5: { + message.unspendable_punishment_reserve = reader.uint64(); + break; + } + case 6: { + message.channel_value_sats = reader.uint64(); + break; + } + case 7: { + message.feerate_sat_per_1000_weight = reader.uint32(); + break; + } + case 8: { + message.outbound_capacity_msat = reader.uint64(); + break; + } + case 9: { + message.inbound_capacity_msat = reader.uint64(); + break; + } + case 10: { + message.confirmations_required = reader.uint32(); + break; + } + case 11: { + message.confirmations = reader.uint32(); + break; + } + case 12: { + message.is_outbound = reader.bool(); + break; + } + case 13: { + message.is_channel_ready = reader.bool(); + break; + } + case 14: { + message.is_usable = reader.bool(); + break; + } + case 15: { + message.is_announced = reader.bool(); + break; + } + case 16: { + message.channel_config = $root.types.ChannelConfig.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 17: { + message.next_outbound_htlc_limit_msat = reader.uint64(); + break; + } + case 18: { + message.next_outbound_htlc_minimum_msat = reader.uint64(); + break; + } + case 19: { + message.force_close_spend_delay = reader.uint32(); + break; + } + case 20: { + message.counterparty_outbound_htlc_minimum_msat = reader.uint64(); + break; + } + case 21: { + message.counterparty_outbound_htlc_maximum_msat = reader.uint64(); + break; + } + case 22: { + message.counterparty_unspendable_punishment_reserve = reader.uint64(); + break; + } + case 23: { + message.counterparty_forwarding_info_fee_base_msat = reader.uint32(); + break; + } + case 24: { + message.counterparty_forwarding_info_fee_proportional_millionths = reader.uint32(); + break; + } + case 25: { + message.counterparty_forwarding_info_cltv_expiry_delta = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Channel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.Channel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.Channel} Channel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Channel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Channel message. + * @function verify + * @memberof types.Channel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Channel.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.channel_id != null && message.hasOwnProperty("channel_id")) + if (!$util.isString(message.channel_id)) + return "channel_id: string expected"; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + if (!$util.isString(message.counterparty_node_id)) + return "counterparty_node_id: string expected"; + if (message.funding_txo != null && message.hasOwnProperty("funding_txo")) { + properties._funding_txo = 1; + { + let error = $root.types.OutPoint.verify(message.funding_txo, long + 1); + if (error) + return "funding_txo." + error; + } + } + if (message.user_channel_id != null && message.hasOwnProperty("user_channel_id")) + if (!$util.isString(message.user_channel_id)) + return "user_channel_id: string expected"; + if (message.unspendable_punishment_reserve != null && message.hasOwnProperty("unspendable_punishment_reserve")) { + properties._unspendable_punishment_reserve = 1; + if (!$util.isInteger(message.unspendable_punishment_reserve) && !(message.unspendable_punishment_reserve && $util.isInteger(message.unspendable_punishment_reserve.low) && $util.isInteger(message.unspendable_punishment_reserve.high))) + return "unspendable_punishment_reserve: integer|Long expected"; + } + if (message.channel_value_sats != null && message.hasOwnProperty("channel_value_sats")) + if (!$util.isInteger(message.channel_value_sats) && !(message.channel_value_sats && $util.isInteger(message.channel_value_sats.low) && $util.isInteger(message.channel_value_sats.high))) + return "channel_value_sats: integer|Long expected"; + if (message.feerate_sat_per_1000_weight != null && message.hasOwnProperty("feerate_sat_per_1000_weight")) + if (!$util.isInteger(message.feerate_sat_per_1000_weight)) + return "feerate_sat_per_1000_weight: integer expected"; + if (message.outbound_capacity_msat != null && message.hasOwnProperty("outbound_capacity_msat")) + if (!$util.isInteger(message.outbound_capacity_msat) && !(message.outbound_capacity_msat && $util.isInteger(message.outbound_capacity_msat.low) && $util.isInteger(message.outbound_capacity_msat.high))) + return "outbound_capacity_msat: integer|Long expected"; + if (message.inbound_capacity_msat != null && message.hasOwnProperty("inbound_capacity_msat")) + if (!$util.isInteger(message.inbound_capacity_msat) && !(message.inbound_capacity_msat && $util.isInteger(message.inbound_capacity_msat.low) && $util.isInteger(message.inbound_capacity_msat.high))) + return "inbound_capacity_msat: integer|Long expected"; + if (message.confirmations_required != null && message.hasOwnProperty("confirmations_required")) { + properties._confirmations_required = 1; + if (!$util.isInteger(message.confirmations_required)) + return "confirmations_required: integer expected"; + } + if (message.confirmations != null && message.hasOwnProperty("confirmations")) { + properties._confirmations = 1; + if (!$util.isInteger(message.confirmations)) + return "confirmations: integer expected"; + } + if (message.is_outbound != null && message.hasOwnProperty("is_outbound")) + if (typeof message.is_outbound !== "boolean") + return "is_outbound: boolean expected"; + if (message.is_channel_ready != null && message.hasOwnProperty("is_channel_ready")) + if (typeof message.is_channel_ready !== "boolean") + return "is_channel_ready: boolean expected"; + if (message.is_usable != null && message.hasOwnProperty("is_usable")) + if (typeof message.is_usable !== "boolean") + return "is_usable: boolean expected"; + if (message.is_announced != null && message.hasOwnProperty("is_announced")) + if (typeof message.is_announced !== "boolean") + return "is_announced: boolean expected"; + if (message.channel_config != null && message.hasOwnProperty("channel_config")) { + let error = $root.types.ChannelConfig.verify(message.channel_config, long + 1); + if (error) + return "channel_config." + error; + } + if (message.next_outbound_htlc_limit_msat != null && message.hasOwnProperty("next_outbound_htlc_limit_msat")) + if (!$util.isInteger(message.next_outbound_htlc_limit_msat) && !(message.next_outbound_htlc_limit_msat && $util.isInteger(message.next_outbound_htlc_limit_msat.low) && $util.isInteger(message.next_outbound_htlc_limit_msat.high))) + return "next_outbound_htlc_limit_msat: integer|Long expected"; + if (message.next_outbound_htlc_minimum_msat != null && message.hasOwnProperty("next_outbound_htlc_minimum_msat")) + if (!$util.isInteger(message.next_outbound_htlc_minimum_msat) && !(message.next_outbound_htlc_minimum_msat && $util.isInteger(message.next_outbound_htlc_minimum_msat.low) && $util.isInteger(message.next_outbound_htlc_minimum_msat.high))) + return "next_outbound_htlc_minimum_msat: integer|Long expected"; + if (message.force_close_spend_delay != null && message.hasOwnProperty("force_close_spend_delay")) { + properties._force_close_spend_delay = 1; + if (!$util.isInteger(message.force_close_spend_delay)) + return "force_close_spend_delay: integer expected"; + } + if (message.counterparty_outbound_htlc_minimum_msat != null && message.hasOwnProperty("counterparty_outbound_htlc_minimum_msat")) { + properties._counterparty_outbound_htlc_minimum_msat = 1; + if (!$util.isInteger(message.counterparty_outbound_htlc_minimum_msat) && !(message.counterparty_outbound_htlc_minimum_msat && $util.isInteger(message.counterparty_outbound_htlc_minimum_msat.low) && $util.isInteger(message.counterparty_outbound_htlc_minimum_msat.high))) + return "counterparty_outbound_htlc_minimum_msat: integer|Long expected"; + } + if (message.counterparty_outbound_htlc_maximum_msat != null && message.hasOwnProperty("counterparty_outbound_htlc_maximum_msat")) { + properties._counterparty_outbound_htlc_maximum_msat = 1; + if (!$util.isInteger(message.counterparty_outbound_htlc_maximum_msat) && !(message.counterparty_outbound_htlc_maximum_msat && $util.isInteger(message.counterparty_outbound_htlc_maximum_msat.low) && $util.isInteger(message.counterparty_outbound_htlc_maximum_msat.high))) + return "counterparty_outbound_htlc_maximum_msat: integer|Long expected"; + } + if (message.counterparty_unspendable_punishment_reserve != null && message.hasOwnProperty("counterparty_unspendable_punishment_reserve")) + if (!$util.isInteger(message.counterparty_unspendable_punishment_reserve) && !(message.counterparty_unspendable_punishment_reserve && $util.isInteger(message.counterparty_unspendable_punishment_reserve.low) && $util.isInteger(message.counterparty_unspendable_punishment_reserve.high))) + return "counterparty_unspendable_punishment_reserve: integer|Long expected"; + if (message.counterparty_forwarding_info_fee_base_msat != null && message.hasOwnProperty("counterparty_forwarding_info_fee_base_msat")) { + properties._counterparty_forwarding_info_fee_base_msat = 1; + if (!$util.isInteger(message.counterparty_forwarding_info_fee_base_msat)) + return "counterparty_forwarding_info_fee_base_msat: integer expected"; + } + if (message.counterparty_forwarding_info_fee_proportional_millionths != null && message.hasOwnProperty("counterparty_forwarding_info_fee_proportional_millionths")) { + properties._counterparty_forwarding_info_fee_proportional_millionths = 1; + if (!$util.isInteger(message.counterparty_forwarding_info_fee_proportional_millionths)) + return "counterparty_forwarding_info_fee_proportional_millionths: integer expected"; + } + if (message.counterparty_forwarding_info_cltv_expiry_delta != null && message.hasOwnProperty("counterparty_forwarding_info_cltv_expiry_delta")) { + properties._counterparty_forwarding_info_cltv_expiry_delta = 1; + if (!$util.isInteger(message.counterparty_forwarding_info_cltv_expiry_delta)) + return "counterparty_forwarding_info_cltv_expiry_delta: integer expected"; + } + return null; + }; + + /** + * Creates a Channel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Channel + * @static + * @param {Object.} object Plain object + * @returns {types.Channel} Channel + */ + Channel.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.Channel) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.Channel(); + if (object.channel_id != null) + message.channel_id = String(object.channel_id); + if (object.counterparty_node_id != null) + message.counterparty_node_id = String(object.counterparty_node_id); + if (object.funding_txo != null) { + if (typeof object.funding_txo !== "object") + throw TypeError(".types.Channel.funding_txo: object expected"); + message.funding_txo = $root.types.OutPoint.fromObject(object.funding_txo, long + 1); + } + if (object.user_channel_id != null) + message.user_channel_id = String(object.user_channel_id); + if (object.unspendable_punishment_reserve != null) + if ($util.Long) + (message.unspendable_punishment_reserve = $util.Long.fromValue(object.unspendable_punishment_reserve)).unsigned = true; + else if (typeof object.unspendable_punishment_reserve === "string") + message.unspendable_punishment_reserve = parseInt(object.unspendable_punishment_reserve, 10); + else if (typeof object.unspendable_punishment_reserve === "number") + message.unspendable_punishment_reserve = object.unspendable_punishment_reserve; + else if (typeof object.unspendable_punishment_reserve === "object") + message.unspendable_punishment_reserve = new $util.LongBits(object.unspendable_punishment_reserve.low >>> 0, object.unspendable_punishment_reserve.high >>> 0).toNumber(true); + if (object.channel_value_sats != null) + if ($util.Long) + (message.channel_value_sats = $util.Long.fromValue(object.channel_value_sats)).unsigned = true; + else if (typeof object.channel_value_sats === "string") + message.channel_value_sats = parseInt(object.channel_value_sats, 10); + else if (typeof object.channel_value_sats === "number") + message.channel_value_sats = object.channel_value_sats; + else if (typeof object.channel_value_sats === "object") + message.channel_value_sats = new $util.LongBits(object.channel_value_sats.low >>> 0, object.channel_value_sats.high >>> 0).toNumber(true); + if (object.feerate_sat_per_1000_weight != null) + message.feerate_sat_per_1000_weight = object.feerate_sat_per_1000_weight >>> 0; + if (object.outbound_capacity_msat != null) + if ($util.Long) + (message.outbound_capacity_msat = $util.Long.fromValue(object.outbound_capacity_msat)).unsigned = true; + else if (typeof object.outbound_capacity_msat === "string") + message.outbound_capacity_msat = parseInt(object.outbound_capacity_msat, 10); + else if (typeof object.outbound_capacity_msat === "number") + message.outbound_capacity_msat = object.outbound_capacity_msat; + else if (typeof object.outbound_capacity_msat === "object") + message.outbound_capacity_msat = new $util.LongBits(object.outbound_capacity_msat.low >>> 0, object.outbound_capacity_msat.high >>> 0).toNumber(true); + if (object.inbound_capacity_msat != null) + if ($util.Long) + (message.inbound_capacity_msat = $util.Long.fromValue(object.inbound_capacity_msat)).unsigned = true; + else if (typeof object.inbound_capacity_msat === "string") + message.inbound_capacity_msat = parseInt(object.inbound_capacity_msat, 10); + else if (typeof object.inbound_capacity_msat === "number") + message.inbound_capacity_msat = object.inbound_capacity_msat; + else if (typeof object.inbound_capacity_msat === "object") + message.inbound_capacity_msat = new $util.LongBits(object.inbound_capacity_msat.low >>> 0, object.inbound_capacity_msat.high >>> 0).toNumber(true); + if (object.confirmations_required != null) + message.confirmations_required = object.confirmations_required >>> 0; + if (object.confirmations != null) + message.confirmations = object.confirmations >>> 0; + if (object.is_outbound != null) + message.is_outbound = Boolean(object.is_outbound); + if (object.is_channel_ready != null) + message.is_channel_ready = Boolean(object.is_channel_ready); + if (object.is_usable != null) + message.is_usable = Boolean(object.is_usable); + if (object.is_announced != null) + message.is_announced = Boolean(object.is_announced); + if (object.channel_config != null) { + if (typeof object.channel_config !== "object") + throw TypeError(".types.Channel.channel_config: object expected"); + message.channel_config = $root.types.ChannelConfig.fromObject(object.channel_config, long + 1); + } + if (object.next_outbound_htlc_limit_msat != null) + if ($util.Long) + (message.next_outbound_htlc_limit_msat = $util.Long.fromValue(object.next_outbound_htlc_limit_msat)).unsigned = true; + else if (typeof object.next_outbound_htlc_limit_msat === "string") + message.next_outbound_htlc_limit_msat = parseInt(object.next_outbound_htlc_limit_msat, 10); + else if (typeof object.next_outbound_htlc_limit_msat === "number") + message.next_outbound_htlc_limit_msat = object.next_outbound_htlc_limit_msat; + else if (typeof object.next_outbound_htlc_limit_msat === "object") + message.next_outbound_htlc_limit_msat = new $util.LongBits(object.next_outbound_htlc_limit_msat.low >>> 0, object.next_outbound_htlc_limit_msat.high >>> 0).toNumber(true); + if (object.next_outbound_htlc_minimum_msat != null) + if ($util.Long) + (message.next_outbound_htlc_minimum_msat = $util.Long.fromValue(object.next_outbound_htlc_minimum_msat)).unsigned = true; + else if (typeof object.next_outbound_htlc_minimum_msat === "string") + message.next_outbound_htlc_minimum_msat = parseInt(object.next_outbound_htlc_minimum_msat, 10); + else if (typeof object.next_outbound_htlc_minimum_msat === "number") + message.next_outbound_htlc_minimum_msat = object.next_outbound_htlc_minimum_msat; + else if (typeof object.next_outbound_htlc_minimum_msat === "object") + message.next_outbound_htlc_minimum_msat = new $util.LongBits(object.next_outbound_htlc_minimum_msat.low >>> 0, object.next_outbound_htlc_minimum_msat.high >>> 0).toNumber(true); + if (object.force_close_spend_delay != null) + message.force_close_spend_delay = object.force_close_spend_delay >>> 0; + if (object.counterparty_outbound_htlc_minimum_msat != null) + if ($util.Long) + (message.counterparty_outbound_htlc_minimum_msat = $util.Long.fromValue(object.counterparty_outbound_htlc_minimum_msat)).unsigned = true; + else if (typeof object.counterparty_outbound_htlc_minimum_msat === "string") + message.counterparty_outbound_htlc_minimum_msat = parseInt(object.counterparty_outbound_htlc_minimum_msat, 10); + else if (typeof object.counterparty_outbound_htlc_minimum_msat === "number") + message.counterparty_outbound_htlc_minimum_msat = object.counterparty_outbound_htlc_minimum_msat; + else if (typeof object.counterparty_outbound_htlc_minimum_msat === "object") + message.counterparty_outbound_htlc_minimum_msat = new $util.LongBits(object.counterparty_outbound_htlc_minimum_msat.low >>> 0, object.counterparty_outbound_htlc_minimum_msat.high >>> 0).toNumber(true); + if (object.counterparty_outbound_htlc_maximum_msat != null) + if ($util.Long) + (message.counterparty_outbound_htlc_maximum_msat = $util.Long.fromValue(object.counterparty_outbound_htlc_maximum_msat)).unsigned = true; + else if (typeof object.counterparty_outbound_htlc_maximum_msat === "string") + message.counterparty_outbound_htlc_maximum_msat = parseInt(object.counterparty_outbound_htlc_maximum_msat, 10); + else if (typeof object.counterparty_outbound_htlc_maximum_msat === "number") + message.counterparty_outbound_htlc_maximum_msat = object.counterparty_outbound_htlc_maximum_msat; + else if (typeof object.counterparty_outbound_htlc_maximum_msat === "object") + message.counterparty_outbound_htlc_maximum_msat = new $util.LongBits(object.counterparty_outbound_htlc_maximum_msat.low >>> 0, object.counterparty_outbound_htlc_maximum_msat.high >>> 0).toNumber(true); + if (object.counterparty_unspendable_punishment_reserve != null) + if ($util.Long) + (message.counterparty_unspendable_punishment_reserve = $util.Long.fromValue(object.counterparty_unspendable_punishment_reserve)).unsigned = true; + else if (typeof object.counterparty_unspendable_punishment_reserve === "string") + message.counterparty_unspendable_punishment_reserve = parseInt(object.counterparty_unspendable_punishment_reserve, 10); + else if (typeof object.counterparty_unspendable_punishment_reserve === "number") + message.counterparty_unspendable_punishment_reserve = object.counterparty_unspendable_punishment_reserve; + else if (typeof object.counterparty_unspendable_punishment_reserve === "object") + message.counterparty_unspendable_punishment_reserve = new $util.LongBits(object.counterparty_unspendable_punishment_reserve.low >>> 0, object.counterparty_unspendable_punishment_reserve.high >>> 0).toNumber(true); + if (object.counterparty_forwarding_info_fee_base_msat != null) + message.counterparty_forwarding_info_fee_base_msat = object.counterparty_forwarding_info_fee_base_msat >>> 0; + if (object.counterparty_forwarding_info_fee_proportional_millionths != null) + message.counterparty_forwarding_info_fee_proportional_millionths = object.counterparty_forwarding_info_fee_proportional_millionths >>> 0; + if (object.counterparty_forwarding_info_cltv_expiry_delta != null) + message.counterparty_forwarding_info_cltv_expiry_delta = object.counterparty_forwarding_info_cltv_expiry_delta >>> 0; + return message; + }; + + /** + * Creates a plain object from a Channel message. Also converts values to other types if specified. + * @function toObject + * @memberof types.Channel + * @static + * @param {types.Channel} message Channel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Channel.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.channel_id = ""; + object.counterparty_node_id = ""; + object.user_channel_id = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.channel_value_sats = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.channel_value_sats = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.feerate_sat_per_1000_weight = 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.outbound_capacity_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.outbound_capacity_msat = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.inbound_capacity_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.inbound_capacity_msat = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.is_outbound = false; + object.is_channel_ready = false; + object.is_usable = false; + object.is_announced = false; + object.channel_config = null; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.next_outbound_htlc_limit_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.next_outbound_htlc_limit_msat = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.next_outbound_htlc_minimum_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.next_outbound_htlc_minimum_msat = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.counterparty_unspendable_punishment_reserve = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.counterparty_unspendable_punishment_reserve = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + } + if (message.channel_id != null && message.hasOwnProperty("channel_id")) + object.channel_id = message.channel_id; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + object.counterparty_node_id = message.counterparty_node_id; + if (message.funding_txo != null && message.hasOwnProperty("funding_txo")) { + object.funding_txo = $root.types.OutPoint.toObject(message.funding_txo, options); + if (options.oneofs) + object._funding_txo = "funding_txo"; + } + if (message.user_channel_id != null && message.hasOwnProperty("user_channel_id")) + object.user_channel_id = message.user_channel_id; + if (message.unspendable_punishment_reserve != null && message.hasOwnProperty("unspendable_punishment_reserve")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.unspendable_punishment_reserve = typeof message.unspendable_punishment_reserve === "number" ? BigInt(message.unspendable_punishment_reserve) : $util.Long.fromBits(message.unspendable_punishment_reserve.low >>> 0, message.unspendable_punishment_reserve.high >>> 0, true).toBigInt(); + else if (typeof message.unspendable_punishment_reserve === "number") + object.unspendable_punishment_reserve = options.longs === String ? String(message.unspendable_punishment_reserve) : message.unspendable_punishment_reserve; + else + object.unspendable_punishment_reserve = options.longs === String ? $util.Long.prototype.toString.call(message.unspendable_punishment_reserve) : options.longs === Number ? new $util.LongBits(message.unspendable_punishment_reserve.low >>> 0, message.unspendable_punishment_reserve.high >>> 0).toNumber(true) : message.unspendable_punishment_reserve; + if (options.oneofs) + object._unspendable_punishment_reserve = "unspendable_punishment_reserve"; + } + if (message.channel_value_sats != null && message.hasOwnProperty("channel_value_sats")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.channel_value_sats = typeof message.channel_value_sats === "number" ? BigInt(message.channel_value_sats) : $util.Long.fromBits(message.channel_value_sats.low >>> 0, message.channel_value_sats.high >>> 0, true).toBigInt(); + else if (typeof message.channel_value_sats === "number") + object.channel_value_sats = options.longs === String ? String(message.channel_value_sats) : message.channel_value_sats; + else + object.channel_value_sats = options.longs === String ? $util.Long.prototype.toString.call(message.channel_value_sats) : options.longs === Number ? new $util.LongBits(message.channel_value_sats.low >>> 0, message.channel_value_sats.high >>> 0).toNumber(true) : message.channel_value_sats; + if (message.feerate_sat_per_1000_weight != null && message.hasOwnProperty("feerate_sat_per_1000_weight")) + object.feerate_sat_per_1000_weight = message.feerate_sat_per_1000_weight; + if (message.outbound_capacity_msat != null && message.hasOwnProperty("outbound_capacity_msat")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.outbound_capacity_msat = typeof message.outbound_capacity_msat === "number" ? BigInt(message.outbound_capacity_msat) : $util.Long.fromBits(message.outbound_capacity_msat.low >>> 0, message.outbound_capacity_msat.high >>> 0, true).toBigInt(); + else if (typeof message.outbound_capacity_msat === "number") + object.outbound_capacity_msat = options.longs === String ? String(message.outbound_capacity_msat) : message.outbound_capacity_msat; + else + object.outbound_capacity_msat = options.longs === String ? $util.Long.prototype.toString.call(message.outbound_capacity_msat) : options.longs === Number ? new $util.LongBits(message.outbound_capacity_msat.low >>> 0, message.outbound_capacity_msat.high >>> 0).toNumber(true) : message.outbound_capacity_msat; + if (message.inbound_capacity_msat != null && message.hasOwnProperty("inbound_capacity_msat")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.inbound_capacity_msat = typeof message.inbound_capacity_msat === "number" ? BigInt(message.inbound_capacity_msat) : $util.Long.fromBits(message.inbound_capacity_msat.low >>> 0, message.inbound_capacity_msat.high >>> 0, true).toBigInt(); + else if (typeof message.inbound_capacity_msat === "number") + object.inbound_capacity_msat = options.longs === String ? String(message.inbound_capacity_msat) : message.inbound_capacity_msat; + else + object.inbound_capacity_msat = options.longs === String ? $util.Long.prototype.toString.call(message.inbound_capacity_msat) : options.longs === Number ? new $util.LongBits(message.inbound_capacity_msat.low >>> 0, message.inbound_capacity_msat.high >>> 0).toNumber(true) : message.inbound_capacity_msat; + if (message.confirmations_required != null && message.hasOwnProperty("confirmations_required")) { + object.confirmations_required = message.confirmations_required; + if (options.oneofs) + object._confirmations_required = "confirmations_required"; + } + if (message.confirmations != null && message.hasOwnProperty("confirmations")) { + object.confirmations = message.confirmations; + if (options.oneofs) + object._confirmations = "confirmations"; + } + if (message.is_outbound != null && message.hasOwnProperty("is_outbound")) + object.is_outbound = message.is_outbound; + if (message.is_channel_ready != null && message.hasOwnProperty("is_channel_ready")) + object.is_channel_ready = message.is_channel_ready; + if (message.is_usable != null && message.hasOwnProperty("is_usable")) + object.is_usable = message.is_usable; + if (message.is_announced != null && message.hasOwnProperty("is_announced")) + object.is_announced = message.is_announced; + if (message.channel_config != null && message.hasOwnProperty("channel_config")) + object.channel_config = $root.types.ChannelConfig.toObject(message.channel_config, options); + if (message.next_outbound_htlc_limit_msat != null && message.hasOwnProperty("next_outbound_htlc_limit_msat")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.next_outbound_htlc_limit_msat = typeof message.next_outbound_htlc_limit_msat === "number" ? BigInt(message.next_outbound_htlc_limit_msat) : $util.Long.fromBits(message.next_outbound_htlc_limit_msat.low >>> 0, message.next_outbound_htlc_limit_msat.high >>> 0, true).toBigInt(); + else if (typeof message.next_outbound_htlc_limit_msat === "number") + object.next_outbound_htlc_limit_msat = options.longs === String ? String(message.next_outbound_htlc_limit_msat) : message.next_outbound_htlc_limit_msat; + else + object.next_outbound_htlc_limit_msat = options.longs === String ? $util.Long.prototype.toString.call(message.next_outbound_htlc_limit_msat) : options.longs === Number ? new $util.LongBits(message.next_outbound_htlc_limit_msat.low >>> 0, message.next_outbound_htlc_limit_msat.high >>> 0).toNumber(true) : message.next_outbound_htlc_limit_msat; + if (message.next_outbound_htlc_minimum_msat != null && message.hasOwnProperty("next_outbound_htlc_minimum_msat")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.next_outbound_htlc_minimum_msat = typeof message.next_outbound_htlc_minimum_msat === "number" ? BigInt(message.next_outbound_htlc_minimum_msat) : $util.Long.fromBits(message.next_outbound_htlc_minimum_msat.low >>> 0, message.next_outbound_htlc_minimum_msat.high >>> 0, true).toBigInt(); + else if (typeof message.next_outbound_htlc_minimum_msat === "number") + object.next_outbound_htlc_minimum_msat = options.longs === String ? String(message.next_outbound_htlc_minimum_msat) : message.next_outbound_htlc_minimum_msat; + else + object.next_outbound_htlc_minimum_msat = options.longs === String ? $util.Long.prototype.toString.call(message.next_outbound_htlc_minimum_msat) : options.longs === Number ? new $util.LongBits(message.next_outbound_htlc_minimum_msat.low >>> 0, message.next_outbound_htlc_minimum_msat.high >>> 0).toNumber(true) : message.next_outbound_htlc_minimum_msat; + if (message.force_close_spend_delay != null && message.hasOwnProperty("force_close_spend_delay")) { + object.force_close_spend_delay = message.force_close_spend_delay; + if (options.oneofs) + object._force_close_spend_delay = "force_close_spend_delay"; + } + if (message.counterparty_outbound_htlc_minimum_msat != null && message.hasOwnProperty("counterparty_outbound_htlc_minimum_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.counterparty_outbound_htlc_minimum_msat = typeof message.counterparty_outbound_htlc_minimum_msat === "number" ? BigInt(message.counterparty_outbound_htlc_minimum_msat) : $util.Long.fromBits(message.counterparty_outbound_htlc_minimum_msat.low >>> 0, message.counterparty_outbound_htlc_minimum_msat.high >>> 0, true).toBigInt(); + else if (typeof message.counterparty_outbound_htlc_minimum_msat === "number") + object.counterparty_outbound_htlc_minimum_msat = options.longs === String ? String(message.counterparty_outbound_htlc_minimum_msat) : message.counterparty_outbound_htlc_minimum_msat; + else + object.counterparty_outbound_htlc_minimum_msat = options.longs === String ? $util.Long.prototype.toString.call(message.counterparty_outbound_htlc_minimum_msat) : options.longs === Number ? new $util.LongBits(message.counterparty_outbound_htlc_minimum_msat.low >>> 0, message.counterparty_outbound_htlc_minimum_msat.high >>> 0).toNumber(true) : message.counterparty_outbound_htlc_minimum_msat; + if (options.oneofs) + object._counterparty_outbound_htlc_minimum_msat = "counterparty_outbound_htlc_minimum_msat"; + } + if (message.counterparty_outbound_htlc_maximum_msat != null && message.hasOwnProperty("counterparty_outbound_htlc_maximum_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.counterparty_outbound_htlc_maximum_msat = typeof message.counterparty_outbound_htlc_maximum_msat === "number" ? BigInt(message.counterparty_outbound_htlc_maximum_msat) : $util.Long.fromBits(message.counterparty_outbound_htlc_maximum_msat.low >>> 0, message.counterparty_outbound_htlc_maximum_msat.high >>> 0, true).toBigInt(); + else if (typeof message.counterparty_outbound_htlc_maximum_msat === "number") + object.counterparty_outbound_htlc_maximum_msat = options.longs === String ? String(message.counterparty_outbound_htlc_maximum_msat) : message.counterparty_outbound_htlc_maximum_msat; + else + object.counterparty_outbound_htlc_maximum_msat = options.longs === String ? $util.Long.prototype.toString.call(message.counterparty_outbound_htlc_maximum_msat) : options.longs === Number ? new $util.LongBits(message.counterparty_outbound_htlc_maximum_msat.low >>> 0, message.counterparty_outbound_htlc_maximum_msat.high >>> 0).toNumber(true) : message.counterparty_outbound_htlc_maximum_msat; + if (options.oneofs) + object._counterparty_outbound_htlc_maximum_msat = "counterparty_outbound_htlc_maximum_msat"; + } + if (message.counterparty_unspendable_punishment_reserve != null && message.hasOwnProperty("counterparty_unspendable_punishment_reserve")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.counterparty_unspendable_punishment_reserve = typeof message.counterparty_unspendable_punishment_reserve === "number" ? BigInt(message.counterparty_unspendable_punishment_reserve) : $util.Long.fromBits(message.counterparty_unspendable_punishment_reserve.low >>> 0, message.counterparty_unspendable_punishment_reserve.high >>> 0, true).toBigInt(); + else if (typeof message.counterparty_unspendable_punishment_reserve === "number") + object.counterparty_unspendable_punishment_reserve = options.longs === String ? String(message.counterparty_unspendable_punishment_reserve) : message.counterparty_unspendable_punishment_reserve; + else + object.counterparty_unspendable_punishment_reserve = options.longs === String ? $util.Long.prototype.toString.call(message.counterparty_unspendable_punishment_reserve) : options.longs === Number ? new $util.LongBits(message.counterparty_unspendable_punishment_reserve.low >>> 0, message.counterparty_unspendable_punishment_reserve.high >>> 0).toNumber(true) : message.counterparty_unspendable_punishment_reserve; + if (message.counterparty_forwarding_info_fee_base_msat != null && message.hasOwnProperty("counterparty_forwarding_info_fee_base_msat")) { + object.counterparty_forwarding_info_fee_base_msat = message.counterparty_forwarding_info_fee_base_msat; + if (options.oneofs) + object._counterparty_forwarding_info_fee_base_msat = "counterparty_forwarding_info_fee_base_msat"; + } + if (message.counterparty_forwarding_info_fee_proportional_millionths != null && message.hasOwnProperty("counterparty_forwarding_info_fee_proportional_millionths")) { + object.counterparty_forwarding_info_fee_proportional_millionths = message.counterparty_forwarding_info_fee_proportional_millionths; + if (options.oneofs) + object._counterparty_forwarding_info_fee_proportional_millionths = "counterparty_forwarding_info_fee_proportional_millionths"; + } + if (message.counterparty_forwarding_info_cltv_expiry_delta != null && message.hasOwnProperty("counterparty_forwarding_info_cltv_expiry_delta")) { + object.counterparty_forwarding_info_cltv_expiry_delta = message.counterparty_forwarding_info_cltv_expiry_delta; + if (options.oneofs) + object._counterparty_forwarding_info_cltv_expiry_delta = "counterparty_forwarding_info_cltv_expiry_delta"; + } + return object; + }; + + /** + * Converts this Channel to JSON. + * @function toJSON + * @memberof types.Channel + * @instance + * @returns {Object.} JSON object + */ + Channel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Channel + * @function getTypeUrl + * @memberof types.Channel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Channel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Channel"; + }; + + return Channel; + })(); + + types.ChannelConfig = (function() { + + /** + * Properties of a ChannelConfig. + * @memberof types + * @interface IChannelConfig + * @property {number|null} [forwarding_fee_proportional_millionths] ChannelConfig forwarding_fee_proportional_millionths + * @property {number|null} [forwarding_fee_base_msat] ChannelConfig forwarding_fee_base_msat + * @property {number|null} [cltv_expiry_delta] ChannelConfig cltv_expiry_delta + * @property {Long|null} [force_close_avoidance_max_fee_satoshis] ChannelConfig force_close_avoidance_max_fee_satoshis + * @property {boolean|null} [accept_underpaying_htlcs] ChannelConfig accept_underpaying_htlcs + * @property {Long|null} [fixed_limit_msat] ChannelConfig fixed_limit_msat + * @property {Long|null} [fee_rate_multiplier] ChannelConfig fee_rate_multiplier + */ + + /** + * Constructs a new ChannelConfig. + * @memberof types + * @classdesc Represents a ChannelConfig. + * @implements IChannelConfig + * @constructor + * @param {types.IChannelConfig=} [properties] Properties to set + */ + function ChannelConfig(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChannelConfig forwarding_fee_proportional_millionths. + * @member {number|null|undefined} forwarding_fee_proportional_millionths + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.forwarding_fee_proportional_millionths = null; + + /** + * ChannelConfig forwarding_fee_base_msat. + * @member {number|null|undefined} forwarding_fee_base_msat + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.forwarding_fee_base_msat = null; + + /** + * ChannelConfig cltv_expiry_delta. + * @member {number|null|undefined} cltv_expiry_delta + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.cltv_expiry_delta = null; + + /** + * ChannelConfig force_close_avoidance_max_fee_satoshis. + * @member {Long|null|undefined} force_close_avoidance_max_fee_satoshis + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.force_close_avoidance_max_fee_satoshis = null; + + /** + * ChannelConfig accept_underpaying_htlcs. + * @member {boolean|null|undefined} accept_underpaying_htlcs + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.accept_underpaying_htlcs = null; + + /** + * ChannelConfig fixed_limit_msat. + * @member {Long|null|undefined} fixed_limit_msat + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.fixed_limit_msat = null; + + /** + * ChannelConfig fee_rate_multiplier. + * @member {Long|null|undefined} fee_rate_multiplier + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.fee_rate_multiplier = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChannelConfig.prototype, "_forwarding_fee_proportional_millionths", { + get: $util.oneOfGetter($oneOfFields = ["forwarding_fee_proportional_millionths"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChannelConfig.prototype, "_forwarding_fee_base_msat", { + get: $util.oneOfGetter($oneOfFields = ["forwarding_fee_base_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChannelConfig.prototype, "_cltv_expiry_delta", { + get: $util.oneOfGetter($oneOfFields = ["cltv_expiry_delta"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChannelConfig.prototype, "_force_close_avoidance_max_fee_satoshis", { + get: $util.oneOfGetter($oneOfFields = ["force_close_avoidance_max_fee_satoshis"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChannelConfig.prototype, "_accept_underpaying_htlcs", { + get: $util.oneOfGetter($oneOfFields = ["accept_underpaying_htlcs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ChannelConfig max_dust_htlc_exposure. + * @member {"fixed_limit_msat"|"fee_rate_multiplier"|undefined} max_dust_htlc_exposure + * @memberof types.ChannelConfig + * @instance + */ + Object.defineProperty(ChannelConfig.prototype, "max_dust_htlc_exposure", { + get: $util.oneOfGetter($oneOfFields = ["fixed_limit_msat", "fee_rate_multiplier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ChannelConfig instance using the specified properties. + * @function create + * @memberof types.ChannelConfig + * @static + * @param {types.IChannelConfig=} [properties] Properties to set + * @returns {types.ChannelConfig} ChannelConfig instance + */ + ChannelConfig.create = function create(properties) { + return new ChannelConfig(properties); + }; + + /** + * Encodes the specified ChannelConfig message. Does not implicitly {@link types.ChannelConfig.verify|verify} messages. + * @function encode + * @memberof types.ChannelConfig + * @static + * @param {types.IChannelConfig} message ChannelConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.forwarding_fee_proportional_millionths != null && Object.hasOwnProperty.call(message, "forwarding_fee_proportional_millionths")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.forwarding_fee_proportional_millionths); + if (message.forwarding_fee_base_msat != null && Object.hasOwnProperty.call(message, "forwarding_fee_base_msat")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.forwarding_fee_base_msat); + if (message.cltv_expiry_delta != null && Object.hasOwnProperty.call(message, "cltv_expiry_delta")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.cltv_expiry_delta); + if (message.force_close_avoidance_max_fee_satoshis != null && Object.hasOwnProperty.call(message, "force_close_avoidance_max_fee_satoshis")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.force_close_avoidance_max_fee_satoshis); + if (message.accept_underpaying_htlcs != null && Object.hasOwnProperty.call(message, "accept_underpaying_htlcs")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.accept_underpaying_htlcs); + if (message.fixed_limit_msat != null && Object.hasOwnProperty.call(message, "fixed_limit_msat")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.fixed_limit_msat); + if (message.fee_rate_multiplier != null && Object.hasOwnProperty.call(message, "fee_rate_multiplier")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.fee_rate_multiplier); + return writer; + }; + + /** + * Encodes the specified ChannelConfig message, length delimited. Does not implicitly {@link types.ChannelConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof types.ChannelConfig + * @static + * @param {types.IChannelConfig} message ChannelConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChannelConfig message from the specified reader or buffer. + * @function decode + * @memberof types.ChannelConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.ChannelConfig} ChannelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.ChannelConfig(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.forwarding_fee_proportional_millionths = reader.uint32(); + break; + } + case 2: { + message.forwarding_fee_base_msat = reader.uint32(); + break; + } + case 3: { + message.cltv_expiry_delta = reader.uint32(); + break; + } + case 4: { + message.force_close_avoidance_max_fee_satoshis = reader.uint64(); + break; + } + case 5: { + message.accept_underpaying_htlcs = reader.bool(); + break; + } + case 6: { + message.fixed_limit_msat = reader.uint64(); + break; + } + case 7: { + message.fee_rate_multiplier = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ChannelConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.ChannelConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.ChannelConfig} ChannelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChannelConfig message. + * @function verify + * @memberof types.ChannelConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChannelConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.forwarding_fee_proportional_millionths != null && message.hasOwnProperty("forwarding_fee_proportional_millionths")) { + properties._forwarding_fee_proportional_millionths = 1; + if (!$util.isInteger(message.forwarding_fee_proportional_millionths)) + return "forwarding_fee_proportional_millionths: integer expected"; + } + if (message.forwarding_fee_base_msat != null && message.hasOwnProperty("forwarding_fee_base_msat")) { + properties._forwarding_fee_base_msat = 1; + if (!$util.isInteger(message.forwarding_fee_base_msat)) + return "forwarding_fee_base_msat: integer expected"; + } + if (message.cltv_expiry_delta != null && message.hasOwnProperty("cltv_expiry_delta")) { + properties._cltv_expiry_delta = 1; + if (!$util.isInteger(message.cltv_expiry_delta)) + return "cltv_expiry_delta: integer expected"; + } + if (message.force_close_avoidance_max_fee_satoshis != null && message.hasOwnProperty("force_close_avoidance_max_fee_satoshis")) { + properties._force_close_avoidance_max_fee_satoshis = 1; + if (!$util.isInteger(message.force_close_avoidance_max_fee_satoshis) && !(message.force_close_avoidance_max_fee_satoshis && $util.isInteger(message.force_close_avoidance_max_fee_satoshis.low) && $util.isInteger(message.force_close_avoidance_max_fee_satoshis.high))) + return "force_close_avoidance_max_fee_satoshis: integer|Long expected"; + } + if (message.accept_underpaying_htlcs != null && message.hasOwnProperty("accept_underpaying_htlcs")) { + properties._accept_underpaying_htlcs = 1; + if (typeof message.accept_underpaying_htlcs !== "boolean") + return "accept_underpaying_htlcs: boolean expected"; + } + if (message.fixed_limit_msat != null && message.hasOwnProperty("fixed_limit_msat")) { + properties.max_dust_htlc_exposure = 1; + if (!$util.isInteger(message.fixed_limit_msat) && !(message.fixed_limit_msat && $util.isInteger(message.fixed_limit_msat.low) && $util.isInteger(message.fixed_limit_msat.high))) + return "fixed_limit_msat: integer|Long expected"; + } + if (message.fee_rate_multiplier != null && message.hasOwnProperty("fee_rate_multiplier")) { + if (properties.max_dust_htlc_exposure === 1) + return "max_dust_htlc_exposure: multiple values"; + properties.max_dust_htlc_exposure = 1; + if (!$util.isInteger(message.fee_rate_multiplier) && !(message.fee_rate_multiplier && $util.isInteger(message.fee_rate_multiplier.low) && $util.isInteger(message.fee_rate_multiplier.high))) + return "fee_rate_multiplier: integer|Long expected"; + } + return null; + }; + + /** + * Creates a ChannelConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.ChannelConfig + * @static + * @param {Object.} object Plain object + * @returns {types.ChannelConfig} ChannelConfig + */ + ChannelConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.ChannelConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.ChannelConfig(); + if (object.forwarding_fee_proportional_millionths != null) + message.forwarding_fee_proportional_millionths = object.forwarding_fee_proportional_millionths >>> 0; + if (object.forwarding_fee_base_msat != null) + message.forwarding_fee_base_msat = object.forwarding_fee_base_msat >>> 0; + if (object.cltv_expiry_delta != null) + message.cltv_expiry_delta = object.cltv_expiry_delta >>> 0; + if (object.force_close_avoidance_max_fee_satoshis != null) + if ($util.Long) + (message.force_close_avoidance_max_fee_satoshis = $util.Long.fromValue(object.force_close_avoidance_max_fee_satoshis)).unsigned = true; + else if (typeof object.force_close_avoidance_max_fee_satoshis === "string") + message.force_close_avoidance_max_fee_satoshis = parseInt(object.force_close_avoidance_max_fee_satoshis, 10); + else if (typeof object.force_close_avoidance_max_fee_satoshis === "number") + message.force_close_avoidance_max_fee_satoshis = object.force_close_avoidance_max_fee_satoshis; + else if (typeof object.force_close_avoidance_max_fee_satoshis === "object") + message.force_close_avoidance_max_fee_satoshis = new $util.LongBits(object.force_close_avoidance_max_fee_satoshis.low >>> 0, object.force_close_avoidance_max_fee_satoshis.high >>> 0).toNumber(true); + if (object.accept_underpaying_htlcs != null) + message.accept_underpaying_htlcs = Boolean(object.accept_underpaying_htlcs); + if (object.fixed_limit_msat != null) + if ($util.Long) + (message.fixed_limit_msat = $util.Long.fromValue(object.fixed_limit_msat)).unsigned = true; + else if (typeof object.fixed_limit_msat === "string") + message.fixed_limit_msat = parseInt(object.fixed_limit_msat, 10); + else if (typeof object.fixed_limit_msat === "number") + message.fixed_limit_msat = object.fixed_limit_msat; + else if (typeof object.fixed_limit_msat === "object") + message.fixed_limit_msat = new $util.LongBits(object.fixed_limit_msat.low >>> 0, object.fixed_limit_msat.high >>> 0).toNumber(true); + if (object.fee_rate_multiplier != null) + if ($util.Long) + (message.fee_rate_multiplier = $util.Long.fromValue(object.fee_rate_multiplier)).unsigned = true; + else if (typeof object.fee_rate_multiplier === "string") + message.fee_rate_multiplier = parseInt(object.fee_rate_multiplier, 10); + else if (typeof object.fee_rate_multiplier === "number") + message.fee_rate_multiplier = object.fee_rate_multiplier; + else if (typeof object.fee_rate_multiplier === "object") + message.fee_rate_multiplier = new $util.LongBits(object.fee_rate_multiplier.low >>> 0, object.fee_rate_multiplier.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a ChannelConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof types.ChannelConfig + * @static + * @param {types.ChannelConfig} message ChannelConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChannelConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.forwarding_fee_proportional_millionths != null && message.hasOwnProperty("forwarding_fee_proportional_millionths")) { + object.forwarding_fee_proportional_millionths = message.forwarding_fee_proportional_millionths; + if (options.oneofs) + object._forwarding_fee_proportional_millionths = "forwarding_fee_proportional_millionths"; + } + if (message.forwarding_fee_base_msat != null && message.hasOwnProperty("forwarding_fee_base_msat")) { + object.forwarding_fee_base_msat = message.forwarding_fee_base_msat; + if (options.oneofs) + object._forwarding_fee_base_msat = "forwarding_fee_base_msat"; + } + if (message.cltv_expiry_delta != null && message.hasOwnProperty("cltv_expiry_delta")) { + object.cltv_expiry_delta = message.cltv_expiry_delta; + if (options.oneofs) + object._cltv_expiry_delta = "cltv_expiry_delta"; + } + if (message.force_close_avoidance_max_fee_satoshis != null && message.hasOwnProperty("force_close_avoidance_max_fee_satoshis")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.force_close_avoidance_max_fee_satoshis = typeof message.force_close_avoidance_max_fee_satoshis === "number" ? BigInt(message.force_close_avoidance_max_fee_satoshis) : $util.Long.fromBits(message.force_close_avoidance_max_fee_satoshis.low >>> 0, message.force_close_avoidance_max_fee_satoshis.high >>> 0, true).toBigInt(); + else if (typeof message.force_close_avoidance_max_fee_satoshis === "number") + object.force_close_avoidance_max_fee_satoshis = options.longs === String ? String(message.force_close_avoidance_max_fee_satoshis) : message.force_close_avoidance_max_fee_satoshis; + else + object.force_close_avoidance_max_fee_satoshis = options.longs === String ? $util.Long.prototype.toString.call(message.force_close_avoidance_max_fee_satoshis) : options.longs === Number ? new $util.LongBits(message.force_close_avoidance_max_fee_satoshis.low >>> 0, message.force_close_avoidance_max_fee_satoshis.high >>> 0).toNumber(true) : message.force_close_avoidance_max_fee_satoshis; + if (options.oneofs) + object._force_close_avoidance_max_fee_satoshis = "force_close_avoidance_max_fee_satoshis"; + } + if (message.accept_underpaying_htlcs != null && message.hasOwnProperty("accept_underpaying_htlcs")) { + object.accept_underpaying_htlcs = message.accept_underpaying_htlcs; + if (options.oneofs) + object._accept_underpaying_htlcs = "accept_underpaying_htlcs"; + } + if (message.fixed_limit_msat != null && message.hasOwnProperty("fixed_limit_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.fixed_limit_msat = typeof message.fixed_limit_msat === "number" ? BigInt(message.fixed_limit_msat) : $util.Long.fromBits(message.fixed_limit_msat.low >>> 0, message.fixed_limit_msat.high >>> 0, true).toBigInt(); + else if (typeof message.fixed_limit_msat === "number") + object.fixed_limit_msat = options.longs === String ? String(message.fixed_limit_msat) : message.fixed_limit_msat; + else + object.fixed_limit_msat = options.longs === String ? $util.Long.prototype.toString.call(message.fixed_limit_msat) : options.longs === Number ? new $util.LongBits(message.fixed_limit_msat.low >>> 0, message.fixed_limit_msat.high >>> 0).toNumber(true) : message.fixed_limit_msat; + if (options.oneofs) + object.max_dust_htlc_exposure = "fixed_limit_msat"; + } + if (message.fee_rate_multiplier != null && message.hasOwnProperty("fee_rate_multiplier")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.fee_rate_multiplier = typeof message.fee_rate_multiplier === "number" ? BigInt(message.fee_rate_multiplier) : $util.Long.fromBits(message.fee_rate_multiplier.low >>> 0, message.fee_rate_multiplier.high >>> 0, true).toBigInt(); + else if (typeof message.fee_rate_multiplier === "number") + object.fee_rate_multiplier = options.longs === String ? String(message.fee_rate_multiplier) : message.fee_rate_multiplier; + else + object.fee_rate_multiplier = options.longs === String ? $util.Long.prototype.toString.call(message.fee_rate_multiplier) : options.longs === Number ? new $util.LongBits(message.fee_rate_multiplier.low >>> 0, message.fee_rate_multiplier.high >>> 0).toNumber(true) : message.fee_rate_multiplier; + if (options.oneofs) + object.max_dust_htlc_exposure = "fee_rate_multiplier"; + } + return object; + }; + + /** + * Converts this ChannelConfig to JSON. + * @function toJSON + * @memberof types.ChannelConfig + * @instance + * @returns {Object.} JSON object + */ + ChannelConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChannelConfig + * @function getTypeUrl + * @memberof types.ChannelConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChannelConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.ChannelConfig"; + }; + + return ChannelConfig; + })(); + + types.OutPoint = (function() { + + /** + * Properties of an OutPoint. + * @memberof types + * @interface IOutPoint + * @property {string|null} [txid] OutPoint txid + * @property {number|null} [vout] OutPoint vout + */ + + /** + * Constructs a new OutPoint. + * @memberof types + * @classdesc Represents an OutPoint. + * @implements IOutPoint + * @constructor + * @param {types.IOutPoint=} [properties] Properties to set + */ + function OutPoint(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutPoint txid. + * @member {string} txid + * @memberof types.OutPoint + * @instance + */ + OutPoint.prototype.txid = ""; + + /** + * OutPoint vout. + * @member {number} vout + * @memberof types.OutPoint + * @instance + */ + OutPoint.prototype.vout = 0; + + /** + * Creates a new OutPoint instance using the specified properties. + * @function create + * @memberof types.OutPoint + * @static + * @param {types.IOutPoint=} [properties] Properties to set + * @returns {types.OutPoint} OutPoint instance + */ + OutPoint.create = function create(properties) { + return new OutPoint(properties); + }; + + /** + * Encodes the specified OutPoint message. Does not implicitly {@link types.OutPoint.verify|verify} messages. + * @function encode + * @memberof types.OutPoint + * @static + * @param {types.IOutPoint} message OutPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutPoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.txid != null && Object.hasOwnProperty.call(message, "txid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.txid); + if (message.vout != null && Object.hasOwnProperty.call(message, "vout")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.vout); + return writer; + }; + + /** + * Encodes the specified OutPoint message, length delimited. Does not implicitly {@link types.OutPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof types.OutPoint + * @static + * @param {types.IOutPoint} message OutPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutPoint message from the specified reader or buffer. + * @function decode + * @memberof types.OutPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.OutPoint} OutPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutPoint.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.OutPoint(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.txid = reader.string(); + break; + } + case 2: { + message.vout = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OutPoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.OutPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.OutPoint} OutPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutPoint message. + * @function verify + * @memberof types.OutPoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutPoint.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.txid != null && message.hasOwnProperty("txid")) + if (!$util.isString(message.txid)) + return "txid: string expected"; + if (message.vout != null && message.hasOwnProperty("vout")) + if (!$util.isInteger(message.vout)) + return "vout: integer expected"; + return null; + }; + + /** + * Creates an OutPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.OutPoint + * @static + * @param {Object.} object Plain object + * @returns {types.OutPoint} OutPoint + */ + OutPoint.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.OutPoint) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.OutPoint(); + if (object.txid != null) + message.txid = String(object.txid); + if (object.vout != null) + message.vout = object.vout >>> 0; + return message; + }; + + /** + * Creates a plain object from an OutPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof types.OutPoint + * @static + * @param {types.OutPoint} message OutPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutPoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.txid = ""; + object.vout = 0; + } + if (message.txid != null && message.hasOwnProperty("txid")) + object.txid = message.txid; + if (message.vout != null && message.hasOwnProperty("vout")) + object.vout = message.vout; + return object; + }; + + /** + * Converts this OutPoint to JSON. + * @function toJSON + * @memberof types.OutPoint + * @instance + * @returns {Object.} JSON object + */ + OutPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutPoint + * @function getTypeUrl + * @memberof types.OutPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.OutPoint"; + }; + + return OutPoint; + })(); + + types.BestBlock = (function() { + + /** + * Properties of a BestBlock. + * @memberof types + * @interface IBestBlock + * @property {string|null} [block_hash] BestBlock block_hash + * @property {number|null} [height] BestBlock height + */ + + /** + * Constructs a new BestBlock. + * @memberof types + * @classdesc Represents a BestBlock. + * @implements IBestBlock + * @constructor + * @param {types.IBestBlock=} [properties] Properties to set + */ + function BestBlock(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BestBlock block_hash. + * @member {string} block_hash + * @memberof types.BestBlock + * @instance + */ + BestBlock.prototype.block_hash = ""; + + /** + * BestBlock height. + * @member {number} height + * @memberof types.BestBlock + * @instance + */ + BestBlock.prototype.height = 0; + + /** + * Creates a new BestBlock instance using the specified properties. + * @function create + * @memberof types.BestBlock + * @static + * @param {types.IBestBlock=} [properties] Properties to set + * @returns {types.BestBlock} BestBlock instance + */ + BestBlock.create = function create(properties) { + return new BestBlock(properties); + }; + + /** + * Encodes the specified BestBlock message. Does not implicitly {@link types.BestBlock.verify|verify} messages. + * @function encode + * @memberof types.BestBlock + * @static + * @param {types.IBestBlock} message BestBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BestBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.block_hash != null && Object.hasOwnProperty.call(message, "block_hash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.block_hash); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.height); + return writer; + }; + + /** + * Encodes the specified BestBlock message, length delimited. Does not implicitly {@link types.BestBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof types.BestBlock + * @static + * @param {types.IBestBlock} message BestBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BestBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BestBlock message from the specified reader or buffer. + * @function decode + * @memberof types.BestBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.BestBlock} BestBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BestBlock.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.BestBlock(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.block_hash = reader.string(); + break; + } + case 2: { + message.height = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BestBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.BestBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.BestBlock} BestBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BestBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BestBlock message. + * @function verify + * @memberof types.BestBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BestBlock.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.block_hash != null && message.hasOwnProperty("block_hash")) + if (!$util.isString(message.block_hash)) + return "block_hash: string expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + return null; + }; + + /** + * Creates a BestBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.BestBlock + * @static + * @param {Object.} object Plain object + * @returns {types.BestBlock} BestBlock + */ + BestBlock.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.BestBlock) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.BestBlock(); + if (object.block_hash != null) + message.block_hash = String(object.block_hash); + if (object.height != null) + message.height = object.height >>> 0; + return message; + }; + + /** + * Creates a plain object from a BestBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof types.BestBlock + * @static + * @param {types.BestBlock} message BestBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BestBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.block_hash = ""; + object.height = 0; + } + if (message.block_hash != null && message.hasOwnProperty("block_hash")) + object.block_hash = message.block_hash; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + return object; + }; + + /** + * Converts this BestBlock to JSON. + * @function toJSON + * @memberof types.BestBlock + * @instance + * @returns {Object.} JSON object + */ + BestBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BestBlock + * @function getTypeUrl + * @memberof types.BestBlock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BestBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.BestBlock"; + }; + + return BestBlock; + })(); + + types.LightningBalance = (function() { + + /** + * Properties of a LightningBalance. + * @memberof types + * @interface ILightningBalance + * @property {types.IClaimableOnChannelClose|null} [claimable_on_channel_close] LightningBalance claimable_on_channel_close + * @property {types.IClaimableAwaitingConfirmations|null} [claimable_awaiting_confirmations] LightningBalance claimable_awaiting_confirmations + * @property {types.IContentiousClaimable|null} [contentious_claimable] LightningBalance contentious_claimable + * @property {types.IMaybeTimeoutClaimableHTLC|null} [maybe_timeout_claimable_htlc] LightningBalance maybe_timeout_claimable_htlc + * @property {types.IMaybePreimageClaimableHTLC|null} [maybe_preimage_claimable_htlc] LightningBalance maybe_preimage_claimable_htlc + * @property {types.ICounterpartyRevokedOutputClaimable|null} [counterparty_revoked_output_claimable] LightningBalance counterparty_revoked_output_claimable + */ + + /** + * Constructs a new LightningBalance. + * @memberof types + * @classdesc Represents a LightningBalance. + * @implements ILightningBalance + * @constructor + * @param {types.ILightningBalance=} [properties] Properties to set + */ + function LightningBalance(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * LightningBalance claimable_on_channel_close. + * @member {types.IClaimableOnChannelClose|null|undefined} claimable_on_channel_close + * @memberof types.LightningBalance + * @instance + */ + LightningBalance.prototype.claimable_on_channel_close = null; + + /** + * LightningBalance claimable_awaiting_confirmations. + * @member {types.IClaimableAwaitingConfirmations|null|undefined} claimable_awaiting_confirmations + * @memberof types.LightningBalance + * @instance + */ + LightningBalance.prototype.claimable_awaiting_confirmations = null; + + /** + * LightningBalance contentious_claimable. + * @member {types.IContentiousClaimable|null|undefined} contentious_claimable + * @memberof types.LightningBalance + * @instance + */ + LightningBalance.prototype.contentious_claimable = null; + + /** + * LightningBalance maybe_timeout_claimable_htlc. + * @member {types.IMaybeTimeoutClaimableHTLC|null|undefined} maybe_timeout_claimable_htlc + * @memberof types.LightningBalance + * @instance + */ + LightningBalance.prototype.maybe_timeout_claimable_htlc = null; + + /** + * LightningBalance maybe_preimage_claimable_htlc. + * @member {types.IMaybePreimageClaimableHTLC|null|undefined} maybe_preimage_claimable_htlc + * @memberof types.LightningBalance + * @instance + */ + LightningBalance.prototype.maybe_preimage_claimable_htlc = null; + + /** + * LightningBalance counterparty_revoked_output_claimable. + * @member {types.ICounterpartyRevokedOutputClaimable|null|undefined} counterparty_revoked_output_claimable + * @memberof types.LightningBalance + * @instance + */ + LightningBalance.prototype.counterparty_revoked_output_claimable = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * LightningBalance balance_type. + * @member {"claimable_on_channel_close"|"claimable_awaiting_confirmations"|"contentious_claimable"|"maybe_timeout_claimable_htlc"|"maybe_preimage_claimable_htlc"|"counterparty_revoked_output_claimable"|undefined} balance_type + * @memberof types.LightningBalance + * @instance + */ + Object.defineProperty(LightningBalance.prototype, "balance_type", { + get: $util.oneOfGetter($oneOfFields = ["claimable_on_channel_close", "claimable_awaiting_confirmations", "contentious_claimable", "maybe_timeout_claimable_htlc", "maybe_preimage_claimable_htlc", "counterparty_revoked_output_claimable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LightningBalance instance using the specified properties. + * @function create + * @memberof types.LightningBalance + * @static + * @param {types.ILightningBalance=} [properties] Properties to set + * @returns {types.LightningBalance} LightningBalance instance + */ + LightningBalance.create = function create(properties) { + return new LightningBalance(properties); + }; + + /** + * Encodes the specified LightningBalance message. Does not implicitly {@link types.LightningBalance.verify|verify} messages. + * @function encode + * @memberof types.LightningBalance + * @static + * @param {types.ILightningBalance} message LightningBalance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LightningBalance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.claimable_on_channel_close != null && Object.hasOwnProperty.call(message, "claimable_on_channel_close")) + $root.types.ClaimableOnChannelClose.encode(message.claimable_on_channel_close, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.claimable_awaiting_confirmations != null && Object.hasOwnProperty.call(message, "claimable_awaiting_confirmations")) + $root.types.ClaimableAwaitingConfirmations.encode(message.claimable_awaiting_confirmations, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.contentious_claimable != null && Object.hasOwnProperty.call(message, "contentious_claimable")) + $root.types.ContentiousClaimable.encode(message.contentious_claimable, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.maybe_timeout_claimable_htlc != null && Object.hasOwnProperty.call(message, "maybe_timeout_claimable_htlc")) + $root.types.MaybeTimeoutClaimableHTLC.encode(message.maybe_timeout_claimable_htlc, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.maybe_preimage_claimable_htlc != null && Object.hasOwnProperty.call(message, "maybe_preimage_claimable_htlc")) + $root.types.MaybePreimageClaimableHTLC.encode(message.maybe_preimage_claimable_htlc, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.counterparty_revoked_output_claimable != null && Object.hasOwnProperty.call(message, "counterparty_revoked_output_claimable")) + $root.types.CounterpartyRevokedOutputClaimable.encode(message.counterparty_revoked_output_claimable, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LightningBalance message, length delimited. Does not implicitly {@link types.LightningBalance.verify|verify} messages. + * @function encodeDelimited + * @memberof types.LightningBalance + * @static + * @param {types.ILightningBalance} message LightningBalance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LightningBalance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LightningBalance message from the specified reader or buffer. + * @function decode + * @memberof types.LightningBalance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.LightningBalance} LightningBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LightningBalance.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.LightningBalance(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.claimable_on_channel_close = $root.types.ClaimableOnChannelClose.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.claimable_awaiting_confirmations = $root.types.ClaimableAwaitingConfirmations.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.contentious_claimable = $root.types.ContentiousClaimable.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.maybe_timeout_claimable_htlc = $root.types.MaybeTimeoutClaimableHTLC.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.maybe_preimage_claimable_htlc = $root.types.MaybePreimageClaimableHTLC.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.counterparty_revoked_output_claimable = $root.types.CounterpartyRevokedOutputClaimable.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a LightningBalance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.LightningBalance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.LightningBalance} LightningBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LightningBalance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LightningBalance message. + * @function verify + * @memberof types.LightningBalance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LightningBalance.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.claimable_on_channel_close != null && message.hasOwnProperty("claimable_on_channel_close")) { + properties.balance_type = 1; + { + let error = $root.types.ClaimableOnChannelClose.verify(message.claimable_on_channel_close, long + 1); + if (error) + return "claimable_on_channel_close." + error; + } + } + if (message.claimable_awaiting_confirmations != null && message.hasOwnProperty("claimable_awaiting_confirmations")) { + if (properties.balance_type === 1) + return "balance_type: multiple values"; + properties.balance_type = 1; + { + let error = $root.types.ClaimableAwaitingConfirmations.verify(message.claimable_awaiting_confirmations, long + 1); + if (error) + return "claimable_awaiting_confirmations." + error; + } + } + if (message.contentious_claimable != null && message.hasOwnProperty("contentious_claimable")) { + if (properties.balance_type === 1) + return "balance_type: multiple values"; + properties.balance_type = 1; + { + let error = $root.types.ContentiousClaimable.verify(message.contentious_claimable, long + 1); + if (error) + return "contentious_claimable." + error; + } + } + if (message.maybe_timeout_claimable_htlc != null && message.hasOwnProperty("maybe_timeout_claimable_htlc")) { + if (properties.balance_type === 1) + return "balance_type: multiple values"; + properties.balance_type = 1; + { + let error = $root.types.MaybeTimeoutClaimableHTLC.verify(message.maybe_timeout_claimable_htlc, long + 1); + if (error) + return "maybe_timeout_claimable_htlc." + error; + } + } + if (message.maybe_preimage_claimable_htlc != null && message.hasOwnProperty("maybe_preimage_claimable_htlc")) { + if (properties.balance_type === 1) + return "balance_type: multiple values"; + properties.balance_type = 1; + { + let error = $root.types.MaybePreimageClaimableHTLC.verify(message.maybe_preimage_claimable_htlc, long + 1); + if (error) + return "maybe_preimage_claimable_htlc." + error; + } + } + if (message.counterparty_revoked_output_claimable != null && message.hasOwnProperty("counterparty_revoked_output_claimable")) { + if (properties.balance_type === 1) + return "balance_type: multiple values"; + properties.balance_type = 1; + { + let error = $root.types.CounterpartyRevokedOutputClaimable.verify(message.counterparty_revoked_output_claimable, long + 1); + if (error) + return "counterparty_revoked_output_claimable." + error; + } + } + return null; + }; + + /** + * Creates a LightningBalance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.LightningBalance + * @static + * @param {Object.} object Plain object + * @returns {types.LightningBalance} LightningBalance + */ + LightningBalance.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.LightningBalance) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.LightningBalance(); + if (object.claimable_on_channel_close != null) { + if (typeof object.claimable_on_channel_close !== "object") + throw TypeError(".types.LightningBalance.claimable_on_channel_close: object expected"); + message.claimable_on_channel_close = $root.types.ClaimableOnChannelClose.fromObject(object.claimable_on_channel_close, long + 1); + } + if (object.claimable_awaiting_confirmations != null) { + if (typeof object.claimable_awaiting_confirmations !== "object") + throw TypeError(".types.LightningBalance.claimable_awaiting_confirmations: object expected"); + message.claimable_awaiting_confirmations = $root.types.ClaimableAwaitingConfirmations.fromObject(object.claimable_awaiting_confirmations, long + 1); + } + if (object.contentious_claimable != null) { + if (typeof object.contentious_claimable !== "object") + throw TypeError(".types.LightningBalance.contentious_claimable: object expected"); + message.contentious_claimable = $root.types.ContentiousClaimable.fromObject(object.contentious_claimable, long + 1); + } + if (object.maybe_timeout_claimable_htlc != null) { + if (typeof object.maybe_timeout_claimable_htlc !== "object") + throw TypeError(".types.LightningBalance.maybe_timeout_claimable_htlc: object expected"); + message.maybe_timeout_claimable_htlc = $root.types.MaybeTimeoutClaimableHTLC.fromObject(object.maybe_timeout_claimable_htlc, long + 1); + } + if (object.maybe_preimage_claimable_htlc != null) { + if (typeof object.maybe_preimage_claimable_htlc !== "object") + throw TypeError(".types.LightningBalance.maybe_preimage_claimable_htlc: object expected"); + message.maybe_preimage_claimable_htlc = $root.types.MaybePreimageClaimableHTLC.fromObject(object.maybe_preimage_claimable_htlc, long + 1); + } + if (object.counterparty_revoked_output_claimable != null) { + if (typeof object.counterparty_revoked_output_claimable !== "object") + throw TypeError(".types.LightningBalance.counterparty_revoked_output_claimable: object expected"); + message.counterparty_revoked_output_claimable = $root.types.CounterpartyRevokedOutputClaimable.fromObject(object.counterparty_revoked_output_claimable, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a LightningBalance message. Also converts values to other types if specified. + * @function toObject + * @memberof types.LightningBalance + * @static + * @param {types.LightningBalance} message LightningBalance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LightningBalance.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.claimable_on_channel_close != null && message.hasOwnProperty("claimable_on_channel_close")) { + object.claimable_on_channel_close = $root.types.ClaimableOnChannelClose.toObject(message.claimable_on_channel_close, options); + if (options.oneofs) + object.balance_type = "claimable_on_channel_close"; + } + if (message.claimable_awaiting_confirmations != null && message.hasOwnProperty("claimable_awaiting_confirmations")) { + object.claimable_awaiting_confirmations = $root.types.ClaimableAwaitingConfirmations.toObject(message.claimable_awaiting_confirmations, options); + if (options.oneofs) + object.balance_type = "claimable_awaiting_confirmations"; + } + if (message.contentious_claimable != null && message.hasOwnProperty("contentious_claimable")) { + object.contentious_claimable = $root.types.ContentiousClaimable.toObject(message.contentious_claimable, options); + if (options.oneofs) + object.balance_type = "contentious_claimable"; + } + if (message.maybe_timeout_claimable_htlc != null && message.hasOwnProperty("maybe_timeout_claimable_htlc")) { + object.maybe_timeout_claimable_htlc = $root.types.MaybeTimeoutClaimableHTLC.toObject(message.maybe_timeout_claimable_htlc, options); + if (options.oneofs) + object.balance_type = "maybe_timeout_claimable_htlc"; + } + if (message.maybe_preimage_claimable_htlc != null && message.hasOwnProperty("maybe_preimage_claimable_htlc")) { + object.maybe_preimage_claimable_htlc = $root.types.MaybePreimageClaimableHTLC.toObject(message.maybe_preimage_claimable_htlc, options); + if (options.oneofs) + object.balance_type = "maybe_preimage_claimable_htlc"; + } + if (message.counterparty_revoked_output_claimable != null && message.hasOwnProperty("counterparty_revoked_output_claimable")) { + object.counterparty_revoked_output_claimable = $root.types.CounterpartyRevokedOutputClaimable.toObject(message.counterparty_revoked_output_claimable, options); + if (options.oneofs) + object.balance_type = "counterparty_revoked_output_claimable"; + } + return object; + }; + + /** + * Converts this LightningBalance to JSON. + * @function toJSON + * @memberof types.LightningBalance + * @instance + * @returns {Object.} JSON object + */ + LightningBalance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LightningBalance + * @function getTypeUrl + * @memberof types.LightningBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LightningBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.LightningBalance"; + }; + + return LightningBalance; + })(); + + types.ClaimableOnChannelClose = (function() { + + /** + * Properties of a ClaimableOnChannelClose. + * @memberof types + * @interface IClaimableOnChannelClose + * @property {string|null} [channel_id] ClaimableOnChannelClose channel_id + * @property {string|null} [counterparty_node_id] ClaimableOnChannelClose counterparty_node_id + * @property {Long|null} [amount_satoshis] ClaimableOnChannelClose amount_satoshis + * @property {Long|null} [transaction_fee_satoshis] ClaimableOnChannelClose transaction_fee_satoshis + * @property {Long|null} [outbound_payment_htlc_rounded_msat] ClaimableOnChannelClose outbound_payment_htlc_rounded_msat + * @property {Long|null} [outbound_forwarded_htlc_rounded_msat] ClaimableOnChannelClose outbound_forwarded_htlc_rounded_msat + * @property {Long|null} [inbound_claiming_htlc_rounded_msat] ClaimableOnChannelClose inbound_claiming_htlc_rounded_msat + * @property {Long|null} [inbound_htlc_rounded_msat] ClaimableOnChannelClose inbound_htlc_rounded_msat + */ + + /** + * Constructs a new ClaimableOnChannelClose. + * @memberof types + * @classdesc Represents a ClaimableOnChannelClose. + * @implements IClaimableOnChannelClose + * @constructor + * @param {types.IClaimableOnChannelClose=} [properties] Properties to set + */ + function ClaimableOnChannelClose(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClaimableOnChannelClose channel_id. + * @member {string} channel_id + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.channel_id = ""; + + /** + * ClaimableOnChannelClose counterparty_node_id. + * @member {string} counterparty_node_id + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.counterparty_node_id = ""; + + /** + * ClaimableOnChannelClose amount_satoshis. + * @member {Long} amount_satoshis + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.amount_satoshis = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ClaimableOnChannelClose transaction_fee_satoshis. + * @member {Long} transaction_fee_satoshis + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.transaction_fee_satoshis = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ClaimableOnChannelClose outbound_payment_htlc_rounded_msat. + * @member {Long} outbound_payment_htlc_rounded_msat + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.outbound_payment_htlc_rounded_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ClaimableOnChannelClose outbound_forwarded_htlc_rounded_msat. + * @member {Long} outbound_forwarded_htlc_rounded_msat + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.outbound_forwarded_htlc_rounded_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ClaimableOnChannelClose inbound_claiming_htlc_rounded_msat. + * @member {Long} inbound_claiming_htlc_rounded_msat + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.inbound_claiming_htlc_rounded_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ClaimableOnChannelClose inbound_htlc_rounded_msat. + * @member {Long} inbound_htlc_rounded_msat + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.inbound_htlc_rounded_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new ClaimableOnChannelClose instance using the specified properties. + * @function create + * @memberof types.ClaimableOnChannelClose + * @static + * @param {types.IClaimableOnChannelClose=} [properties] Properties to set + * @returns {types.ClaimableOnChannelClose} ClaimableOnChannelClose instance + */ + ClaimableOnChannelClose.create = function create(properties) { + return new ClaimableOnChannelClose(properties); + }; + + /** + * Encodes the specified ClaimableOnChannelClose message. Does not implicitly {@link types.ClaimableOnChannelClose.verify|verify} messages. + * @function encode + * @memberof types.ClaimableOnChannelClose + * @static + * @param {types.IClaimableOnChannelClose} message ClaimableOnChannelClose message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClaimableOnChannelClose.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); + if (message.counterparty_node_id != null && Object.hasOwnProperty.call(message, "counterparty_node_id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterparty_node_id); + if (message.amount_satoshis != null && Object.hasOwnProperty.call(message, "amount_satoshis")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.amount_satoshis); + if (message.transaction_fee_satoshis != null && Object.hasOwnProperty.call(message, "transaction_fee_satoshis")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.transaction_fee_satoshis); + if (message.outbound_payment_htlc_rounded_msat != null && Object.hasOwnProperty.call(message, "outbound_payment_htlc_rounded_msat")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.outbound_payment_htlc_rounded_msat); + if (message.outbound_forwarded_htlc_rounded_msat != null && Object.hasOwnProperty.call(message, "outbound_forwarded_htlc_rounded_msat")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.outbound_forwarded_htlc_rounded_msat); + if (message.inbound_claiming_htlc_rounded_msat != null && Object.hasOwnProperty.call(message, "inbound_claiming_htlc_rounded_msat")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.inbound_claiming_htlc_rounded_msat); + if (message.inbound_htlc_rounded_msat != null && Object.hasOwnProperty.call(message, "inbound_htlc_rounded_msat")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.inbound_htlc_rounded_msat); + return writer; + }; + + /** + * Encodes the specified ClaimableOnChannelClose message, length delimited. Does not implicitly {@link types.ClaimableOnChannelClose.verify|verify} messages. + * @function encodeDelimited + * @memberof types.ClaimableOnChannelClose + * @static + * @param {types.IClaimableOnChannelClose} message ClaimableOnChannelClose message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClaimableOnChannelClose.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClaimableOnChannelClose message from the specified reader or buffer. + * @function decode + * @memberof types.ClaimableOnChannelClose + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.ClaimableOnChannelClose} ClaimableOnChannelClose + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClaimableOnChannelClose.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.ClaimableOnChannelClose(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.channel_id = reader.string(); + break; + } + case 2: { + message.counterparty_node_id = reader.string(); + break; + } + case 3: { + message.amount_satoshis = reader.uint64(); + break; + } + case 4: { + message.transaction_fee_satoshis = reader.uint64(); + break; + } + case 5: { + message.outbound_payment_htlc_rounded_msat = reader.uint64(); + break; + } + case 6: { + message.outbound_forwarded_htlc_rounded_msat = reader.uint64(); + break; + } + case 7: { + message.inbound_claiming_htlc_rounded_msat = reader.uint64(); + break; + } + case 8: { + message.inbound_htlc_rounded_msat = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ClaimableOnChannelClose message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.ClaimableOnChannelClose + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.ClaimableOnChannelClose} ClaimableOnChannelClose + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClaimableOnChannelClose.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClaimableOnChannelClose message. + * @function verify + * @memberof types.ClaimableOnChannelClose + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClaimableOnChannelClose.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.channel_id != null && message.hasOwnProperty("channel_id")) + if (!$util.isString(message.channel_id)) + return "channel_id: string expected"; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + if (!$util.isString(message.counterparty_node_id)) + return "counterparty_node_id: string expected"; + if (message.amount_satoshis != null && message.hasOwnProperty("amount_satoshis")) + if (!$util.isInteger(message.amount_satoshis) && !(message.amount_satoshis && $util.isInteger(message.amount_satoshis.low) && $util.isInteger(message.amount_satoshis.high))) + return "amount_satoshis: integer|Long expected"; + if (message.transaction_fee_satoshis != null && message.hasOwnProperty("transaction_fee_satoshis")) + if (!$util.isInteger(message.transaction_fee_satoshis) && !(message.transaction_fee_satoshis && $util.isInteger(message.transaction_fee_satoshis.low) && $util.isInteger(message.transaction_fee_satoshis.high))) + return "transaction_fee_satoshis: integer|Long expected"; + if (message.outbound_payment_htlc_rounded_msat != null && message.hasOwnProperty("outbound_payment_htlc_rounded_msat")) + if (!$util.isInteger(message.outbound_payment_htlc_rounded_msat) && !(message.outbound_payment_htlc_rounded_msat && $util.isInteger(message.outbound_payment_htlc_rounded_msat.low) && $util.isInteger(message.outbound_payment_htlc_rounded_msat.high))) + return "outbound_payment_htlc_rounded_msat: integer|Long expected"; + if (message.outbound_forwarded_htlc_rounded_msat != null && message.hasOwnProperty("outbound_forwarded_htlc_rounded_msat")) + if (!$util.isInteger(message.outbound_forwarded_htlc_rounded_msat) && !(message.outbound_forwarded_htlc_rounded_msat && $util.isInteger(message.outbound_forwarded_htlc_rounded_msat.low) && $util.isInteger(message.outbound_forwarded_htlc_rounded_msat.high))) + return "outbound_forwarded_htlc_rounded_msat: integer|Long expected"; + if (message.inbound_claiming_htlc_rounded_msat != null && message.hasOwnProperty("inbound_claiming_htlc_rounded_msat")) + if (!$util.isInteger(message.inbound_claiming_htlc_rounded_msat) && !(message.inbound_claiming_htlc_rounded_msat && $util.isInteger(message.inbound_claiming_htlc_rounded_msat.low) && $util.isInteger(message.inbound_claiming_htlc_rounded_msat.high))) + return "inbound_claiming_htlc_rounded_msat: integer|Long expected"; + if (message.inbound_htlc_rounded_msat != null && message.hasOwnProperty("inbound_htlc_rounded_msat")) + if (!$util.isInteger(message.inbound_htlc_rounded_msat) && !(message.inbound_htlc_rounded_msat && $util.isInteger(message.inbound_htlc_rounded_msat.low) && $util.isInteger(message.inbound_htlc_rounded_msat.high))) + return "inbound_htlc_rounded_msat: integer|Long expected"; + return null; + }; + + /** + * Creates a ClaimableOnChannelClose message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.ClaimableOnChannelClose + * @static + * @param {Object.} object Plain object + * @returns {types.ClaimableOnChannelClose} ClaimableOnChannelClose + */ + ClaimableOnChannelClose.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.ClaimableOnChannelClose) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.ClaimableOnChannelClose(); + if (object.channel_id != null) + message.channel_id = String(object.channel_id); + if (object.counterparty_node_id != null) + message.counterparty_node_id = String(object.counterparty_node_id); + if (object.amount_satoshis != null) + if ($util.Long) + (message.amount_satoshis = $util.Long.fromValue(object.amount_satoshis)).unsigned = true; + else if (typeof object.amount_satoshis === "string") + message.amount_satoshis = parseInt(object.amount_satoshis, 10); + else if (typeof object.amount_satoshis === "number") + message.amount_satoshis = object.amount_satoshis; + else if (typeof object.amount_satoshis === "object") + message.amount_satoshis = new $util.LongBits(object.amount_satoshis.low >>> 0, object.amount_satoshis.high >>> 0).toNumber(true); + if (object.transaction_fee_satoshis != null) + if ($util.Long) + (message.transaction_fee_satoshis = $util.Long.fromValue(object.transaction_fee_satoshis)).unsigned = true; + else if (typeof object.transaction_fee_satoshis === "string") + message.transaction_fee_satoshis = parseInt(object.transaction_fee_satoshis, 10); + else if (typeof object.transaction_fee_satoshis === "number") + message.transaction_fee_satoshis = object.transaction_fee_satoshis; + else if (typeof object.transaction_fee_satoshis === "object") + message.transaction_fee_satoshis = new $util.LongBits(object.transaction_fee_satoshis.low >>> 0, object.transaction_fee_satoshis.high >>> 0).toNumber(true); + if (object.outbound_payment_htlc_rounded_msat != null) + if ($util.Long) + (message.outbound_payment_htlc_rounded_msat = $util.Long.fromValue(object.outbound_payment_htlc_rounded_msat)).unsigned = true; + else if (typeof object.outbound_payment_htlc_rounded_msat === "string") + message.outbound_payment_htlc_rounded_msat = parseInt(object.outbound_payment_htlc_rounded_msat, 10); + else if (typeof object.outbound_payment_htlc_rounded_msat === "number") + message.outbound_payment_htlc_rounded_msat = object.outbound_payment_htlc_rounded_msat; + else if (typeof object.outbound_payment_htlc_rounded_msat === "object") + message.outbound_payment_htlc_rounded_msat = new $util.LongBits(object.outbound_payment_htlc_rounded_msat.low >>> 0, object.outbound_payment_htlc_rounded_msat.high >>> 0).toNumber(true); + if (object.outbound_forwarded_htlc_rounded_msat != null) + if ($util.Long) + (message.outbound_forwarded_htlc_rounded_msat = $util.Long.fromValue(object.outbound_forwarded_htlc_rounded_msat)).unsigned = true; + else if (typeof object.outbound_forwarded_htlc_rounded_msat === "string") + message.outbound_forwarded_htlc_rounded_msat = parseInt(object.outbound_forwarded_htlc_rounded_msat, 10); + else if (typeof object.outbound_forwarded_htlc_rounded_msat === "number") + message.outbound_forwarded_htlc_rounded_msat = object.outbound_forwarded_htlc_rounded_msat; + else if (typeof object.outbound_forwarded_htlc_rounded_msat === "object") + message.outbound_forwarded_htlc_rounded_msat = new $util.LongBits(object.outbound_forwarded_htlc_rounded_msat.low >>> 0, object.outbound_forwarded_htlc_rounded_msat.high >>> 0).toNumber(true); + if (object.inbound_claiming_htlc_rounded_msat != null) + if ($util.Long) + (message.inbound_claiming_htlc_rounded_msat = $util.Long.fromValue(object.inbound_claiming_htlc_rounded_msat)).unsigned = true; + else if (typeof object.inbound_claiming_htlc_rounded_msat === "string") + message.inbound_claiming_htlc_rounded_msat = parseInt(object.inbound_claiming_htlc_rounded_msat, 10); + else if (typeof object.inbound_claiming_htlc_rounded_msat === "number") + message.inbound_claiming_htlc_rounded_msat = object.inbound_claiming_htlc_rounded_msat; + else if (typeof object.inbound_claiming_htlc_rounded_msat === "object") + message.inbound_claiming_htlc_rounded_msat = new $util.LongBits(object.inbound_claiming_htlc_rounded_msat.low >>> 0, object.inbound_claiming_htlc_rounded_msat.high >>> 0).toNumber(true); + if (object.inbound_htlc_rounded_msat != null) + if ($util.Long) + (message.inbound_htlc_rounded_msat = $util.Long.fromValue(object.inbound_htlc_rounded_msat)).unsigned = true; + else if (typeof object.inbound_htlc_rounded_msat === "string") + message.inbound_htlc_rounded_msat = parseInt(object.inbound_htlc_rounded_msat, 10); + else if (typeof object.inbound_htlc_rounded_msat === "number") + message.inbound_htlc_rounded_msat = object.inbound_htlc_rounded_msat; + else if (typeof object.inbound_htlc_rounded_msat === "object") + message.inbound_htlc_rounded_msat = new $util.LongBits(object.inbound_htlc_rounded_msat.low >>> 0, object.inbound_htlc_rounded_msat.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a ClaimableOnChannelClose message. Also converts values to other types if specified. + * @function toObject + * @memberof types.ClaimableOnChannelClose + * @static + * @param {types.ClaimableOnChannelClose} message ClaimableOnChannelClose + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClaimableOnChannelClose.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.channel_id = ""; + object.counterparty_node_id = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.amount_satoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.amount_satoshis = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.transaction_fee_satoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.transaction_fee_satoshis = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.outbound_payment_htlc_rounded_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.outbound_payment_htlc_rounded_msat = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.outbound_forwarded_htlc_rounded_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.outbound_forwarded_htlc_rounded_msat = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.inbound_claiming_htlc_rounded_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.inbound_claiming_htlc_rounded_msat = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.inbound_htlc_rounded_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.inbound_htlc_rounded_msat = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + } + if (message.channel_id != null && message.hasOwnProperty("channel_id")) + object.channel_id = message.channel_id; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + object.counterparty_node_id = message.counterparty_node_id; + if (message.amount_satoshis != null && message.hasOwnProperty("amount_satoshis")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_satoshis = typeof message.amount_satoshis === "number" ? BigInt(message.amount_satoshis) : $util.Long.fromBits(message.amount_satoshis.low >>> 0, message.amount_satoshis.high >>> 0, true).toBigInt(); + else if (typeof message.amount_satoshis === "number") + object.amount_satoshis = options.longs === String ? String(message.amount_satoshis) : message.amount_satoshis; + else + object.amount_satoshis = options.longs === String ? $util.Long.prototype.toString.call(message.amount_satoshis) : options.longs === Number ? new $util.LongBits(message.amount_satoshis.low >>> 0, message.amount_satoshis.high >>> 0).toNumber(true) : message.amount_satoshis; + if (message.transaction_fee_satoshis != null && message.hasOwnProperty("transaction_fee_satoshis")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.transaction_fee_satoshis = typeof message.transaction_fee_satoshis === "number" ? BigInt(message.transaction_fee_satoshis) : $util.Long.fromBits(message.transaction_fee_satoshis.low >>> 0, message.transaction_fee_satoshis.high >>> 0, true).toBigInt(); + else if (typeof message.transaction_fee_satoshis === "number") + object.transaction_fee_satoshis = options.longs === String ? String(message.transaction_fee_satoshis) : message.transaction_fee_satoshis; + else + object.transaction_fee_satoshis = options.longs === String ? $util.Long.prototype.toString.call(message.transaction_fee_satoshis) : options.longs === Number ? new $util.LongBits(message.transaction_fee_satoshis.low >>> 0, message.transaction_fee_satoshis.high >>> 0).toNumber(true) : message.transaction_fee_satoshis; + if (message.outbound_payment_htlc_rounded_msat != null && message.hasOwnProperty("outbound_payment_htlc_rounded_msat")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.outbound_payment_htlc_rounded_msat = typeof message.outbound_payment_htlc_rounded_msat === "number" ? BigInt(message.outbound_payment_htlc_rounded_msat) : $util.Long.fromBits(message.outbound_payment_htlc_rounded_msat.low >>> 0, message.outbound_payment_htlc_rounded_msat.high >>> 0, true).toBigInt(); + else if (typeof message.outbound_payment_htlc_rounded_msat === "number") + object.outbound_payment_htlc_rounded_msat = options.longs === String ? String(message.outbound_payment_htlc_rounded_msat) : message.outbound_payment_htlc_rounded_msat; + else + object.outbound_payment_htlc_rounded_msat = options.longs === String ? $util.Long.prototype.toString.call(message.outbound_payment_htlc_rounded_msat) : options.longs === Number ? new $util.LongBits(message.outbound_payment_htlc_rounded_msat.low >>> 0, message.outbound_payment_htlc_rounded_msat.high >>> 0).toNumber(true) : message.outbound_payment_htlc_rounded_msat; + if (message.outbound_forwarded_htlc_rounded_msat != null && message.hasOwnProperty("outbound_forwarded_htlc_rounded_msat")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.outbound_forwarded_htlc_rounded_msat = typeof message.outbound_forwarded_htlc_rounded_msat === "number" ? BigInt(message.outbound_forwarded_htlc_rounded_msat) : $util.Long.fromBits(message.outbound_forwarded_htlc_rounded_msat.low >>> 0, message.outbound_forwarded_htlc_rounded_msat.high >>> 0, true).toBigInt(); + else if (typeof message.outbound_forwarded_htlc_rounded_msat === "number") + object.outbound_forwarded_htlc_rounded_msat = options.longs === String ? String(message.outbound_forwarded_htlc_rounded_msat) : message.outbound_forwarded_htlc_rounded_msat; + else + object.outbound_forwarded_htlc_rounded_msat = options.longs === String ? $util.Long.prototype.toString.call(message.outbound_forwarded_htlc_rounded_msat) : options.longs === Number ? new $util.LongBits(message.outbound_forwarded_htlc_rounded_msat.low >>> 0, message.outbound_forwarded_htlc_rounded_msat.high >>> 0).toNumber(true) : message.outbound_forwarded_htlc_rounded_msat; + if (message.inbound_claiming_htlc_rounded_msat != null && message.hasOwnProperty("inbound_claiming_htlc_rounded_msat")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.inbound_claiming_htlc_rounded_msat = typeof message.inbound_claiming_htlc_rounded_msat === "number" ? BigInt(message.inbound_claiming_htlc_rounded_msat) : $util.Long.fromBits(message.inbound_claiming_htlc_rounded_msat.low >>> 0, message.inbound_claiming_htlc_rounded_msat.high >>> 0, true).toBigInt(); + else if (typeof message.inbound_claiming_htlc_rounded_msat === "number") + object.inbound_claiming_htlc_rounded_msat = options.longs === String ? String(message.inbound_claiming_htlc_rounded_msat) : message.inbound_claiming_htlc_rounded_msat; + else + object.inbound_claiming_htlc_rounded_msat = options.longs === String ? $util.Long.prototype.toString.call(message.inbound_claiming_htlc_rounded_msat) : options.longs === Number ? new $util.LongBits(message.inbound_claiming_htlc_rounded_msat.low >>> 0, message.inbound_claiming_htlc_rounded_msat.high >>> 0).toNumber(true) : message.inbound_claiming_htlc_rounded_msat; + if (message.inbound_htlc_rounded_msat != null && message.hasOwnProperty("inbound_htlc_rounded_msat")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.inbound_htlc_rounded_msat = typeof message.inbound_htlc_rounded_msat === "number" ? BigInt(message.inbound_htlc_rounded_msat) : $util.Long.fromBits(message.inbound_htlc_rounded_msat.low >>> 0, message.inbound_htlc_rounded_msat.high >>> 0, true).toBigInt(); + else if (typeof message.inbound_htlc_rounded_msat === "number") + object.inbound_htlc_rounded_msat = options.longs === String ? String(message.inbound_htlc_rounded_msat) : message.inbound_htlc_rounded_msat; + else + object.inbound_htlc_rounded_msat = options.longs === String ? $util.Long.prototype.toString.call(message.inbound_htlc_rounded_msat) : options.longs === Number ? new $util.LongBits(message.inbound_htlc_rounded_msat.low >>> 0, message.inbound_htlc_rounded_msat.high >>> 0).toNumber(true) : message.inbound_htlc_rounded_msat; + return object; + }; + + /** + * Converts this ClaimableOnChannelClose to JSON. + * @function toJSON + * @memberof types.ClaimableOnChannelClose + * @instance + * @returns {Object.} JSON object + */ + ClaimableOnChannelClose.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClaimableOnChannelClose + * @function getTypeUrl + * @memberof types.ClaimableOnChannelClose + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClaimableOnChannelClose.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.ClaimableOnChannelClose"; + }; + + return ClaimableOnChannelClose; + })(); + + types.ClaimableAwaitingConfirmations = (function() { + + /** + * Properties of a ClaimableAwaitingConfirmations. + * @memberof types + * @interface IClaimableAwaitingConfirmations + * @property {string|null} [channel_id] ClaimableAwaitingConfirmations channel_id + * @property {string|null} [counterparty_node_id] ClaimableAwaitingConfirmations counterparty_node_id + * @property {Long|null} [amount_satoshis] ClaimableAwaitingConfirmations amount_satoshis + * @property {number|null} [confirmation_height] ClaimableAwaitingConfirmations confirmation_height + * @property {types.BalanceSource|null} [source] ClaimableAwaitingConfirmations source + */ + + /** + * Constructs a new ClaimableAwaitingConfirmations. + * @memberof types + * @classdesc Represents a ClaimableAwaitingConfirmations. + * @implements IClaimableAwaitingConfirmations + * @constructor + * @param {types.IClaimableAwaitingConfirmations=} [properties] Properties to set + */ + function ClaimableAwaitingConfirmations(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClaimableAwaitingConfirmations channel_id. + * @member {string} channel_id + * @memberof types.ClaimableAwaitingConfirmations + * @instance + */ + ClaimableAwaitingConfirmations.prototype.channel_id = ""; + + /** + * ClaimableAwaitingConfirmations counterparty_node_id. + * @member {string} counterparty_node_id + * @memberof types.ClaimableAwaitingConfirmations + * @instance + */ + ClaimableAwaitingConfirmations.prototype.counterparty_node_id = ""; + + /** + * ClaimableAwaitingConfirmations amount_satoshis. + * @member {Long} amount_satoshis + * @memberof types.ClaimableAwaitingConfirmations + * @instance + */ + ClaimableAwaitingConfirmations.prototype.amount_satoshis = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ClaimableAwaitingConfirmations confirmation_height. + * @member {number} confirmation_height + * @memberof types.ClaimableAwaitingConfirmations + * @instance + */ + ClaimableAwaitingConfirmations.prototype.confirmation_height = 0; + + /** + * ClaimableAwaitingConfirmations source. + * @member {types.BalanceSource} source + * @memberof types.ClaimableAwaitingConfirmations + * @instance + */ + ClaimableAwaitingConfirmations.prototype.source = 0; + + /** + * Creates a new ClaimableAwaitingConfirmations instance using the specified properties. + * @function create + * @memberof types.ClaimableAwaitingConfirmations + * @static + * @param {types.IClaimableAwaitingConfirmations=} [properties] Properties to set + * @returns {types.ClaimableAwaitingConfirmations} ClaimableAwaitingConfirmations instance + */ + ClaimableAwaitingConfirmations.create = function create(properties) { + return new ClaimableAwaitingConfirmations(properties); + }; + + /** + * Encodes the specified ClaimableAwaitingConfirmations message. Does not implicitly {@link types.ClaimableAwaitingConfirmations.verify|verify} messages. + * @function encode + * @memberof types.ClaimableAwaitingConfirmations + * @static + * @param {types.IClaimableAwaitingConfirmations} message ClaimableAwaitingConfirmations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClaimableAwaitingConfirmations.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); + if (message.counterparty_node_id != null && Object.hasOwnProperty.call(message, "counterparty_node_id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterparty_node_id); + if (message.amount_satoshis != null && Object.hasOwnProperty.call(message, "amount_satoshis")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.amount_satoshis); + if (message.confirmation_height != null && Object.hasOwnProperty.call(message, "confirmation_height")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.confirmation_height); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.source); + return writer; + }; + + /** + * Encodes the specified ClaimableAwaitingConfirmations message, length delimited. Does not implicitly {@link types.ClaimableAwaitingConfirmations.verify|verify} messages. + * @function encodeDelimited + * @memberof types.ClaimableAwaitingConfirmations + * @static + * @param {types.IClaimableAwaitingConfirmations} message ClaimableAwaitingConfirmations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClaimableAwaitingConfirmations.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClaimableAwaitingConfirmations message from the specified reader or buffer. + * @function decode + * @memberof types.ClaimableAwaitingConfirmations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.ClaimableAwaitingConfirmations} ClaimableAwaitingConfirmations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClaimableAwaitingConfirmations.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.ClaimableAwaitingConfirmations(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.channel_id = reader.string(); + break; + } + case 2: { + message.counterparty_node_id = reader.string(); + break; + } + case 3: { + message.amount_satoshis = reader.uint64(); + break; + } + case 4: { + message.confirmation_height = reader.uint32(); + break; + } + case 5: { + message.source = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ClaimableAwaitingConfirmations message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.ClaimableAwaitingConfirmations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.ClaimableAwaitingConfirmations} ClaimableAwaitingConfirmations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClaimableAwaitingConfirmations.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClaimableAwaitingConfirmations message. + * @function verify + * @memberof types.ClaimableAwaitingConfirmations + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClaimableAwaitingConfirmations.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.channel_id != null && message.hasOwnProperty("channel_id")) + if (!$util.isString(message.channel_id)) + return "channel_id: string expected"; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + if (!$util.isString(message.counterparty_node_id)) + return "counterparty_node_id: string expected"; + if (message.amount_satoshis != null && message.hasOwnProperty("amount_satoshis")) + if (!$util.isInteger(message.amount_satoshis) && !(message.amount_satoshis && $util.isInteger(message.amount_satoshis.low) && $util.isInteger(message.amount_satoshis.high))) + return "amount_satoshis: integer|Long expected"; + if (message.confirmation_height != null && message.hasOwnProperty("confirmation_height")) + if (!$util.isInteger(message.confirmation_height)) + return "confirmation_height: integer expected"; + if (message.source != null && message.hasOwnProperty("source")) + switch (message.source) { + default: + return "source: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ClaimableAwaitingConfirmations message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.ClaimableAwaitingConfirmations + * @static + * @param {Object.} object Plain object + * @returns {types.ClaimableAwaitingConfirmations} ClaimableAwaitingConfirmations + */ + ClaimableAwaitingConfirmations.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.ClaimableAwaitingConfirmations) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.ClaimableAwaitingConfirmations(); + if (object.channel_id != null) + message.channel_id = String(object.channel_id); + if (object.counterparty_node_id != null) + message.counterparty_node_id = String(object.counterparty_node_id); + if (object.amount_satoshis != null) + if ($util.Long) + (message.amount_satoshis = $util.Long.fromValue(object.amount_satoshis)).unsigned = true; + else if (typeof object.amount_satoshis === "string") + message.amount_satoshis = parseInt(object.amount_satoshis, 10); + else if (typeof object.amount_satoshis === "number") + message.amount_satoshis = object.amount_satoshis; + else if (typeof object.amount_satoshis === "object") + message.amount_satoshis = new $util.LongBits(object.amount_satoshis.low >>> 0, object.amount_satoshis.high >>> 0).toNumber(true); + if (object.confirmation_height != null) + message.confirmation_height = object.confirmation_height >>> 0; + switch (object.source) { + default: + if (typeof object.source === "number") { + message.source = object.source; + break; + } + break; + case "HOLDER_FORCE_CLOSED": + case 0: + message.source = 0; + break; + case "COUNTERPARTY_FORCE_CLOSED": + case 1: + message.source = 1; + break; + case "COOP_CLOSE": + case 2: + message.source = 2; + break; + case "HTLC": + case 3: + message.source = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ClaimableAwaitingConfirmations message. Also converts values to other types if specified. + * @function toObject + * @memberof types.ClaimableAwaitingConfirmations + * @static + * @param {types.ClaimableAwaitingConfirmations} message ClaimableAwaitingConfirmations + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClaimableAwaitingConfirmations.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.channel_id = ""; + object.counterparty_node_id = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.amount_satoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.amount_satoshis = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.confirmation_height = 0; + object.source = options.enums === String ? "HOLDER_FORCE_CLOSED" : 0; + } + if (message.channel_id != null && message.hasOwnProperty("channel_id")) + object.channel_id = message.channel_id; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + object.counterparty_node_id = message.counterparty_node_id; + if (message.amount_satoshis != null && message.hasOwnProperty("amount_satoshis")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_satoshis = typeof message.amount_satoshis === "number" ? BigInt(message.amount_satoshis) : $util.Long.fromBits(message.amount_satoshis.low >>> 0, message.amount_satoshis.high >>> 0, true).toBigInt(); + else if (typeof message.amount_satoshis === "number") + object.amount_satoshis = options.longs === String ? String(message.amount_satoshis) : message.amount_satoshis; + else + object.amount_satoshis = options.longs === String ? $util.Long.prototype.toString.call(message.amount_satoshis) : options.longs === Number ? new $util.LongBits(message.amount_satoshis.low >>> 0, message.amount_satoshis.high >>> 0).toNumber(true) : message.amount_satoshis; + if (message.confirmation_height != null && message.hasOwnProperty("confirmation_height")) + object.confirmation_height = message.confirmation_height; + if (message.source != null && message.hasOwnProperty("source")) + object.source = options.enums === String ? $root.types.BalanceSource[message.source] === undefined ? message.source : $root.types.BalanceSource[message.source] : message.source; + return object; + }; + + /** + * Converts this ClaimableAwaitingConfirmations to JSON. + * @function toJSON + * @memberof types.ClaimableAwaitingConfirmations + * @instance + * @returns {Object.} JSON object + */ + ClaimableAwaitingConfirmations.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClaimableAwaitingConfirmations + * @function getTypeUrl + * @memberof types.ClaimableAwaitingConfirmations + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClaimableAwaitingConfirmations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.ClaimableAwaitingConfirmations"; + }; + + return ClaimableAwaitingConfirmations; + })(); + + /** + * BalanceSource enum. + * @name types.BalanceSource + * @enum {number} + * @property {number} HOLDER_FORCE_CLOSED=0 HOLDER_FORCE_CLOSED value + * @property {number} COUNTERPARTY_FORCE_CLOSED=1 COUNTERPARTY_FORCE_CLOSED value + * @property {number} COOP_CLOSE=2 COOP_CLOSE value + * @property {number} HTLC=3 HTLC value + */ + types.BalanceSource = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HOLDER_FORCE_CLOSED"] = 0; + values[valuesById[1] = "COUNTERPARTY_FORCE_CLOSED"] = 1; + values[valuesById[2] = "COOP_CLOSE"] = 2; + values[valuesById[3] = "HTLC"] = 3; + return values; + })(); + + types.ContentiousClaimable = (function() { + + /** + * Properties of a ContentiousClaimable. + * @memberof types + * @interface IContentiousClaimable + * @property {string|null} [channel_id] ContentiousClaimable channel_id + * @property {string|null} [counterparty_node_id] ContentiousClaimable counterparty_node_id + * @property {Long|null} [amount_satoshis] ContentiousClaimable amount_satoshis + * @property {number|null} [timeout_height] ContentiousClaimable timeout_height + * @property {string|null} [payment_hash] ContentiousClaimable payment_hash + * @property {string|null} [payment_preimage] ContentiousClaimable payment_preimage + */ + + /** + * Constructs a new ContentiousClaimable. + * @memberof types + * @classdesc Represents a ContentiousClaimable. + * @implements IContentiousClaimable + * @constructor + * @param {types.IContentiousClaimable=} [properties] Properties to set + */ + function ContentiousClaimable(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContentiousClaimable channel_id. + * @member {string} channel_id + * @memberof types.ContentiousClaimable + * @instance + */ + ContentiousClaimable.prototype.channel_id = ""; + + /** + * ContentiousClaimable counterparty_node_id. + * @member {string} counterparty_node_id + * @memberof types.ContentiousClaimable + * @instance + */ + ContentiousClaimable.prototype.counterparty_node_id = ""; + + /** + * ContentiousClaimable amount_satoshis. + * @member {Long} amount_satoshis + * @memberof types.ContentiousClaimable + * @instance + */ + ContentiousClaimable.prototype.amount_satoshis = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ContentiousClaimable timeout_height. + * @member {number} timeout_height + * @memberof types.ContentiousClaimable + * @instance + */ + ContentiousClaimable.prototype.timeout_height = 0; + + /** + * ContentiousClaimable payment_hash. + * @member {string} payment_hash + * @memberof types.ContentiousClaimable + * @instance + */ + ContentiousClaimable.prototype.payment_hash = ""; + + /** + * ContentiousClaimable payment_preimage. + * @member {string} payment_preimage + * @memberof types.ContentiousClaimable + * @instance + */ + ContentiousClaimable.prototype.payment_preimage = ""; + + /** + * Creates a new ContentiousClaimable instance using the specified properties. + * @function create + * @memberof types.ContentiousClaimable + * @static + * @param {types.IContentiousClaimable=} [properties] Properties to set + * @returns {types.ContentiousClaimable} ContentiousClaimable instance + */ + ContentiousClaimable.create = function create(properties) { + return new ContentiousClaimable(properties); + }; + + /** + * Encodes the specified ContentiousClaimable message. Does not implicitly {@link types.ContentiousClaimable.verify|verify} messages. + * @function encode + * @memberof types.ContentiousClaimable + * @static + * @param {types.IContentiousClaimable} message ContentiousClaimable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentiousClaimable.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); + if (message.counterparty_node_id != null && Object.hasOwnProperty.call(message, "counterparty_node_id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterparty_node_id); + if (message.amount_satoshis != null && Object.hasOwnProperty.call(message, "amount_satoshis")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.amount_satoshis); + if (message.timeout_height != null && Object.hasOwnProperty.call(message, "timeout_height")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.timeout_height); + if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.payment_hash); + if (message.payment_preimage != null && Object.hasOwnProperty.call(message, "payment_preimage")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.payment_preimage); + return writer; + }; + + /** + * Encodes the specified ContentiousClaimable message, length delimited. Does not implicitly {@link types.ContentiousClaimable.verify|verify} messages. + * @function encodeDelimited + * @memberof types.ContentiousClaimable + * @static + * @param {types.IContentiousClaimable} message ContentiousClaimable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentiousClaimable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContentiousClaimable message from the specified reader or buffer. + * @function decode + * @memberof types.ContentiousClaimable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.ContentiousClaimable} ContentiousClaimable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentiousClaimable.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.ContentiousClaimable(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.channel_id = reader.string(); + break; + } + case 2: { + message.counterparty_node_id = reader.string(); + break; + } + case 3: { + message.amount_satoshis = reader.uint64(); + break; + } + case 4: { + message.timeout_height = reader.uint32(); + break; + } + case 5: { + message.payment_hash = reader.string(); + break; + } + case 6: { + message.payment_preimage = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ContentiousClaimable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.ContentiousClaimable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.ContentiousClaimable} ContentiousClaimable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentiousClaimable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContentiousClaimable message. + * @function verify + * @memberof types.ContentiousClaimable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContentiousClaimable.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.channel_id != null && message.hasOwnProperty("channel_id")) + if (!$util.isString(message.channel_id)) + return "channel_id: string expected"; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + if (!$util.isString(message.counterparty_node_id)) + return "counterparty_node_id: string expected"; + if (message.amount_satoshis != null && message.hasOwnProperty("amount_satoshis")) + if (!$util.isInteger(message.amount_satoshis) && !(message.amount_satoshis && $util.isInteger(message.amount_satoshis.low) && $util.isInteger(message.amount_satoshis.high))) + return "amount_satoshis: integer|Long expected"; + if (message.timeout_height != null && message.hasOwnProperty("timeout_height")) + if (!$util.isInteger(message.timeout_height)) + return "timeout_height: integer expected"; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + if (!$util.isString(message.payment_hash)) + return "payment_hash: string expected"; + if (message.payment_preimage != null && message.hasOwnProperty("payment_preimage")) + if (!$util.isString(message.payment_preimage)) + return "payment_preimage: string expected"; + return null; + }; + + /** + * Creates a ContentiousClaimable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.ContentiousClaimable + * @static + * @param {Object.} object Plain object + * @returns {types.ContentiousClaimable} ContentiousClaimable + */ + ContentiousClaimable.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.ContentiousClaimable) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.ContentiousClaimable(); + if (object.channel_id != null) + message.channel_id = String(object.channel_id); + if (object.counterparty_node_id != null) + message.counterparty_node_id = String(object.counterparty_node_id); + if (object.amount_satoshis != null) + if ($util.Long) + (message.amount_satoshis = $util.Long.fromValue(object.amount_satoshis)).unsigned = true; + else if (typeof object.amount_satoshis === "string") + message.amount_satoshis = parseInt(object.amount_satoshis, 10); + else if (typeof object.amount_satoshis === "number") + message.amount_satoshis = object.amount_satoshis; + else if (typeof object.amount_satoshis === "object") + message.amount_satoshis = new $util.LongBits(object.amount_satoshis.low >>> 0, object.amount_satoshis.high >>> 0).toNumber(true); + if (object.timeout_height != null) + message.timeout_height = object.timeout_height >>> 0; + if (object.payment_hash != null) + message.payment_hash = String(object.payment_hash); + if (object.payment_preimage != null) + message.payment_preimage = String(object.payment_preimage); + return message; + }; + + /** + * Creates a plain object from a ContentiousClaimable message. Also converts values to other types if specified. + * @function toObject + * @memberof types.ContentiousClaimable + * @static + * @param {types.ContentiousClaimable} message ContentiousClaimable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContentiousClaimable.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.channel_id = ""; + object.counterparty_node_id = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.amount_satoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.amount_satoshis = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.timeout_height = 0; + object.payment_hash = ""; + object.payment_preimage = ""; + } + if (message.channel_id != null && message.hasOwnProperty("channel_id")) + object.channel_id = message.channel_id; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + object.counterparty_node_id = message.counterparty_node_id; + if (message.amount_satoshis != null && message.hasOwnProperty("amount_satoshis")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_satoshis = typeof message.amount_satoshis === "number" ? BigInt(message.amount_satoshis) : $util.Long.fromBits(message.amount_satoshis.low >>> 0, message.amount_satoshis.high >>> 0, true).toBigInt(); + else if (typeof message.amount_satoshis === "number") + object.amount_satoshis = options.longs === String ? String(message.amount_satoshis) : message.amount_satoshis; + else + object.amount_satoshis = options.longs === String ? $util.Long.prototype.toString.call(message.amount_satoshis) : options.longs === Number ? new $util.LongBits(message.amount_satoshis.low >>> 0, message.amount_satoshis.high >>> 0).toNumber(true) : message.amount_satoshis; + if (message.timeout_height != null && message.hasOwnProperty("timeout_height")) + object.timeout_height = message.timeout_height; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + object.payment_hash = message.payment_hash; + if (message.payment_preimage != null && message.hasOwnProperty("payment_preimage")) + object.payment_preimage = message.payment_preimage; + return object; + }; + + /** + * Converts this ContentiousClaimable to JSON. + * @function toJSON + * @memberof types.ContentiousClaimable + * @instance + * @returns {Object.} JSON object + */ + ContentiousClaimable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContentiousClaimable + * @function getTypeUrl + * @memberof types.ContentiousClaimable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContentiousClaimable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.ContentiousClaimable"; + }; + + return ContentiousClaimable; + })(); + + types.MaybeTimeoutClaimableHTLC = (function() { + + /** + * Properties of a MaybeTimeoutClaimableHTLC. + * @memberof types + * @interface IMaybeTimeoutClaimableHTLC + * @property {string|null} [channel_id] MaybeTimeoutClaimableHTLC channel_id + * @property {string|null} [counterparty_node_id] MaybeTimeoutClaimableHTLC counterparty_node_id + * @property {Long|null} [amount_satoshis] MaybeTimeoutClaimableHTLC amount_satoshis + * @property {number|null} [claimable_height] MaybeTimeoutClaimableHTLC claimable_height + * @property {string|null} [payment_hash] MaybeTimeoutClaimableHTLC payment_hash + * @property {boolean|null} [outbound_payment] MaybeTimeoutClaimableHTLC outbound_payment + */ + + /** + * Constructs a new MaybeTimeoutClaimableHTLC. + * @memberof types + * @classdesc Represents a MaybeTimeoutClaimableHTLC. + * @implements IMaybeTimeoutClaimableHTLC + * @constructor + * @param {types.IMaybeTimeoutClaimableHTLC=} [properties] Properties to set + */ + function MaybeTimeoutClaimableHTLC(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaybeTimeoutClaimableHTLC channel_id. + * @member {string} channel_id + * @memberof types.MaybeTimeoutClaimableHTLC + * @instance + */ + MaybeTimeoutClaimableHTLC.prototype.channel_id = ""; + + /** + * MaybeTimeoutClaimableHTLC counterparty_node_id. + * @member {string} counterparty_node_id + * @memberof types.MaybeTimeoutClaimableHTLC + * @instance + */ + MaybeTimeoutClaimableHTLC.prototype.counterparty_node_id = ""; + + /** + * MaybeTimeoutClaimableHTLC amount_satoshis. + * @member {Long} amount_satoshis + * @memberof types.MaybeTimeoutClaimableHTLC + * @instance + */ + MaybeTimeoutClaimableHTLC.prototype.amount_satoshis = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * MaybeTimeoutClaimableHTLC claimable_height. + * @member {number} claimable_height + * @memberof types.MaybeTimeoutClaimableHTLC + * @instance + */ + MaybeTimeoutClaimableHTLC.prototype.claimable_height = 0; + + /** + * MaybeTimeoutClaimableHTLC payment_hash. + * @member {string} payment_hash + * @memberof types.MaybeTimeoutClaimableHTLC + * @instance + */ + MaybeTimeoutClaimableHTLC.prototype.payment_hash = ""; + + /** + * MaybeTimeoutClaimableHTLC outbound_payment. + * @member {boolean} outbound_payment + * @memberof types.MaybeTimeoutClaimableHTLC + * @instance + */ + MaybeTimeoutClaimableHTLC.prototype.outbound_payment = false; + + /** + * Creates a new MaybeTimeoutClaimableHTLC instance using the specified properties. + * @function create + * @memberof types.MaybeTimeoutClaimableHTLC + * @static + * @param {types.IMaybeTimeoutClaimableHTLC=} [properties] Properties to set + * @returns {types.MaybeTimeoutClaimableHTLC} MaybeTimeoutClaimableHTLC instance + */ + MaybeTimeoutClaimableHTLC.create = function create(properties) { + return new MaybeTimeoutClaimableHTLC(properties); + }; + + /** + * Encodes the specified MaybeTimeoutClaimableHTLC message. Does not implicitly {@link types.MaybeTimeoutClaimableHTLC.verify|verify} messages. + * @function encode + * @memberof types.MaybeTimeoutClaimableHTLC + * @static + * @param {types.IMaybeTimeoutClaimableHTLC} message MaybeTimeoutClaimableHTLC message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaybeTimeoutClaimableHTLC.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); + if (message.counterparty_node_id != null && Object.hasOwnProperty.call(message, "counterparty_node_id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterparty_node_id); + if (message.amount_satoshis != null && Object.hasOwnProperty.call(message, "amount_satoshis")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.amount_satoshis); + if (message.claimable_height != null && Object.hasOwnProperty.call(message, "claimable_height")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.claimable_height); + if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.payment_hash); + if (message.outbound_payment != null && Object.hasOwnProperty.call(message, "outbound_payment")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.outbound_payment); + return writer; + }; + + /** + * Encodes the specified MaybeTimeoutClaimableHTLC message, length delimited. Does not implicitly {@link types.MaybeTimeoutClaimableHTLC.verify|verify} messages. + * @function encodeDelimited + * @memberof types.MaybeTimeoutClaimableHTLC + * @static + * @param {types.IMaybeTimeoutClaimableHTLC} message MaybeTimeoutClaimableHTLC message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaybeTimeoutClaimableHTLC.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaybeTimeoutClaimableHTLC message from the specified reader or buffer. + * @function decode + * @memberof types.MaybeTimeoutClaimableHTLC + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.MaybeTimeoutClaimableHTLC} MaybeTimeoutClaimableHTLC + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaybeTimeoutClaimableHTLC.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.MaybeTimeoutClaimableHTLC(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.channel_id = reader.string(); + break; + } + case 2: { + message.counterparty_node_id = reader.string(); + break; + } + case 3: { + message.amount_satoshis = reader.uint64(); + break; + } + case 4: { + message.claimable_height = reader.uint32(); + break; + } + case 5: { + message.payment_hash = reader.string(); + break; + } + case 6: { + message.outbound_payment = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MaybeTimeoutClaimableHTLC message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.MaybeTimeoutClaimableHTLC + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.MaybeTimeoutClaimableHTLC} MaybeTimeoutClaimableHTLC + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaybeTimeoutClaimableHTLC.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaybeTimeoutClaimableHTLC message. + * @function verify + * @memberof types.MaybeTimeoutClaimableHTLC + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaybeTimeoutClaimableHTLC.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.channel_id != null && message.hasOwnProperty("channel_id")) + if (!$util.isString(message.channel_id)) + return "channel_id: string expected"; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + if (!$util.isString(message.counterparty_node_id)) + return "counterparty_node_id: string expected"; + if (message.amount_satoshis != null && message.hasOwnProperty("amount_satoshis")) + if (!$util.isInteger(message.amount_satoshis) && !(message.amount_satoshis && $util.isInteger(message.amount_satoshis.low) && $util.isInteger(message.amount_satoshis.high))) + return "amount_satoshis: integer|Long expected"; + if (message.claimable_height != null && message.hasOwnProperty("claimable_height")) + if (!$util.isInteger(message.claimable_height)) + return "claimable_height: integer expected"; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + if (!$util.isString(message.payment_hash)) + return "payment_hash: string expected"; + if (message.outbound_payment != null && message.hasOwnProperty("outbound_payment")) + if (typeof message.outbound_payment !== "boolean") + return "outbound_payment: boolean expected"; + return null; + }; + + /** + * Creates a MaybeTimeoutClaimableHTLC message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.MaybeTimeoutClaimableHTLC + * @static + * @param {Object.} object Plain object + * @returns {types.MaybeTimeoutClaimableHTLC} MaybeTimeoutClaimableHTLC + */ + MaybeTimeoutClaimableHTLC.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.MaybeTimeoutClaimableHTLC) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.MaybeTimeoutClaimableHTLC(); + if (object.channel_id != null) + message.channel_id = String(object.channel_id); + if (object.counterparty_node_id != null) + message.counterparty_node_id = String(object.counterparty_node_id); + if (object.amount_satoshis != null) + if ($util.Long) + (message.amount_satoshis = $util.Long.fromValue(object.amount_satoshis)).unsigned = true; + else if (typeof object.amount_satoshis === "string") + message.amount_satoshis = parseInt(object.amount_satoshis, 10); + else if (typeof object.amount_satoshis === "number") + message.amount_satoshis = object.amount_satoshis; + else if (typeof object.amount_satoshis === "object") + message.amount_satoshis = new $util.LongBits(object.amount_satoshis.low >>> 0, object.amount_satoshis.high >>> 0).toNumber(true); + if (object.claimable_height != null) + message.claimable_height = object.claimable_height >>> 0; + if (object.payment_hash != null) + message.payment_hash = String(object.payment_hash); + if (object.outbound_payment != null) + message.outbound_payment = Boolean(object.outbound_payment); + return message; + }; + + /** + * Creates a plain object from a MaybeTimeoutClaimableHTLC message. Also converts values to other types if specified. + * @function toObject + * @memberof types.MaybeTimeoutClaimableHTLC + * @static + * @param {types.MaybeTimeoutClaimableHTLC} message MaybeTimeoutClaimableHTLC + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaybeTimeoutClaimableHTLC.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.channel_id = ""; + object.counterparty_node_id = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.amount_satoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.amount_satoshis = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.claimable_height = 0; + object.payment_hash = ""; + object.outbound_payment = false; + } + if (message.channel_id != null && message.hasOwnProperty("channel_id")) + object.channel_id = message.channel_id; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + object.counterparty_node_id = message.counterparty_node_id; + if (message.amount_satoshis != null && message.hasOwnProperty("amount_satoshis")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_satoshis = typeof message.amount_satoshis === "number" ? BigInt(message.amount_satoshis) : $util.Long.fromBits(message.amount_satoshis.low >>> 0, message.amount_satoshis.high >>> 0, true).toBigInt(); + else if (typeof message.amount_satoshis === "number") + object.amount_satoshis = options.longs === String ? String(message.amount_satoshis) : message.amount_satoshis; + else + object.amount_satoshis = options.longs === String ? $util.Long.prototype.toString.call(message.amount_satoshis) : options.longs === Number ? new $util.LongBits(message.amount_satoshis.low >>> 0, message.amount_satoshis.high >>> 0).toNumber(true) : message.amount_satoshis; + if (message.claimable_height != null && message.hasOwnProperty("claimable_height")) + object.claimable_height = message.claimable_height; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + object.payment_hash = message.payment_hash; + if (message.outbound_payment != null && message.hasOwnProperty("outbound_payment")) + object.outbound_payment = message.outbound_payment; + return object; + }; + + /** + * Converts this MaybeTimeoutClaimableHTLC to JSON. + * @function toJSON + * @memberof types.MaybeTimeoutClaimableHTLC + * @instance + * @returns {Object.} JSON object + */ + MaybeTimeoutClaimableHTLC.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaybeTimeoutClaimableHTLC + * @function getTypeUrl + * @memberof types.MaybeTimeoutClaimableHTLC + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaybeTimeoutClaimableHTLC.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.MaybeTimeoutClaimableHTLC"; + }; + + return MaybeTimeoutClaimableHTLC; + })(); + + types.MaybePreimageClaimableHTLC = (function() { + + /** + * Properties of a MaybePreimageClaimableHTLC. + * @memberof types + * @interface IMaybePreimageClaimableHTLC + * @property {string|null} [channel_id] MaybePreimageClaimableHTLC channel_id + * @property {string|null} [counterparty_node_id] MaybePreimageClaimableHTLC counterparty_node_id + * @property {Long|null} [amount_satoshis] MaybePreimageClaimableHTLC amount_satoshis + * @property {number|null} [expiry_height] MaybePreimageClaimableHTLC expiry_height + * @property {string|null} [payment_hash] MaybePreimageClaimableHTLC payment_hash + */ + + /** + * Constructs a new MaybePreimageClaimableHTLC. + * @memberof types + * @classdesc Represents a MaybePreimageClaimableHTLC. + * @implements IMaybePreimageClaimableHTLC + * @constructor + * @param {types.IMaybePreimageClaimableHTLC=} [properties] Properties to set + */ + function MaybePreimageClaimableHTLC(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaybePreimageClaimableHTLC channel_id. + * @member {string} channel_id + * @memberof types.MaybePreimageClaimableHTLC + * @instance + */ + MaybePreimageClaimableHTLC.prototype.channel_id = ""; + + /** + * MaybePreimageClaimableHTLC counterparty_node_id. + * @member {string} counterparty_node_id + * @memberof types.MaybePreimageClaimableHTLC + * @instance + */ + MaybePreimageClaimableHTLC.prototype.counterparty_node_id = ""; + + /** + * MaybePreimageClaimableHTLC amount_satoshis. + * @member {Long} amount_satoshis + * @memberof types.MaybePreimageClaimableHTLC + * @instance + */ + MaybePreimageClaimableHTLC.prototype.amount_satoshis = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * MaybePreimageClaimableHTLC expiry_height. + * @member {number} expiry_height + * @memberof types.MaybePreimageClaimableHTLC + * @instance + */ + MaybePreimageClaimableHTLC.prototype.expiry_height = 0; + + /** + * MaybePreimageClaimableHTLC payment_hash. + * @member {string} payment_hash + * @memberof types.MaybePreimageClaimableHTLC + * @instance + */ + MaybePreimageClaimableHTLC.prototype.payment_hash = ""; + + /** + * Creates a new MaybePreimageClaimableHTLC instance using the specified properties. + * @function create + * @memberof types.MaybePreimageClaimableHTLC + * @static + * @param {types.IMaybePreimageClaimableHTLC=} [properties] Properties to set + * @returns {types.MaybePreimageClaimableHTLC} MaybePreimageClaimableHTLC instance + */ + MaybePreimageClaimableHTLC.create = function create(properties) { + return new MaybePreimageClaimableHTLC(properties); + }; + + /** + * Encodes the specified MaybePreimageClaimableHTLC message. Does not implicitly {@link types.MaybePreimageClaimableHTLC.verify|verify} messages. + * @function encode + * @memberof types.MaybePreimageClaimableHTLC + * @static + * @param {types.IMaybePreimageClaimableHTLC} message MaybePreimageClaimableHTLC message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaybePreimageClaimableHTLC.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); + if (message.counterparty_node_id != null && Object.hasOwnProperty.call(message, "counterparty_node_id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterparty_node_id); + if (message.amount_satoshis != null && Object.hasOwnProperty.call(message, "amount_satoshis")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.amount_satoshis); + if (message.expiry_height != null && Object.hasOwnProperty.call(message, "expiry_height")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.expiry_height); + if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.payment_hash); + return writer; + }; + + /** + * Encodes the specified MaybePreimageClaimableHTLC message, length delimited. Does not implicitly {@link types.MaybePreimageClaimableHTLC.verify|verify} messages. + * @function encodeDelimited + * @memberof types.MaybePreimageClaimableHTLC + * @static + * @param {types.IMaybePreimageClaimableHTLC} message MaybePreimageClaimableHTLC message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MaybePreimageClaimableHTLC.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MaybePreimageClaimableHTLC message from the specified reader or buffer. + * @function decode + * @memberof types.MaybePreimageClaimableHTLC + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.MaybePreimageClaimableHTLC} MaybePreimageClaimableHTLC + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaybePreimageClaimableHTLC.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.MaybePreimageClaimableHTLC(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.channel_id = reader.string(); + break; + } + case 2: { + message.counterparty_node_id = reader.string(); + break; + } + case 3: { + message.amount_satoshis = reader.uint64(); + break; + } + case 4: { + message.expiry_height = reader.uint32(); + break; + } + case 5: { + message.payment_hash = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a MaybePreimageClaimableHTLC message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.MaybePreimageClaimableHTLC + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.MaybePreimageClaimableHTLC} MaybePreimageClaimableHTLC + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MaybePreimageClaimableHTLC.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MaybePreimageClaimableHTLC message. + * @function verify + * @memberof types.MaybePreimageClaimableHTLC + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MaybePreimageClaimableHTLC.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.channel_id != null && message.hasOwnProperty("channel_id")) + if (!$util.isString(message.channel_id)) + return "channel_id: string expected"; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + if (!$util.isString(message.counterparty_node_id)) + return "counterparty_node_id: string expected"; + if (message.amount_satoshis != null && message.hasOwnProperty("amount_satoshis")) + if (!$util.isInteger(message.amount_satoshis) && !(message.amount_satoshis && $util.isInteger(message.amount_satoshis.low) && $util.isInteger(message.amount_satoshis.high))) + return "amount_satoshis: integer|Long expected"; + if (message.expiry_height != null && message.hasOwnProperty("expiry_height")) + if (!$util.isInteger(message.expiry_height)) + return "expiry_height: integer expected"; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + if (!$util.isString(message.payment_hash)) + return "payment_hash: string expected"; + return null; + }; + + /** + * Creates a MaybePreimageClaimableHTLC message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.MaybePreimageClaimableHTLC + * @static + * @param {Object.} object Plain object + * @returns {types.MaybePreimageClaimableHTLC} MaybePreimageClaimableHTLC + */ + MaybePreimageClaimableHTLC.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.MaybePreimageClaimableHTLC) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.MaybePreimageClaimableHTLC(); + if (object.channel_id != null) + message.channel_id = String(object.channel_id); + if (object.counterparty_node_id != null) + message.counterparty_node_id = String(object.counterparty_node_id); + if (object.amount_satoshis != null) + if ($util.Long) + (message.amount_satoshis = $util.Long.fromValue(object.amount_satoshis)).unsigned = true; + else if (typeof object.amount_satoshis === "string") + message.amount_satoshis = parseInt(object.amount_satoshis, 10); + else if (typeof object.amount_satoshis === "number") + message.amount_satoshis = object.amount_satoshis; + else if (typeof object.amount_satoshis === "object") + message.amount_satoshis = new $util.LongBits(object.amount_satoshis.low >>> 0, object.amount_satoshis.high >>> 0).toNumber(true); + if (object.expiry_height != null) + message.expiry_height = object.expiry_height >>> 0; + if (object.payment_hash != null) + message.payment_hash = String(object.payment_hash); + return message; + }; + + /** + * Creates a plain object from a MaybePreimageClaimableHTLC message. Also converts values to other types if specified. + * @function toObject + * @memberof types.MaybePreimageClaimableHTLC + * @static + * @param {types.MaybePreimageClaimableHTLC} message MaybePreimageClaimableHTLC + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MaybePreimageClaimableHTLC.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.channel_id = ""; + object.counterparty_node_id = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.amount_satoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.amount_satoshis = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.expiry_height = 0; + object.payment_hash = ""; + } + if (message.channel_id != null && message.hasOwnProperty("channel_id")) + object.channel_id = message.channel_id; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + object.counterparty_node_id = message.counterparty_node_id; + if (message.amount_satoshis != null && message.hasOwnProperty("amount_satoshis")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_satoshis = typeof message.amount_satoshis === "number" ? BigInt(message.amount_satoshis) : $util.Long.fromBits(message.amount_satoshis.low >>> 0, message.amount_satoshis.high >>> 0, true).toBigInt(); + else if (typeof message.amount_satoshis === "number") + object.amount_satoshis = options.longs === String ? String(message.amount_satoshis) : message.amount_satoshis; + else + object.amount_satoshis = options.longs === String ? $util.Long.prototype.toString.call(message.amount_satoshis) : options.longs === Number ? new $util.LongBits(message.amount_satoshis.low >>> 0, message.amount_satoshis.high >>> 0).toNumber(true) : message.amount_satoshis; + if (message.expiry_height != null && message.hasOwnProperty("expiry_height")) + object.expiry_height = message.expiry_height; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) + object.payment_hash = message.payment_hash; + return object; + }; + + /** + * Converts this MaybePreimageClaimableHTLC to JSON. + * @function toJSON + * @memberof types.MaybePreimageClaimableHTLC + * @instance + * @returns {Object.} JSON object + */ + MaybePreimageClaimableHTLC.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MaybePreimageClaimableHTLC + * @function getTypeUrl + * @memberof types.MaybePreimageClaimableHTLC + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaybePreimageClaimableHTLC.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.MaybePreimageClaimableHTLC"; + }; + + return MaybePreimageClaimableHTLC; + })(); + + types.CounterpartyRevokedOutputClaimable = (function() { + + /** + * Properties of a CounterpartyRevokedOutputClaimable. + * @memberof types + * @interface ICounterpartyRevokedOutputClaimable + * @property {string|null} [channel_id] CounterpartyRevokedOutputClaimable channel_id + * @property {string|null} [counterparty_node_id] CounterpartyRevokedOutputClaimable counterparty_node_id + * @property {Long|null} [amount_satoshis] CounterpartyRevokedOutputClaimable amount_satoshis + */ + + /** + * Constructs a new CounterpartyRevokedOutputClaimable. + * @memberof types + * @classdesc Represents a CounterpartyRevokedOutputClaimable. + * @implements ICounterpartyRevokedOutputClaimable + * @constructor + * @param {types.ICounterpartyRevokedOutputClaimable=} [properties] Properties to set + */ + function CounterpartyRevokedOutputClaimable(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CounterpartyRevokedOutputClaimable channel_id. + * @member {string} channel_id + * @memberof types.CounterpartyRevokedOutputClaimable + * @instance + */ + CounterpartyRevokedOutputClaimable.prototype.channel_id = ""; + + /** + * CounterpartyRevokedOutputClaimable counterparty_node_id. + * @member {string} counterparty_node_id + * @memberof types.CounterpartyRevokedOutputClaimable + * @instance + */ + CounterpartyRevokedOutputClaimable.prototype.counterparty_node_id = ""; + + /** + * CounterpartyRevokedOutputClaimable amount_satoshis. + * @member {Long} amount_satoshis + * @memberof types.CounterpartyRevokedOutputClaimable + * @instance + */ + CounterpartyRevokedOutputClaimable.prototype.amount_satoshis = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new CounterpartyRevokedOutputClaimable instance using the specified properties. + * @function create + * @memberof types.CounterpartyRevokedOutputClaimable + * @static + * @param {types.ICounterpartyRevokedOutputClaimable=} [properties] Properties to set + * @returns {types.CounterpartyRevokedOutputClaimable} CounterpartyRevokedOutputClaimable instance + */ + CounterpartyRevokedOutputClaimable.create = function create(properties) { + return new CounterpartyRevokedOutputClaimable(properties); + }; + + /** + * Encodes the specified CounterpartyRevokedOutputClaimable message. Does not implicitly {@link types.CounterpartyRevokedOutputClaimable.verify|verify} messages. + * @function encode + * @memberof types.CounterpartyRevokedOutputClaimable + * @static + * @param {types.ICounterpartyRevokedOutputClaimable} message CounterpartyRevokedOutputClaimable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CounterpartyRevokedOutputClaimable.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); + if (message.counterparty_node_id != null && Object.hasOwnProperty.call(message, "counterparty_node_id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterparty_node_id); + if (message.amount_satoshis != null && Object.hasOwnProperty.call(message, "amount_satoshis")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.amount_satoshis); + return writer; + }; + + /** + * Encodes the specified CounterpartyRevokedOutputClaimable message, length delimited. Does not implicitly {@link types.CounterpartyRevokedOutputClaimable.verify|verify} messages. + * @function encodeDelimited + * @memberof types.CounterpartyRevokedOutputClaimable + * @static + * @param {types.ICounterpartyRevokedOutputClaimable} message CounterpartyRevokedOutputClaimable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CounterpartyRevokedOutputClaimable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CounterpartyRevokedOutputClaimable message from the specified reader or buffer. + * @function decode + * @memberof types.CounterpartyRevokedOutputClaimable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.CounterpartyRevokedOutputClaimable} CounterpartyRevokedOutputClaimable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CounterpartyRevokedOutputClaimable.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.CounterpartyRevokedOutputClaimable(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.channel_id = reader.string(); + break; + } + case 2: { + message.counterparty_node_id = reader.string(); + break; + } + case 3: { + message.amount_satoshis = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CounterpartyRevokedOutputClaimable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.CounterpartyRevokedOutputClaimable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.CounterpartyRevokedOutputClaimable} CounterpartyRevokedOutputClaimable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CounterpartyRevokedOutputClaimable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CounterpartyRevokedOutputClaimable message. + * @function verify + * @memberof types.CounterpartyRevokedOutputClaimable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CounterpartyRevokedOutputClaimable.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.channel_id != null && message.hasOwnProperty("channel_id")) + if (!$util.isString(message.channel_id)) + return "channel_id: string expected"; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + if (!$util.isString(message.counterparty_node_id)) + return "counterparty_node_id: string expected"; + if (message.amount_satoshis != null && message.hasOwnProperty("amount_satoshis")) + if (!$util.isInteger(message.amount_satoshis) && !(message.amount_satoshis && $util.isInteger(message.amount_satoshis.low) && $util.isInteger(message.amount_satoshis.high))) + return "amount_satoshis: integer|Long expected"; + return null; + }; + + /** + * Creates a CounterpartyRevokedOutputClaimable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.CounterpartyRevokedOutputClaimable + * @static + * @param {Object.} object Plain object + * @returns {types.CounterpartyRevokedOutputClaimable} CounterpartyRevokedOutputClaimable + */ + CounterpartyRevokedOutputClaimable.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.CounterpartyRevokedOutputClaimable) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.CounterpartyRevokedOutputClaimable(); + if (object.channel_id != null) + message.channel_id = String(object.channel_id); + if (object.counterparty_node_id != null) + message.counterparty_node_id = String(object.counterparty_node_id); + if (object.amount_satoshis != null) + if ($util.Long) + (message.amount_satoshis = $util.Long.fromValue(object.amount_satoshis)).unsigned = true; + else if (typeof object.amount_satoshis === "string") + message.amount_satoshis = parseInt(object.amount_satoshis, 10); + else if (typeof object.amount_satoshis === "number") + message.amount_satoshis = object.amount_satoshis; + else if (typeof object.amount_satoshis === "object") + message.amount_satoshis = new $util.LongBits(object.amount_satoshis.low >>> 0, object.amount_satoshis.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a CounterpartyRevokedOutputClaimable message. Also converts values to other types if specified. + * @function toObject + * @memberof types.CounterpartyRevokedOutputClaimable + * @static + * @param {types.CounterpartyRevokedOutputClaimable} message CounterpartyRevokedOutputClaimable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CounterpartyRevokedOutputClaimable.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.channel_id = ""; + object.counterparty_node_id = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.amount_satoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.amount_satoshis = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + } + if (message.channel_id != null && message.hasOwnProperty("channel_id")) + object.channel_id = message.channel_id; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) + object.counterparty_node_id = message.counterparty_node_id; + if (message.amount_satoshis != null && message.hasOwnProperty("amount_satoshis")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_satoshis = typeof message.amount_satoshis === "number" ? BigInt(message.amount_satoshis) : $util.Long.fromBits(message.amount_satoshis.low >>> 0, message.amount_satoshis.high >>> 0, true).toBigInt(); + else if (typeof message.amount_satoshis === "number") + object.amount_satoshis = options.longs === String ? String(message.amount_satoshis) : message.amount_satoshis; + else + object.amount_satoshis = options.longs === String ? $util.Long.prototype.toString.call(message.amount_satoshis) : options.longs === Number ? new $util.LongBits(message.amount_satoshis.low >>> 0, message.amount_satoshis.high >>> 0).toNumber(true) : message.amount_satoshis; + return object; + }; + + /** + * Converts this CounterpartyRevokedOutputClaimable to JSON. + * @function toJSON + * @memberof types.CounterpartyRevokedOutputClaimable + * @instance + * @returns {Object.} JSON object + */ + CounterpartyRevokedOutputClaimable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CounterpartyRevokedOutputClaimable + * @function getTypeUrl + * @memberof types.CounterpartyRevokedOutputClaimable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CounterpartyRevokedOutputClaimable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.CounterpartyRevokedOutputClaimable"; + }; + + return CounterpartyRevokedOutputClaimable; + })(); + + types.PendingSweepBalance = (function() { + + /** + * Properties of a PendingSweepBalance. + * @memberof types + * @interface IPendingSweepBalance + * @property {types.IPendingBroadcast|null} [pending_broadcast] PendingSweepBalance pending_broadcast + * @property {types.IBroadcastAwaitingConfirmation|null} [broadcast_awaiting_confirmation] PendingSweepBalance broadcast_awaiting_confirmation + * @property {types.IAwaitingThresholdConfirmations|null} [awaiting_threshold_confirmations] PendingSweepBalance awaiting_threshold_confirmations + */ + + /** + * Constructs a new PendingSweepBalance. + * @memberof types + * @classdesc Represents a PendingSweepBalance. + * @implements IPendingSweepBalance + * @constructor + * @param {types.IPendingSweepBalance=} [properties] Properties to set + */ + function PendingSweepBalance(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PendingSweepBalance pending_broadcast. + * @member {types.IPendingBroadcast|null|undefined} pending_broadcast + * @memberof types.PendingSweepBalance + * @instance + */ + PendingSweepBalance.prototype.pending_broadcast = null; + + /** + * PendingSweepBalance broadcast_awaiting_confirmation. + * @member {types.IBroadcastAwaitingConfirmation|null|undefined} broadcast_awaiting_confirmation + * @memberof types.PendingSweepBalance + * @instance + */ + PendingSweepBalance.prototype.broadcast_awaiting_confirmation = null; + + /** + * PendingSweepBalance awaiting_threshold_confirmations. + * @member {types.IAwaitingThresholdConfirmations|null|undefined} awaiting_threshold_confirmations + * @memberof types.PendingSweepBalance + * @instance + */ + PendingSweepBalance.prototype.awaiting_threshold_confirmations = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * PendingSweepBalance balance_type. + * @member {"pending_broadcast"|"broadcast_awaiting_confirmation"|"awaiting_threshold_confirmations"|undefined} balance_type + * @memberof types.PendingSweepBalance + * @instance + */ + Object.defineProperty(PendingSweepBalance.prototype, "balance_type", { + get: $util.oneOfGetter($oneOfFields = ["pending_broadcast", "broadcast_awaiting_confirmation", "awaiting_threshold_confirmations"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingSweepBalance instance using the specified properties. + * @function create + * @memberof types.PendingSweepBalance + * @static + * @param {types.IPendingSweepBalance=} [properties] Properties to set + * @returns {types.PendingSweepBalance} PendingSweepBalance instance + */ + PendingSweepBalance.create = function create(properties) { + return new PendingSweepBalance(properties); + }; + + /** + * Encodes the specified PendingSweepBalance message. Does not implicitly {@link types.PendingSweepBalance.verify|verify} messages. + * @function encode + * @memberof types.PendingSweepBalance + * @static + * @param {types.IPendingSweepBalance} message PendingSweepBalance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingSweepBalance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pending_broadcast != null && Object.hasOwnProperty.call(message, "pending_broadcast")) + $root.types.PendingBroadcast.encode(message.pending_broadcast, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.broadcast_awaiting_confirmation != null && Object.hasOwnProperty.call(message, "broadcast_awaiting_confirmation")) + $root.types.BroadcastAwaitingConfirmation.encode(message.broadcast_awaiting_confirmation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.awaiting_threshold_confirmations != null && Object.hasOwnProperty.call(message, "awaiting_threshold_confirmations")) + $root.types.AwaitingThresholdConfirmations.encode(message.awaiting_threshold_confirmations, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PendingSweepBalance message, length delimited. Does not implicitly {@link types.PendingSweepBalance.verify|verify} messages. + * @function encodeDelimited + * @memberof types.PendingSweepBalance + * @static + * @param {types.IPendingSweepBalance} message PendingSweepBalance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingSweepBalance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PendingSweepBalance message from the specified reader or buffer. + * @function decode + * @memberof types.PendingSweepBalance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.PendingSweepBalance} PendingSweepBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingSweepBalance.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.PendingSweepBalance(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pending_broadcast = $root.types.PendingBroadcast.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 2: { + message.broadcast_awaiting_confirmation = $root.types.BroadcastAwaitingConfirmation.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.awaiting_threshold_confirmations = $root.types.AwaitingThresholdConfirmations.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PendingSweepBalance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.PendingSweepBalance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.PendingSweepBalance} PendingSweepBalance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingSweepBalance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PendingSweepBalance message. + * @function verify + * @memberof types.PendingSweepBalance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PendingSweepBalance.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.pending_broadcast != null && message.hasOwnProperty("pending_broadcast")) { + properties.balance_type = 1; + { + let error = $root.types.PendingBroadcast.verify(message.pending_broadcast, long + 1); + if (error) + return "pending_broadcast." + error; + } + } + if (message.broadcast_awaiting_confirmation != null && message.hasOwnProperty("broadcast_awaiting_confirmation")) { + if (properties.balance_type === 1) + return "balance_type: multiple values"; + properties.balance_type = 1; + { + let error = $root.types.BroadcastAwaitingConfirmation.verify(message.broadcast_awaiting_confirmation, long + 1); + if (error) + return "broadcast_awaiting_confirmation." + error; + } + } + if (message.awaiting_threshold_confirmations != null && message.hasOwnProperty("awaiting_threshold_confirmations")) { + if (properties.balance_type === 1) + return "balance_type: multiple values"; + properties.balance_type = 1; + { + let error = $root.types.AwaitingThresholdConfirmations.verify(message.awaiting_threshold_confirmations, long + 1); + if (error) + return "awaiting_threshold_confirmations." + error; + } + } + return null; + }; + + /** + * Creates a PendingSweepBalance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.PendingSweepBalance + * @static + * @param {Object.} object Plain object + * @returns {types.PendingSweepBalance} PendingSweepBalance + */ + PendingSweepBalance.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.PendingSweepBalance) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.PendingSweepBalance(); + if (object.pending_broadcast != null) { + if (typeof object.pending_broadcast !== "object") + throw TypeError(".types.PendingSweepBalance.pending_broadcast: object expected"); + message.pending_broadcast = $root.types.PendingBroadcast.fromObject(object.pending_broadcast, long + 1); + } + if (object.broadcast_awaiting_confirmation != null) { + if (typeof object.broadcast_awaiting_confirmation !== "object") + throw TypeError(".types.PendingSweepBalance.broadcast_awaiting_confirmation: object expected"); + message.broadcast_awaiting_confirmation = $root.types.BroadcastAwaitingConfirmation.fromObject(object.broadcast_awaiting_confirmation, long + 1); + } + if (object.awaiting_threshold_confirmations != null) { + if (typeof object.awaiting_threshold_confirmations !== "object") + throw TypeError(".types.PendingSweepBalance.awaiting_threshold_confirmations: object expected"); + message.awaiting_threshold_confirmations = $root.types.AwaitingThresholdConfirmations.fromObject(object.awaiting_threshold_confirmations, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PendingSweepBalance message. Also converts values to other types if specified. + * @function toObject + * @memberof types.PendingSweepBalance + * @static + * @param {types.PendingSweepBalance} message PendingSweepBalance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PendingSweepBalance.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.pending_broadcast != null && message.hasOwnProperty("pending_broadcast")) { + object.pending_broadcast = $root.types.PendingBroadcast.toObject(message.pending_broadcast, options); + if (options.oneofs) + object.balance_type = "pending_broadcast"; + } + if (message.broadcast_awaiting_confirmation != null && message.hasOwnProperty("broadcast_awaiting_confirmation")) { + object.broadcast_awaiting_confirmation = $root.types.BroadcastAwaitingConfirmation.toObject(message.broadcast_awaiting_confirmation, options); + if (options.oneofs) + object.balance_type = "broadcast_awaiting_confirmation"; + } + if (message.awaiting_threshold_confirmations != null && message.hasOwnProperty("awaiting_threshold_confirmations")) { + object.awaiting_threshold_confirmations = $root.types.AwaitingThresholdConfirmations.toObject(message.awaiting_threshold_confirmations, options); + if (options.oneofs) + object.balance_type = "awaiting_threshold_confirmations"; + } + return object; + }; + + /** + * Converts this PendingSweepBalance to JSON. + * @function toJSON + * @memberof types.PendingSweepBalance + * @instance + * @returns {Object.} JSON object + */ + PendingSweepBalance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PendingSweepBalance + * @function getTypeUrl + * @memberof types.PendingSweepBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingSweepBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.PendingSweepBalance"; + }; + + return PendingSweepBalance; + })(); + + types.PendingBroadcast = (function() { + + /** + * Properties of a PendingBroadcast. + * @memberof types + * @interface IPendingBroadcast + * @property {string|null} [channel_id] PendingBroadcast channel_id + * @property {Long|null} [amount_satoshis] PendingBroadcast amount_satoshis + */ + + /** + * Constructs a new PendingBroadcast. + * @memberof types + * @classdesc Represents a PendingBroadcast. + * @implements IPendingBroadcast + * @constructor + * @param {types.IPendingBroadcast=} [properties] Properties to set + */ + function PendingBroadcast(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PendingBroadcast channel_id. + * @member {string|null|undefined} channel_id + * @memberof types.PendingBroadcast + * @instance + */ + PendingBroadcast.prototype.channel_id = null; + + /** + * PendingBroadcast amount_satoshis. + * @member {Long} amount_satoshis + * @memberof types.PendingBroadcast + * @instance + */ + PendingBroadcast.prototype.amount_satoshis = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PendingBroadcast.prototype, "_channel_id", { + get: $util.oneOfGetter($oneOfFields = ["channel_id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingBroadcast instance using the specified properties. + * @function create + * @memberof types.PendingBroadcast + * @static + * @param {types.IPendingBroadcast=} [properties] Properties to set + * @returns {types.PendingBroadcast} PendingBroadcast instance + */ + PendingBroadcast.create = function create(properties) { + return new PendingBroadcast(properties); + }; + + /** + * Encodes the specified PendingBroadcast message. Does not implicitly {@link types.PendingBroadcast.verify|verify} messages. + * @function encode + * @memberof types.PendingBroadcast + * @static + * @param {types.IPendingBroadcast} message PendingBroadcast message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingBroadcast.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); + if (message.amount_satoshis != null && Object.hasOwnProperty.call(message, "amount_satoshis")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount_satoshis); + return writer; + }; + + /** + * Encodes the specified PendingBroadcast message, length delimited. Does not implicitly {@link types.PendingBroadcast.verify|verify} messages. + * @function encodeDelimited + * @memberof types.PendingBroadcast + * @static + * @param {types.IPendingBroadcast} message PendingBroadcast message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingBroadcast.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PendingBroadcast message from the specified reader or buffer. + * @function decode + * @memberof types.PendingBroadcast + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.PendingBroadcast} PendingBroadcast + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingBroadcast.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.PendingBroadcast(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.channel_id = reader.string(); + break; + } + case 2: { + message.amount_satoshis = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PendingBroadcast message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.PendingBroadcast + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.PendingBroadcast} PendingBroadcast + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PendingBroadcast.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PendingBroadcast message. + * @function verify + * @memberof types.PendingBroadcast + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PendingBroadcast.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.channel_id != null && message.hasOwnProperty("channel_id")) { + properties._channel_id = 1; + if (!$util.isString(message.channel_id)) + return "channel_id: string expected"; + } + if (message.amount_satoshis != null && message.hasOwnProperty("amount_satoshis")) + if (!$util.isInteger(message.amount_satoshis) && !(message.amount_satoshis && $util.isInteger(message.amount_satoshis.low) && $util.isInteger(message.amount_satoshis.high))) + return "amount_satoshis: integer|Long expected"; + return null; + }; + + /** + * Creates a PendingBroadcast message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.PendingBroadcast + * @static + * @param {Object.} object Plain object + * @returns {types.PendingBroadcast} PendingBroadcast + */ + PendingBroadcast.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.PendingBroadcast) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.PendingBroadcast(); + if (object.channel_id != null) + message.channel_id = String(object.channel_id); + if (object.amount_satoshis != null) + if ($util.Long) + (message.amount_satoshis = $util.Long.fromValue(object.amount_satoshis)).unsigned = true; + else if (typeof object.amount_satoshis === "string") + message.amount_satoshis = parseInt(object.amount_satoshis, 10); + else if (typeof object.amount_satoshis === "number") + message.amount_satoshis = object.amount_satoshis; + else if (typeof object.amount_satoshis === "object") + message.amount_satoshis = new $util.LongBits(object.amount_satoshis.low >>> 0, object.amount_satoshis.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a PendingBroadcast message. Also converts values to other types if specified. + * @function toObject + * @memberof types.PendingBroadcast + * @static + * @param {types.PendingBroadcast} message PendingBroadcast + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PendingBroadcast.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.amount_satoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.amount_satoshis = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if (message.channel_id != null && message.hasOwnProperty("channel_id")) { + object.channel_id = message.channel_id; + if (options.oneofs) + object._channel_id = "channel_id"; + } + if (message.amount_satoshis != null && message.hasOwnProperty("amount_satoshis")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_satoshis = typeof message.amount_satoshis === "number" ? BigInt(message.amount_satoshis) : $util.Long.fromBits(message.amount_satoshis.low >>> 0, message.amount_satoshis.high >>> 0, true).toBigInt(); + else if (typeof message.amount_satoshis === "number") + object.amount_satoshis = options.longs === String ? String(message.amount_satoshis) : message.amount_satoshis; + else + object.amount_satoshis = options.longs === String ? $util.Long.prototype.toString.call(message.amount_satoshis) : options.longs === Number ? new $util.LongBits(message.amount_satoshis.low >>> 0, message.amount_satoshis.high >>> 0).toNumber(true) : message.amount_satoshis; + return object; + }; + + /** + * Converts this PendingBroadcast to JSON. + * @function toJSON + * @memberof types.PendingBroadcast + * @instance + * @returns {Object.} JSON object + */ + PendingBroadcast.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PendingBroadcast + * @function getTypeUrl + * @memberof types.PendingBroadcast + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingBroadcast.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.PendingBroadcast"; + }; + + return PendingBroadcast; + })(); + + types.BroadcastAwaitingConfirmation = (function() { + + /** + * Properties of a BroadcastAwaitingConfirmation. + * @memberof types + * @interface IBroadcastAwaitingConfirmation + * @property {string|null} [channel_id] BroadcastAwaitingConfirmation channel_id + * @property {number|null} [latest_broadcast_height] BroadcastAwaitingConfirmation latest_broadcast_height + * @property {string|null} [latest_spending_txid] BroadcastAwaitingConfirmation latest_spending_txid + * @property {Long|null} [amount_satoshis] BroadcastAwaitingConfirmation amount_satoshis + */ + + /** + * Constructs a new BroadcastAwaitingConfirmation. + * @memberof types + * @classdesc Represents a BroadcastAwaitingConfirmation. + * @implements IBroadcastAwaitingConfirmation + * @constructor + * @param {types.IBroadcastAwaitingConfirmation=} [properties] Properties to set + */ + function BroadcastAwaitingConfirmation(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BroadcastAwaitingConfirmation channel_id. + * @member {string|null|undefined} channel_id + * @memberof types.BroadcastAwaitingConfirmation + * @instance + */ + BroadcastAwaitingConfirmation.prototype.channel_id = null; + + /** + * BroadcastAwaitingConfirmation latest_broadcast_height. + * @member {number} latest_broadcast_height + * @memberof types.BroadcastAwaitingConfirmation + * @instance + */ + BroadcastAwaitingConfirmation.prototype.latest_broadcast_height = 0; + + /** + * BroadcastAwaitingConfirmation latest_spending_txid. + * @member {string} latest_spending_txid + * @memberof types.BroadcastAwaitingConfirmation + * @instance + */ + BroadcastAwaitingConfirmation.prototype.latest_spending_txid = ""; + + /** + * BroadcastAwaitingConfirmation amount_satoshis. + * @member {Long} amount_satoshis + * @memberof types.BroadcastAwaitingConfirmation + * @instance + */ + BroadcastAwaitingConfirmation.prototype.amount_satoshis = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BroadcastAwaitingConfirmation.prototype, "_channel_id", { + get: $util.oneOfGetter($oneOfFields = ["channel_id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BroadcastAwaitingConfirmation instance using the specified properties. + * @function create + * @memberof types.BroadcastAwaitingConfirmation + * @static + * @param {types.IBroadcastAwaitingConfirmation=} [properties] Properties to set + * @returns {types.BroadcastAwaitingConfirmation} BroadcastAwaitingConfirmation instance + */ + BroadcastAwaitingConfirmation.create = function create(properties) { + return new BroadcastAwaitingConfirmation(properties); + }; + + /** + * Encodes the specified BroadcastAwaitingConfirmation message. Does not implicitly {@link types.BroadcastAwaitingConfirmation.verify|verify} messages. + * @function encode + * @memberof types.BroadcastAwaitingConfirmation + * @static + * @param {types.IBroadcastAwaitingConfirmation} message BroadcastAwaitingConfirmation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastAwaitingConfirmation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); + if (message.latest_broadcast_height != null && Object.hasOwnProperty.call(message, "latest_broadcast_height")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.latest_broadcast_height); + if (message.latest_spending_txid != null && Object.hasOwnProperty.call(message, "latest_spending_txid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.latest_spending_txid); + if (message.amount_satoshis != null && Object.hasOwnProperty.call(message, "amount_satoshis")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.amount_satoshis); + return writer; + }; + + /** + * Encodes the specified BroadcastAwaitingConfirmation message, length delimited. Does not implicitly {@link types.BroadcastAwaitingConfirmation.verify|verify} messages. + * @function encodeDelimited + * @memberof types.BroadcastAwaitingConfirmation + * @static + * @param {types.IBroadcastAwaitingConfirmation} message BroadcastAwaitingConfirmation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastAwaitingConfirmation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BroadcastAwaitingConfirmation message from the specified reader or buffer. + * @function decode + * @memberof types.BroadcastAwaitingConfirmation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.BroadcastAwaitingConfirmation} BroadcastAwaitingConfirmation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastAwaitingConfirmation.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.BroadcastAwaitingConfirmation(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.channel_id = reader.string(); + break; + } + case 2: { + message.latest_broadcast_height = reader.uint32(); + break; + } + case 3: { + message.latest_spending_txid = reader.string(); + break; + } + case 4: { + message.amount_satoshis = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BroadcastAwaitingConfirmation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.BroadcastAwaitingConfirmation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.BroadcastAwaitingConfirmation} BroadcastAwaitingConfirmation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BroadcastAwaitingConfirmation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BroadcastAwaitingConfirmation message. + * @function verify + * @memberof types.BroadcastAwaitingConfirmation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BroadcastAwaitingConfirmation.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.channel_id != null && message.hasOwnProperty("channel_id")) { + properties._channel_id = 1; + if (!$util.isString(message.channel_id)) + return "channel_id: string expected"; + } + if (message.latest_broadcast_height != null && message.hasOwnProperty("latest_broadcast_height")) + if (!$util.isInteger(message.latest_broadcast_height)) + return "latest_broadcast_height: integer expected"; + if (message.latest_spending_txid != null && message.hasOwnProperty("latest_spending_txid")) + if (!$util.isString(message.latest_spending_txid)) + return "latest_spending_txid: string expected"; + if (message.amount_satoshis != null && message.hasOwnProperty("amount_satoshis")) + if (!$util.isInteger(message.amount_satoshis) && !(message.amount_satoshis && $util.isInteger(message.amount_satoshis.low) && $util.isInteger(message.amount_satoshis.high))) + return "amount_satoshis: integer|Long expected"; + return null; + }; + + /** + * Creates a BroadcastAwaitingConfirmation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.BroadcastAwaitingConfirmation + * @static + * @param {Object.} object Plain object + * @returns {types.BroadcastAwaitingConfirmation} BroadcastAwaitingConfirmation + */ + BroadcastAwaitingConfirmation.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.BroadcastAwaitingConfirmation) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.BroadcastAwaitingConfirmation(); + if (object.channel_id != null) + message.channel_id = String(object.channel_id); + if (object.latest_broadcast_height != null) + message.latest_broadcast_height = object.latest_broadcast_height >>> 0; + if (object.latest_spending_txid != null) + message.latest_spending_txid = String(object.latest_spending_txid); + if (object.amount_satoshis != null) + if ($util.Long) + (message.amount_satoshis = $util.Long.fromValue(object.amount_satoshis)).unsigned = true; + else if (typeof object.amount_satoshis === "string") + message.amount_satoshis = parseInt(object.amount_satoshis, 10); + else if (typeof object.amount_satoshis === "number") + message.amount_satoshis = object.amount_satoshis; + else if (typeof object.amount_satoshis === "object") + message.amount_satoshis = new $util.LongBits(object.amount_satoshis.low >>> 0, object.amount_satoshis.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a BroadcastAwaitingConfirmation message. Also converts values to other types if specified. + * @function toObject + * @memberof types.BroadcastAwaitingConfirmation + * @static + * @param {types.BroadcastAwaitingConfirmation} message BroadcastAwaitingConfirmation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BroadcastAwaitingConfirmation.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.latest_broadcast_height = 0; + object.latest_spending_txid = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.amount_satoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.amount_satoshis = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + } + if (message.channel_id != null && message.hasOwnProperty("channel_id")) { + object.channel_id = message.channel_id; + if (options.oneofs) + object._channel_id = "channel_id"; + } + if (message.latest_broadcast_height != null && message.hasOwnProperty("latest_broadcast_height")) + object.latest_broadcast_height = message.latest_broadcast_height; + if (message.latest_spending_txid != null && message.hasOwnProperty("latest_spending_txid")) + object.latest_spending_txid = message.latest_spending_txid; + if (message.amount_satoshis != null && message.hasOwnProperty("amount_satoshis")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_satoshis = typeof message.amount_satoshis === "number" ? BigInt(message.amount_satoshis) : $util.Long.fromBits(message.amount_satoshis.low >>> 0, message.amount_satoshis.high >>> 0, true).toBigInt(); + else if (typeof message.amount_satoshis === "number") + object.amount_satoshis = options.longs === String ? String(message.amount_satoshis) : message.amount_satoshis; + else + object.amount_satoshis = options.longs === String ? $util.Long.prototype.toString.call(message.amount_satoshis) : options.longs === Number ? new $util.LongBits(message.amount_satoshis.low >>> 0, message.amount_satoshis.high >>> 0).toNumber(true) : message.amount_satoshis; + return object; + }; + + /** + * Converts this BroadcastAwaitingConfirmation to JSON. + * @function toJSON + * @memberof types.BroadcastAwaitingConfirmation + * @instance + * @returns {Object.} JSON object + */ + BroadcastAwaitingConfirmation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BroadcastAwaitingConfirmation + * @function getTypeUrl + * @memberof types.BroadcastAwaitingConfirmation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BroadcastAwaitingConfirmation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.BroadcastAwaitingConfirmation"; + }; + + return BroadcastAwaitingConfirmation; + })(); + + types.AwaitingThresholdConfirmations = (function() { + + /** + * Properties of an AwaitingThresholdConfirmations. + * @memberof types + * @interface IAwaitingThresholdConfirmations + * @property {string|null} [channel_id] AwaitingThresholdConfirmations channel_id + * @property {string|null} [latest_spending_txid] AwaitingThresholdConfirmations latest_spending_txid + * @property {string|null} [confirmation_hash] AwaitingThresholdConfirmations confirmation_hash + * @property {number|null} [confirmation_height] AwaitingThresholdConfirmations confirmation_height + * @property {Long|null} [amount_satoshis] AwaitingThresholdConfirmations amount_satoshis + */ + + /** + * Constructs a new AwaitingThresholdConfirmations. + * @memberof types + * @classdesc Represents an AwaitingThresholdConfirmations. + * @implements IAwaitingThresholdConfirmations + * @constructor + * @param {types.IAwaitingThresholdConfirmations=} [properties] Properties to set + */ + function AwaitingThresholdConfirmations(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwaitingThresholdConfirmations channel_id. + * @member {string|null|undefined} channel_id + * @memberof types.AwaitingThresholdConfirmations + * @instance + */ + AwaitingThresholdConfirmations.prototype.channel_id = null; + + /** + * AwaitingThresholdConfirmations latest_spending_txid. + * @member {string} latest_spending_txid + * @memberof types.AwaitingThresholdConfirmations + * @instance + */ + AwaitingThresholdConfirmations.prototype.latest_spending_txid = ""; + + /** + * AwaitingThresholdConfirmations confirmation_hash. + * @member {string} confirmation_hash + * @memberof types.AwaitingThresholdConfirmations + * @instance + */ + AwaitingThresholdConfirmations.prototype.confirmation_hash = ""; + + /** + * AwaitingThresholdConfirmations confirmation_height. + * @member {number} confirmation_height + * @memberof types.AwaitingThresholdConfirmations + * @instance + */ + AwaitingThresholdConfirmations.prototype.confirmation_height = 0; + + /** + * AwaitingThresholdConfirmations amount_satoshis. + * @member {Long} amount_satoshis + * @memberof types.AwaitingThresholdConfirmations + * @instance + */ + AwaitingThresholdConfirmations.prototype.amount_satoshis = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AwaitingThresholdConfirmations.prototype, "_channel_id", { + get: $util.oneOfGetter($oneOfFields = ["channel_id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AwaitingThresholdConfirmations instance using the specified properties. + * @function create + * @memberof types.AwaitingThresholdConfirmations + * @static + * @param {types.IAwaitingThresholdConfirmations=} [properties] Properties to set + * @returns {types.AwaitingThresholdConfirmations} AwaitingThresholdConfirmations instance + */ + AwaitingThresholdConfirmations.create = function create(properties) { + return new AwaitingThresholdConfirmations(properties); + }; + + /** + * Encodes the specified AwaitingThresholdConfirmations message. Does not implicitly {@link types.AwaitingThresholdConfirmations.verify|verify} messages. + * @function encode + * @memberof types.AwaitingThresholdConfirmations + * @static + * @param {types.IAwaitingThresholdConfirmations} message AwaitingThresholdConfirmations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwaitingThresholdConfirmations.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); + if (message.latest_spending_txid != null && Object.hasOwnProperty.call(message, "latest_spending_txid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.latest_spending_txid); + if (message.confirmation_hash != null && Object.hasOwnProperty.call(message, "confirmation_hash")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.confirmation_hash); + if (message.confirmation_height != null && Object.hasOwnProperty.call(message, "confirmation_height")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.confirmation_height); + if (message.amount_satoshis != null && Object.hasOwnProperty.call(message, "amount_satoshis")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.amount_satoshis); + return writer; + }; + + /** + * Encodes the specified AwaitingThresholdConfirmations message, length delimited. Does not implicitly {@link types.AwaitingThresholdConfirmations.verify|verify} messages. + * @function encodeDelimited + * @memberof types.AwaitingThresholdConfirmations + * @static + * @param {types.IAwaitingThresholdConfirmations} message AwaitingThresholdConfirmations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwaitingThresholdConfirmations.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AwaitingThresholdConfirmations message from the specified reader or buffer. + * @function decode + * @memberof types.AwaitingThresholdConfirmations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.AwaitingThresholdConfirmations} AwaitingThresholdConfirmations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwaitingThresholdConfirmations.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.AwaitingThresholdConfirmations(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.channel_id = reader.string(); + break; + } + case 2: { + message.latest_spending_txid = reader.string(); + break; + } + case 3: { + message.confirmation_hash = reader.string(); + break; + } + case 4: { + message.confirmation_height = reader.uint32(); + break; + } + case 5: { + message.amount_satoshis = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an AwaitingThresholdConfirmations message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.AwaitingThresholdConfirmations + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.AwaitingThresholdConfirmations} AwaitingThresholdConfirmations + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AwaitingThresholdConfirmations.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AwaitingThresholdConfirmations message. + * @function verify + * @memberof types.AwaitingThresholdConfirmations + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AwaitingThresholdConfirmations.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.channel_id != null && message.hasOwnProperty("channel_id")) { + properties._channel_id = 1; + if (!$util.isString(message.channel_id)) + return "channel_id: string expected"; + } + if (message.latest_spending_txid != null && message.hasOwnProperty("latest_spending_txid")) + if (!$util.isString(message.latest_spending_txid)) + return "latest_spending_txid: string expected"; + if (message.confirmation_hash != null && message.hasOwnProperty("confirmation_hash")) + if (!$util.isString(message.confirmation_hash)) + return "confirmation_hash: string expected"; + if (message.confirmation_height != null && message.hasOwnProperty("confirmation_height")) + if (!$util.isInteger(message.confirmation_height)) + return "confirmation_height: integer expected"; + if (message.amount_satoshis != null && message.hasOwnProperty("amount_satoshis")) + if (!$util.isInteger(message.amount_satoshis) && !(message.amount_satoshis && $util.isInteger(message.amount_satoshis.low) && $util.isInteger(message.amount_satoshis.high))) + return "amount_satoshis: integer|Long expected"; + return null; + }; + + /** + * Creates an AwaitingThresholdConfirmations message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.AwaitingThresholdConfirmations + * @static + * @param {Object.} object Plain object + * @returns {types.AwaitingThresholdConfirmations} AwaitingThresholdConfirmations + */ + AwaitingThresholdConfirmations.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.AwaitingThresholdConfirmations) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.AwaitingThresholdConfirmations(); + if (object.channel_id != null) + message.channel_id = String(object.channel_id); + if (object.latest_spending_txid != null) + message.latest_spending_txid = String(object.latest_spending_txid); + if (object.confirmation_hash != null) + message.confirmation_hash = String(object.confirmation_hash); + if (object.confirmation_height != null) + message.confirmation_height = object.confirmation_height >>> 0; + if (object.amount_satoshis != null) + if ($util.Long) + (message.amount_satoshis = $util.Long.fromValue(object.amount_satoshis)).unsigned = true; + else if (typeof object.amount_satoshis === "string") + message.amount_satoshis = parseInt(object.amount_satoshis, 10); + else if (typeof object.amount_satoshis === "number") + message.amount_satoshis = object.amount_satoshis; + else if (typeof object.amount_satoshis === "object") + message.amount_satoshis = new $util.LongBits(object.amount_satoshis.low >>> 0, object.amount_satoshis.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from an AwaitingThresholdConfirmations message. Also converts values to other types if specified. + * @function toObject + * @memberof types.AwaitingThresholdConfirmations + * @static + * @param {types.AwaitingThresholdConfirmations} message AwaitingThresholdConfirmations + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AwaitingThresholdConfirmations.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.latest_spending_txid = ""; + object.confirmation_hash = ""; + object.confirmation_height = 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.amount_satoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.amount_satoshis = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + } + if (message.channel_id != null && message.hasOwnProperty("channel_id")) { + object.channel_id = message.channel_id; + if (options.oneofs) + object._channel_id = "channel_id"; + } + if (message.latest_spending_txid != null && message.hasOwnProperty("latest_spending_txid")) + object.latest_spending_txid = message.latest_spending_txid; + if (message.confirmation_hash != null && message.hasOwnProperty("confirmation_hash")) + object.confirmation_hash = message.confirmation_hash; + if (message.confirmation_height != null && message.hasOwnProperty("confirmation_height")) + object.confirmation_height = message.confirmation_height; + if (message.amount_satoshis != null && message.hasOwnProperty("amount_satoshis")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount_satoshis = typeof message.amount_satoshis === "number" ? BigInt(message.amount_satoshis) : $util.Long.fromBits(message.amount_satoshis.low >>> 0, message.amount_satoshis.high >>> 0, true).toBigInt(); + else if (typeof message.amount_satoshis === "number") + object.amount_satoshis = options.longs === String ? String(message.amount_satoshis) : message.amount_satoshis; + else + object.amount_satoshis = options.longs === String ? $util.Long.prototype.toString.call(message.amount_satoshis) : options.longs === Number ? new $util.LongBits(message.amount_satoshis.low >>> 0, message.amount_satoshis.high >>> 0).toNumber(true) : message.amount_satoshis; + return object; + }; + + /** + * Converts this AwaitingThresholdConfirmations to JSON. + * @function toJSON + * @memberof types.AwaitingThresholdConfirmations + * @instance + * @returns {Object.} JSON object + */ + AwaitingThresholdConfirmations.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AwaitingThresholdConfirmations + * @function getTypeUrl + * @memberof types.AwaitingThresholdConfirmations + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwaitingThresholdConfirmations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.AwaitingThresholdConfirmations"; + }; + + return AwaitingThresholdConfirmations; + })(); + + types.PageToken = (function() { + + /** + * Properties of a PageToken. + * @memberof types + * @interface IPageToken + * @property {string|null} [token] PageToken token + * @property {Long|null} [index] PageToken index + */ + + /** + * Constructs a new PageToken. + * @memberof types + * @classdesc Represents a PageToken. + * @implements IPageToken + * @constructor + * @param {types.IPageToken=} [properties] Properties to set + */ + function PageToken(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PageToken token. + * @member {string} token + * @memberof types.PageToken + * @instance + */ + PageToken.prototype.token = ""; + + /** + * PageToken index. + * @member {Long} index + * @memberof types.PageToken + * @instance + */ + PageToken.prototype.index = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PageToken instance using the specified properties. + * @function create + * @memberof types.PageToken + * @static + * @param {types.IPageToken=} [properties] Properties to set + * @returns {types.PageToken} PageToken instance + */ + PageToken.create = function create(properties) { + return new PageToken(properties); + }; + + /** + * Encodes the specified PageToken message. Does not implicitly {@link types.PageToken.verify|verify} messages. + * @function encode + * @memberof types.PageToken + * @static + * @param {types.IPageToken} message PageToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageToken.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.index); + return writer; + }; + + /** + * Encodes the specified PageToken message, length delimited. Does not implicitly {@link types.PageToken.verify|verify} messages. + * @function encodeDelimited + * @memberof types.PageToken + * @static + * @param {types.IPageToken} message PageToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageToken.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PageToken message from the specified reader or buffer. + * @function decode + * @memberof types.PageToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.PageToken} PageToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageToken.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.PageToken(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.token = reader.string(); + break; + } + case 2: { + message.index = reader.int64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PageToken message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.PageToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.PageToken} PageToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageToken.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PageToken message. + * @function verify + * @memberof types.PageToken + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PageToken.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.token != null && message.hasOwnProperty("token")) + if (!$util.isString(message.token)) + return "token: string expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) + return "index: integer|Long expected"; + return null; + }; + + /** + * Creates a PageToken message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.PageToken + * @static + * @param {Object.} object Plain object + * @returns {types.PageToken} PageToken + */ + PageToken.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.PageToken) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.PageToken(); + if (object.token != null) + message.token = String(object.token); + if (object.index != null) + if ($util.Long) + (message.index = $util.Long.fromValue(object.index)).unsigned = false; + else if (typeof object.index === "string") + message.index = parseInt(object.index, 10); + else if (typeof object.index === "number") + message.index = object.index; + else if (typeof object.index === "object") + message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a PageToken message. Also converts values to other types if specified. + * @function toObject + * @memberof types.PageToken + * @static + * @param {types.PageToken} message PageToken + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PageToken.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.token = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.index = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + } + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + if (message.index != null && message.hasOwnProperty("index")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.index = typeof message.index === "number" ? BigInt(message.index) : $util.Long.fromBits(message.index.low >>> 0, message.index.high >>> 0, false).toBigInt(); + else if (typeof message.index === "number") + object.index = options.longs === String ? String(message.index) : message.index; + else + object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; + return object; + }; + + /** + * Converts this PageToken to JSON. + * @function toJSON + * @memberof types.PageToken + * @instance + * @returns {Object.} JSON object + */ + PageToken.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PageToken + * @function getTypeUrl + * @memberof types.PageToken + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PageToken.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.PageToken"; + }; + + return PageToken; + })(); + + types.Bolt11InvoiceDescription = (function() { + + /** + * Properties of a Bolt11InvoiceDescription. + * @memberof types + * @interface IBolt11InvoiceDescription + * @property {string|null} [direct] Bolt11InvoiceDescription direct + * @property {string|null} [hash] Bolt11InvoiceDescription hash + */ + + /** + * Constructs a new Bolt11InvoiceDescription. + * @memberof types + * @classdesc Represents a Bolt11InvoiceDescription. + * @implements IBolt11InvoiceDescription + * @constructor + * @param {types.IBolt11InvoiceDescription=} [properties] Properties to set + */ + function Bolt11InvoiceDescription(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11InvoiceDescription direct. + * @member {string|null|undefined} direct + * @memberof types.Bolt11InvoiceDescription + * @instance + */ + Bolt11InvoiceDescription.prototype.direct = null; + + /** + * Bolt11InvoiceDescription hash. + * @member {string|null|undefined} hash + * @memberof types.Bolt11InvoiceDescription + * @instance + */ + Bolt11InvoiceDescription.prototype.hash = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * Bolt11InvoiceDescription kind. + * @member {"direct"|"hash"|undefined} kind + * @memberof types.Bolt11InvoiceDescription + * @instance + */ + Object.defineProperty(Bolt11InvoiceDescription.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["direct", "hash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt11InvoiceDescription instance using the specified properties. + * @function create + * @memberof types.Bolt11InvoiceDescription + * @static + * @param {types.IBolt11InvoiceDescription=} [properties] Properties to set + * @returns {types.Bolt11InvoiceDescription} Bolt11InvoiceDescription instance + */ + Bolt11InvoiceDescription.create = function create(properties) { + return new Bolt11InvoiceDescription(properties); + }; + + /** + * Encodes the specified Bolt11InvoiceDescription message. Does not implicitly {@link types.Bolt11InvoiceDescription.verify|verify} messages. + * @function encode + * @memberof types.Bolt11InvoiceDescription + * @static + * @param {types.IBolt11InvoiceDescription} message Bolt11InvoiceDescription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11InvoiceDescription.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.direct != null && Object.hasOwnProperty.call(message, "direct")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.direct); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.hash); + return writer; + }; + + /** + * Encodes the specified Bolt11InvoiceDescription message, length delimited. Does not implicitly {@link types.Bolt11InvoiceDescription.verify|verify} messages. + * @function encodeDelimited + * @memberof types.Bolt11InvoiceDescription + * @static + * @param {types.IBolt11InvoiceDescription} message Bolt11InvoiceDescription message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11InvoiceDescription.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11InvoiceDescription message from the specified reader or buffer. + * @function decode + * @memberof types.Bolt11InvoiceDescription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.Bolt11InvoiceDescription} Bolt11InvoiceDescription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11InvoiceDescription.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Bolt11InvoiceDescription(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.direct = reader.string(); + break; + } + case 2: { + message.hash = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11InvoiceDescription message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.Bolt11InvoiceDescription + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.Bolt11InvoiceDescription} Bolt11InvoiceDescription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11InvoiceDescription.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11InvoiceDescription message. + * @function verify + * @memberof types.Bolt11InvoiceDescription + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11InvoiceDescription.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.direct != null && message.hasOwnProperty("direct")) { + properties.kind = 1; + if (!$util.isString(message.direct)) + return "direct: string expected"; + } + if (message.hash != null && message.hasOwnProperty("hash")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.hash)) + return "hash: string expected"; + } + return null; + }; + + /** + * Creates a Bolt11InvoiceDescription message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Bolt11InvoiceDescription + * @static + * @param {Object.} object Plain object + * @returns {types.Bolt11InvoiceDescription} Bolt11InvoiceDescription + */ + Bolt11InvoiceDescription.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.Bolt11InvoiceDescription) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.Bolt11InvoiceDescription(); + if (object.direct != null) + message.direct = String(object.direct); + if (object.hash != null) + message.hash = String(object.hash); + return message; + }; + + /** + * Creates a plain object from a Bolt11InvoiceDescription message. Also converts values to other types if specified. + * @function toObject + * @memberof types.Bolt11InvoiceDescription + * @static + * @param {types.Bolt11InvoiceDescription} message Bolt11InvoiceDescription + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11InvoiceDescription.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.direct != null && message.hasOwnProperty("direct")) { + object.direct = message.direct; + if (options.oneofs) + object.kind = "direct"; + } + if (message.hash != null && message.hasOwnProperty("hash")) { + object.hash = message.hash; + if (options.oneofs) + object.kind = "hash"; + } + return object; + }; + + /** + * Converts this Bolt11InvoiceDescription to JSON. + * @function toJSON + * @memberof types.Bolt11InvoiceDescription + * @instance + * @returns {Object.} JSON object + */ + Bolt11InvoiceDescription.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11InvoiceDescription + * @function getTypeUrl + * @memberof types.Bolt11InvoiceDescription + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11InvoiceDescription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Bolt11InvoiceDescription"; + }; + + return Bolt11InvoiceDescription; + })(); + + types.RouteParametersConfig = (function() { + + /** + * Properties of a RouteParametersConfig. + * @memberof types + * @interface IRouteParametersConfig + * @property {Long|null} [max_total_routing_fee_msat] RouteParametersConfig max_total_routing_fee_msat + * @property {number|null} [max_total_cltv_expiry_delta] RouteParametersConfig max_total_cltv_expiry_delta + * @property {number|null} [max_path_count] RouteParametersConfig max_path_count + * @property {number|null} [max_channel_saturation_power_of_half] RouteParametersConfig max_channel_saturation_power_of_half + */ + + /** + * Constructs a new RouteParametersConfig. + * @memberof types + * @classdesc Represents a RouteParametersConfig. + * @implements IRouteParametersConfig + * @constructor + * @param {types.IRouteParametersConfig=} [properties] Properties to set + */ + function RouteParametersConfig(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteParametersConfig max_total_routing_fee_msat. + * @member {Long|null|undefined} max_total_routing_fee_msat + * @memberof types.RouteParametersConfig + * @instance + */ + RouteParametersConfig.prototype.max_total_routing_fee_msat = null; + + /** + * RouteParametersConfig max_total_cltv_expiry_delta. + * @member {number} max_total_cltv_expiry_delta + * @memberof types.RouteParametersConfig + * @instance + */ + RouteParametersConfig.prototype.max_total_cltv_expiry_delta = 0; + + /** + * RouteParametersConfig max_path_count. + * @member {number} max_path_count + * @memberof types.RouteParametersConfig + * @instance + */ + RouteParametersConfig.prototype.max_path_count = 0; + + /** + * RouteParametersConfig max_channel_saturation_power_of_half. + * @member {number} max_channel_saturation_power_of_half + * @memberof types.RouteParametersConfig + * @instance + */ + RouteParametersConfig.prototype.max_channel_saturation_power_of_half = 0; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RouteParametersConfig.prototype, "_max_total_routing_fee_msat", { + get: $util.oneOfGetter($oneOfFields = ["max_total_routing_fee_msat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouteParametersConfig instance using the specified properties. + * @function create + * @memberof types.RouteParametersConfig + * @static + * @param {types.IRouteParametersConfig=} [properties] Properties to set + * @returns {types.RouteParametersConfig} RouteParametersConfig instance + */ + RouteParametersConfig.create = function create(properties) { + return new RouteParametersConfig(properties); + }; + + /** + * Encodes the specified RouteParametersConfig message. Does not implicitly {@link types.RouteParametersConfig.verify|verify} messages. + * @function encode + * @memberof types.RouteParametersConfig + * @static + * @param {types.IRouteParametersConfig} message RouteParametersConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteParametersConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.max_total_routing_fee_msat != null && Object.hasOwnProperty.call(message, "max_total_routing_fee_msat")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.max_total_routing_fee_msat); + if (message.max_total_cltv_expiry_delta != null && Object.hasOwnProperty.call(message, "max_total_cltv_expiry_delta")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.max_total_cltv_expiry_delta); + if (message.max_path_count != null && Object.hasOwnProperty.call(message, "max_path_count")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.max_path_count); + if (message.max_channel_saturation_power_of_half != null && Object.hasOwnProperty.call(message, "max_channel_saturation_power_of_half")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.max_channel_saturation_power_of_half); + return writer; + }; + + /** + * Encodes the specified RouteParametersConfig message, length delimited. Does not implicitly {@link types.RouteParametersConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof types.RouteParametersConfig + * @static + * @param {types.IRouteParametersConfig} message RouteParametersConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteParametersConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteParametersConfig message from the specified reader or buffer. + * @function decode + * @memberof types.RouteParametersConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.RouteParametersConfig} RouteParametersConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteParametersConfig.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.RouteParametersConfig(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.max_total_routing_fee_msat = reader.uint64(); + break; + } + case 2: { + message.max_total_cltv_expiry_delta = reader.uint32(); + break; + } + case 3: { + message.max_path_count = reader.uint32(); + break; + } + case 4: { + message.max_channel_saturation_power_of_half = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a RouteParametersConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.RouteParametersConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.RouteParametersConfig} RouteParametersConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteParametersConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteParametersConfig message. + * @function verify + * @memberof types.RouteParametersConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteParametersConfig.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.max_total_routing_fee_msat != null && message.hasOwnProperty("max_total_routing_fee_msat")) { + properties._max_total_routing_fee_msat = 1; + if (!$util.isInteger(message.max_total_routing_fee_msat) && !(message.max_total_routing_fee_msat && $util.isInteger(message.max_total_routing_fee_msat.low) && $util.isInteger(message.max_total_routing_fee_msat.high))) + return "max_total_routing_fee_msat: integer|Long expected"; + } + if (message.max_total_cltv_expiry_delta != null && message.hasOwnProperty("max_total_cltv_expiry_delta")) + if (!$util.isInteger(message.max_total_cltv_expiry_delta)) + return "max_total_cltv_expiry_delta: integer expected"; + if (message.max_path_count != null && message.hasOwnProperty("max_path_count")) + if (!$util.isInteger(message.max_path_count)) + return "max_path_count: integer expected"; + if (message.max_channel_saturation_power_of_half != null && message.hasOwnProperty("max_channel_saturation_power_of_half")) + if (!$util.isInteger(message.max_channel_saturation_power_of_half)) + return "max_channel_saturation_power_of_half: integer expected"; + return null; + }; + + /** + * Creates a RouteParametersConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.RouteParametersConfig + * @static + * @param {Object.} object Plain object + * @returns {types.RouteParametersConfig} RouteParametersConfig + */ + RouteParametersConfig.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.RouteParametersConfig) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.RouteParametersConfig(); + if (object.max_total_routing_fee_msat != null) + if ($util.Long) + (message.max_total_routing_fee_msat = $util.Long.fromValue(object.max_total_routing_fee_msat)).unsigned = true; + else if (typeof object.max_total_routing_fee_msat === "string") + message.max_total_routing_fee_msat = parseInt(object.max_total_routing_fee_msat, 10); + else if (typeof object.max_total_routing_fee_msat === "number") + message.max_total_routing_fee_msat = object.max_total_routing_fee_msat; + else if (typeof object.max_total_routing_fee_msat === "object") + message.max_total_routing_fee_msat = new $util.LongBits(object.max_total_routing_fee_msat.low >>> 0, object.max_total_routing_fee_msat.high >>> 0).toNumber(true); + if (object.max_total_cltv_expiry_delta != null) + message.max_total_cltv_expiry_delta = object.max_total_cltv_expiry_delta >>> 0; + if (object.max_path_count != null) + message.max_path_count = object.max_path_count >>> 0; + if (object.max_channel_saturation_power_of_half != null) + message.max_channel_saturation_power_of_half = object.max_channel_saturation_power_of_half >>> 0; + return message; + }; + + /** + * Creates a plain object from a RouteParametersConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof types.RouteParametersConfig + * @static + * @param {types.RouteParametersConfig} message RouteParametersConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteParametersConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.max_total_cltv_expiry_delta = 0; + object.max_path_count = 0; + object.max_channel_saturation_power_of_half = 0; + } + if (message.max_total_routing_fee_msat != null && message.hasOwnProperty("max_total_routing_fee_msat")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.max_total_routing_fee_msat = typeof message.max_total_routing_fee_msat === "number" ? BigInt(message.max_total_routing_fee_msat) : $util.Long.fromBits(message.max_total_routing_fee_msat.low >>> 0, message.max_total_routing_fee_msat.high >>> 0, true).toBigInt(); + else if (typeof message.max_total_routing_fee_msat === "number") + object.max_total_routing_fee_msat = options.longs === String ? String(message.max_total_routing_fee_msat) : message.max_total_routing_fee_msat; + else + object.max_total_routing_fee_msat = options.longs === String ? $util.Long.prototype.toString.call(message.max_total_routing_fee_msat) : options.longs === Number ? new $util.LongBits(message.max_total_routing_fee_msat.low >>> 0, message.max_total_routing_fee_msat.high >>> 0).toNumber(true) : message.max_total_routing_fee_msat; + if (options.oneofs) + object._max_total_routing_fee_msat = "max_total_routing_fee_msat"; + } + if (message.max_total_cltv_expiry_delta != null && message.hasOwnProperty("max_total_cltv_expiry_delta")) + object.max_total_cltv_expiry_delta = message.max_total_cltv_expiry_delta; + if (message.max_path_count != null && message.hasOwnProperty("max_path_count")) + object.max_path_count = message.max_path_count; + if (message.max_channel_saturation_power_of_half != null && message.hasOwnProperty("max_channel_saturation_power_of_half")) + object.max_channel_saturation_power_of_half = message.max_channel_saturation_power_of_half; + return object; + }; + + /** + * Converts this RouteParametersConfig to JSON. + * @function toJSON + * @memberof types.RouteParametersConfig + * @instance + * @returns {Object.} JSON object + */ + RouteParametersConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteParametersConfig + * @function getTypeUrl + * @memberof types.RouteParametersConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteParametersConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.RouteParametersConfig"; + }; + + return RouteParametersConfig; + })(); + + types.GraphRoutingFees = (function() { + + /** + * Properties of a GraphRoutingFees. + * @memberof types + * @interface IGraphRoutingFees + * @property {number|null} [base_msat] GraphRoutingFees base_msat + * @property {number|null} [proportional_millionths] GraphRoutingFees proportional_millionths + */ + + /** + * Constructs a new GraphRoutingFees. + * @memberof types + * @classdesc Represents a GraphRoutingFees. + * @implements IGraphRoutingFees + * @constructor + * @param {types.IGraphRoutingFees=} [properties] Properties to set + */ + function GraphRoutingFees(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphRoutingFees base_msat. + * @member {number} base_msat + * @memberof types.GraphRoutingFees + * @instance + */ + GraphRoutingFees.prototype.base_msat = 0; + + /** + * GraphRoutingFees proportional_millionths. + * @member {number} proportional_millionths + * @memberof types.GraphRoutingFees + * @instance + */ + GraphRoutingFees.prototype.proportional_millionths = 0; + + /** + * Creates a new GraphRoutingFees instance using the specified properties. + * @function create + * @memberof types.GraphRoutingFees + * @static + * @param {types.IGraphRoutingFees=} [properties] Properties to set + * @returns {types.GraphRoutingFees} GraphRoutingFees instance + */ + GraphRoutingFees.create = function create(properties) { + return new GraphRoutingFees(properties); + }; + + /** + * Encodes the specified GraphRoutingFees message. Does not implicitly {@link types.GraphRoutingFees.verify|verify} messages. + * @function encode + * @memberof types.GraphRoutingFees + * @static + * @param {types.IGraphRoutingFees} message GraphRoutingFees message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphRoutingFees.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.base_msat != null && Object.hasOwnProperty.call(message, "base_msat")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.base_msat); + if (message.proportional_millionths != null && Object.hasOwnProperty.call(message, "proportional_millionths")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.proportional_millionths); + return writer; + }; + + /** + * Encodes the specified GraphRoutingFees message, length delimited. Does not implicitly {@link types.GraphRoutingFees.verify|verify} messages. + * @function encodeDelimited + * @memberof types.GraphRoutingFees + * @static + * @param {types.IGraphRoutingFees} message GraphRoutingFees message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphRoutingFees.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GraphRoutingFees message from the specified reader or buffer. + * @function decode + * @memberof types.GraphRoutingFees + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.GraphRoutingFees} GraphRoutingFees + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphRoutingFees.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.GraphRoutingFees(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.base_msat = reader.uint32(); + break; + } + case 2: { + message.proportional_millionths = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GraphRoutingFees message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.GraphRoutingFees + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.GraphRoutingFees} GraphRoutingFees + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphRoutingFees.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GraphRoutingFees message. + * @function verify + * @memberof types.GraphRoutingFees + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GraphRoutingFees.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.base_msat != null && message.hasOwnProperty("base_msat")) + if (!$util.isInteger(message.base_msat)) + return "base_msat: integer expected"; + if (message.proportional_millionths != null && message.hasOwnProperty("proportional_millionths")) + if (!$util.isInteger(message.proportional_millionths)) + return "proportional_millionths: integer expected"; + return null; + }; + + /** + * Creates a GraphRoutingFees message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.GraphRoutingFees + * @static + * @param {Object.} object Plain object + * @returns {types.GraphRoutingFees} GraphRoutingFees + */ + GraphRoutingFees.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.GraphRoutingFees) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.GraphRoutingFees(); + if (object.base_msat != null) + message.base_msat = object.base_msat >>> 0; + if (object.proportional_millionths != null) + message.proportional_millionths = object.proportional_millionths >>> 0; + return message; + }; + + /** + * Creates a plain object from a GraphRoutingFees message. Also converts values to other types if specified. + * @function toObject + * @memberof types.GraphRoutingFees + * @static + * @param {types.GraphRoutingFees} message GraphRoutingFees + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GraphRoutingFees.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.base_msat = 0; + object.proportional_millionths = 0; + } + if (message.base_msat != null && message.hasOwnProperty("base_msat")) + object.base_msat = message.base_msat; + if (message.proportional_millionths != null && message.hasOwnProperty("proportional_millionths")) + object.proportional_millionths = message.proportional_millionths; + return object; + }; + + /** + * Converts this GraphRoutingFees to JSON. + * @function toJSON + * @memberof types.GraphRoutingFees + * @instance + * @returns {Object.} JSON object + */ + GraphRoutingFees.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GraphRoutingFees + * @function getTypeUrl + * @memberof types.GraphRoutingFees + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphRoutingFees.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.GraphRoutingFees"; + }; + + return GraphRoutingFees; + })(); + + types.GraphChannelUpdate = (function() { + + /** + * Properties of a GraphChannelUpdate. + * @memberof types + * @interface IGraphChannelUpdate + * @property {number|null} [last_update] GraphChannelUpdate last_update + * @property {boolean|null} [enabled] GraphChannelUpdate enabled + * @property {number|null} [cltv_expiry_delta] GraphChannelUpdate cltv_expiry_delta + * @property {Long|null} [htlc_minimum_msat] GraphChannelUpdate htlc_minimum_msat + * @property {Long|null} [htlc_maximum_msat] GraphChannelUpdate htlc_maximum_msat + * @property {types.IGraphRoutingFees|null} [fees] GraphChannelUpdate fees + */ + + /** + * Constructs a new GraphChannelUpdate. + * @memberof types + * @classdesc Represents a GraphChannelUpdate. + * @implements IGraphChannelUpdate + * @constructor + * @param {types.IGraphChannelUpdate=} [properties] Properties to set + */ + function GraphChannelUpdate(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphChannelUpdate last_update. + * @member {number} last_update + * @memberof types.GraphChannelUpdate + * @instance + */ + GraphChannelUpdate.prototype.last_update = 0; + + /** + * GraphChannelUpdate enabled. + * @member {boolean} enabled + * @memberof types.GraphChannelUpdate + * @instance + */ + GraphChannelUpdate.prototype.enabled = false; + + /** + * GraphChannelUpdate cltv_expiry_delta. + * @member {number} cltv_expiry_delta + * @memberof types.GraphChannelUpdate + * @instance + */ + GraphChannelUpdate.prototype.cltv_expiry_delta = 0; + + /** + * GraphChannelUpdate htlc_minimum_msat. + * @member {Long} htlc_minimum_msat + * @memberof types.GraphChannelUpdate + * @instance + */ + GraphChannelUpdate.prototype.htlc_minimum_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GraphChannelUpdate htlc_maximum_msat. + * @member {Long} htlc_maximum_msat + * @memberof types.GraphChannelUpdate + * @instance + */ + GraphChannelUpdate.prototype.htlc_maximum_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GraphChannelUpdate fees. + * @member {types.IGraphRoutingFees|null|undefined} fees + * @memberof types.GraphChannelUpdate + * @instance + */ + GraphChannelUpdate.prototype.fees = null; + + /** + * Creates a new GraphChannelUpdate instance using the specified properties. + * @function create + * @memberof types.GraphChannelUpdate + * @static + * @param {types.IGraphChannelUpdate=} [properties] Properties to set + * @returns {types.GraphChannelUpdate} GraphChannelUpdate instance + */ + GraphChannelUpdate.create = function create(properties) { + return new GraphChannelUpdate(properties); + }; + + /** + * Encodes the specified GraphChannelUpdate message. Does not implicitly {@link types.GraphChannelUpdate.verify|verify} messages. + * @function encode + * @memberof types.GraphChannelUpdate + * @static + * @param {types.IGraphChannelUpdate} message GraphChannelUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphChannelUpdate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.last_update != null && Object.hasOwnProperty.call(message, "last_update")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.last_update); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enabled); + if (message.cltv_expiry_delta != null && Object.hasOwnProperty.call(message, "cltv_expiry_delta")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.cltv_expiry_delta); + if (message.htlc_minimum_msat != null && Object.hasOwnProperty.call(message, "htlc_minimum_msat")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.htlc_minimum_msat); + if (message.htlc_maximum_msat != null && Object.hasOwnProperty.call(message, "htlc_maximum_msat")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.htlc_maximum_msat); + if (message.fees != null && Object.hasOwnProperty.call(message, "fees")) + $root.types.GraphRoutingFees.encode(message.fees, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GraphChannelUpdate message, length delimited. Does not implicitly {@link types.GraphChannelUpdate.verify|verify} messages. + * @function encodeDelimited + * @memberof types.GraphChannelUpdate + * @static + * @param {types.IGraphChannelUpdate} message GraphChannelUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphChannelUpdate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GraphChannelUpdate message from the specified reader or buffer. + * @function decode + * @memberof types.GraphChannelUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.GraphChannelUpdate} GraphChannelUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphChannelUpdate.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.GraphChannelUpdate(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.last_update = reader.uint32(); + break; + } + case 2: { + message.enabled = reader.bool(); + break; + } + case 3: { + message.cltv_expiry_delta = reader.uint32(); + break; + } + case 4: { + message.htlc_minimum_msat = reader.uint64(); + break; + } + case 5: { + message.htlc_maximum_msat = reader.uint64(); + break; + } + case 6: { + message.fees = $root.types.GraphRoutingFees.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GraphChannelUpdate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.GraphChannelUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.GraphChannelUpdate} GraphChannelUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphChannelUpdate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GraphChannelUpdate message. + * @function verify + * @memberof types.GraphChannelUpdate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GraphChannelUpdate.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.last_update != null && message.hasOwnProperty("last_update")) + if (!$util.isInteger(message.last_update)) + return "last_update: integer expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.cltv_expiry_delta != null && message.hasOwnProperty("cltv_expiry_delta")) + if (!$util.isInteger(message.cltv_expiry_delta)) + return "cltv_expiry_delta: integer expected"; + if (message.htlc_minimum_msat != null && message.hasOwnProperty("htlc_minimum_msat")) + if (!$util.isInteger(message.htlc_minimum_msat) && !(message.htlc_minimum_msat && $util.isInteger(message.htlc_minimum_msat.low) && $util.isInteger(message.htlc_minimum_msat.high))) + return "htlc_minimum_msat: integer|Long expected"; + if (message.htlc_maximum_msat != null && message.hasOwnProperty("htlc_maximum_msat")) + if (!$util.isInteger(message.htlc_maximum_msat) && !(message.htlc_maximum_msat && $util.isInteger(message.htlc_maximum_msat.low) && $util.isInteger(message.htlc_maximum_msat.high))) + return "htlc_maximum_msat: integer|Long expected"; + if (message.fees != null && message.hasOwnProperty("fees")) { + let error = $root.types.GraphRoutingFees.verify(message.fees, long + 1); + if (error) + return "fees." + error; + } + return null; + }; + + /** + * Creates a GraphChannelUpdate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.GraphChannelUpdate + * @static + * @param {Object.} object Plain object + * @returns {types.GraphChannelUpdate} GraphChannelUpdate + */ + GraphChannelUpdate.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.GraphChannelUpdate) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.GraphChannelUpdate(); + if (object.last_update != null) + message.last_update = object.last_update >>> 0; + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.cltv_expiry_delta != null) + message.cltv_expiry_delta = object.cltv_expiry_delta >>> 0; + if (object.htlc_minimum_msat != null) + if ($util.Long) + (message.htlc_minimum_msat = $util.Long.fromValue(object.htlc_minimum_msat)).unsigned = true; + else if (typeof object.htlc_minimum_msat === "string") + message.htlc_minimum_msat = parseInt(object.htlc_minimum_msat, 10); + else if (typeof object.htlc_minimum_msat === "number") + message.htlc_minimum_msat = object.htlc_minimum_msat; + else if (typeof object.htlc_minimum_msat === "object") + message.htlc_minimum_msat = new $util.LongBits(object.htlc_minimum_msat.low >>> 0, object.htlc_minimum_msat.high >>> 0).toNumber(true); + if (object.htlc_maximum_msat != null) + if ($util.Long) + (message.htlc_maximum_msat = $util.Long.fromValue(object.htlc_maximum_msat)).unsigned = true; + else if (typeof object.htlc_maximum_msat === "string") + message.htlc_maximum_msat = parseInt(object.htlc_maximum_msat, 10); + else if (typeof object.htlc_maximum_msat === "number") + message.htlc_maximum_msat = object.htlc_maximum_msat; + else if (typeof object.htlc_maximum_msat === "object") + message.htlc_maximum_msat = new $util.LongBits(object.htlc_maximum_msat.low >>> 0, object.htlc_maximum_msat.high >>> 0).toNumber(true); + if (object.fees != null) { + if (typeof object.fees !== "object") + throw TypeError(".types.GraphChannelUpdate.fees: object expected"); + message.fees = $root.types.GraphRoutingFees.fromObject(object.fees, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a GraphChannelUpdate message. Also converts values to other types if specified. + * @function toObject + * @memberof types.GraphChannelUpdate + * @static + * @param {types.GraphChannelUpdate} message GraphChannelUpdate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GraphChannelUpdate.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.last_update = 0; + object.enabled = false; + object.cltv_expiry_delta = 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.htlc_minimum_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.htlc_minimum_msat = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.htlc_maximum_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.htlc_maximum_msat = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.fees = null; + } + if (message.last_update != null && message.hasOwnProperty("last_update")) + object.last_update = message.last_update; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.cltv_expiry_delta != null && message.hasOwnProperty("cltv_expiry_delta")) + object.cltv_expiry_delta = message.cltv_expiry_delta; + if (message.htlc_minimum_msat != null && message.hasOwnProperty("htlc_minimum_msat")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.htlc_minimum_msat = typeof message.htlc_minimum_msat === "number" ? BigInt(message.htlc_minimum_msat) : $util.Long.fromBits(message.htlc_minimum_msat.low >>> 0, message.htlc_minimum_msat.high >>> 0, true).toBigInt(); + else if (typeof message.htlc_minimum_msat === "number") + object.htlc_minimum_msat = options.longs === String ? String(message.htlc_minimum_msat) : message.htlc_minimum_msat; + else + object.htlc_minimum_msat = options.longs === String ? $util.Long.prototype.toString.call(message.htlc_minimum_msat) : options.longs === Number ? new $util.LongBits(message.htlc_minimum_msat.low >>> 0, message.htlc_minimum_msat.high >>> 0).toNumber(true) : message.htlc_minimum_msat; + if (message.htlc_maximum_msat != null && message.hasOwnProperty("htlc_maximum_msat")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.htlc_maximum_msat = typeof message.htlc_maximum_msat === "number" ? BigInt(message.htlc_maximum_msat) : $util.Long.fromBits(message.htlc_maximum_msat.low >>> 0, message.htlc_maximum_msat.high >>> 0, true).toBigInt(); + else if (typeof message.htlc_maximum_msat === "number") + object.htlc_maximum_msat = options.longs === String ? String(message.htlc_maximum_msat) : message.htlc_maximum_msat; + else + object.htlc_maximum_msat = options.longs === String ? $util.Long.prototype.toString.call(message.htlc_maximum_msat) : options.longs === Number ? new $util.LongBits(message.htlc_maximum_msat.low >>> 0, message.htlc_maximum_msat.high >>> 0).toNumber(true) : message.htlc_maximum_msat; + if (message.fees != null && message.hasOwnProperty("fees")) + object.fees = $root.types.GraphRoutingFees.toObject(message.fees, options); + return object; + }; + + /** + * Converts this GraphChannelUpdate to JSON. + * @function toJSON + * @memberof types.GraphChannelUpdate + * @instance + * @returns {Object.} JSON object + */ + GraphChannelUpdate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GraphChannelUpdate + * @function getTypeUrl + * @memberof types.GraphChannelUpdate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphChannelUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.GraphChannelUpdate"; + }; + + return GraphChannelUpdate; + })(); + + types.GraphChannel = (function() { + + /** + * Properties of a GraphChannel. + * @memberof types + * @interface IGraphChannel + * @property {string|null} [node_one] GraphChannel node_one + * @property {string|null} [node_two] GraphChannel node_two + * @property {Long|null} [capacity_sats] GraphChannel capacity_sats + * @property {types.IGraphChannelUpdate|null} [one_to_two] GraphChannel one_to_two + * @property {types.IGraphChannelUpdate|null} [two_to_one] GraphChannel two_to_one + */ + + /** + * Constructs a new GraphChannel. + * @memberof types + * @classdesc Represents a GraphChannel. + * @implements IGraphChannel + * @constructor + * @param {types.IGraphChannel=} [properties] Properties to set + */ + function GraphChannel(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphChannel node_one. + * @member {string} node_one + * @memberof types.GraphChannel + * @instance + */ + GraphChannel.prototype.node_one = ""; + + /** + * GraphChannel node_two. + * @member {string} node_two + * @memberof types.GraphChannel + * @instance + */ + GraphChannel.prototype.node_two = ""; + + /** + * GraphChannel capacity_sats. + * @member {Long|null|undefined} capacity_sats + * @memberof types.GraphChannel + * @instance + */ + GraphChannel.prototype.capacity_sats = null; + + /** + * GraphChannel one_to_two. + * @member {types.IGraphChannelUpdate|null|undefined} one_to_two + * @memberof types.GraphChannel + * @instance + */ + GraphChannel.prototype.one_to_two = null; + + /** + * GraphChannel two_to_one. + * @member {types.IGraphChannelUpdate|null|undefined} two_to_one + * @memberof types.GraphChannel + * @instance + */ + GraphChannel.prototype.two_to_one = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GraphChannel.prototype, "_capacity_sats", { + get: $util.oneOfGetter($oneOfFields = ["capacity_sats"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GraphChannel instance using the specified properties. + * @function create + * @memberof types.GraphChannel + * @static + * @param {types.IGraphChannel=} [properties] Properties to set + * @returns {types.GraphChannel} GraphChannel instance + */ + GraphChannel.create = function create(properties) { + return new GraphChannel(properties); + }; + + /** + * Encodes the specified GraphChannel message. Does not implicitly {@link types.GraphChannel.verify|verify} messages. + * @function encode + * @memberof types.GraphChannel + * @static + * @param {types.IGraphChannel} message GraphChannel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphChannel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.node_one != null && Object.hasOwnProperty.call(message, "node_one")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.node_one); + if (message.node_two != null && Object.hasOwnProperty.call(message, "node_two")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.node_two); + if (message.capacity_sats != null && Object.hasOwnProperty.call(message, "capacity_sats")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.capacity_sats); + if (message.one_to_two != null && Object.hasOwnProperty.call(message, "one_to_two")) + $root.types.GraphChannelUpdate.encode(message.one_to_two, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.two_to_one != null && Object.hasOwnProperty.call(message, "two_to_one")) + $root.types.GraphChannelUpdate.encode(message.two_to_one, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GraphChannel message, length delimited. Does not implicitly {@link types.GraphChannel.verify|verify} messages. + * @function encodeDelimited + * @memberof types.GraphChannel + * @static + * @param {types.IGraphChannel} message GraphChannel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphChannel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GraphChannel message from the specified reader or buffer. + * @function decode + * @memberof types.GraphChannel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.GraphChannel} GraphChannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphChannel.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.GraphChannel(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.node_one = reader.string(); + break; + } + case 2: { + message.node_two = reader.string(); + break; + } + case 3: { + message.capacity_sats = reader.uint64(); + break; + } + case 4: { + message.one_to_two = $root.types.GraphChannelUpdate.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.two_to_one = $root.types.GraphChannelUpdate.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GraphChannel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.GraphChannel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.GraphChannel} GraphChannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphChannel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GraphChannel message. + * @function verify + * @memberof types.GraphChannel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GraphChannel.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.node_one != null && message.hasOwnProperty("node_one")) + if (!$util.isString(message.node_one)) + return "node_one: string expected"; + if (message.node_two != null && message.hasOwnProperty("node_two")) + if (!$util.isString(message.node_two)) + return "node_two: string expected"; + if (message.capacity_sats != null && message.hasOwnProperty("capacity_sats")) { + properties._capacity_sats = 1; + if (!$util.isInteger(message.capacity_sats) && !(message.capacity_sats && $util.isInteger(message.capacity_sats.low) && $util.isInteger(message.capacity_sats.high))) + return "capacity_sats: integer|Long expected"; + } + if (message.one_to_two != null && message.hasOwnProperty("one_to_two")) { + let error = $root.types.GraphChannelUpdate.verify(message.one_to_two, long + 1); + if (error) + return "one_to_two." + error; + } + if (message.two_to_one != null && message.hasOwnProperty("two_to_one")) { + let error = $root.types.GraphChannelUpdate.verify(message.two_to_one, long + 1); + if (error) + return "two_to_one." + error; + } + return null; + }; + + /** + * Creates a GraphChannel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.GraphChannel + * @static + * @param {Object.} object Plain object + * @returns {types.GraphChannel} GraphChannel + */ + GraphChannel.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.GraphChannel) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.GraphChannel(); + if (object.node_one != null) + message.node_one = String(object.node_one); + if (object.node_two != null) + message.node_two = String(object.node_two); + if (object.capacity_sats != null) + if ($util.Long) + (message.capacity_sats = $util.Long.fromValue(object.capacity_sats)).unsigned = true; + else if (typeof object.capacity_sats === "string") + message.capacity_sats = parseInt(object.capacity_sats, 10); + else if (typeof object.capacity_sats === "number") + message.capacity_sats = object.capacity_sats; + else if (typeof object.capacity_sats === "object") + message.capacity_sats = new $util.LongBits(object.capacity_sats.low >>> 0, object.capacity_sats.high >>> 0).toNumber(true); + if (object.one_to_two != null) { + if (typeof object.one_to_two !== "object") + throw TypeError(".types.GraphChannel.one_to_two: object expected"); + message.one_to_two = $root.types.GraphChannelUpdate.fromObject(object.one_to_two, long + 1); + } + if (object.two_to_one != null) { + if (typeof object.two_to_one !== "object") + throw TypeError(".types.GraphChannel.two_to_one: object expected"); + message.two_to_one = $root.types.GraphChannelUpdate.fromObject(object.two_to_one, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a GraphChannel message. Also converts values to other types if specified. + * @function toObject + * @memberof types.GraphChannel + * @static + * @param {types.GraphChannel} message GraphChannel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GraphChannel.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.node_one = ""; + object.node_two = ""; + object.one_to_two = null; + object.two_to_one = null; + } + if (message.node_one != null && message.hasOwnProperty("node_one")) + object.node_one = message.node_one; + if (message.node_two != null && message.hasOwnProperty("node_two")) + object.node_two = message.node_two; + if (message.capacity_sats != null && message.hasOwnProperty("capacity_sats")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.capacity_sats = typeof message.capacity_sats === "number" ? BigInt(message.capacity_sats) : $util.Long.fromBits(message.capacity_sats.low >>> 0, message.capacity_sats.high >>> 0, true).toBigInt(); + else if (typeof message.capacity_sats === "number") + object.capacity_sats = options.longs === String ? String(message.capacity_sats) : message.capacity_sats; + else + object.capacity_sats = options.longs === String ? $util.Long.prototype.toString.call(message.capacity_sats) : options.longs === Number ? new $util.LongBits(message.capacity_sats.low >>> 0, message.capacity_sats.high >>> 0).toNumber(true) : message.capacity_sats; + if (options.oneofs) + object._capacity_sats = "capacity_sats"; + } + if (message.one_to_two != null && message.hasOwnProperty("one_to_two")) + object.one_to_two = $root.types.GraphChannelUpdate.toObject(message.one_to_two, options); + if (message.two_to_one != null && message.hasOwnProperty("two_to_one")) + object.two_to_one = $root.types.GraphChannelUpdate.toObject(message.two_to_one, options); + return object; + }; + + /** + * Converts this GraphChannel to JSON. + * @function toJSON + * @memberof types.GraphChannel + * @instance + * @returns {Object.} JSON object + */ + GraphChannel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GraphChannel + * @function getTypeUrl + * @memberof types.GraphChannel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphChannel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.GraphChannel"; + }; + + return GraphChannel; + })(); + + types.GraphNodeAnnouncement = (function() { + + /** + * Properties of a GraphNodeAnnouncement. + * @memberof types + * @interface IGraphNodeAnnouncement + * @property {number|null} [last_update] GraphNodeAnnouncement last_update + * @property {string|null} [alias] GraphNodeAnnouncement alias + * @property {string|null} [rgb] GraphNodeAnnouncement rgb + * @property {Array.|null} [addresses] GraphNodeAnnouncement addresses + */ + + /** + * Constructs a new GraphNodeAnnouncement. + * @memberof types + * @classdesc Represents a GraphNodeAnnouncement. + * @implements IGraphNodeAnnouncement + * @constructor + * @param {types.IGraphNodeAnnouncement=} [properties] Properties to set + */ + function GraphNodeAnnouncement(properties) { + this.addresses = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphNodeAnnouncement last_update. + * @member {number} last_update + * @memberof types.GraphNodeAnnouncement + * @instance + */ + GraphNodeAnnouncement.prototype.last_update = 0; + + /** + * GraphNodeAnnouncement alias. + * @member {string} alias + * @memberof types.GraphNodeAnnouncement + * @instance + */ + GraphNodeAnnouncement.prototype.alias = ""; + + /** + * GraphNodeAnnouncement rgb. + * @member {string} rgb + * @memberof types.GraphNodeAnnouncement + * @instance + */ + GraphNodeAnnouncement.prototype.rgb = ""; + + /** + * GraphNodeAnnouncement addresses. + * @member {Array.} addresses + * @memberof types.GraphNodeAnnouncement + * @instance + */ + GraphNodeAnnouncement.prototype.addresses = $util.emptyArray; + + /** + * Creates a new GraphNodeAnnouncement instance using the specified properties. + * @function create + * @memberof types.GraphNodeAnnouncement + * @static + * @param {types.IGraphNodeAnnouncement=} [properties] Properties to set + * @returns {types.GraphNodeAnnouncement} GraphNodeAnnouncement instance + */ + GraphNodeAnnouncement.create = function create(properties) { + return new GraphNodeAnnouncement(properties); + }; + + /** + * Encodes the specified GraphNodeAnnouncement message. Does not implicitly {@link types.GraphNodeAnnouncement.verify|verify} messages. + * @function encode + * @memberof types.GraphNodeAnnouncement + * @static + * @param {types.IGraphNodeAnnouncement} message GraphNodeAnnouncement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphNodeAnnouncement.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.last_update != null && Object.hasOwnProperty.call(message, "last_update")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.last_update); + if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.alias); + if (message.rgb != null && Object.hasOwnProperty.call(message, "rgb")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.rgb); + if (message.addresses != null && message.addresses.length) + for (let i = 0; i < message.addresses.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.addresses[i]); + return writer; + }; + + /** + * Encodes the specified GraphNodeAnnouncement message, length delimited. Does not implicitly {@link types.GraphNodeAnnouncement.verify|verify} messages. + * @function encodeDelimited + * @memberof types.GraphNodeAnnouncement + * @static + * @param {types.IGraphNodeAnnouncement} message GraphNodeAnnouncement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphNodeAnnouncement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GraphNodeAnnouncement message from the specified reader or buffer. + * @function decode + * @memberof types.GraphNodeAnnouncement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.GraphNodeAnnouncement} GraphNodeAnnouncement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphNodeAnnouncement.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.GraphNodeAnnouncement(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.last_update = reader.uint32(); + break; + } + case 2: { + message.alias = reader.string(); + break; + } + case 3: { + message.rgb = reader.string(); + break; + } + case 4: { + if (!(message.addresses && message.addresses.length)) + message.addresses = []; + message.addresses.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GraphNodeAnnouncement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.GraphNodeAnnouncement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.GraphNodeAnnouncement} GraphNodeAnnouncement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphNodeAnnouncement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GraphNodeAnnouncement message. + * @function verify + * @memberof types.GraphNodeAnnouncement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GraphNodeAnnouncement.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.last_update != null && message.hasOwnProperty("last_update")) + if (!$util.isInteger(message.last_update)) + return "last_update: integer expected"; + if (message.alias != null && message.hasOwnProperty("alias")) + if (!$util.isString(message.alias)) + return "alias: string expected"; + if (message.rgb != null && message.hasOwnProperty("rgb")) + if (!$util.isString(message.rgb)) + return "rgb: string expected"; + if (message.addresses != null && message.hasOwnProperty("addresses")) { + if (!Array.isArray(message.addresses)) + return "addresses: array expected"; + for (let i = 0; i < message.addresses.length; ++i) + if (!$util.isString(message.addresses[i])) + return "addresses: string[] expected"; + } + return null; + }; + + /** + * Creates a GraphNodeAnnouncement message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.GraphNodeAnnouncement + * @static + * @param {Object.} object Plain object + * @returns {types.GraphNodeAnnouncement} GraphNodeAnnouncement + */ + GraphNodeAnnouncement.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.GraphNodeAnnouncement) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.GraphNodeAnnouncement(); + if (object.last_update != null) + message.last_update = object.last_update >>> 0; + if (object.alias != null) + message.alias = String(object.alias); + if (object.rgb != null) + message.rgb = String(object.rgb); + if (object.addresses) { + if (!Array.isArray(object.addresses)) + throw TypeError(".types.GraphNodeAnnouncement.addresses: array expected"); + message.addresses = []; + for (let i = 0; i < object.addresses.length; ++i) + message.addresses[i] = String(object.addresses[i]); + } + return message; + }; + + /** + * Creates a plain object from a GraphNodeAnnouncement message. Also converts values to other types if specified. + * @function toObject + * @memberof types.GraphNodeAnnouncement + * @static + * @param {types.GraphNodeAnnouncement} message GraphNodeAnnouncement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GraphNodeAnnouncement.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.addresses = []; + if (options.defaults) { + object.last_update = 0; + object.alias = ""; + object.rgb = ""; + } + if (message.last_update != null && message.hasOwnProperty("last_update")) + object.last_update = message.last_update; + if (message.alias != null && message.hasOwnProperty("alias")) + object.alias = message.alias; + if (message.rgb != null && message.hasOwnProperty("rgb")) + object.rgb = message.rgb; + if (message.addresses && message.addresses.length) { + object.addresses = []; + for (let j = 0; j < message.addresses.length; ++j) + object.addresses[j] = message.addresses[j]; + } + return object; + }; + + /** + * Converts this GraphNodeAnnouncement to JSON. + * @function toJSON + * @memberof types.GraphNodeAnnouncement + * @instance + * @returns {Object.} JSON object + */ + GraphNodeAnnouncement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GraphNodeAnnouncement + * @function getTypeUrl + * @memberof types.GraphNodeAnnouncement + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphNodeAnnouncement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.GraphNodeAnnouncement"; + }; + + return GraphNodeAnnouncement; + })(); + + types.Peer = (function() { + + /** + * Properties of a Peer. + * @memberof types + * @interface IPeer + * @property {string|null} [node_id] Peer node_id + * @property {string|null} [address] Peer address + * @property {boolean|null} [is_persisted] Peer is_persisted + * @property {boolean|null} [is_connected] Peer is_connected + */ + + /** + * Constructs a new Peer. + * @memberof types + * @classdesc Represents a Peer. + * @implements IPeer + * @constructor + * @param {types.IPeer=} [properties] Properties to set + */ + function Peer(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Peer node_id. + * @member {string} node_id + * @memberof types.Peer + * @instance + */ + Peer.prototype.node_id = ""; + + /** + * Peer address. + * @member {string} address + * @memberof types.Peer + * @instance + */ + Peer.prototype.address = ""; + + /** + * Peer is_persisted. + * @member {boolean} is_persisted + * @memberof types.Peer + * @instance + */ + Peer.prototype.is_persisted = false; + + /** + * Peer is_connected. + * @member {boolean} is_connected + * @memberof types.Peer + * @instance + */ + Peer.prototype.is_connected = false; + + /** + * Creates a new Peer instance using the specified properties. + * @function create + * @memberof types.Peer + * @static + * @param {types.IPeer=} [properties] Properties to set + * @returns {types.Peer} Peer instance + */ + Peer.create = function create(properties) { + return new Peer(properties); + }; + + /** + * Encodes the specified Peer message. Does not implicitly {@link types.Peer.verify|verify} messages. + * @function encode + * @memberof types.Peer + * @static + * @param {types.IPeer} message Peer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Peer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.node_id != null && Object.hasOwnProperty.call(message, "node_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.node_id); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.address); + if (message.is_persisted != null && Object.hasOwnProperty.call(message, "is_persisted")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.is_persisted); + if (message.is_connected != null && Object.hasOwnProperty.call(message, "is_connected")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.is_connected); + return writer; + }; + + /** + * Encodes the specified Peer message, length delimited. Does not implicitly {@link types.Peer.verify|verify} messages. + * @function encodeDelimited + * @memberof types.Peer + * @static + * @param {types.IPeer} message Peer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Peer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Peer message from the specified reader or buffer. + * @function decode + * @memberof types.Peer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.Peer} Peer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Peer.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Peer(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.node_id = reader.string(); + break; + } + case 2: { + message.address = reader.string(); + break; + } + case 3: { + message.is_persisted = reader.bool(); + break; + } + case 4: { + message.is_connected = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Peer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.Peer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.Peer} Peer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Peer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Peer message. + * @function verify + * @memberof types.Peer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Peer.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.node_id != null && message.hasOwnProperty("node_id")) + if (!$util.isString(message.node_id)) + return "node_id: string expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.is_persisted != null && message.hasOwnProperty("is_persisted")) + if (typeof message.is_persisted !== "boolean") + return "is_persisted: boolean expected"; + if (message.is_connected != null && message.hasOwnProperty("is_connected")) + if (typeof message.is_connected !== "boolean") + return "is_connected: boolean expected"; + return null; + }; + + /** + * Creates a Peer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Peer + * @static + * @param {Object.} object Plain object + * @returns {types.Peer} Peer + */ + Peer.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.Peer) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.Peer(); + if (object.node_id != null) + message.node_id = String(object.node_id); + if (object.address != null) + message.address = String(object.address); + if (object.is_persisted != null) + message.is_persisted = Boolean(object.is_persisted); + if (object.is_connected != null) + message.is_connected = Boolean(object.is_connected); + return message; + }; + + /** + * Creates a plain object from a Peer message. Also converts values to other types if specified. + * @function toObject + * @memberof types.Peer + * @static + * @param {types.Peer} message Peer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Peer.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.node_id = ""; + object.address = ""; + object.is_persisted = false; + object.is_connected = false; + } + if (message.node_id != null && message.hasOwnProperty("node_id")) + object.node_id = message.node_id; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.is_persisted != null && message.hasOwnProperty("is_persisted")) + object.is_persisted = message.is_persisted; + if (message.is_connected != null && message.hasOwnProperty("is_connected")) + object.is_connected = message.is_connected; + return object; + }; + + /** + * Converts this Peer to JSON. + * @function toJSON + * @memberof types.Peer + * @instance + * @returns {Object.} JSON object + */ + Peer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Peer + * @function getTypeUrl + * @memberof types.Peer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Peer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Peer"; + }; + + return Peer; + })(); + + types.GraphNode = (function() { + + /** + * Properties of a GraphNode. + * @memberof types + * @interface IGraphNode + * @property {Array.|null} [channels] GraphNode channels + * @property {types.IGraphNodeAnnouncement|null} [announcement_info] GraphNode announcement_info + */ + + /** + * Constructs a new GraphNode. + * @memberof types + * @classdesc Represents a GraphNode. + * @implements IGraphNode + * @constructor + * @param {types.IGraphNode=} [properties] Properties to set + */ + function GraphNode(properties) { + this.channels = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphNode channels. + * @member {Array.} channels + * @memberof types.GraphNode + * @instance + */ + GraphNode.prototype.channels = $util.emptyArray; + + /** + * GraphNode announcement_info. + * @member {types.IGraphNodeAnnouncement|null|undefined} announcement_info + * @memberof types.GraphNode + * @instance + */ + GraphNode.prototype.announcement_info = null; + + /** + * Creates a new GraphNode instance using the specified properties. + * @function create + * @memberof types.GraphNode + * @static + * @param {types.IGraphNode=} [properties] Properties to set + * @returns {types.GraphNode} GraphNode instance + */ + GraphNode.create = function create(properties) { + return new GraphNode(properties); + }; + + /** + * Encodes the specified GraphNode message. Does not implicitly {@link types.GraphNode.verify|verify} messages. + * @function encode + * @memberof types.GraphNode + * @static + * @param {types.IGraphNode} message GraphNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channels != null && message.channels.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (let i = 0; i < message.channels.length; ++i) + writer.uint64(message.channels[i]); + writer.ldelim(); + } + if (message.announcement_info != null && Object.hasOwnProperty.call(message, "announcement_info")) + $root.types.GraphNodeAnnouncement.encode(message.announcement_info, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GraphNode message, length delimited. Does not implicitly {@link types.GraphNode.verify|verify} messages. + * @function encodeDelimited + * @memberof types.GraphNode + * @static + * @param {types.IGraphNode} message GraphNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GraphNode message from the specified reader or buffer. + * @function decode + * @memberof types.GraphNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.GraphNode} GraphNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphNode.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.GraphNode(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.channels && message.channels.length)) + message.channels = []; + if ((tag & 7) === 2) { + let end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.channels.push(reader.uint64()); + } else + message.channels.push(reader.uint64()); + break; + } + case 2: { + message.announcement_info = $root.types.GraphNodeAnnouncement.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a GraphNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.GraphNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.GraphNode} GraphNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GraphNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GraphNode message. + * @function verify + * @memberof types.GraphNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GraphNode.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.channels != null && message.hasOwnProperty("channels")) { + if (!Array.isArray(message.channels)) + return "channels: array expected"; + for (let i = 0; i < message.channels.length; ++i) + if (!$util.isInteger(message.channels[i]) && !(message.channels[i] && $util.isInteger(message.channels[i].low) && $util.isInteger(message.channels[i].high))) + return "channels: integer|Long[] expected"; + } + if (message.announcement_info != null && message.hasOwnProperty("announcement_info")) { + let error = $root.types.GraphNodeAnnouncement.verify(message.announcement_info, long + 1); + if (error) + return "announcement_info." + error; + } + return null; + }; + + /** + * Creates a GraphNode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.GraphNode + * @static + * @param {Object.} object Plain object + * @returns {types.GraphNode} GraphNode + */ + GraphNode.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.GraphNode) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.GraphNode(); + if (object.channels) { + if (!Array.isArray(object.channels)) + throw TypeError(".types.GraphNode.channels: array expected"); + message.channels = []; + for (let i = 0; i < object.channels.length; ++i) + if ($util.Long) + (message.channels[i] = $util.Long.fromValue(object.channels[i])).unsigned = true; + else if (typeof object.channels[i] === "string") + message.channels[i] = parseInt(object.channels[i], 10); + else if (typeof object.channels[i] === "number") + message.channels[i] = object.channels[i]; + else if (typeof object.channels[i] === "object") + message.channels[i] = new $util.LongBits(object.channels[i].low >>> 0, object.channels[i].high >>> 0).toNumber(true); + } + if (object.announcement_info != null) { + if (typeof object.announcement_info !== "object") + throw TypeError(".types.GraphNode.announcement_info: object expected"); + message.announcement_info = $root.types.GraphNodeAnnouncement.fromObject(object.announcement_info, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a GraphNode message. Also converts values to other types if specified. + * @function toObject + * @memberof types.GraphNode + * @static + * @param {types.GraphNode} message GraphNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GraphNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.channels = []; + if (options.defaults) + object.announcement_info = null; + if (message.channels && message.channels.length) { + object.channels = []; + for (let j = 0; j < message.channels.length; ++j) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.channels[j] = typeof message.channels[j] === "number" ? BigInt(message.channels[j]) : $util.Long.fromBits(message.channels[j].low >>> 0, message.channels[j].high >>> 0, true).toBigInt(); + else if (typeof message.channels[j] === "number") + object.channels[j] = options.longs === String ? String(message.channels[j]) : message.channels[j]; + else + object.channels[j] = options.longs === String ? $util.Long.prototype.toString.call(message.channels[j]) : options.longs === Number ? new $util.LongBits(message.channels[j].low >>> 0, message.channels[j].high >>> 0).toNumber(true) : message.channels[j]; + } + if (message.announcement_info != null && message.hasOwnProperty("announcement_info")) + object.announcement_info = $root.types.GraphNodeAnnouncement.toObject(message.announcement_info, options); + return object; + }; + + /** + * Converts this GraphNode to JSON. + * @function toJSON + * @memberof types.GraphNode + * @instance + * @returns {Object.} JSON object + */ + GraphNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GraphNode + * @function getTypeUrl + * @memberof types.GraphNode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.GraphNode"; + }; + + return GraphNode; + })(); + + types.Bolt11RouteHint = (function() { + + /** + * Properties of a Bolt11RouteHint. + * @memberof types + * @interface IBolt11RouteHint + * @property {Array.|null} [hop_hints] Bolt11RouteHint hop_hints + */ + + /** + * Constructs a new Bolt11RouteHint. + * @memberof types + * @classdesc Represents a Bolt11RouteHint. + * @implements IBolt11RouteHint + * @constructor + * @param {types.IBolt11RouteHint=} [properties] Properties to set + */ + function Bolt11RouteHint(properties) { + this.hop_hints = []; + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11RouteHint hop_hints. + * @member {Array.} hop_hints + * @memberof types.Bolt11RouteHint + * @instance + */ + Bolt11RouteHint.prototype.hop_hints = $util.emptyArray; + + /** + * Creates a new Bolt11RouteHint instance using the specified properties. + * @function create + * @memberof types.Bolt11RouteHint + * @static + * @param {types.IBolt11RouteHint=} [properties] Properties to set + * @returns {types.Bolt11RouteHint} Bolt11RouteHint instance + */ + Bolt11RouteHint.create = function create(properties) { + return new Bolt11RouteHint(properties); + }; + + /** + * Encodes the specified Bolt11RouteHint message. Does not implicitly {@link types.Bolt11RouteHint.verify|verify} messages. + * @function encode + * @memberof types.Bolt11RouteHint + * @static + * @param {types.IBolt11RouteHint} message Bolt11RouteHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11RouteHint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hop_hints != null && message.hop_hints.length) + for (let i = 0; i < message.hop_hints.length; ++i) + $root.types.Bolt11HopHint.encode(message.hop_hints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Bolt11RouteHint message, length delimited. Does not implicitly {@link types.Bolt11RouteHint.verify|verify} messages. + * @function encodeDelimited + * @memberof types.Bolt11RouteHint + * @static + * @param {types.IBolt11RouteHint} message Bolt11RouteHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11RouteHint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11RouteHint message from the specified reader or buffer. + * @function decode + * @memberof types.Bolt11RouteHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.Bolt11RouteHint} Bolt11RouteHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11RouteHint.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Bolt11RouteHint(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.hop_hints && message.hop_hints.length)) + message.hop_hints = []; + message.hop_hints.push($root.types.Bolt11HopHint.decode(reader, reader.uint32(), undefined, long + 1)); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11RouteHint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.Bolt11RouteHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.Bolt11RouteHint} Bolt11RouteHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11RouteHint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11RouteHint message. + * @function verify + * @memberof types.Bolt11RouteHint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11RouteHint.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.hop_hints != null && message.hasOwnProperty("hop_hints")) { + if (!Array.isArray(message.hop_hints)) + return "hop_hints: array expected"; + for (let i = 0; i < message.hop_hints.length; ++i) { + let error = $root.types.Bolt11HopHint.verify(message.hop_hints[i], long + 1); + if (error) + return "hop_hints." + error; + } + } + return null; + }; + + /** + * Creates a Bolt11RouteHint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Bolt11RouteHint + * @static + * @param {Object.} object Plain object + * @returns {types.Bolt11RouteHint} Bolt11RouteHint + */ + Bolt11RouteHint.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.Bolt11RouteHint) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.Bolt11RouteHint(); + if (object.hop_hints) { + if (!Array.isArray(object.hop_hints)) + throw TypeError(".types.Bolt11RouteHint.hop_hints: array expected"); + message.hop_hints = []; + for (let i = 0; i < object.hop_hints.length; ++i) { + if (typeof object.hop_hints[i] !== "object") + throw TypeError(".types.Bolt11RouteHint.hop_hints: object expected"); + message.hop_hints[i] = $root.types.Bolt11HopHint.fromObject(object.hop_hints[i], long + 1); + } + } + return message; + }; + + /** + * Creates a plain object from a Bolt11RouteHint message. Also converts values to other types if specified. + * @function toObject + * @memberof types.Bolt11RouteHint + * @static + * @param {types.Bolt11RouteHint} message Bolt11RouteHint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11RouteHint.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.arrays || options.defaults) + object.hop_hints = []; + if (message.hop_hints && message.hop_hints.length) { + object.hop_hints = []; + for (let j = 0; j < message.hop_hints.length; ++j) + object.hop_hints[j] = $root.types.Bolt11HopHint.toObject(message.hop_hints[j], options); + } + return object; + }; + + /** + * Converts this Bolt11RouteHint to JSON. + * @function toJSON + * @memberof types.Bolt11RouteHint + * @instance + * @returns {Object.} JSON object + */ + Bolt11RouteHint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11RouteHint + * @function getTypeUrl + * @memberof types.Bolt11RouteHint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11RouteHint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Bolt11RouteHint"; + }; + + return Bolt11RouteHint; + })(); + + types.Bolt11HopHint = (function() { + + /** + * Properties of a Bolt11HopHint. + * @memberof types + * @interface IBolt11HopHint + * @property {string|null} [node_id] Bolt11HopHint node_id + * @property {Long|null} [short_channel_id] Bolt11HopHint short_channel_id + * @property {number|null} [fee_base_msat] Bolt11HopHint fee_base_msat + * @property {number|null} [fee_proportional_millionths] Bolt11HopHint fee_proportional_millionths + * @property {number|null} [cltv_expiry_delta] Bolt11HopHint cltv_expiry_delta + */ + + /** + * Constructs a new Bolt11HopHint. + * @memberof types + * @classdesc Represents a Bolt11HopHint. + * @implements IBolt11HopHint + * @constructor + * @param {types.IBolt11HopHint=} [properties] Properties to set + */ + function Bolt11HopHint(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11HopHint node_id. + * @member {string} node_id + * @memberof types.Bolt11HopHint + * @instance + */ + Bolt11HopHint.prototype.node_id = ""; + + /** + * Bolt11HopHint short_channel_id. + * @member {Long} short_channel_id + * @memberof types.Bolt11HopHint + * @instance + */ + Bolt11HopHint.prototype.short_channel_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Bolt11HopHint fee_base_msat. + * @member {number} fee_base_msat + * @memberof types.Bolt11HopHint + * @instance + */ + Bolt11HopHint.prototype.fee_base_msat = 0; + + /** + * Bolt11HopHint fee_proportional_millionths. + * @member {number} fee_proportional_millionths + * @memberof types.Bolt11HopHint + * @instance + */ + Bolt11HopHint.prototype.fee_proportional_millionths = 0; + + /** + * Bolt11HopHint cltv_expiry_delta. + * @member {number} cltv_expiry_delta + * @memberof types.Bolt11HopHint + * @instance + */ + Bolt11HopHint.prototype.cltv_expiry_delta = 0; + + /** + * Creates a new Bolt11HopHint instance using the specified properties. + * @function create + * @memberof types.Bolt11HopHint + * @static + * @param {types.IBolt11HopHint=} [properties] Properties to set + * @returns {types.Bolt11HopHint} Bolt11HopHint instance + */ + Bolt11HopHint.create = function create(properties) { + return new Bolt11HopHint(properties); + }; + + /** + * Encodes the specified Bolt11HopHint message. Does not implicitly {@link types.Bolt11HopHint.verify|verify} messages. + * @function encode + * @memberof types.Bolt11HopHint + * @static + * @param {types.IBolt11HopHint} message Bolt11HopHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11HopHint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.node_id != null && Object.hasOwnProperty.call(message, "node_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.node_id); + if (message.short_channel_id != null && Object.hasOwnProperty.call(message, "short_channel_id")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.short_channel_id); + if (message.fee_base_msat != null && Object.hasOwnProperty.call(message, "fee_base_msat")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.fee_base_msat); + if (message.fee_proportional_millionths != null && Object.hasOwnProperty.call(message, "fee_proportional_millionths")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.fee_proportional_millionths); + if (message.cltv_expiry_delta != null && Object.hasOwnProperty.call(message, "cltv_expiry_delta")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.cltv_expiry_delta); + return writer; + }; + + /** + * Encodes the specified Bolt11HopHint message, length delimited. Does not implicitly {@link types.Bolt11HopHint.verify|verify} messages. + * @function encodeDelimited + * @memberof types.Bolt11HopHint + * @static + * @param {types.IBolt11HopHint} message Bolt11HopHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11HopHint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11HopHint message from the specified reader or buffer. + * @function decode + * @memberof types.Bolt11HopHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.Bolt11HopHint} Bolt11HopHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11HopHint.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Bolt11HopHint(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.node_id = reader.string(); + break; + } + case 2: { + message.short_channel_id = reader.uint64(); + break; + } + case 3: { + message.fee_base_msat = reader.uint32(); + break; + } + case 4: { + message.fee_proportional_millionths = reader.uint32(); + break; + } + case 5: { + message.cltv_expiry_delta = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11HopHint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.Bolt11HopHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.Bolt11HopHint} Bolt11HopHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11HopHint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11HopHint message. + * @function verify + * @memberof types.Bolt11HopHint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11HopHint.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.node_id != null && message.hasOwnProperty("node_id")) + if (!$util.isString(message.node_id)) + return "node_id: string expected"; + if (message.short_channel_id != null && message.hasOwnProperty("short_channel_id")) + if (!$util.isInteger(message.short_channel_id) && !(message.short_channel_id && $util.isInteger(message.short_channel_id.low) && $util.isInteger(message.short_channel_id.high))) + return "short_channel_id: integer|Long expected"; + if (message.fee_base_msat != null && message.hasOwnProperty("fee_base_msat")) + if (!$util.isInteger(message.fee_base_msat)) + return "fee_base_msat: integer expected"; + if (message.fee_proportional_millionths != null && message.hasOwnProperty("fee_proportional_millionths")) + if (!$util.isInteger(message.fee_proportional_millionths)) + return "fee_proportional_millionths: integer expected"; + if (message.cltv_expiry_delta != null && message.hasOwnProperty("cltv_expiry_delta")) + if (!$util.isInteger(message.cltv_expiry_delta)) + return "cltv_expiry_delta: integer expected"; + return null; + }; + + /** + * Creates a Bolt11HopHint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Bolt11HopHint + * @static + * @param {Object.} object Plain object + * @returns {types.Bolt11HopHint} Bolt11HopHint + */ + Bolt11HopHint.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.Bolt11HopHint) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.Bolt11HopHint(); + if (object.node_id != null) + message.node_id = String(object.node_id); + if (object.short_channel_id != null) + if ($util.Long) + (message.short_channel_id = $util.Long.fromValue(object.short_channel_id)).unsigned = true; + else if (typeof object.short_channel_id === "string") + message.short_channel_id = parseInt(object.short_channel_id, 10); + else if (typeof object.short_channel_id === "number") + message.short_channel_id = object.short_channel_id; + else if (typeof object.short_channel_id === "object") + message.short_channel_id = new $util.LongBits(object.short_channel_id.low >>> 0, object.short_channel_id.high >>> 0).toNumber(true); + if (object.fee_base_msat != null) + message.fee_base_msat = object.fee_base_msat >>> 0; + if (object.fee_proportional_millionths != null) + message.fee_proportional_millionths = object.fee_proportional_millionths >>> 0; + if (object.cltv_expiry_delta != null) + message.cltv_expiry_delta = object.cltv_expiry_delta >>> 0; + return message; + }; + + /** + * Creates a plain object from a Bolt11HopHint message. Also converts values to other types if specified. + * @function toObject + * @memberof types.Bolt11HopHint + * @static + * @param {types.Bolt11HopHint} message Bolt11HopHint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11HopHint.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.node_id = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.short_channel_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.short_channel_id = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.fee_base_msat = 0; + object.fee_proportional_millionths = 0; + object.cltv_expiry_delta = 0; + } + if (message.node_id != null && message.hasOwnProperty("node_id")) + object.node_id = message.node_id; + if (message.short_channel_id != null && message.hasOwnProperty("short_channel_id")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.short_channel_id = typeof message.short_channel_id === "number" ? BigInt(message.short_channel_id) : $util.Long.fromBits(message.short_channel_id.low >>> 0, message.short_channel_id.high >>> 0, true).toBigInt(); + else if (typeof message.short_channel_id === "number") + object.short_channel_id = options.longs === String ? String(message.short_channel_id) : message.short_channel_id; + else + object.short_channel_id = options.longs === String ? $util.Long.prototype.toString.call(message.short_channel_id) : options.longs === Number ? new $util.LongBits(message.short_channel_id.low >>> 0, message.short_channel_id.high >>> 0).toNumber(true) : message.short_channel_id; + if (message.fee_base_msat != null && message.hasOwnProperty("fee_base_msat")) + object.fee_base_msat = message.fee_base_msat; + if (message.fee_proportional_millionths != null && message.hasOwnProperty("fee_proportional_millionths")) + object.fee_proportional_millionths = message.fee_proportional_millionths; + if (message.cltv_expiry_delta != null && message.hasOwnProperty("cltv_expiry_delta")) + object.cltv_expiry_delta = message.cltv_expiry_delta; + return object; + }; + + /** + * Converts this Bolt11HopHint to JSON. + * @function toJSON + * @memberof types.Bolt11HopHint + * @instance + * @returns {Object.} JSON object + */ + Bolt11HopHint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11HopHint + * @function getTypeUrl + * @memberof types.Bolt11HopHint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11HopHint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Bolt11HopHint"; + }; + + return Bolt11HopHint; + })(); + + types.OfferAmount = (function() { + + /** + * Properties of an OfferAmount. + * @memberof types + * @interface IOfferAmount + * @property {Long|null} [bitcoin_amount_msats] OfferAmount bitcoin_amount_msats + * @property {types.ICurrencyAmount|null} [currency_amount] OfferAmount currency_amount + */ + + /** + * Constructs a new OfferAmount. + * @memberof types + * @classdesc Represents an OfferAmount. + * @implements IOfferAmount + * @constructor + * @param {types.IOfferAmount=} [properties] Properties to set + */ + function OfferAmount(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OfferAmount bitcoin_amount_msats. + * @member {Long|null|undefined} bitcoin_amount_msats + * @memberof types.OfferAmount + * @instance + */ + OfferAmount.prototype.bitcoin_amount_msats = null; + + /** + * OfferAmount currency_amount. + * @member {types.ICurrencyAmount|null|undefined} currency_amount + * @memberof types.OfferAmount + * @instance + */ + OfferAmount.prototype.currency_amount = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * OfferAmount amount. + * @member {"bitcoin_amount_msats"|"currency_amount"|undefined} amount + * @memberof types.OfferAmount + * @instance + */ + Object.defineProperty(OfferAmount.prototype, "amount", { + get: $util.oneOfGetter($oneOfFields = ["bitcoin_amount_msats", "currency_amount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OfferAmount instance using the specified properties. + * @function create + * @memberof types.OfferAmount + * @static + * @param {types.IOfferAmount=} [properties] Properties to set + * @returns {types.OfferAmount} OfferAmount instance + */ + OfferAmount.create = function create(properties) { + return new OfferAmount(properties); + }; + + /** + * Encodes the specified OfferAmount message. Does not implicitly {@link types.OfferAmount.verify|verify} messages. + * @function encode + * @memberof types.OfferAmount + * @static + * @param {types.IOfferAmount} message OfferAmount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OfferAmount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bitcoin_amount_msats != null && Object.hasOwnProperty.call(message, "bitcoin_amount_msats")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.bitcoin_amount_msats); + if (message.currency_amount != null && Object.hasOwnProperty.call(message, "currency_amount")) + $root.types.CurrencyAmount.encode(message.currency_amount, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OfferAmount message, length delimited. Does not implicitly {@link types.OfferAmount.verify|verify} messages. + * @function encodeDelimited + * @memberof types.OfferAmount + * @static + * @param {types.IOfferAmount} message OfferAmount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OfferAmount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OfferAmount message from the specified reader or buffer. + * @function decode + * @memberof types.OfferAmount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.OfferAmount} OfferAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OfferAmount.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.OfferAmount(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.bitcoin_amount_msats = reader.uint64(); + break; + } + case 2: { + message.currency_amount = $root.types.CurrencyAmount.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OfferAmount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.OfferAmount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.OfferAmount} OfferAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OfferAmount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OfferAmount message. + * @function verify + * @memberof types.OfferAmount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OfferAmount.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.bitcoin_amount_msats != null && message.hasOwnProperty("bitcoin_amount_msats")) { + properties.amount = 1; + if (!$util.isInteger(message.bitcoin_amount_msats) && !(message.bitcoin_amount_msats && $util.isInteger(message.bitcoin_amount_msats.low) && $util.isInteger(message.bitcoin_amount_msats.high))) + return "bitcoin_amount_msats: integer|Long expected"; + } + if (message.currency_amount != null && message.hasOwnProperty("currency_amount")) { + if (properties.amount === 1) + return "amount: multiple values"; + properties.amount = 1; + { + let error = $root.types.CurrencyAmount.verify(message.currency_amount, long + 1); + if (error) + return "currency_amount." + error; + } + } + return null; + }; + + /** + * Creates an OfferAmount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.OfferAmount + * @static + * @param {Object.} object Plain object + * @returns {types.OfferAmount} OfferAmount + */ + OfferAmount.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.OfferAmount) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.OfferAmount(); + if (object.bitcoin_amount_msats != null) + if ($util.Long) + (message.bitcoin_amount_msats = $util.Long.fromValue(object.bitcoin_amount_msats)).unsigned = true; + else if (typeof object.bitcoin_amount_msats === "string") + message.bitcoin_amount_msats = parseInt(object.bitcoin_amount_msats, 10); + else if (typeof object.bitcoin_amount_msats === "number") + message.bitcoin_amount_msats = object.bitcoin_amount_msats; + else if (typeof object.bitcoin_amount_msats === "object") + message.bitcoin_amount_msats = new $util.LongBits(object.bitcoin_amount_msats.low >>> 0, object.bitcoin_amount_msats.high >>> 0).toNumber(true); + if (object.currency_amount != null) { + if (typeof object.currency_amount !== "object") + throw TypeError(".types.OfferAmount.currency_amount: object expected"); + message.currency_amount = $root.types.CurrencyAmount.fromObject(object.currency_amount, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an OfferAmount message. Also converts values to other types if specified. + * @function toObject + * @memberof types.OfferAmount + * @static + * @param {types.OfferAmount} message OfferAmount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OfferAmount.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.bitcoin_amount_msats != null && message.hasOwnProperty("bitcoin_amount_msats")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.bitcoin_amount_msats = typeof message.bitcoin_amount_msats === "number" ? BigInt(message.bitcoin_amount_msats) : $util.Long.fromBits(message.bitcoin_amount_msats.low >>> 0, message.bitcoin_amount_msats.high >>> 0, true).toBigInt(); + else if (typeof message.bitcoin_amount_msats === "number") + object.bitcoin_amount_msats = options.longs === String ? String(message.bitcoin_amount_msats) : message.bitcoin_amount_msats; + else + object.bitcoin_amount_msats = options.longs === String ? $util.Long.prototype.toString.call(message.bitcoin_amount_msats) : options.longs === Number ? new $util.LongBits(message.bitcoin_amount_msats.low >>> 0, message.bitcoin_amount_msats.high >>> 0).toNumber(true) : message.bitcoin_amount_msats; + if (options.oneofs) + object.amount = "bitcoin_amount_msats"; + } + if (message.currency_amount != null && message.hasOwnProperty("currency_amount")) { + object.currency_amount = $root.types.CurrencyAmount.toObject(message.currency_amount, options); + if (options.oneofs) + object.amount = "currency_amount"; + } + return object; + }; + + /** + * Converts this OfferAmount to JSON. + * @function toJSON + * @memberof types.OfferAmount + * @instance + * @returns {Object.} JSON object + */ + OfferAmount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OfferAmount + * @function getTypeUrl + * @memberof types.OfferAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OfferAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.OfferAmount"; + }; + + return OfferAmount; + })(); + + types.CurrencyAmount = (function() { + + /** + * Properties of a CurrencyAmount. + * @memberof types + * @interface ICurrencyAmount + * @property {string|null} [iso4217_code] CurrencyAmount iso4217_code + * @property {Long|null} [amount] CurrencyAmount amount + */ + + /** + * Constructs a new CurrencyAmount. + * @memberof types + * @classdesc Represents a CurrencyAmount. + * @implements ICurrencyAmount + * @constructor + * @param {types.ICurrencyAmount=} [properties] Properties to set + */ + function CurrencyAmount(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CurrencyAmount iso4217_code. + * @member {string} iso4217_code + * @memberof types.CurrencyAmount + * @instance + */ + CurrencyAmount.prototype.iso4217_code = ""; + + /** + * CurrencyAmount amount. + * @member {Long} amount + * @memberof types.CurrencyAmount + * @instance + */ + CurrencyAmount.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new CurrencyAmount instance using the specified properties. + * @function create + * @memberof types.CurrencyAmount + * @static + * @param {types.ICurrencyAmount=} [properties] Properties to set + * @returns {types.CurrencyAmount} CurrencyAmount instance + */ + CurrencyAmount.create = function create(properties) { + return new CurrencyAmount(properties); + }; + + /** + * Encodes the specified CurrencyAmount message. Does not implicitly {@link types.CurrencyAmount.verify|verify} messages. + * @function encode + * @memberof types.CurrencyAmount + * @static + * @param {types.ICurrencyAmount} message CurrencyAmount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrencyAmount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.iso4217_code != null && Object.hasOwnProperty.call(message, "iso4217_code")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.iso4217_code); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount); + return writer; + }; + + /** + * Encodes the specified CurrencyAmount message, length delimited. Does not implicitly {@link types.CurrencyAmount.verify|verify} messages. + * @function encodeDelimited + * @memberof types.CurrencyAmount + * @static + * @param {types.ICurrencyAmount} message CurrencyAmount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrencyAmount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CurrencyAmount message from the specified reader or buffer. + * @function decode + * @memberof types.CurrencyAmount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.CurrencyAmount} CurrencyAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrencyAmount.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.CurrencyAmount(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.iso4217_code = reader.string(); + break; + } + case 2: { + message.amount = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CurrencyAmount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.CurrencyAmount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.CurrencyAmount} CurrencyAmount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrencyAmount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CurrencyAmount message. + * @function verify + * @memberof types.CurrencyAmount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CurrencyAmount.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.iso4217_code != null && message.hasOwnProperty("iso4217_code")) + if (!$util.isString(message.iso4217_code)) + return "iso4217_code: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) + return "amount: integer|Long expected"; + return null; + }; + + /** + * Creates a CurrencyAmount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.CurrencyAmount + * @static + * @param {Object.} object Plain object + * @returns {types.CurrencyAmount} CurrencyAmount + */ + CurrencyAmount.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.CurrencyAmount) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.CurrencyAmount(); + if (object.iso4217_code != null) + message.iso4217_code = String(object.iso4217_code); + if (object.amount != null) + if ($util.Long) + (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; + else if (typeof object.amount === "string") + message.amount = parseInt(object.amount, 10); + else if (typeof object.amount === "number") + message.amount = object.amount; + else if (typeof object.amount === "object") + message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a CurrencyAmount message. Also converts values to other types if specified. + * @function toObject + * @memberof types.CurrencyAmount + * @static + * @param {types.CurrencyAmount} message CurrencyAmount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CurrencyAmount.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.iso4217_code = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.amount = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + } + if (message.iso4217_code != null && message.hasOwnProperty("iso4217_code")) + object.iso4217_code = message.iso4217_code; + if (message.amount != null && message.hasOwnProperty("amount")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.amount = typeof message.amount === "number" ? BigInt(message.amount) : $util.Long.fromBits(message.amount.low >>> 0, message.amount.high >>> 0, true).toBigInt(); + else if (typeof message.amount === "number") + object.amount = options.longs === String ? String(message.amount) : message.amount; + else + object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; + return object; + }; + + /** + * Converts this CurrencyAmount to JSON. + * @function toJSON + * @memberof types.CurrencyAmount + * @instance + * @returns {Object.} JSON object + */ + CurrencyAmount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CurrencyAmount + * @function getTypeUrl + * @memberof types.CurrencyAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrencyAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.CurrencyAmount"; + }; + + return CurrencyAmount; + })(); + + types.OfferQuantity = (function() { + + /** + * Properties of an OfferQuantity. + * @memberof types + * @interface IOfferQuantity + * @property {boolean|null} [one] OfferQuantity one + * @property {Long|null} [bounded] OfferQuantity bounded + * @property {boolean|null} [unbounded] OfferQuantity unbounded + */ + + /** + * Constructs a new OfferQuantity. + * @memberof types + * @classdesc Represents an OfferQuantity. + * @implements IOfferQuantity + * @constructor + * @param {types.IOfferQuantity=} [properties] Properties to set + */ + function OfferQuantity(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * OfferQuantity one. + * @member {boolean|null|undefined} one + * @memberof types.OfferQuantity + * @instance + */ + OfferQuantity.prototype.one = null; + + /** + * OfferQuantity bounded. + * @member {Long|null|undefined} bounded + * @memberof types.OfferQuantity + * @instance + */ + OfferQuantity.prototype.bounded = null; + + /** + * OfferQuantity unbounded. + * @member {boolean|null|undefined} unbounded + * @memberof types.OfferQuantity + * @instance + */ + OfferQuantity.prototype.unbounded = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * OfferQuantity quantity. + * @member {"one"|"bounded"|"unbounded"|undefined} quantity + * @memberof types.OfferQuantity + * @instance + */ + Object.defineProperty(OfferQuantity.prototype, "quantity", { + get: $util.oneOfGetter($oneOfFields = ["one", "bounded", "unbounded"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OfferQuantity instance using the specified properties. + * @function create + * @memberof types.OfferQuantity + * @static + * @param {types.IOfferQuantity=} [properties] Properties to set + * @returns {types.OfferQuantity} OfferQuantity instance + */ + OfferQuantity.create = function create(properties) { + return new OfferQuantity(properties); + }; + + /** + * Encodes the specified OfferQuantity message. Does not implicitly {@link types.OfferQuantity.verify|verify} messages. + * @function encode + * @memberof types.OfferQuantity + * @static + * @param {types.IOfferQuantity} message OfferQuantity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OfferQuantity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.one != null && Object.hasOwnProperty.call(message, "one")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.one); + if (message.bounded != null && Object.hasOwnProperty.call(message, "bounded")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.bounded); + if (message.unbounded != null && Object.hasOwnProperty.call(message, "unbounded")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unbounded); + return writer; + }; + + /** + * Encodes the specified OfferQuantity message, length delimited. Does not implicitly {@link types.OfferQuantity.verify|verify} messages. + * @function encodeDelimited + * @memberof types.OfferQuantity + * @static + * @param {types.IOfferQuantity} message OfferQuantity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OfferQuantity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OfferQuantity message from the specified reader or buffer. + * @function decode + * @memberof types.OfferQuantity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.OfferQuantity} OfferQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OfferQuantity.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.OfferQuantity(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.one = reader.bool(); + break; + } + case 2: { + message.bounded = reader.uint64(); + break; + } + case 3: { + message.unbounded = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an OfferQuantity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.OfferQuantity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.OfferQuantity} OfferQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OfferQuantity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OfferQuantity message. + * @function verify + * @memberof types.OfferQuantity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OfferQuantity.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.one != null && message.hasOwnProperty("one")) { + properties.quantity = 1; + if (typeof message.one !== "boolean") + return "one: boolean expected"; + } + if (message.bounded != null && message.hasOwnProperty("bounded")) { + if (properties.quantity === 1) + return "quantity: multiple values"; + properties.quantity = 1; + if (!$util.isInteger(message.bounded) && !(message.bounded && $util.isInteger(message.bounded.low) && $util.isInteger(message.bounded.high))) + return "bounded: integer|Long expected"; + } + if (message.unbounded != null && message.hasOwnProperty("unbounded")) { + if (properties.quantity === 1) + return "quantity: multiple values"; + properties.quantity = 1; + if (typeof message.unbounded !== "boolean") + return "unbounded: boolean expected"; + } + return null; + }; + + /** + * Creates an OfferQuantity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.OfferQuantity + * @static + * @param {Object.} object Plain object + * @returns {types.OfferQuantity} OfferQuantity + */ + OfferQuantity.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.OfferQuantity) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.OfferQuantity(); + if (object.one != null) + message.one = Boolean(object.one); + if (object.bounded != null) + if ($util.Long) + (message.bounded = $util.Long.fromValue(object.bounded)).unsigned = true; + else if (typeof object.bounded === "string") + message.bounded = parseInt(object.bounded, 10); + else if (typeof object.bounded === "number") + message.bounded = object.bounded; + else if (typeof object.bounded === "object") + message.bounded = new $util.LongBits(object.bounded.low >>> 0, object.bounded.high >>> 0).toNumber(true); + if (object.unbounded != null) + message.unbounded = Boolean(object.unbounded); + return message; + }; + + /** + * Creates a plain object from an OfferQuantity message. Also converts values to other types if specified. + * @function toObject + * @memberof types.OfferQuantity + * @static + * @param {types.OfferQuantity} message OfferQuantity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OfferQuantity.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.one != null && message.hasOwnProperty("one")) { + object.one = message.one; + if (options.oneofs) + object.quantity = "one"; + } + if (message.bounded != null && message.hasOwnProperty("bounded")) { + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.bounded = typeof message.bounded === "number" ? BigInt(message.bounded) : $util.Long.fromBits(message.bounded.low >>> 0, message.bounded.high >>> 0, true).toBigInt(); + else if (typeof message.bounded === "number") + object.bounded = options.longs === String ? String(message.bounded) : message.bounded; + else + object.bounded = options.longs === String ? $util.Long.prototype.toString.call(message.bounded) : options.longs === Number ? new $util.LongBits(message.bounded.low >>> 0, message.bounded.high >>> 0).toNumber(true) : message.bounded; + if (options.oneofs) + object.quantity = "bounded"; + } + if (message.unbounded != null && message.hasOwnProperty("unbounded")) { + object.unbounded = message.unbounded; + if (options.oneofs) + object.quantity = "unbounded"; + } + return object; + }; + + /** + * Converts this OfferQuantity to JSON. + * @function toJSON + * @memberof types.OfferQuantity + * @instance + * @returns {Object.} JSON object + */ + OfferQuantity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OfferQuantity + * @function getTypeUrl + * @memberof types.OfferQuantity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OfferQuantity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.OfferQuantity"; + }; + + return OfferQuantity; + })(); + + types.BlindedPath = (function() { + + /** + * Properties of a BlindedPath. + * @memberof types + * @interface IBlindedPath + * @property {string|null} [node_id] BlindedPath node_id + * @property {types.IDirectedShortChannelId|null} [directed_scid] BlindedPath directed_scid + * @property {string|null} [blinding_point] BlindedPath blinding_point + * @property {number|null} [num_hops] BlindedPath num_hops + */ + + /** + * Constructs a new BlindedPath. + * @memberof types + * @classdesc Represents a BlindedPath. + * @implements IBlindedPath + * @constructor + * @param {types.IBlindedPath=} [properties] Properties to set + */ + function BlindedPath(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * BlindedPath node_id. + * @member {string|null|undefined} node_id + * @memberof types.BlindedPath + * @instance + */ + BlindedPath.prototype.node_id = null; + + /** + * BlindedPath directed_scid. + * @member {types.IDirectedShortChannelId|null|undefined} directed_scid + * @memberof types.BlindedPath + * @instance + */ + BlindedPath.prototype.directed_scid = null; + + /** + * BlindedPath blinding_point. + * @member {string} blinding_point + * @memberof types.BlindedPath + * @instance + */ + BlindedPath.prototype.blinding_point = ""; + + /** + * BlindedPath num_hops. + * @member {number} num_hops + * @memberof types.BlindedPath + * @instance + */ + BlindedPath.prototype.num_hops = 0; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * BlindedPath introduction_node. + * @member {"node_id"|"directed_scid"|undefined} introduction_node + * @memberof types.BlindedPath + * @instance + */ + Object.defineProperty(BlindedPath.prototype, "introduction_node", { + get: $util.oneOfGetter($oneOfFields = ["node_id", "directed_scid"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BlindedPath instance using the specified properties. + * @function create + * @memberof types.BlindedPath + * @static + * @param {types.IBlindedPath=} [properties] Properties to set + * @returns {types.BlindedPath} BlindedPath instance + */ + BlindedPath.create = function create(properties) { + return new BlindedPath(properties); + }; + + /** + * Encodes the specified BlindedPath message. Does not implicitly {@link types.BlindedPath.verify|verify} messages. + * @function encode + * @memberof types.BlindedPath + * @static + * @param {types.IBlindedPath} message BlindedPath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlindedPath.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.node_id != null && Object.hasOwnProperty.call(message, "node_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.node_id); + if (message.directed_scid != null && Object.hasOwnProperty.call(message, "directed_scid")) + $root.types.DirectedShortChannelId.encode(message.directed_scid, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.blinding_point != null && Object.hasOwnProperty.call(message, "blinding_point")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.blinding_point); + if (message.num_hops != null && Object.hasOwnProperty.call(message, "num_hops")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.num_hops); + return writer; + }; + + /** + * Encodes the specified BlindedPath message, length delimited. Does not implicitly {@link types.BlindedPath.verify|verify} messages. + * @function encodeDelimited + * @memberof types.BlindedPath + * @static + * @param {types.IBlindedPath} message BlindedPath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlindedPath.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BlindedPath message from the specified reader or buffer. + * @function decode + * @memberof types.BlindedPath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.BlindedPath} BlindedPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlindedPath.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.BlindedPath(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.node_id = reader.string(); + break; + } + case 2: { + message.directed_scid = $root.types.DirectedShortChannelId.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.blinding_point = reader.string(); + break; + } + case 4: { + message.num_hops = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a BlindedPath message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.BlindedPath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.BlindedPath} BlindedPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlindedPath.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BlindedPath message. + * @function verify + * @memberof types.BlindedPath + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BlindedPath.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.node_id != null && message.hasOwnProperty("node_id")) { + properties.introduction_node = 1; + if (!$util.isString(message.node_id)) + return "node_id: string expected"; + } + if (message.directed_scid != null && message.hasOwnProperty("directed_scid")) { + if (properties.introduction_node === 1) + return "introduction_node: multiple values"; + properties.introduction_node = 1; + { + let error = $root.types.DirectedShortChannelId.verify(message.directed_scid, long + 1); + if (error) + return "directed_scid." + error; + } + } + if (message.blinding_point != null && message.hasOwnProperty("blinding_point")) + if (!$util.isString(message.blinding_point)) + return "blinding_point: string expected"; + if (message.num_hops != null && message.hasOwnProperty("num_hops")) + if (!$util.isInteger(message.num_hops)) + return "num_hops: integer expected"; + return null; + }; + + /** + * Creates a BlindedPath message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.BlindedPath + * @static + * @param {Object.} object Plain object + * @returns {types.BlindedPath} BlindedPath + */ + BlindedPath.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.BlindedPath) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.BlindedPath(); + if (object.node_id != null) + message.node_id = String(object.node_id); + if (object.directed_scid != null) { + if (typeof object.directed_scid !== "object") + throw TypeError(".types.BlindedPath.directed_scid: object expected"); + message.directed_scid = $root.types.DirectedShortChannelId.fromObject(object.directed_scid, long + 1); + } + if (object.blinding_point != null) + message.blinding_point = String(object.blinding_point); + if (object.num_hops != null) + message.num_hops = object.num_hops >>> 0; + return message; + }; + + /** + * Creates a plain object from a BlindedPath message. Also converts values to other types if specified. + * @function toObject + * @memberof types.BlindedPath + * @static + * @param {types.BlindedPath} message BlindedPath + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BlindedPath.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.blinding_point = ""; + object.num_hops = 0; + } + if (message.node_id != null && message.hasOwnProperty("node_id")) { + object.node_id = message.node_id; + if (options.oneofs) + object.introduction_node = "node_id"; + } + if (message.directed_scid != null && message.hasOwnProperty("directed_scid")) { + object.directed_scid = $root.types.DirectedShortChannelId.toObject(message.directed_scid, options); + if (options.oneofs) + object.introduction_node = "directed_scid"; + } + if (message.blinding_point != null && message.hasOwnProperty("blinding_point")) + object.blinding_point = message.blinding_point; + if (message.num_hops != null && message.hasOwnProperty("num_hops")) + object.num_hops = message.num_hops; + return object; + }; + + /** + * Converts this BlindedPath to JSON. + * @function toJSON + * @memberof types.BlindedPath + * @instance + * @returns {Object.} JSON object + */ + BlindedPath.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BlindedPath + * @function getTypeUrl + * @memberof types.BlindedPath + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BlindedPath.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.BlindedPath"; + }; + + return BlindedPath; + })(); + + types.DirectedShortChannelId = (function() { + + /** + * Properties of a DirectedShortChannelId. + * @memberof types + * @interface IDirectedShortChannelId + * @property {Long|null} [scid] DirectedShortChannelId scid + * @property {types.ChannelDirection|null} [direction] DirectedShortChannelId direction + */ + + /** + * Constructs a new DirectedShortChannelId. + * @memberof types + * @classdesc Represents a DirectedShortChannelId. + * @implements IDirectedShortChannelId + * @constructor + * @param {types.IDirectedShortChannelId=} [properties] Properties to set + */ + function DirectedShortChannelId(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * DirectedShortChannelId scid. + * @member {Long} scid + * @memberof types.DirectedShortChannelId + * @instance + */ + DirectedShortChannelId.prototype.scid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * DirectedShortChannelId direction. + * @member {types.ChannelDirection} direction + * @memberof types.DirectedShortChannelId + * @instance + */ + DirectedShortChannelId.prototype.direction = 0; + + /** + * Creates a new DirectedShortChannelId instance using the specified properties. + * @function create + * @memberof types.DirectedShortChannelId + * @static + * @param {types.IDirectedShortChannelId=} [properties] Properties to set + * @returns {types.DirectedShortChannelId} DirectedShortChannelId instance + */ + DirectedShortChannelId.create = function create(properties) { + return new DirectedShortChannelId(properties); + }; + + /** + * Encodes the specified DirectedShortChannelId message. Does not implicitly {@link types.DirectedShortChannelId.verify|verify} messages. + * @function encode + * @memberof types.DirectedShortChannelId + * @static + * @param {types.IDirectedShortChannelId} message DirectedShortChannelId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DirectedShortChannelId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scid != null && Object.hasOwnProperty.call(message, "scid")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.scid); + if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.direction); + return writer; + }; + + /** + * Encodes the specified DirectedShortChannelId message, length delimited. Does not implicitly {@link types.DirectedShortChannelId.verify|verify} messages. + * @function encodeDelimited + * @memberof types.DirectedShortChannelId + * @static + * @param {types.IDirectedShortChannelId} message DirectedShortChannelId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DirectedShortChannelId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DirectedShortChannelId message from the specified reader or buffer. + * @function decode + * @memberof types.DirectedShortChannelId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.DirectedShortChannelId} DirectedShortChannelId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DirectedShortChannelId.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.DirectedShortChannelId(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.scid = reader.uint64(); + break; + } + case 2: { + message.direction = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a DirectedShortChannelId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.DirectedShortChannelId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.DirectedShortChannelId} DirectedShortChannelId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DirectedShortChannelId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DirectedShortChannelId message. + * @function verify + * @memberof types.DirectedShortChannelId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DirectedShortChannelId.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.scid != null && message.hasOwnProperty("scid")) + if (!$util.isInteger(message.scid) && !(message.scid && $util.isInteger(message.scid.low) && $util.isInteger(message.scid.high))) + return "scid: integer|Long expected"; + if (message.direction != null && message.hasOwnProperty("direction")) + switch (message.direction) { + default: + return "direction: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a DirectedShortChannelId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.DirectedShortChannelId + * @static + * @param {Object.} object Plain object + * @returns {types.DirectedShortChannelId} DirectedShortChannelId + */ + DirectedShortChannelId.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.DirectedShortChannelId) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.DirectedShortChannelId(); + if (object.scid != null) + if ($util.Long) + (message.scid = $util.Long.fromValue(object.scid)).unsigned = true; + else if (typeof object.scid === "string") + message.scid = parseInt(object.scid, 10); + else if (typeof object.scid === "number") + message.scid = object.scid; + else if (typeof object.scid === "object") + message.scid = new $util.LongBits(object.scid.low >>> 0, object.scid.high >>> 0).toNumber(true); + switch (object.direction) { + default: + if (typeof object.direction === "number") { + message.direction = object.direction; + break; + } + break; + case "NODE_ONE": + case 0: + message.direction = 0; + break; + case "NODE_TWO": + case 1: + message.direction = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a DirectedShortChannelId message. Also converts values to other types if specified. + * @function toObject + * @memberof types.DirectedShortChannelId + * @static + * @param {types.DirectedShortChannelId} message DirectedShortChannelId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DirectedShortChannelId.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.scid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long; + } else + object.scid = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0; + object.direction = options.enums === String ? "NODE_ONE" : 0; + } + if (message.scid != null && message.hasOwnProperty("scid")) + if (typeof BigInt !== "undefined" && options.longs === BigInt) + object.scid = typeof message.scid === "number" ? BigInt(message.scid) : $util.Long.fromBits(message.scid.low >>> 0, message.scid.high >>> 0, true).toBigInt(); + else if (typeof message.scid === "number") + object.scid = options.longs === String ? String(message.scid) : message.scid; + else + object.scid = options.longs === String ? $util.Long.prototype.toString.call(message.scid) : options.longs === Number ? new $util.LongBits(message.scid.low >>> 0, message.scid.high >>> 0).toNumber(true) : message.scid; + if (message.direction != null && message.hasOwnProperty("direction")) + object.direction = options.enums === String ? $root.types.ChannelDirection[message.direction] === undefined ? message.direction : $root.types.ChannelDirection[message.direction] : message.direction; + return object; + }; + + /** + * Converts this DirectedShortChannelId to JSON. + * @function toJSON + * @memberof types.DirectedShortChannelId + * @instance + * @returns {Object.} JSON object + */ + DirectedShortChannelId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DirectedShortChannelId + * @function getTypeUrl + * @memberof types.DirectedShortChannelId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DirectedShortChannelId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.DirectedShortChannelId"; + }; + + return DirectedShortChannelId; + })(); + + /** + * ChannelDirection enum. + * @name types.ChannelDirection + * @enum {number} + * @property {number} NODE_ONE=0 NODE_ONE value + * @property {number} NODE_TWO=1 NODE_TWO value + */ + types.ChannelDirection = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NODE_ONE"] = 0; + values[valuesById[1] = "NODE_TWO"] = 1; + return values; + })(); + + types.Bolt11Feature = (function() { + + /** + * Properties of a Bolt11Feature. + * @memberof types + * @interface IBolt11Feature + * @property {string|null} [name] Bolt11Feature name + * @property {boolean|null} [is_required] Bolt11Feature is_required + * @property {boolean|null} [is_known] Bolt11Feature is_known + */ + + /** + * Constructs a new Bolt11Feature. + * @memberof types + * @classdesc Represents a Bolt11Feature. + * @implements IBolt11Feature + * @constructor + * @param {types.IBolt11Feature=} [properties] Properties to set + */ + function Bolt11Feature(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11Feature name. + * @member {string} name + * @memberof types.Bolt11Feature + * @instance + */ + Bolt11Feature.prototype.name = ""; + + /** + * Bolt11Feature is_required. + * @member {boolean} is_required + * @memberof types.Bolt11Feature + * @instance + */ + Bolt11Feature.prototype.is_required = false; + + /** + * Bolt11Feature is_known. + * @member {boolean} is_known + * @memberof types.Bolt11Feature + * @instance + */ + Bolt11Feature.prototype.is_known = false; + + /** + * Creates a new Bolt11Feature instance using the specified properties. + * @function create + * @memberof types.Bolt11Feature + * @static + * @param {types.IBolt11Feature=} [properties] Properties to set + * @returns {types.Bolt11Feature} Bolt11Feature instance + */ + Bolt11Feature.create = function create(properties) { + return new Bolt11Feature(properties); + }; + + /** + * Encodes the specified Bolt11Feature message. Does not implicitly {@link types.Bolt11Feature.verify|verify} messages. + * @function encode + * @memberof types.Bolt11Feature + * @static + * @param {types.IBolt11Feature} message Bolt11Feature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11Feature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.is_required != null && Object.hasOwnProperty.call(message, "is_required")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.is_required); + if (message.is_known != null && Object.hasOwnProperty.call(message, "is_known")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.is_known); + return writer; + }; + + /** + * Encodes the specified Bolt11Feature message, length delimited. Does not implicitly {@link types.Bolt11Feature.verify|verify} messages. + * @function encodeDelimited + * @memberof types.Bolt11Feature + * @static + * @param {types.IBolt11Feature} message Bolt11Feature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11Feature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11Feature message from the specified reader or buffer. + * @function decode + * @memberof types.Bolt11Feature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.Bolt11Feature} Bolt11Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11Feature.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Bolt11Feature(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.is_required = reader.bool(); + break; + } + case 3: { + message.is_known = reader.bool(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a Bolt11Feature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof types.Bolt11Feature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {types.Bolt11Feature} Bolt11Feature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11Feature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Bolt11Feature message. + * @function verify + * @memberof types.Bolt11Feature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Bolt11Feature.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.is_required != null && message.hasOwnProperty("is_required")) + if (typeof message.is_required !== "boolean") + return "is_required: boolean expected"; + if (message.is_known != null && message.hasOwnProperty("is_known")) + if (typeof message.is_known !== "boolean") + return "is_known: boolean expected"; + return null; + }; + + /** + * Creates a Bolt11Feature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Bolt11Feature + * @static + * @param {Object.} object Plain object + * @returns {types.Bolt11Feature} Bolt11Feature + */ + Bolt11Feature.fromObject = function fromObject(object, long) { + if (object instanceof $root.types.Bolt11Feature) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.types.Bolt11Feature(); + if (object.name != null) + message.name = String(object.name); + if (object.is_required != null) + message.is_required = Boolean(object.is_required); + if (object.is_known != null) + message.is_known = Boolean(object.is_known); + return message; + }; + + /** + * Creates a plain object from a Bolt11Feature message. Also converts values to other types if specified. + * @function toObject + * @memberof types.Bolt11Feature + * @static + * @param {types.Bolt11Feature} message Bolt11Feature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11Feature.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.name = ""; + object.is_required = false; + object.is_known = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.is_required != null && message.hasOwnProperty("is_required")) + object.is_required = message.is_required; + if (message.is_known != null && message.hasOwnProperty("is_known")) + object.is_known = message.is_known; + return object; + }; + + /** + * Converts this Bolt11Feature to JSON. + * @function toJSON + * @memberof types.Bolt11Feature + * @instance + * @returns {Object.} JSON object + */ + Bolt11Feature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11Feature + * @function getTypeUrl + * @memberof types.Bolt11Feature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11Feature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Bolt11Feature"; + }; + + return Bolt11Feature; + })(); + + return types; +})(); + +export const events = $root.events = (() => { + + /** + * Namespace events. + * @exports events + * @namespace + */ + const events = {}; + + events.EventEnvelope = (function() { + + /** + * Properties of an EventEnvelope. + * @memberof events + * @interface IEventEnvelope + * @property {events.IPaymentReceived|null} [payment_received] EventEnvelope payment_received + * @property {events.IPaymentSuccessful|null} [payment_successful] EventEnvelope payment_successful + * @property {events.IPaymentFailed|null} [payment_failed] EventEnvelope payment_failed + * @property {events.IPaymentForwarded|null} [payment_forwarded] EventEnvelope payment_forwarded + * @property {events.IPaymentClaimable|null} [payment_claimable] EventEnvelope payment_claimable + * @property {events.IChannelStateChanged|null} [channel_state_changed] EventEnvelope channel_state_changed + */ + + /** + * Constructs a new EventEnvelope. + * @memberof events + * @classdesc Represents an EventEnvelope. + * @implements IEventEnvelope + * @constructor + * @param {events.IEventEnvelope=} [properties] Properties to set + */ + function EventEnvelope(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * EventEnvelope payment_received. + * @member {events.IPaymentReceived|null|undefined} payment_received + * @memberof events.EventEnvelope + * @instance + */ + EventEnvelope.prototype.payment_received = null; + + /** + * EventEnvelope payment_successful. + * @member {events.IPaymentSuccessful|null|undefined} payment_successful + * @memberof events.EventEnvelope + * @instance + */ + EventEnvelope.prototype.payment_successful = null; + + /** + * EventEnvelope payment_failed. + * @member {events.IPaymentFailed|null|undefined} payment_failed + * @memberof events.EventEnvelope + * @instance + */ + EventEnvelope.prototype.payment_failed = null; + + /** + * EventEnvelope payment_forwarded. + * @member {events.IPaymentForwarded|null|undefined} payment_forwarded + * @memberof events.EventEnvelope + * @instance + */ + EventEnvelope.prototype.payment_forwarded = null; + + /** + * EventEnvelope payment_claimable. + * @member {events.IPaymentClaimable|null|undefined} payment_claimable + * @memberof events.EventEnvelope + * @instance + */ + EventEnvelope.prototype.payment_claimable = null; + + /** + * EventEnvelope channel_state_changed. + * @member {events.IChannelStateChanged|null|undefined} channel_state_changed + * @memberof events.EventEnvelope + * @instance + */ + EventEnvelope.prototype.channel_state_changed = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * EventEnvelope event. + * @member {"payment_received"|"payment_successful"|"payment_failed"|"payment_forwarded"|"payment_claimable"|"channel_state_changed"|undefined} event + * @memberof events.EventEnvelope + * @instance + */ + Object.defineProperty(EventEnvelope.prototype, "event", { + get: $util.oneOfGetter($oneOfFields = ["payment_received", "payment_successful", "payment_failed", "payment_forwarded", "payment_claimable", "channel_state_changed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EventEnvelope instance using the specified properties. + * @function create + * @memberof events.EventEnvelope + * @static + * @param {events.IEventEnvelope=} [properties] Properties to set + * @returns {events.EventEnvelope} EventEnvelope instance + */ + EventEnvelope.create = function create(properties) { + return new EventEnvelope(properties); + }; + + /** + * Encodes the specified EventEnvelope message. Does not implicitly {@link events.EventEnvelope.verify|verify} messages. + * @function encode + * @memberof events.EventEnvelope + * @static + * @param {events.IEventEnvelope} message EventEnvelope message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventEnvelope.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payment_received != null && Object.hasOwnProperty.call(message, "payment_received")) + $root.events.PaymentReceived.encode(message.payment_received, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.payment_successful != null && Object.hasOwnProperty.call(message, "payment_successful")) + $root.events.PaymentSuccessful.encode(message.payment_successful, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.payment_failed != null && Object.hasOwnProperty.call(message, "payment_failed")) + $root.events.PaymentFailed.encode(message.payment_failed, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.payment_forwarded != null && Object.hasOwnProperty.call(message, "payment_forwarded")) + $root.events.PaymentForwarded.encode(message.payment_forwarded, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.payment_claimable != null && Object.hasOwnProperty.call(message, "payment_claimable")) + $root.events.PaymentClaimable.encode(message.payment_claimable, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.channel_state_changed != null && Object.hasOwnProperty.call(message, "channel_state_changed")) + $root.events.ChannelStateChanged.encode(message.channel_state_changed, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EventEnvelope message, length delimited. Does not implicitly {@link events.EventEnvelope.verify|verify} messages. + * @function encodeDelimited + * @memberof events.EventEnvelope + * @static + * @param {events.IEventEnvelope} message EventEnvelope message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventEnvelope.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventEnvelope message from the specified reader or buffer. + * @function decode + * @memberof events.EventEnvelope + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {events.EventEnvelope} EventEnvelope + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventEnvelope.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.EventEnvelope(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.payment_received = $root.events.PaymentReceived.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 3: { + message.payment_successful = $root.events.PaymentSuccessful.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.payment_failed = $root.events.PaymentFailed.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.payment_forwarded = $root.events.PaymentForwarded.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.payment_claimable = $root.events.PaymentClaimable.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 8: { + message.channel_state_changed = $root.events.ChannelStateChanged.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an EventEnvelope message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof events.EventEnvelope + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {events.EventEnvelope} EventEnvelope + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventEnvelope.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventEnvelope message. + * @function verify + * @memberof events.EventEnvelope + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventEnvelope.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.payment_received != null && message.hasOwnProperty("payment_received")) { + properties.event = 1; + { + let error = $root.events.PaymentReceived.verify(message.payment_received, long + 1); + if (error) + return "payment_received." + error; + } + } + if (message.payment_successful != null && message.hasOwnProperty("payment_successful")) { + if (properties.event === 1) + return "event: multiple values"; + properties.event = 1; + { + let error = $root.events.PaymentSuccessful.verify(message.payment_successful, long + 1); + if (error) + return "payment_successful." + error; + } + } + if (message.payment_failed != null && message.hasOwnProperty("payment_failed")) { + if (properties.event === 1) + return "event: multiple values"; + properties.event = 1; + { + let error = $root.events.PaymentFailed.verify(message.payment_failed, long + 1); + if (error) + return "payment_failed." + error; + } + } + if (message.payment_forwarded != null && message.hasOwnProperty("payment_forwarded")) { + if (properties.event === 1) + return "event: multiple values"; + properties.event = 1; + { + let error = $root.events.PaymentForwarded.verify(message.payment_forwarded, long + 1); + if (error) + return "payment_forwarded." + error; + } + } + if (message.payment_claimable != null && message.hasOwnProperty("payment_claimable")) { + if (properties.event === 1) + return "event: multiple values"; + properties.event = 1; + { + let error = $root.events.PaymentClaimable.verify(message.payment_claimable, long + 1); + if (error) + return "payment_claimable." + error; + } + } + if (message.channel_state_changed != null && message.hasOwnProperty("channel_state_changed")) { + if (properties.event === 1) + return "event: multiple values"; + properties.event = 1; + { + let error = $root.events.ChannelStateChanged.verify(message.channel_state_changed, long + 1); + if (error) + return "channel_state_changed." + error; + } + } + return null; + }; + + /** + * Creates an EventEnvelope message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof events.EventEnvelope + * @static + * @param {Object.} object Plain object + * @returns {events.EventEnvelope} EventEnvelope + */ + EventEnvelope.fromObject = function fromObject(object, long) { + if (object instanceof $root.events.EventEnvelope) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.events.EventEnvelope(); + if (object.payment_received != null) { + if (typeof object.payment_received !== "object") + throw TypeError(".events.EventEnvelope.payment_received: object expected"); + message.payment_received = $root.events.PaymentReceived.fromObject(object.payment_received, long + 1); + } + if (object.payment_successful != null) { + if (typeof object.payment_successful !== "object") + throw TypeError(".events.EventEnvelope.payment_successful: object expected"); + message.payment_successful = $root.events.PaymentSuccessful.fromObject(object.payment_successful, long + 1); + } + if (object.payment_failed != null) { + if (typeof object.payment_failed !== "object") + throw TypeError(".events.EventEnvelope.payment_failed: object expected"); + message.payment_failed = $root.events.PaymentFailed.fromObject(object.payment_failed, long + 1); + } + if (object.payment_forwarded != null) { + if (typeof object.payment_forwarded !== "object") + throw TypeError(".events.EventEnvelope.payment_forwarded: object expected"); + message.payment_forwarded = $root.events.PaymentForwarded.fromObject(object.payment_forwarded, long + 1); + } + if (object.payment_claimable != null) { + if (typeof object.payment_claimable !== "object") + throw TypeError(".events.EventEnvelope.payment_claimable: object expected"); + message.payment_claimable = $root.events.PaymentClaimable.fromObject(object.payment_claimable, long + 1); + } + if (object.channel_state_changed != null) { + if (typeof object.channel_state_changed !== "object") + throw TypeError(".events.EventEnvelope.channel_state_changed: object expected"); + message.channel_state_changed = $root.events.ChannelStateChanged.fromObject(object.channel_state_changed, long + 1); + } + return message; + }; + + /** + * Creates a plain object from an EventEnvelope message. Also converts values to other types if specified. + * @function toObject + * @memberof events.EventEnvelope + * @static + * @param {events.EventEnvelope} message EventEnvelope + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventEnvelope.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.payment_received != null && message.hasOwnProperty("payment_received")) { + object.payment_received = $root.events.PaymentReceived.toObject(message.payment_received, options); + if (options.oneofs) + object.event = "payment_received"; + } + if (message.payment_successful != null && message.hasOwnProperty("payment_successful")) { + object.payment_successful = $root.events.PaymentSuccessful.toObject(message.payment_successful, options); + if (options.oneofs) + object.event = "payment_successful"; + } + if (message.payment_failed != null && message.hasOwnProperty("payment_failed")) { + object.payment_failed = $root.events.PaymentFailed.toObject(message.payment_failed, options); + if (options.oneofs) + object.event = "payment_failed"; + } + if (message.payment_forwarded != null && message.hasOwnProperty("payment_forwarded")) { + object.payment_forwarded = $root.events.PaymentForwarded.toObject(message.payment_forwarded, options); + if (options.oneofs) + object.event = "payment_forwarded"; + } + if (message.payment_claimable != null && message.hasOwnProperty("payment_claimable")) { + object.payment_claimable = $root.events.PaymentClaimable.toObject(message.payment_claimable, options); + if (options.oneofs) + object.event = "payment_claimable"; + } + if (message.channel_state_changed != null && message.hasOwnProperty("channel_state_changed")) { + object.channel_state_changed = $root.events.ChannelStateChanged.toObject(message.channel_state_changed, options); + if (options.oneofs) + object.event = "channel_state_changed"; + } + return object; + }; + + /** + * Converts this EventEnvelope to JSON. + * @function toJSON + * @memberof events.EventEnvelope + * @instance + * @returns {Object.} JSON object + */ + EventEnvelope.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EventEnvelope + * @function getTypeUrl + * @memberof events.EventEnvelope + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EventEnvelope.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.EventEnvelope"; + }; + + return EventEnvelope; + })(); + + /** + * ChannelState enum. + * @name events.ChannelState + * @enum {number} + * @property {number} CHANNEL_STATE_UNSPECIFIED=0 CHANNEL_STATE_UNSPECIFIED value + * @property {number} CHANNEL_STATE_PENDING=1 CHANNEL_STATE_PENDING value + * @property {number} CHANNEL_STATE_READY=2 CHANNEL_STATE_READY value + * @property {number} CHANNEL_STATE_OPEN_FAILED=3 CHANNEL_STATE_OPEN_FAILED value + * @property {number} CHANNEL_STATE_CLOSED=4 CHANNEL_STATE_CLOSED value + */ + events.ChannelState = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CHANNEL_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CHANNEL_STATE_PENDING"] = 1; + values[valuesById[2] = "CHANNEL_STATE_READY"] = 2; + values[valuesById[3] = "CHANNEL_STATE_OPEN_FAILED"] = 3; + values[valuesById[4] = "CHANNEL_STATE_CLOSED"] = 4; + return values; + })(); + + /** + * ChannelClosureInitiator enum. + * @name events.ChannelClosureInitiator + * @enum {number} + * @property {number} CHANNEL_CLOSURE_INITIATOR_UNSPECIFIED=0 CHANNEL_CLOSURE_INITIATOR_UNSPECIFIED value + * @property {number} CHANNEL_CLOSURE_INITIATOR_LOCAL=1 CHANNEL_CLOSURE_INITIATOR_LOCAL value + * @property {number} CHANNEL_CLOSURE_INITIATOR_REMOTE=2 CHANNEL_CLOSURE_INITIATOR_REMOTE value + * @property {number} CHANNEL_CLOSURE_INITIATOR_UNKNOWN=3 CHANNEL_CLOSURE_INITIATOR_UNKNOWN value + */ + events.ChannelClosureInitiator = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CHANNEL_CLOSURE_INITIATOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "CHANNEL_CLOSURE_INITIATOR_LOCAL"] = 1; + values[valuesById[2] = "CHANNEL_CLOSURE_INITIATOR_REMOTE"] = 2; + values[valuesById[3] = "CHANNEL_CLOSURE_INITIATOR_UNKNOWN"] = 3; + return values; + })(); + + /** + * ChannelStateChangeReasonKind enum. + * @name events.ChannelStateChangeReasonKind + * @enum {number} + * @property {number} CHANNEL_STATE_CHANGE_REASON_KIND_UNSPECIFIED=0 CHANNEL_STATE_CHANGE_REASON_KIND_UNSPECIFIED value + * @property {number} CHANNEL_STATE_CHANGE_REASON_KIND_COUNTERPARTY_FORCE_CLOSED=1 CHANNEL_STATE_CHANGE_REASON_KIND_COUNTERPARTY_FORCE_CLOSED value + * @property {number} CHANNEL_STATE_CHANGE_REASON_KIND_HOLDER_FORCE_CLOSED=2 CHANNEL_STATE_CHANGE_REASON_KIND_HOLDER_FORCE_CLOSED value + * @property {number} CHANNEL_STATE_CHANGE_REASON_KIND_LEGACY_COOPERATIVE_CLOSURE=3 CHANNEL_STATE_CHANGE_REASON_KIND_LEGACY_COOPERATIVE_CLOSURE value + * @property {number} CHANNEL_STATE_CHANGE_REASON_KIND_COUNTERPARTY_INITIATED_COOPERATIVE_CLOSURE=4 CHANNEL_STATE_CHANGE_REASON_KIND_COUNTERPARTY_INITIATED_COOPERATIVE_CLOSURE value + * @property {number} CHANNEL_STATE_CHANGE_REASON_KIND_LOCALLY_INITIATED_COOPERATIVE_CLOSURE=5 CHANNEL_STATE_CHANGE_REASON_KIND_LOCALLY_INITIATED_COOPERATIVE_CLOSURE value + * @property {number} CHANNEL_STATE_CHANGE_REASON_KIND_COMMITMENT_TX_CONFIRMED=6 CHANNEL_STATE_CHANGE_REASON_KIND_COMMITMENT_TX_CONFIRMED value + * @property {number} CHANNEL_STATE_CHANGE_REASON_KIND_FUNDING_TIMED_OUT=7 CHANNEL_STATE_CHANGE_REASON_KIND_FUNDING_TIMED_OUT value + * @property {number} CHANNEL_STATE_CHANGE_REASON_KIND_PROCESSING_ERROR=8 CHANNEL_STATE_CHANGE_REASON_KIND_PROCESSING_ERROR value + * @property {number} CHANNEL_STATE_CHANGE_REASON_KIND_DISCONNECTED_PEER=9 CHANNEL_STATE_CHANGE_REASON_KIND_DISCONNECTED_PEER value + * @property {number} CHANNEL_STATE_CHANGE_REASON_KIND_OUTDATED_CHANNEL_MANAGER=10 CHANNEL_STATE_CHANGE_REASON_KIND_OUTDATED_CHANNEL_MANAGER value + * @property {number} CHANNEL_STATE_CHANGE_REASON_KIND_COUNTERPARTY_COOP_CLOSED_UNFUNDED_CHANNEL=11 CHANNEL_STATE_CHANGE_REASON_KIND_COUNTERPARTY_COOP_CLOSED_UNFUNDED_CHANNEL value + * @property {number} CHANNEL_STATE_CHANGE_REASON_KIND_LOCALLY_COOP_CLOSED_UNFUNDED_CHANNEL=12 CHANNEL_STATE_CHANGE_REASON_KIND_LOCALLY_COOP_CLOSED_UNFUNDED_CHANNEL value + * @property {number} CHANNEL_STATE_CHANGE_REASON_KIND_FUNDING_BATCH_CLOSURE=13 CHANNEL_STATE_CHANGE_REASON_KIND_FUNDING_BATCH_CLOSURE value + * @property {number} CHANNEL_STATE_CHANGE_REASON_KIND_HTLCS_TIMED_OUT=14 CHANNEL_STATE_CHANGE_REASON_KIND_HTLCS_TIMED_OUT value + * @property {number} CHANNEL_STATE_CHANGE_REASON_KIND_PEER_FEERATE_TOO_LOW=15 CHANNEL_STATE_CHANGE_REASON_KIND_PEER_FEERATE_TOO_LOW value + */ + events.ChannelStateChangeReasonKind = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CHANNEL_STATE_CHANGE_REASON_KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "CHANNEL_STATE_CHANGE_REASON_KIND_COUNTERPARTY_FORCE_CLOSED"] = 1; + values[valuesById[2] = "CHANNEL_STATE_CHANGE_REASON_KIND_HOLDER_FORCE_CLOSED"] = 2; + values[valuesById[3] = "CHANNEL_STATE_CHANGE_REASON_KIND_LEGACY_COOPERATIVE_CLOSURE"] = 3; + values[valuesById[4] = "CHANNEL_STATE_CHANGE_REASON_KIND_COUNTERPARTY_INITIATED_COOPERATIVE_CLOSURE"] = 4; + values[valuesById[5] = "CHANNEL_STATE_CHANGE_REASON_KIND_LOCALLY_INITIATED_COOPERATIVE_CLOSURE"] = 5; + values[valuesById[6] = "CHANNEL_STATE_CHANGE_REASON_KIND_COMMITMENT_TX_CONFIRMED"] = 6; + values[valuesById[7] = "CHANNEL_STATE_CHANGE_REASON_KIND_FUNDING_TIMED_OUT"] = 7; + values[valuesById[8] = "CHANNEL_STATE_CHANGE_REASON_KIND_PROCESSING_ERROR"] = 8; + values[valuesById[9] = "CHANNEL_STATE_CHANGE_REASON_KIND_DISCONNECTED_PEER"] = 9; + values[valuesById[10] = "CHANNEL_STATE_CHANGE_REASON_KIND_OUTDATED_CHANNEL_MANAGER"] = 10; + values[valuesById[11] = "CHANNEL_STATE_CHANGE_REASON_KIND_COUNTERPARTY_COOP_CLOSED_UNFUNDED_CHANNEL"] = 11; + values[valuesById[12] = "CHANNEL_STATE_CHANGE_REASON_KIND_LOCALLY_COOP_CLOSED_UNFUNDED_CHANNEL"] = 12; + values[valuesById[13] = "CHANNEL_STATE_CHANGE_REASON_KIND_FUNDING_BATCH_CLOSURE"] = 13; + values[valuesById[14] = "CHANNEL_STATE_CHANGE_REASON_KIND_HTLCS_TIMED_OUT"] = 14; + values[valuesById[15] = "CHANNEL_STATE_CHANGE_REASON_KIND_PEER_FEERATE_TOO_LOW"] = 15; + return values; + })(); + + events.CounterpartyForceClosedDetails = (function() { + + /** + * Properties of a CounterpartyForceClosedDetails. + * @memberof events + * @interface ICounterpartyForceClosedDetails + * @property {string|null} [peer_msg] CounterpartyForceClosedDetails peer_msg + */ + + /** + * Constructs a new CounterpartyForceClosedDetails. + * @memberof events + * @classdesc Represents a CounterpartyForceClosedDetails. + * @implements ICounterpartyForceClosedDetails + * @constructor + * @param {events.ICounterpartyForceClosedDetails=} [properties] Properties to set + */ + function CounterpartyForceClosedDetails(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * CounterpartyForceClosedDetails peer_msg. + * @member {string} peer_msg + * @memberof events.CounterpartyForceClosedDetails + * @instance + */ + CounterpartyForceClosedDetails.prototype.peer_msg = ""; + + /** + * Creates a new CounterpartyForceClosedDetails instance using the specified properties. + * @function create + * @memberof events.CounterpartyForceClosedDetails + * @static + * @param {events.ICounterpartyForceClosedDetails=} [properties] Properties to set + * @returns {events.CounterpartyForceClosedDetails} CounterpartyForceClosedDetails instance + */ + CounterpartyForceClosedDetails.create = function create(properties) { + return new CounterpartyForceClosedDetails(properties); + }; + + /** + * Encodes the specified CounterpartyForceClosedDetails message. Does not implicitly {@link events.CounterpartyForceClosedDetails.verify|verify} messages. + * @function encode + * @memberof events.CounterpartyForceClosedDetails + * @static + * @param {events.ICounterpartyForceClosedDetails} message CounterpartyForceClosedDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CounterpartyForceClosedDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.peer_msg != null && Object.hasOwnProperty.call(message, "peer_msg")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.peer_msg); + return writer; + }; + + /** + * Encodes the specified CounterpartyForceClosedDetails message, length delimited. Does not implicitly {@link events.CounterpartyForceClosedDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof events.CounterpartyForceClosedDetails + * @static + * @param {events.ICounterpartyForceClosedDetails} message CounterpartyForceClosedDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CounterpartyForceClosedDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CounterpartyForceClosedDetails message from the specified reader or buffer. + * @function decode + * @memberof events.CounterpartyForceClosedDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {events.CounterpartyForceClosedDetails} CounterpartyForceClosedDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CounterpartyForceClosedDetails.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.CounterpartyForceClosedDetails(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.peer_msg = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a CounterpartyForceClosedDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof events.CounterpartyForceClosedDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {events.CounterpartyForceClosedDetails} CounterpartyForceClosedDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CounterpartyForceClosedDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CounterpartyForceClosedDetails message. + * @function verify + * @memberof events.CounterpartyForceClosedDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CounterpartyForceClosedDetails.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.peer_msg != null && message.hasOwnProperty("peer_msg")) + if (!$util.isString(message.peer_msg)) + return "peer_msg: string expected"; + return null; + }; + + /** + * Creates a CounterpartyForceClosedDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof events.CounterpartyForceClosedDetails + * @static + * @param {Object.} object Plain object + * @returns {events.CounterpartyForceClosedDetails} CounterpartyForceClosedDetails + */ + CounterpartyForceClosedDetails.fromObject = function fromObject(object, long) { + if (object instanceof $root.events.CounterpartyForceClosedDetails) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.events.CounterpartyForceClosedDetails(); + if (object.peer_msg != null) + message.peer_msg = String(object.peer_msg); + return message; + }; + + /** + * Creates a plain object from a CounterpartyForceClosedDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof events.CounterpartyForceClosedDetails + * @static + * @param {events.CounterpartyForceClosedDetails} message CounterpartyForceClosedDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CounterpartyForceClosedDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.peer_msg = ""; + if (message.peer_msg != null && message.hasOwnProperty("peer_msg")) + object.peer_msg = message.peer_msg; + return object; + }; + + /** + * Converts this CounterpartyForceClosedDetails to JSON. + * @function toJSON + * @memberof events.CounterpartyForceClosedDetails + * @instance + * @returns {Object.} JSON object + */ + CounterpartyForceClosedDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CounterpartyForceClosedDetails + * @function getTypeUrl + * @memberof events.CounterpartyForceClosedDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CounterpartyForceClosedDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.CounterpartyForceClosedDetails"; + }; + + return CounterpartyForceClosedDetails; + })(); + + events.HolderForceClosedDetails = (function() { + + /** + * Properties of a HolderForceClosedDetails. + * @memberof events + * @interface IHolderForceClosedDetails + * @property {boolean|null} [broadcasted_latest_txn] HolderForceClosedDetails broadcasted_latest_txn + * @property {string|null} [message] HolderForceClosedDetails message + */ + + /** + * Constructs a new HolderForceClosedDetails. + * @memberof events + * @classdesc Represents a HolderForceClosedDetails. + * @implements IHolderForceClosedDetails + * @constructor + * @param {events.IHolderForceClosedDetails=} [properties] Properties to set + */ + function HolderForceClosedDetails(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * HolderForceClosedDetails broadcasted_latest_txn. + * @member {boolean|null|undefined} broadcasted_latest_txn + * @memberof events.HolderForceClosedDetails + * @instance + */ + HolderForceClosedDetails.prototype.broadcasted_latest_txn = null; + + /** + * HolderForceClosedDetails message. + * @member {string} message + * @memberof events.HolderForceClosedDetails + * @instance + */ + HolderForceClosedDetails.prototype.message = ""; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HolderForceClosedDetails.prototype, "_broadcasted_latest_txn", { + get: $util.oneOfGetter($oneOfFields = ["broadcasted_latest_txn"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HolderForceClosedDetails instance using the specified properties. + * @function create + * @memberof events.HolderForceClosedDetails + * @static + * @param {events.IHolderForceClosedDetails=} [properties] Properties to set + * @returns {events.HolderForceClosedDetails} HolderForceClosedDetails instance + */ + HolderForceClosedDetails.create = function create(properties) { + return new HolderForceClosedDetails(properties); + }; + + /** + * Encodes the specified HolderForceClosedDetails message. Does not implicitly {@link events.HolderForceClosedDetails.verify|verify} messages. + * @function encode + * @memberof events.HolderForceClosedDetails + * @static + * @param {events.IHolderForceClosedDetails} message HolderForceClosedDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HolderForceClosedDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.broadcasted_latest_txn != null && Object.hasOwnProperty.call(message, "broadcasted_latest_txn")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.broadcasted_latest_txn); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + return writer; + }; + + /** + * Encodes the specified HolderForceClosedDetails message, length delimited. Does not implicitly {@link events.HolderForceClosedDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof events.HolderForceClosedDetails + * @static + * @param {events.IHolderForceClosedDetails} message HolderForceClosedDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HolderForceClosedDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HolderForceClosedDetails message from the specified reader or buffer. + * @function decode + * @memberof events.HolderForceClosedDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {events.HolderForceClosedDetails} HolderForceClosedDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HolderForceClosedDetails.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.HolderForceClosedDetails(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.broadcasted_latest_txn = reader.bool(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a HolderForceClosedDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof events.HolderForceClosedDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {events.HolderForceClosedDetails} HolderForceClosedDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HolderForceClosedDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HolderForceClosedDetails message. + * @function verify + * @memberof events.HolderForceClosedDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HolderForceClosedDetails.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.broadcasted_latest_txn != null && message.hasOwnProperty("broadcasted_latest_txn")) { + properties._broadcasted_latest_txn = 1; + if (typeof message.broadcasted_latest_txn !== "boolean") + return "broadcasted_latest_txn: boolean expected"; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + return null; + }; + + /** + * Creates a HolderForceClosedDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof events.HolderForceClosedDetails + * @static + * @param {Object.} object Plain object + * @returns {events.HolderForceClosedDetails} HolderForceClosedDetails + */ + HolderForceClosedDetails.fromObject = function fromObject(object, long) { + if (object instanceof $root.events.HolderForceClosedDetails) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.events.HolderForceClosedDetails(); + if (object.broadcasted_latest_txn != null) + message.broadcasted_latest_txn = Boolean(object.broadcasted_latest_txn); + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from a HolderForceClosedDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof events.HolderForceClosedDetails + * @static + * @param {events.HolderForceClosedDetails} message HolderForceClosedDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HolderForceClosedDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.message = ""; + if (message.broadcasted_latest_txn != null && message.hasOwnProperty("broadcasted_latest_txn")) { + object.broadcasted_latest_txn = message.broadcasted_latest_txn; + if (options.oneofs) + object._broadcasted_latest_txn = "broadcasted_latest_txn"; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + return object; + }; + + /** + * Converts this HolderForceClosedDetails to JSON. + * @function toJSON + * @memberof events.HolderForceClosedDetails + * @instance + * @returns {Object.} JSON object + */ + HolderForceClosedDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HolderForceClosedDetails + * @function getTypeUrl + * @memberof events.HolderForceClosedDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HolderForceClosedDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.HolderForceClosedDetails"; + }; + + return HolderForceClosedDetails; + })(); + + events.ProcessingErrorDetails = (function() { + + /** + * Properties of a ProcessingErrorDetails. + * @memberof events + * @interface IProcessingErrorDetails + * @property {string|null} [err] ProcessingErrorDetails err + */ + + /** + * Constructs a new ProcessingErrorDetails. + * @memberof events + * @classdesc Represents a ProcessingErrorDetails. + * @implements IProcessingErrorDetails + * @constructor + * @param {events.IProcessingErrorDetails=} [properties] Properties to set + */ + function ProcessingErrorDetails(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProcessingErrorDetails err. + * @member {string} err + * @memberof events.ProcessingErrorDetails + * @instance + */ + ProcessingErrorDetails.prototype.err = ""; + + /** + * Creates a new ProcessingErrorDetails instance using the specified properties. + * @function create + * @memberof events.ProcessingErrorDetails + * @static + * @param {events.IProcessingErrorDetails=} [properties] Properties to set + * @returns {events.ProcessingErrorDetails} ProcessingErrorDetails instance + */ + ProcessingErrorDetails.create = function create(properties) { + return new ProcessingErrorDetails(properties); + }; + + /** + * Encodes the specified ProcessingErrorDetails message. Does not implicitly {@link events.ProcessingErrorDetails.verify|verify} messages. + * @function encode + * @memberof events.ProcessingErrorDetails + * @static + * @param {events.IProcessingErrorDetails} message ProcessingErrorDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessingErrorDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.err != null && Object.hasOwnProperty.call(message, "err")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.err); + return writer; + }; + + /** + * Encodes the specified ProcessingErrorDetails message, length delimited. Does not implicitly {@link events.ProcessingErrorDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof events.ProcessingErrorDetails + * @static + * @param {events.IProcessingErrorDetails} message ProcessingErrorDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProcessingErrorDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProcessingErrorDetails message from the specified reader or buffer. + * @function decode + * @memberof events.ProcessingErrorDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {events.ProcessingErrorDetails} ProcessingErrorDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessingErrorDetails.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.ProcessingErrorDetails(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.err = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ProcessingErrorDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof events.ProcessingErrorDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {events.ProcessingErrorDetails} ProcessingErrorDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProcessingErrorDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProcessingErrorDetails message. + * @function verify + * @memberof events.ProcessingErrorDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProcessingErrorDetails.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.err != null && message.hasOwnProperty("err")) + if (!$util.isString(message.err)) + return "err: string expected"; + return null; + }; + + /** + * Creates a ProcessingErrorDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof events.ProcessingErrorDetails + * @static + * @param {Object.} object Plain object + * @returns {events.ProcessingErrorDetails} ProcessingErrorDetails + */ + ProcessingErrorDetails.fromObject = function fromObject(object, long) { + if (object instanceof $root.events.ProcessingErrorDetails) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.events.ProcessingErrorDetails(); + if (object.err != null) + message.err = String(object.err); + return message; + }; + + /** + * Creates a plain object from a ProcessingErrorDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof events.ProcessingErrorDetails + * @static + * @param {events.ProcessingErrorDetails} message ProcessingErrorDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProcessingErrorDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.err = ""; + if (message.err != null && message.hasOwnProperty("err")) + object.err = message.err; + return object; + }; + + /** + * Converts this ProcessingErrorDetails to JSON. + * @function toJSON + * @memberof events.ProcessingErrorDetails + * @instance + * @returns {Object.} JSON object + */ + ProcessingErrorDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProcessingErrorDetails + * @function getTypeUrl + * @memberof events.ProcessingErrorDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProcessingErrorDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.ProcessingErrorDetails"; + }; + + return ProcessingErrorDetails; + })(); + + events.HtlcsTimedOutDetails = (function() { + + /** + * Properties of a HtlcsTimedOutDetails. + * @memberof events + * @interface IHtlcsTimedOutDetails + * @property {string|null} [payment_hash] HtlcsTimedOutDetails payment_hash + */ + + /** + * Constructs a new HtlcsTimedOutDetails. + * @memberof events + * @classdesc Represents a HtlcsTimedOutDetails. + * @implements IHtlcsTimedOutDetails + * @constructor + * @param {events.IHtlcsTimedOutDetails=} [properties] Properties to set + */ + function HtlcsTimedOutDetails(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * HtlcsTimedOutDetails payment_hash. + * @member {string|null|undefined} payment_hash + * @memberof events.HtlcsTimedOutDetails + * @instance + */ + HtlcsTimedOutDetails.prototype.payment_hash = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(HtlcsTimedOutDetails.prototype, "_payment_hash", { + get: $util.oneOfGetter($oneOfFields = ["payment_hash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HtlcsTimedOutDetails instance using the specified properties. + * @function create + * @memberof events.HtlcsTimedOutDetails + * @static + * @param {events.IHtlcsTimedOutDetails=} [properties] Properties to set + * @returns {events.HtlcsTimedOutDetails} HtlcsTimedOutDetails instance + */ + HtlcsTimedOutDetails.create = function create(properties) { + return new HtlcsTimedOutDetails(properties); + }; + + /** + * Encodes the specified HtlcsTimedOutDetails message. Does not implicitly {@link events.HtlcsTimedOutDetails.verify|verify} messages. + * @function encode + * @memberof events.HtlcsTimedOutDetails + * @static + * @param {events.IHtlcsTimedOutDetails} message HtlcsTimedOutDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HtlcsTimedOutDetails.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).string(message.payment_hash); + return writer; + }; + + /** + * Encodes the specified HtlcsTimedOutDetails message, length delimited. Does not implicitly {@link events.HtlcsTimedOutDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof events.HtlcsTimedOutDetails + * @static + * @param {events.IHtlcsTimedOutDetails} message HtlcsTimedOutDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HtlcsTimedOutDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HtlcsTimedOutDetails message from the specified reader or buffer. + * @function decode + * @memberof events.HtlcsTimedOutDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {events.HtlcsTimedOutDetails} HtlcsTimedOutDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HtlcsTimedOutDetails.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.HtlcsTimedOutDetails(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.payment_hash = reader.string(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a HtlcsTimedOutDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof events.HtlcsTimedOutDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {events.HtlcsTimedOutDetails} HtlcsTimedOutDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HtlcsTimedOutDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HtlcsTimedOutDetails message. + * @function verify + * @memberof events.HtlcsTimedOutDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HtlcsTimedOutDetails.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) { + properties._payment_hash = 1; + if (!$util.isString(message.payment_hash)) + return "payment_hash: string expected"; + } + return null; + }; + + /** + * Creates a HtlcsTimedOutDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof events.HtlcsTimedOutDetails + * @static + * @param {Object.} object Plain object + * @returns {events.HtlcsTimedOutDetails} HtlcsTimedOutDetails + */ + HtlcsTimedOutDetails.fromObject = function fromObject(object, long) { + if (object instanceof $root.events.HtlcsTimedOutDetails) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.events.HtlcsTimedOutDetails(); + if (object.payment_hash != null) + message.payment_hash = String(object.payment_hash); + return message; + }; + + /** + * Creates a plain object from a HtlcsTimedOutDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof events.HtlcsTimedOutDetails + * @static + * @param {events.HtlcsTimedOutDetails} message HtlcsTimedOutDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HtlcsTimedOutDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) { + object.payment_hash = message.payment_hash; + if (options.oneofs) + object._payment_hash = "payment_hash"; + } + return object; + }; + + /** + * Converts this HtlcsTimedOutDetails to JSON. + * @function toJSON + * @memberof events.HtlcsTimedOutDetails + * @instance + * @returns {Object.} JSON object + */ + HtlcsTimedOutDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HtlcsTimedOutDetails + * @function getTypeUrl + * @memberof events.HtlcsTimedOutDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HtlcsTimedOutDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.HtlcsTimedOutDetails"; + }; + + return HtlcsTimedOutDetails; + })(); + + events.PeerFeerateTooLowDetails = (function() { + + /** + * Properties of a PeerFeerateTooLowDetails. + * @memberof events + * @interface IPeerFeerateTooLowDetails + * @property {number|null} [peer_feerate_sat_per_kw] PeerFeerateTooLowDetails peer_feerate_sat_per_kw + * @property {number|null} [required_feerate_sat_per_kw] PeerFeerateTooLowDetails required_feerate_sat_per_kw + */ + + /** + * Constructs a new PeerFeerateTooLowDetails. + * @memberof events + * @classdesc Represents a PeerFeerateTooLowDetails. + * @implements IPeerFeerateTooLowDetails + * @constructor + * @param {events.IPeerFeerateTooLowDetails=} [properties] Properties to set + */ + function PeerFeerateTooLowDetails(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PeerFeerateTooLowDetails peer_feerate_sat_per_kw. + * @member {number} peer_feerate_sat_per_kw + * @memberof events.PeerFeerateTooLowDetails + * @instance + */ + PeerFeerateTooLowDetails.prototype.peer_feerate_sat_per_kw = 0; + + /** + * PeerFeerateTooLowDetails required_feerate_sat_per_kw. + * @member {number} required_feerate_sat_per_kw + * @memberof events.PeerFeerateTooLowDetails + * @instance + */ + PeerFeerateTooLowDetails.prototype.required_feerate_sat_per_kw = 0; + + /** + * Creates a new PeerFeerateTooLowDetails instance using the specified properties. + * @function create + * @memberof events.PeerFeerateTooLowDetails + * @static + * @param {events.IPeerFeerateTooLowDetails=} [properties] Properties to set + * @returns {events.PeerFeerateTooLowDetails} PeerFeerateTooLowDetails instance + */ + PeerFeerateTooLowDetails.create = function create(properties) { + return new PeerFeerateTooLowDetails(properties); + }; + + /** + * Encodes the specified PeerFeerateTooLowDetails message. Does not implicitly {@link events.PeerFeerateTooLowDetails.verify|verify} messages. + * @function encode + * @memberof events.PeerFeerateTooLowDetails + * @static + * @param {events.IPeerFeerateTooLowDetails} message PeerFeerateTooLowDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PeerFeerateTooLowDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.peer_feerate_sat_per_kw != null && Object.hasOwnProperty.call(message, "peer_feerate_sat_per_kw")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.peer_feerate_sat_per_kw); + if (message.required_feerate_sat_per_kw != null && Object.hasOwnProperty.call(message, "required_feerate_sat_per_kw")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.required_feerate_sat_per_kw); + return writer; + }; + + /** + * Encodes the specified PeerFeerateTooLowDetails message, length delimited. Does not implicitly {@link events.PeerFeerateTooLowDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof events.PeerFeerateTooLowDetails + * @static + * @param {events.IPeerFeerateTooLowDetails} message PeerFeerateTooLowDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PeerFeerateTooLowDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PeerFeerateTooLowDetails message from the specified reader or buffer. + * @function decode + * @memberof events.PeerFeerateTooLowDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {events.PeerFeerateTooLowDetails} PeerFeerateTooLowDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PeerFeerateTooLowDetails.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.PeerFeerateTooLowDetails(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.peer_feerate_sat_per_kw = reader.uint32(); + break; + } + case 2: { + message.required_feerate_sat_per_kw = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PeerFeerateTooLowDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof events.PeerFeerateTooLowDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {events.PeerFeerateTooLowDetails} PeerFeerateTooLowDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PeerFeerateTooLowDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PeerFeerateTooLowDetails message. + * @function verify + * @memberof events.PeerFeerateTooLowDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PeerFeerateTooLowDetails.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.peer_feerate_sat_per_kw != null && message.hasOwnProperty("peer_feerate_sat_per_kw")) + if (!$util.isInteger(message.peer_feerate_sat_per_kw)) + return "peer_feerate_sat_per_kw: integer expected"; + if (message.required_feerate_sat_per_kw != null && message.hasOwnProperty("required_feerate_sat_per_kw")) + if (!$util.isInteger(message.required_feerate_sat_per_kw)) + return "required_feerate_sat_per_kw: integer expected"; + return null; + }; + + /** + * Creates a PeerFeerateTooLowDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof events.PeerFeerateTooLowDetails + * @static + * @param {Object.} object Plain object + * @returns {events.PeerFeerateTooLowDetails} PeerFeerateTooLowDetails + */ + PeerFeerateTooLowDetails.fromObject = function fromObject(object, long) { + if (object instanceof $root.events.PeerFeerateTooLowDetails) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.events.PeerFeerateTooLowDetails(); + if (object.peer_feerate_sat_per_kw != null) + message.peer_feerate_sat_per_kw = object.peer_feerate_sat_per_kw >>> 0; + if (object.required_feerate_sat_per_kw != null) + message.required_feerate_sat_per_kw = object.required_feerate_sat_per_kw >>> 0; + return message; + }; + + /** + * Creates a plain object from a PeerFeerateTooLowDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof events.PeerFeerateTooLowDetails + * @static + * @param {events.PeerFeerateTooLowDetails} message PeerFeerateTooLowDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PeerFeerateTooLowDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.peer_feerate_sat_per_kw = 0; + object.required_feerate_sat_per_kw = 0; + } + if (message.peer_feerate_sat_per_kw != null && message.hasOwnProperty("peer_feerate_sat_per_kw")) + object.peer_feerate_sat_per_kw = message.peer_feerate_sat_per_kw; + if (message.required_feerate_sat_per_kw != null && message.hasOwnProperty("required_feerate_sat_per_kw")) + object.required_feerate_sat_per_kw = message.required_feerate_sat_per_kw; + return object; + }; + + /** + * Converts this PeerFeerateTooLowDetails to JSON. + * @function toJSON + * @memberof events.PeerFeerateTooLowDetails + * @instance + * @returns {Object.} JSON object + */ + PeerFeerateTooLowDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PeerFeerateTooLowDetails + * @function getTypeUrl + * @memberof events.PeerFeerateTooLowDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PeerFeerateTooLowDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.PeerFeerateTooLowDetails"; + }; + + return PeerFeerateTooLowDetails; + })(); + + events.ChannelStateChangeReason = (function() { + + /** + * Properties of a ChannelStateChangeReason. + * @memberof events + * @interface IChannelStateChangeReason + * @property {events.ChannelStateChangeReasonKind|null} [kind] ChannelStateChangeReason kind + * @property {string|null} [message] ChannelStateChangeReason message + * @property {events.ICounterpartyForceClosedDetails|null} [counterparty_force_closed] ChannelStateChangeReason counterparty_force_closed + * @property {events.IHolderForceClosedDetails|null} [holder_force_closed] ChannelStateChangeReason holder_force_closed + * @property {events.IProcessingErrorDetails|null} [processing_error] ChannelStateChangeReason processing_error + * @property {events.IHtlcsTimedOutDetails|null} [htlcs_timed_out] ChannelStateChangeReason htlcs_timed_out + * @property {events.IPeerFeerateTooLowDetails|null} [peer_feerate_too_low] ChannelStateChangeReason peer_feerate_too_low + */ + + /** + * Constructs a new ChannelStateChangeReason. + * @memberof events + * @classdesc Represents a ChannelStateChangeReason. + * @implements IChannelStateChangeReason + * @constructor + * @param {events.IChannelStateChangeReason=} [properties] Properties to set + */ + function ChannelStateChangeReason(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChannelStateChangeReason kind. + * @member {events.ChannelStateChangeReasonKind} kind + * @memberof events.ChannelStateChangeReason + * @instance + */ + ChannelStateChangeReason.prototype.kind = 0; + + /** + * ChannelStateChangeReason message. + * @member {string} message + * @memberof events.ChannelStateChangeReason + * @instance + */ + ChannelStateChangeReason.prototype.message = ""; + + /** + * ChannelStateChangeReason counterparty_force_closed. + * @member {events.ICounterpartyForceClosedDetails|null|undefined} counterparty_force_closed + * @memberof events.ChannelStateChangeReason + * @instance + */ + ChannelStateChangeReason.prototype.counterparty_force_closed = null; + + /** + * ChannelStateChangeReason holder_force_closed. + * @member {events.IHolderForceClosedDetails|null|undefined} holder_force_closed + * @memberof events.ChannelStateChangeReason + * @instance + */ + ChannelStateChangeReason.prototype.holder_force_closed = null; + + /** + * ChannelStateChangeReason processing_error. + * @member {events.IProcessingErrorDetails|null|undefined} processing_error + * @memberof events.ChannelStateChangeReason + * @instance + */ + ChannelStateChangeReason.prototype.processing_error = null; + + /** + * ChannelStateChangeReason htlcs_timed_out. + * @member {events.IHtlcsTimedOutDetails|null|undefined} htlcs_timed_out + * @memberof events.ChannelStateChangeReason + * @instance + */ + ChannelStateChangeReason.prototype.htlcs_timed_out = null; + + /** + * ChannelStateChangeReason peer_feerate_too_low. + * @member {events.IPeerFeerateTooLowDetails|null|undefined} peer_feerate_too_low + * @memberof events.ChannelStateChangeReason + * @instance + */ + ChannelStateChangeReason.prototype.peer_feerate_too_low = null; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + /** + * ChannelStateChangeReason details. + * @member {"counterparty_force_closed"|"holder_force_closed"|"processing_error"|"htlcs_timed_out"|"peer_feerate_too_low"|undefined} details + * @memberof events.ChannelStateChangeReason + * @instance + */ + Object.defineProperty(ChannelStateChangeReason.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["counterparty_force_closed", "holder_force_closed", "processing_error", "htlcs_timed_out", "peer_feerate_too_low"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ChannelStateChangeReason instance using the specified properties. + * @function create + * @memberof events.ChannelStateChangeReason + * @static + * @param {events.IChannelStateChangeReason=} [properties] Properties to set + * @returns {events.ChannelStateChangeReason} ChannelStateChangeReason instance + */ + ChannelStateChangeReason.create = function create(properties) { + return new ChannelStateChangeReason(properties); + }; + + /** + * Encodes the specified ChannelStateChangeReason message. Does not implicitly {@link events.ChannelStateChangeReason.verify|verify} messages. + * @function encode + * @memberof events.ChannelStateChangeReason + * @static + * @param {events.IChannelStateChangeReason} message ChannelStateChangeReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelStateChangeReason.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.counterparty_force_closed != null && Object.hasOwnProperty.call(message, "counterparty_force_closed")) + $root.events.CounterpartyForceClosedDetails.encode(message.counterparty_force_closed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.holder_force_closed != null && Object.hasOwnProperty.call(message, "holder_force_closed")) + $root.events.HolderForceClosedDetails.encode(message.holder_force_closed, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.processing_error != null && Object.hasOwnProperty.call(message, "processing_error")) + $root.events.ProcessingErrorDetails.encode(message.processing_error, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.htlcs_timed_out != null && Object.hasOwnProperty.call(message, "htlcs_timed_out")) + $root.events.HtlcsTimedOutDetails.encode(message.htlcs_timed_out, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.peer_feerate_too_low != null && Object.hasOwnProperty.call(message, "peer_feerate_too_low")) + $root.events.PeerFeerateTooLowDetails.encode(message.peer_feerate_too_low, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ChannelStateChangeReason message, length delimited. Does not implicitly {@link events.ChannelStateChangeReason.verify|verify} messages. + * @function encodeDelimited + * @memberof events.ChannelStateChangeReason + * @static + * @param {events.IChannelStateChangeReason} message ChannelStateChangeReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelStateChangeReason.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChannelStateChangeReason message from the specified reader or buffer. + * @function decode + * @memberof events.ChannelStateChangeReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {events.ChannelStateChangeReason} ChannelStateChangeReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelStateChangeReason.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.ChannelStateChangeReason(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kind = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + message.counterparty_force_closed = $root.events.CounterpartyForceClosedDetails.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 4: { + message.holder_force_closed = $root.events.HolderForceClosedDetails.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 5: { + message.processing_error = $root.events.ProcessingErrorDetails.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 6: { + message.htlcs_timed_out = $root.events.HtlcsTimedOutDetails.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.peer_feerate_too_low = $root.events.PeerFeerateTooLowDetails.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ChannelStateChangeReason message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof events.ChannelStateChangeReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {events.ChannelStateChangeReason} ChannelStateChangeReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelStateChangeReason.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChannelStateChangeReason message. + * @function verify + * @memberof events.ChannelStateChangeReason + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChannelStateChangeReason.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: 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: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.counterparty_force_closed != null && message.hasOwnProperty("counterparty_force_closed")) { + properties.details = 1; + { + let error = $root.events.CounterpartyForceClosedDetails.verify(message.counterparty_force_closed, long + 1); + if (error) + return "counterparty_force_closed." + error; + } + } + if (message.holder_force_closed != null && message.hasOwnProperty("holder_force_closed")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + let error = $root.events.HolderForceClosedDetails.verify(message.holder_force_closed, long + 1); + if (error) + return "holder_force_closed." + error; + } + } + if (message.processing_error != null && message.hasOwnProperty("processing_error")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + let error = $root.events.ProcessingErrorDetails.verify(message.processing_error, long + 1); + if (error) + return "processing_error." + error; + } + } + if (message.htlcs_timed_out != null && message.hasOwnProperty("htlcs_timed_out")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + let error = $root.events.HtlcsTimedOutDetails.verify(message.htlcs_timed_out, long + 1); + if (error) + return "htlcs_timed_out." + error; + } + } + if (message.peer_feerate_too_low != null && message.hasOwnProperty("peer_feerate_too_low")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + let error = $root.events.PeerFeerateTooLowDetails.verify(message.peer_feerate_too_low, long + 1); + if (error) + return "peer_feerate_too_low." + error; + } + } + return null; + }; + + /** + * Creates a ChannelStateChangeReason message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof events.ChannelStateChangeReason + * @static + * @param {Object.} object Plain object + * @returns {events.ChannelStateChangeReason} ChannelStateChangeReason + */ + ChannelStateChangeReason.fromObject = function fromObject(object, long) { + if (object instanceof $root.events.ChannelStateChangeReason) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.events.ChannelStateChangeReason(); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "CHANNEL_STATE_CHANGE_REASON_KIND_UNSPECIFIED": + case 0: + message.kind = 0; + break; + case "CHANNEL_STATE_CHANGE_REASON_KIND_COUNTERPARTY_FORCE_CLOSED": + case 1: + message.kind = 1; + break; + case "CHANNEL_STATE_CHANGE_REASON_KIND_HOLDER_FORCE_CLOSED": + case 2: + message.kind = 2; + break; + case "CHANNEL_STATE_CHANGE_REASON_KIND_LEGACY_COOPERATIVE_CLOSURE": + case 3: + message.kind = 3; + break; + case "CHANNEL_STATE_CHANGE_REASON_KIND_COUNTERPARTY_INITIATED_COOPERATIVE_CLOSURE": + case 4: + message.kind = 4; + break; + case "CHANNEL_STATE_CHANGE_REASON_KIND_LOCALLY_INITIATED_COOPERATIVE_CLOSURE": + case 5: + message.kind = 5; + break; + case "CHANNEL_STATE_CHANGE_REASON_KIND_COMMITMENT_TX_CONFIRMED": + case 6: + message.kind = 6; + break; + case "CHANNEL_STATE_CHANGE_REASON_KIND_FUNDING_TIMED_OUT": + case 7: + message.kind = 7; + break; + case "CHANNEL_STATE_CHANGE_REASON_KIND_PROCESSING_ERROR": + case 8: + message.kind = 8; + break; + case "CHANNEL_STATE_CHANGE_REASON_KIND_DISCONNECTED_PEER": + case 9: + message.kind = 9; + break; + case "CHANNEL_STATE_CHANGE_REASON_KIND_OUTDATED_CHANNEL_MANAGER": + case 10: + message.kind = 10; + break; + case "CHANNEL_STATE_CHANGE_REASON_KIND_COUNTERPARTY_COOP_CLOSED_UNFUNDED_CHANNEL": + case 11: + message.kind = 11; + break; + case "CHANNEL_STATE_CHANGE_REASON_KIND_LOCALLY_COOP_CLOSED_UNFUNDED_CHANNEL": + case 12: + message.kind = 12; + break; + case "CHANNEL_STATE_CHANGE_REASON_KIND_FUNDING_BATCH_CLOSURE": + case 13: + message.kind = 13; + break; + case "CHANNEL_STATE_CHANGE_REASON_KIND_HTLCS_TIMED_OUT": + case 14: + message.kind = 14; + break; + case "CHANNEL_STATE_CHANGE_REASON_KIND_PEER_FEERATE_TOO_LOW": + case 15: + message.kind = 15; + break; + } + if (object.message != null) + message.message = String(object.message); + if (object.counterparty_force_closed != null) { + if (typeof object.counterparty_force_closed !== "object") + throw TypeError(".events.ChannelStateChangeReason.counterparty_force_closed: object expected"); + message.counterparty_force_closed = $root.events.CounterpartyForceClosedDetails.fromObject(object.counterparty_force_closed, long + 1); + } + if (object.holder_force_closed != null) { + if (typeof object.holder_force_closed !== "object") + throw TypeError(".events.ChannelStateChangeReason.holder_force_closed: object expected"); + message.holder_force_closed = $root.events.HolderForceClosedDetails.fromObject(object.holder_force_closed, long + 1); + } + if (object.processing_error != null) { + if (typeof object.processing_error !== "object") + throw TypeError(".events.ChannelStateChangeReason.processing_error: object expected"); + message.processing_error = $root.events.ProcessingErrorDetails.fromObject(object.processing_error, long + 1); + } + if (object.htlcs_timed_out != null) { + if (typeof object.htlcs_timed_out !== "object") + throw TypeError(".events.ChannelStateChangeReason.htlcs_timed_out: object expected"); + message.htlcs_timed_out = $root.events.HtlcsTimedOutDetails.fromObject(object.htlcs_timed_out, long + 1); + } + if (object.peer_feerate_too_low != null) { + if (typeof object.peer_feerate_too_low !== "object") + throw TypeError(".events.ChannelStateChangeReason.peer_feerate_too_low: object expected"); + message.peer_feerate_too_low = $root.events.PeerFeerateTooLowDetails.fromObject(object.peer_feerate_too_low, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a ChannelStateChangeReason message. Also converts values to other types if specified. + * @function toObject + * @memberof events.ChannelStateChangeReason + * @static + * @param {events.ChannelStateChangeReason} message ChannelStateChangeReason + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChannelStateChangeReason.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.kind = options.enums === String ? "CHANNEL_STATE_CHANGE_REASON_KIND_UNSPECIFIED" : 0; + object.message = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.events.ChannelStateChangeReasonKind[message.kind] === undefined ? message.kind : $root.events.ChannelStateChangeReasonKind[message.kind] : message.kind; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.counterparty_force_closed != null && message.hasOwnProperty("counterparty_force_closed")) { + object.counterparty_force_closed = $root.events.CounterpartyForceClosedDetails.toObject(message.counterparty_force_closed, options); + if (options.oneofs) + object.details = "counterparty_force_closed"; + } + if (message.holder_force_closed != null && message.hasOwnProperty("holder_force_closed")) { + object.holder_force_closed = $root.events.HolderForceClosedDetails.toObject(message.holder_force_closed, options); + if (options.oneofs) + object.details = "holder_force_closed"; + } + if (message.processing_error != null && message.hasOwnProperty("processing_error")) { + object.processing_error = $root.events.ProcessingErrorDetails.toObject(message.processing_error, options); + if (options.oneofs) + object.details = "processing_error"; + } + if (message.htlcs_timed_out != null && message.hasOwnProperty("htlcs_timed_out")) { + object.htlcs_timed_out = $root.events.HtlcsTimedOutDetails.toObject(message.htlcs_timed_out, options); + if (options.oneofs) + object.details = "htlcs_timed_out"; + } + if (message.peer_feerate_too_low != null && message.hasOwnProperty("peer_feerate_too_low")) { + object.peer_feerate_too_low = $root.events.PeerFeerateTooLowDetails.toObject(message.peer_feerate_too_low, options); + if (options.oneofs) + object.details = "peer_feerate_too_low"; + } + return object; + }; + + /** + * Converts this ChannelStateChangeReason to JSON. + * @function toJSON + * @memberof events.ChannelStateChangeReason + * @instance + * @returns {Object.} JSON object + */ + ChannelStateChangeReason.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChannelStateChangeReason + * @function getTypeUrl + * @memberof events.ChannelStateChangeReason + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChannelStateChangeReason.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.ChannelStateChangeReason"; + }; + + return ChannelStateChangeReason; + })(); + + events.ChannelStateChanged = (function() { + + /** + * Properties of a ChannelStateChanged. + * @memberof events + * @interface IChannelStateChanged + * @property {string|null} [channel_id] ChannelStateChanged channel_id + * @property {string|null} [user_channel_id] ChannelStateChanged user_channel_id + * @property {string|null} [counterparty_node_id] ChannelStateChanged counterparty_node_id + * @property {events.ChannelState|null} [state] ChannelStateChanged state + * @property {string|null} [funding_txo] ChannelStateChanged funding_txo + * @property {events.IChannelStateChangeReason|null} [reason] ChannelStateChanged reason + * @property {events.ChannelClosureInitiator|null} [closure_initiator] ChannelStateChanged closure_initiator + */ + + /** + * Constructs a new ChannelStateChanged. + * @memberof events + * @classdesc Represents a ChannelStateChanged. + * @implements IChannelStateChanged + * @constructor + * @param {events.IChannelStateChanged=} [properties] Properties to set + */ + function ChannelStateChanged(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChannelStateChanged channel_id. + * @member {string} channel_id + * @memberof events.ChannelStateChanged + * @instance + */ + ChannelStateChanged.prototype.channel_id = ""; + + /** + * ChannelStateChanged user_channel_id. + * @member {string} user_channel_id + * @memberof events.ChannelStateChanged + * @instance + */ + ChannelStateChanged.prototype.user_channel_id = ""; + + /** + * ChannelStateChanged counterparty_node_id. + * @member {string|null|undefined} counterparty_node_id + * @memberof events.ChannelStateChanged + * @instance + */ + ChannelStateChanged.prototype.counterparty_node_id = null; + + /** + * ChannelStateChanged state. + * @member {events.ChannelState} state + * @memberof events.ChannelStateChanged + * @instance + */ + ChannelStateChanged.prototype.state = 0; + + /** + * ChannelStateChanged funding_txo. + * @member {string|null|undefined} funding_txo + * @memberof events.ChannelStateChanged + * @instance + */ + ChannelStateChanged.prototype.funding_txo = null; + + /** + * ChannelStateChanged reason. + * @member {events.IChannelStateChangeReason|null|undefined} reason + * @memberof events.ChannelStateChanged + * @instance + */ + ChannelStateChanged.prototype.reason = null; + + /** + * ChannelStateChanged closure_initiator. + * @member {events.ChannelClosureInitiator} closure_initiator + * @memberof events.ChannelStateChanged + * @instance + */ + ChannelStateChanged.prototype.closure_initiator = 0; + + // OneOf field names bound to virtual getters and setters + let $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChannelStateChanged.prototype, "_counterparty_node_id", { + get: $util.oneOfGetter($oneOfFields = ["counterparty_node_id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChannelStateChanged.prototype, "_funding_txo", { + get: $util.oneOfGetter($oneOfFields = ["funding_txo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChannelStateChanged.prototype, "_reason", { + get: $util.oneOfGetter($oneOfFields = ["reason"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ChannelStateChanged instance using the specified properties. + * @function create + * @memberof events.ChannelStateChanged + * @static + * @param {events.IChannelStateChanged=} [properties] Properties to set + * @returns {events.ChannelStateChanged} ChannelStateChanged instance + */ + ChannelStateChanged.create = function create(properties) { + return new ChannelStateChanged(properties); + }; + + /** + * Encodes the specified ChannelStateChanged message. Does not implicitly {@link events.ChannelStateChanged.verify|verify} messages. + * @function encode + * @memberof events.ChannelStateChanged + * @static + * @param {events.IChannelStateChanged} message ChannelStateChanged message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelStateChanged.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_id); + if (message.user_channel_id != null && Object.hasOwnProperty.call(message, "user_channel_id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.user_channel_id); + if (message.counterparty_node_id != null && Object.hasOwnProperty.call(message, "counterparty_node_id")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.counterparty_node_id); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.funding_txo != null && Object.hasOwnProperty.call(message, "funding_txo")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.funding_txo); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + $root.events.ChannelStateChangeReason.encode(message.reason, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.closure_initiator != null && Object.hasOwnProperty.call(message, "closure_initiator")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.closure_initiator); + return writer; + }; + + /** + * Encodes the specified ChannelStateChanged message, length delimited. Does not implicitly {@link events.ChannelStateChanged.verify|verify} messages. + * @function encodeDelimited + * @memberof events.ChannelStateChanged + * @static + * @param {events.IChannelStateChanged} message ChannelStateChanged message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChannelStateChanged.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChannelStateChanged message from the specified reader or buffer. + * @function decode + * @memberof events.ChannelStateChanged + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {events.ChannelStateChanged} ChannelStateChanged + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelStateChanged.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.ChannelStateChanged(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.channel_id = reader.string(); + break; + } + case 2: { + message.user_channel_id = reader.string(); + break; + } + case 3: { + message.counterparty_node_id = reader.string(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.funding_txo = reader.string(); + break; + } + case 6: { + message.reason = $root.events.ChannelStateChangeReason.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + case 7: { + message.closure_initiator = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a ChannelStateChanged message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof events.ChannelStateChanged + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {events.ChannelStateChanged} ChannelStateChanged + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChannelStateChanged.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChannelStateChanged message. + * @function verify + * @memberof events.ChannelStateChanged + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChannelStateChanged.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + let properties = {}; + if (message.channel_id != null && message.hasOwnProperty("channel_id")) + if (!$util.isString(message.channel_id)) + return "channel_id: string expected"; + if (message.user_channel_id != null && message.hasOwnProperty("user_channel_id")) + if (!$util.isString(message.user_channel_id)) + return "user_channel_id: string expected"; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) { + properties._counterparty_node_id = 1; + if (!$util.isString(message.counterparty_node_id)) + return "counterparty_node_id: string 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: + break; + } + if (message.funding_txo != null && message.hasOwnProperty("funding_txo")) { + properties._funding_txo = 1; + if (!$util.isString(message.funding_txo)) + return "funding_txo: string expected"; + } + if (message.reason != null && message.hasOwnProperty("reason")) { + properties._reason = 1; + { + let error = $root.events.ChannelStateChangeReason.verify(message.reason, long + 1); + if (error) + return "reason." + error; + } + } + if (message.closure_initiator != null && message.hasOwnProperty("closure_initiator")) + switch (message.closure_initiator) { + default: + return "closure_initiator: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ChannelStateChanged message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof events.ChannelStateChanged + * @static + * @param {Object.} object Plain object + * @returns {events.ChannelStateChanged} ChannelStateChanged + */ + ChannelStateChanged.fromObject = function fromObject(object, long) { + if (object instanceof $root.events.ChannelStateChanged) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.events.ChannelStateChanged(); + if (object.channel_id != null) + message.channel_id = String(object.channel_id); + if (object.user_channel_id != null) + message.user_channel_id = String(object.user_channel_id); + if (object.counterparty_node_id != null) + message.counterparty_node_id = String(object.counterparty_node_id); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "CHANNEL_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CHANNEL_STATE_PENDING": + case 1: + message.state = 1; + break; + case "CHANNEL_STATE_READY": + case 2: + message.state = 2; + break; + case "CHANNEL_STATE_OPEN_FAILED": + case 3: + message.state = 3; + break; + case "CHANNEL_STATE_CLOSED": + case 4: + message.state = 4; + break; + } + if (object.funding_txo != null) + message.funding_txo = String(object.funding_txo); + if (object.reason != null) { + if (typeof object.reason !== "object") + throw TypeError(".events.ChannelStateChanged.reason: object expected"); + message.reason = $root.events.ChannelStateChangeReason.fromObject(object.reason, long + 1); + } + switch (object.closure_initiator) { + default: + if (typeof object.closure_initiator === "number") { + message.closure_initiator = object.closure_initiator; + break; + } + break; + case "CHANNEL_CLOSURE_INITIATOR_UNSPECIFIED": + case 0: + message.closure_initiator = 0; + break; + case "CHANNEL_CLOSURE_INITIATOR_LOCAL": + case 1: + message.closure_initiator = 1; + break; + case "CHANNEL_CLOSURE_INITIATOR_REMOTE": + case 2: + message.closure_initiator = 2; + break; + case "CHANNEL_CLOSURE_INITIATOR_UNKNOWN": + case 3: + message.closure_initiator = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ChannelStateChanged message. Also converts values to other types if specified. + * @function toObject + * @memberof events.ChannelStateChanged + * @static + * @param {events.ChannelStateChanged} message ChannelStateChanged + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChannelStateChanged.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.channel_id = ""; + object.user_channel_id = ""; + object.state = options.enums === String ? "CHANNEL_STATE_UNSPECIFIED" : 0; + object.closure_initiator = options.enums === String ? "CHANNEL_CLOSURE_INITIATOR_UNSPECIFIED" : 0; + } + if (message.channel_id != null && message.hasOwnProperty("channel_id")) + object.channel_id = message.channel_id; + if (message.user_channel_id != null && message.hasOwnProperty("user_channel_id")) + object.user_channel_id = message.user_channel_id; + if (message.counterparty_node_id != null && message.hasOwnProperty("counterparty_node_id")) { + object.counterparty_node_id = message.counterparty_node_id; + if (options.oneofs) + object._counterparty_node_id = "counterparty_node_id"; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.events.ChannelState[message.state] === undefined ? message.state : $root.events.ChannelState[message.state] : message.state; + if (message.funding_txo != null && message.hasOwnProperty("funding_txo")) { + object.funding_txo = message.funding_txo; + if (options.oneofs) + object._funding_txo = "funding_txo"; + } + if (message.reason != null && message.hasOwnProperty("reason")) { + object.reason = $root.events.ChannelStateChangeReason.toObject(message.reason, options); + if (options.oneofs) + object._reason = "reason"; + } + if (message.closure_initiator != null && message.hasOwnProperty("closure_initiator")) + object.closure_initiator = options.enums === String ? $root.events.ChannelClosureInitiator[message.closure_initiator] === undefined ? message.closure_initiator : $root.events.ChannelClosureInitiator[message.closure_initiator] : message.closure_initiator; + return object; + }; + + /** + * Converts this ChannelStateChanged to JSON. + * @function toJSON + * @memberof events.ChannelStateChanged + * @instance + * @returns {Object.} JSON object + */ + ChannelStateChanged.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChannelStateChanged + * @function getTypeUrl + * @memberof events.ChannelStateChanged + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChannelStateChanged.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.ChannelStateChanged"; + }; + + return ChannelStateChanged; + })(); + + events.PaymentReceived = (function() { + + /** + * Properties of a PaymentReceived. + * @memberof events + * @interface IPaymentReceived + * @property {types.IPayment|null} [payment] PaymentReceived payment + */ + + /** + * Constructs a new PaymentReceived. + * @memberof events + * @classdesc Represents a PaymentReceived. + * @implements IPaymentReceived + * @constructor + * @param {events.IPaymentReceived=} [properties] Properties to set + */ + function PaymentReceived(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PaymentReceived payment. + * @member {types.IPayment|null|undefined} payment + * @memberof events.PaymentReceived + * @instance + */ + PaymentReceived.prototype.payment = null; + + /** + * Creates a new PaymentReceived instance using the specified properties. + * @function create + * @memberof events.PaymentReceived + * @static + * @param {events.IPaymentReceived=} [properties] Properties to set + * @returns {events.PaymentReceived} PaymentReceived instance + */ + PaymentReceived.create = function create(properties) { + return new PaymentReceived(properties); + }; + + /** + * Encodes the specified PaymentReceived message. Does not implicitly {@link events.PaymentReceived.verify|verify} messages. + * @function encode + * @memberof events.PaymentReceived + * @static + * @param {events.IPaymentReceived} message PaymentReceived message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PaymentReceived.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payment != null && Object.hasOwnProperty.call(message, "payment")) + $root.types.Payment.encode(message.payment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PaymentReceived message, length delimited. Does not implicitly {@link events.PaymentReceived.verify|verify} messages. + * @function encodeDelimited + * @memberof events.PaymentReceived + * @static + * @param {events.IPaymentReceived} message PaymentReceived message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PaymentReceived.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PaymentReceived message from the specified reader or buffer. + * @function decode + * @memberof events.PaymentReceived + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {events.PaymentReceived} PaymentReceived + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PaymentReceived.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.PaymentReceived(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.payment = $root.types.Payment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PaymentReceived message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof events.PaymentReceived + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {events.PaymentReceived} PaymentReceived + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PaymentReceived.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PaymentReceived message. + * @function verify + * @memberof events.PaymentReceived + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PaymentReceived.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.payment != null && message.hasOwnProperty("payment")) { + let error = $root.types.Payment.verify(message.payment, long + 1); + if (error) + return "payment." + error; + } + return null; + }; + + /** + * Creates a PaymentReceived message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof events.PaymentReceived + * @static + * @param {Object.} object Plain object + * @returns {events.PaymentReceived} PaymentReceived + */ + PaymentReceived.fromObject = function fromObject(object, long) { + if (object instanceof $root.events.PaymentReceived) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.events.PaymentReceived(); + if (object.payment != null) { + if (typeof object.payment !== "object") + throw TypeError(".events.PaymentReceived.payment: object expected"); + message.payment = $root.types.Payment.fromObject(object.payment, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PaymentReceived message. Also converts values to other types if specified. + * @function toObject + * @memberof events.PaymentReceived + * @static + * @param {events.PaymentReceived} message PaymentReceived + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PaymentReceived.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.payment = null; + if (message.payment != null && message.hasOwnProperty("payment")) + object.payment = $root.types.Payment.toObject(message.payment, options); + return object; + }; + + /** + * Converts this PaymentReceived to JSON. + * @function toJSON + * @memberof events.PaymentReceived + * @instance + * @returns {Object.} JSON object + */ + PaymentReceived.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PaymentReceived + * @function getTypeUrl + * @memberof events.PaymentReceived + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PaymentReceived.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.PaymentReceived"; + }; + + return PaymentReceived; + })(); + + events.PaymentSuccessful = (function() { + + /** + * Properties of a PaymentSuccessful. + * @memberof events + * @interface IPaymentSuccessful + * @property {types.IPayment|null} [payment] PaymentSuccessful payment + */ + + /** + * Constructs a new PaymentSuccessful. + * @memberof events + * @classdesc Represents a PaymentSuccessful. + * @implements IPaymentSuccessful + * @constructor + * @param {events.IPaymentSuccessful=} [properties] Properties to set + */ + function PaymentSuccessful(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PaymentSuccessful payment. + * @member {types.IPayment|null|undefined} payment + * @memberof events.PaymentSuccessful + * @instance + */ + PaymentSuccessful.prototype.payment = null; + + /** + * Creates a new PaymentSuccessful instance using the specified properties. + * @function create + * @memberof events.PaymentSuccessful + * @static + * @param {events.IPaymentSuccessful=} [properties] Properties to set + * @returns {events.PaymentSuccessful} PaymentSuccessful instance + */ + PaymentSuccessful.create = function create(properties) { + return new PaymentSuccessful(properties); + }; + + /** + * Encodes the specified PaymentSuccessful message. Does not implicitly {@link events.PaymentSuccessful.verify|verify} messages. + * @function encode + * @memberof events.PaymentSuccessful + * @static + * @param {events.IPaymentSuccessful} message PaymentSuccessful message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PaymentSuccessful.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payment != null && Object.hasOwnProperty.call(message, "payment")) + $root.types.Payment.encode(message.payment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PaymentSuccessful message, length delimited. Does not implicitly {@link events.PaymentSuccessful.verify|verify} messages. + * @function encodeDelimited + * @memberof events.PaymentSuccessful + * @static + * @param {events.IPaymentSuccessful} message PaymentSuccessful message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PaymentSuccessful.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PaymentSuccessful message from the specified reader or buffer. + * @function decode + * @memberof events.PaymentSuccessful + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {events.PaymentSuccessful} PaymentSuccessful + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PaymentSuccessful.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.PaymentSuccessful(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.payment = $root.types.Payment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PaymentSuccessful message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof events.PaymentSuccessful + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {events.PaymentSuccessful} PaymentSuccessful + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PaymentSuccessful.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PaymentSuccessful message. + * @function verify + * @memberof events.PaymentSuccessful + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PaymentSuccessful.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.payment != null && message.hasOwnProperty("payment")) { + let error = $root.types.Payment.verify(message.payment, long + 1); + if (error) + return "payment." + error; + } + return null; + }; + + /** + * Creates a PaymentSuccessful message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof events.PaymentSuccessful + * @static + * @param {Object.} object Plain object + * @returns {events.PaymentSuccessful} PaymentSuccessful + */ + PaymentSuccessful.fromObject = function fromObject(object, long) { + if (object instanceof $root.events.PaymentSuccessful) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.events.PaymentSuccessful(); + if (object.payment != null) { + if (typeof object.payment !== "object") + throw TypeError(".events.PaymentSuccessful.payment: object expected"); + message.payment = $root.types.Payment.fromObject(object.payment, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PaymentSuccessful message. Also converts values to other types if specified. + * @function toObject + * @memberof events.PaymentSuccessful + * @static + * @param {events.PaymentSuccessful} message PaymentSuccessful + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PaymentSuccessful.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.payment = null; + if (message.payment != null && message.hasOwnProperty("payment")) + object.payment = $root.types.Payment.toObject(message.payment, options); + return object; + }; + + /** + * Converts this PaymentSuccessful to JSON. + * @function toJSON + * @memberof events.PaymentSuccessful + * @instance + * @returns {Object.} JSON object + */ + PaymentSuccessful.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PaymentSuccessful + * @function getTypeUrl + * @memberof events.PaymentSuccessful + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PaymentSuccessful.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.PaymentSuccessful"; + }; + + return PaymentSuccessful; + })(); + + events.PaymentFailed = (function() { + + /** + * Properties of a PaymentFailed. + * @memberof events + * @interface IPaymentFailed + * @property {types.IPayment|null} [payment] PaymentFailed payment + */ + + /** + * Constructs a new PaymentFailed. + * @memberof events + * @classdesc Represents a PaymentFailed. + * @implements IPaymentFailed + * @constructor + * @param {events.IPaymentFailed=} [properties] Properties to set + */ + function PaymentFailed(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PaymentFailed payment. + * @member {types.IPayment|null|undefined} payment + * @memberof events.PaymentFailed + * @instance + */ + PaymentFailed.prototype.payment = null; + + /** + * Creates a new PaymentFailed instance using the specified properties. + * @function create + * @memberof events.PaymentFailed + * @static + * @param {events.IPaymentFailed=} [properties] Properties to set + * @returns {events.PaymentFailed} PaymentFailed instance + */ + PaymentFailed.create = function create(properties) { + return new PaymentFailed(properties); + }; + + /** + * Encodes the specified PaymentFailed message. Does not implicitly {@link events.PaymentFailed.verify|verify} messages. + * @function encode + * @memberof events.PaymentFailed + * @static + * @param {events.IPaymentFailed} message PaymentFailed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PaymentFailed.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payment != null && Object.hasOwnProperty.call(message, "payment")) + $root.types.Payment.encode(message.payment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PaymentFailed message, length delimited. Does not implicitly {@link events.PaymentFailed.verify|verify} messages. + * @function encodeDelimited + * @memberof events.PaymentFailed + * @static + * @param {events.IPaymentFailed} message PaymentFailed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PaymentFailed.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PaymentFailed message from the specified reader or buffer. + * @function decode + * @memberof events.PaymentFailed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {events.PaymentFailed} PaymentFailed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PaymentFailed.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.PaymentFailed(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.payment = $root.types.Payment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PaymentFailed message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof events.PaymentFailed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {events.PaymentFailed} PaymentFailed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PaymentFailed.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PaymentFailed message. + * @function verify + * @memberof events.PaymentFailed + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PaymentFailed.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.payment != null && message.hasOwnProperty("payment")) { + let error = $root.types.Payment.verify(message.payment, long + 1); + if (error) + return "payment." + error; + } + return null; + }; + + /** + * Creates a PaymentFailed message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof events.PaymentFailed + * @static + * @param {Object.} object Plain object + * @returns {events.PaymentFailed} PaymentFailed + */ + PaymentFailed.fromObject = function fromObject(object, long) { + if (object instanceof $root.events.PaymentFailed) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.events.PaymentFailed(); + if (object.payment != null) { + if (typeof object.payment !== "object") + throw TypeError(".events.PaymentFailed.payment: object expected"); + message.payment = $root.types.Payment.fromObject(object.payment, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PaymentFailed message. Also converts values to other types if specified. + * @function toObject + * @memberof events.PaymentFailed + * @static + * @param {events.PaymentFailed} message PaymentFailed + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PaymentFailed.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.payment = null; + if (message.payment != null && message.hasOwnProperty("payment")) + object.payment = $root.types.Payment.toObject(message.payment, options); + return object; + }; + + /** + * Converts this PaymentFailed to JSON. + * @function toJSON + * @memberof events.PaymentFailed + * @instance + * @returns {Object.} JSON object + */ + PaymentFailed.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PaymentFailed + * @function getTypeUrl + * @memberof events.PaymentFailed + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PaymentFailed.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.PaymentFailed"; + }; + + return PaymentFailed; + })(); + + events.PaymentClaimable = (function() { + + /** + * Properties of a PaymentClaimable. + * @memberof events + * @interface IPaymentClaimable + * @property {types.IPayment|null} [payment] PaymentClaimable payment + */ + + /** + * Constructs a new PaymentClaimable. + * @memberof events + * @classdesc Represents a PaymentClaimable. + * @implements IPaymentClaimable + * @constructor + * @param {events.IPaymentClaimable=} [properties] Properties to set + */ + function PaymentClaimable(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PaymentClaimable payment. + * @member {types.IPayment|null|undefined} payment + * @memberof events.PaymentClaimable + * @instance + */ + PaymentClaimable.prototype.payment = null; + + /** + * Creates a new PaymentClaimable instance using the specified properties. + * @function create + * @memberof events.PaymentClaimable + * @static + * @param {events.IPaymentClaimable=} [properties] Properties to set + * @returns {events.PaymentClaimable} PaymentClaimable instance + */ + PaymentClaimable.create = function create(properties) { + return new PaymentClaimable(properties); + }; + + /** + * Encodes the specified PaymentClaimable message. Does not implicitly {@link events.PaymentClaimable.verify|verify} messages. + * @function encode + * @memberof events.PaymentClaimable + * @static + * @param {events.IPaymentClaimable} message PaymentClaimable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PaymentClaimable.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payment != null && Object.hasOwnProperty.call(message, "payment")) + $root.types.Payment.encode(message.payment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PaymentClaimable message, length delimited. Does not implicitly {@link events.PaymentClaimable.verify|verify} messages. + * @function encodeDelimited + * @memberof events.PaymentClaimable + * @static + * @param {events.IPaymentClaimable} message PaymentClaimable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PaymentClaimable.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PaymentClaimable message from the specified reader or buffer. + * @function decode + * @memberof events.PaymentClaimable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {events.PaymentClaimable} PaymentClaimable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PaymentClaimable.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.PaymentClaimable(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.payment = $root.types.Payment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PaymentClaimable message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof events.PaymentClaimable + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {events.PaymentClaimable} PaymentClaimable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PaymentClaimable.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PaymentClaimable message. + * @function verify + * @memberof events.PaymentClaimable + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PaymentClaimable.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.payment != null && message.hasOwnProperty("payment")) { + let error = $root.types.Payment.verify(message.payment, long + 1); + if (error) + return "payment." + error; + } + return null; + }; + + /** + * Creates a PaymentClaimable message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof events.PaymentClaimable + * @static + * @param {Object.} object Plain object + * @returns {events.PaymentClaimable} PaymentClaimable + */ + PaymentClaimable.fromObject = function fromObject(object, long) { + if (object instanceof $root.events.PaymentClaimable) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.events.PaymentClaimable(); + if (object.payment != null) { + if (typeof object.payment !== "object") + throw TypeError(".events.PaymentClaimable.payment: object expected"); + message.payment = $root.types.Payment.fromObject(object.payment, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PaymentClaimable message. Also converts values to other types if specified. + * @function toObject + * @memberof events.PaymentClaimable + * @static + * @param {events.PaymentClaimable} message PaymentClaimable + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PaymentClaimable.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.payment = null; + if (message.payment != null && message.hasOwnProperty("payment")) + object.payment = $root.types.Payment.toObject(message.payment, options); + return object; + }; + + /** + * Converts this PaymentClaimable to JSON. + * @function toJSON + * @memberof events.PaymentClaimable + * @instance + * @returns {Object.} JSON object + */ + PaymentClaimable.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PaymentClaimable + * @function getTypeUrl + * @memberof events.PaymentClaimable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PaymentClaimable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.PaymentClaimable"; + }; + + return PaymentClaimable; + })(); + + events.PaymentForwarded = (function() { + + /** + * Properties of a PaymentForwarded. + * @memberof events + * @interface IPaymentForwarded + * @property {types.IForwardedPayment|null} [forwarded_payment] PaymentForwarded forwarded_payment + */ + + /** + * Constructs a new PaymentForwarded. + * @memberof events + * @classdesc Represents a PaymentForwarded. + * @implements IPaymentForwarded + * @constructor + * @param {events.IPaymentForwarded=} [properties] Properties to set + */ + function PaymentForwarded(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * PaymentForwarded forwarded_payment. + * @member {types.IForwardedPayment|null|undefined} forwarded_payment + * @memberof events.PaymentForwarded + * @instance + */ + PaymentForwarded.prototype.forwarded_payment = null; + + /** + * Creates a new PaymentForwarded instance using the specified properties. + * @function create + * @memberof events.PaymentForwarded + * @static + * @param {events.IPaymentForwarded=} [properties] Properties to set + * @returns {events.PaymentForwarded} PaymentForwarded instance + */ + PaymentForwarded.create = function create(properties) { + return new PaymentForwarded(properties); + }; + + /** + * Encodes the specified PaymentForwarded message. Does not implicitly {@link events.PaymentForwarded.verify|verify} messages. + * @function encode + * @memberof events.PaymentForwarded + * @static + * @param {events.IPaymentForwarded} message PaymentForwarded message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PaymentForwarded.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.forwarded_payment != null && Object.hasOwnProperty.call(message, "forwarded_payment")) + $root.types.ForwardedPayment.encode(message.forwarded_payment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PaymentForwarded message, length delimited. Does not implicitly {@link events.PaymentForwarded.verify|verify} messages. + * @function encodeDelimited + * @memberof events.PaymentForwarded + * @static + * @param {events.IPaymentForwarded} message PaymentForwarded message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PaymentForwarded.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PaymentForwarded message from the specified reader or buffer. + * @function decode + * @memberof events.PaymentForwarded + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {events.PaymentForwarded} PaymentForwarded + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PaymentForwarded.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.PaymentForwarded(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.forwarded_payment = $root.types.ForwardedPayment.decode(reader, reader.uint32(), undefined, long + 1); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes a PaymentForwarded message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof events.PaymentForwarded + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {events.PaymentForwarded} PaymentForwarded + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PaymentForwarded.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PaymentForwarded message. + * @function verify + * @memberof events.PaymentForwarded + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PaymentForwarded.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.forwarded_payment != null && message.hasOwnProperty("forwarded_payment")) { + let error = $root.types.ForwardedPayment.verify(message.forwarded_payment, long + 1); + if (error) + return "forwarded_payment." + error; + } + return null; + }; + + /** + * Creates a PaymentForwarded message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof events.PaymentForwarded + * @static + * @param {Object.} object Plain object + * @returns {events.PaymentForwarded} PaymentForwarded + */ + PaymentForwarded.fromObject = function fromObject(object, long) { + if (object instanceof $root.events.PaymentForwarded) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.events.PaymentForwarded(); + if (object.forwarded_payment != null) { + if (typeof object.forwarded_payment !== "object") + throw TypeError(".events.PaymentForwarded.forwarded_payment: object expected"); + message.forwarded_payment = $root.types.ForwardedPayment.fromObject(object.forwarded_payment, long + 1); + } + return message; + }; + + /** + * Creates a plain object from a PaymentForwarded message. Also converts values to other types if specified. + * @function toObject + * @memberof events.PaymentForwarded + * @static + * @param {events.PaymentForwarded} message PaymentForwarded + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PaymentForwarded.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.forwarded_payment = null; + if (message.forwarded_payment != null && message.hasOwnProperty("forwarded_payment")) + object.forwarded_payment = $root.types.ForwardedPayment.toObject(message.forwarded_payment, options); + return object; + }; + + /** + * Converts this PaymentForwarded to JSON. + * @function toJSON + * @memberof events.PaymentForwarded + * @instance + * @returns {Object.} JSON object + */ + PaymentForwarded.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PaymentForwarded + * @function getTypeUrl + * @memberof events.PaymentForwarded + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PaymentForwarded.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.PaymentForwarded"; + }; + + return PaymentForwarded; + })(); + + return events; +})(); + +export const error = $root.error = (() => { + + /** + * Namespace error. + * @exports error + * @namespace + */ + const error = {}; + + error.ErrorResponse = (function() { + + /** + * Properties of an ErrorResponse. + * @memberof error + * @interface IErrorResponse + * @property {string|null} [message] ErrorResponse message + * @property {error.ErrorCode|null} [error_code] ErrorResponse error_code + */ + + /** + * Constructs a new ErrorResponse. + * @memberof error + * @classdesc Represents an ErrorResponse. + * @implements IErrorResponse + * @constructor + * @param {error.IErrorResponse=} [properties] Properties to set + */ + function ErrorResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null && keys[i] !== "__proto__") + this[keys[i]] = properties[keys[i]]; + } + + /** + * ErrorResponse message. + * @member {string} message + * @memberof error.ErrorResponse + * @instance + */ + ErrorResponse.prototype.message = ""; + + /** + * ErrorResponse error_code. + * @member {error.ErrorCode} error_code + * @memberof error.ErrorResponse + * @instance + */ + ErrorResponse.prototype.error_code = 0; + + /** + * Creates a new ErrorResponse instance using the specified properties. + * @function create + * @memberof error.ErrorResponse + * @static + * @param {error.IErrorResponse=} [properties] Properties to set + * @returns {error.ErrorResponse} ErrorResponse instance + */ + ErrorResponse.create = function create(properties) { + return new ErrorResponse(properties); + }; + + /** + * Encodes the specified ErrorResponse message. Does not implicitly {@link error.ErrorResponse.verify|verify} messages. + * @function encode + * @memberof error.ErrorResponse + * @static + * @param {error.IErrorResponse} message ErrorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.error_code != null && Object.hasOwnProperty.call(message, "error_code")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.error_code); + return writer; + }; + + /** + * Encodes the specified ErrorResponse message, length delimited. Does not implicitly {@link error.ErrorResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof error.ErrorResponse + * @static + * @param {error.IErrorResponse} message ErrorResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrorResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ErrorResponse message from the specified reader or buffer. + * @function decode + * @memberof error.ErrorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {error.ErrorResponse} ErrorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorResponse.decode = function decode(reader, length, error, long) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + if (long === undefined) + long = 0; + if (long > $Reader.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.error.ErrorResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.error_code = reader.int32(); + break; + } + default: + reader.skipType(tag & 7, long); + break; + } + } + return message; + }; + + /** + * Decodes an ErrorResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof error.ErrorResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {error.ErrorResponse} ErrorResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrorResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ErrorResponse message. + * @function verify + * @memberof error.ErrorResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ErrorResponse.verify = function verify(message, long) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + return "maximum nesting depth exceeded"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.error_code != null && message.hasOwnProperty("error_code")) + switch (message.error_code) { + default: + return "error_code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates an ErrorResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof error.ErrorResponse + * @static + * @param {Object.} object Plain object + * @returns {error.ErrorResponse} ErrorResponse + */ + ErrorResponse.fromObject = function fromObject(object, long) { + if (object instanceof $root.error.ErrorResponse) + return object; + if (long === undefined) + long = 0; + if (long > $util.recursionLimit) + throw Error("maximum nesting depth exceeded"); + let message = new $root.error.ErrorResponse(); + if (object.message != null) + message.message = String(object.message); + switch (object.error_code) { + default: + if (typeof object.error_code === "number") { + message.error_code = object.error_code; + break; + } + break; + case "UNKNOWN_ERROR": + case 0: + message.error_code = 0; + break; + case "INVALID_REQUEST_ERROR": + case 1: + message.error_code = 1; + break; + case "AUTH_ERROR": + case 2: + message.error_code = 2; + break; + case "LIGHTNING_ERROR": + case 3: + message.error_code = 3; + break; + case "INTERNAL_SERVER_ERROR": + case 4: + message.error_code = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from an ErrorResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof error.ErrorResponse + * @static + * @param {error.ErrorResponse} message ErrorResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ErrorResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.message = ""; + object.error_code = options.enums === String ? "UNKNOWN_ERROR" : 0; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.error_code != null && message.hasOwnProperty("error_code")) + object.error_code = options.enums === String ? $root.error.ErrorCode[message.error_code] === undefined ? message.error_code : $root.error.ErrorCode[message.error_code] : message.error_code; + return object; + }; + + /** + * Converts this ErrorResponse to JSON. + * @function toJSON + * @memberof error.ErrorResponse + * @instance + * @returns {Object.} JSON object + */ + ErrorResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ErrorResponse + * @function getTypeUrl + * @memberof error.ErrorResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ErrorResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/error.ErrorResponse"; + }; + + return ErrorResponse; + })(); + + /** + * ErrorCode enum. + * @name error.ErrorCode + * @enum {number} + * @property {number} UNKNOWN_ERROR=0 UNKNOWN_ERROR value + * @property {number} INVALID_REQUEST_ERROR=1 INVALID_REQUEST_ERROR value + * @property {number} AUTH_ERROR=2 AUTH_ERROR value + * @property {number} LIGHTNING_ERROR=3 LIGHTNING_ERROR value + * @property {number} INTERNAL_SERVER_ERROR=4 INTERNAL_SERVER_ERROR value + */ + error.ErrorCode = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN_ERROR"] = 0; + values[valuesById[1] = "INVALID_REQUEST_ERROR"] = 1; + values[valuesById[2] = "AUTH_ERROR"] = 2; + values[valuesById[3] = "LIGHTNING_ERROR"] = 3; + values[valuesById[4] = "INTERNAL_SERVER_ERROR"] = 4; + return values; + })(); + + return error; +})(); + +export { $root as default }; diff --git a/proto/ldkserver/api.proto b/proto/ldkserver/api.proto new file mode 100644 index 0000000000..ba6e5a1e10 --- /dev/null +++ b/proto/ldkserver/api.proto @@ -0,0 +1,979 @@ +syntax = "proto3"; +package api; + +import 'types.proto'; +import 'events.proto'; + +// Retrieve the latest node info like `node_id`, `current_best_block` etc. +// See more: +// - https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.node_id +// - https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.status +message GetNodeInfoRequest { +} + +// The response for the `GetNodeInfo` RPC. On failure, a gRPC error status is returned. +message GetNodeInfoResponse { + + // The hex-encoded `node-id` or public key for our own lightning node. + string node_id = 1; + + // The best block to which our Lightning wallet is currently synced. + // + // Should be always set, will never be `None`. + types.BestBlock current_best_block = 3; + + // The timestamp, in seconds since start of the UNIX epoch, when we last successfully synced our Lightning wallet to + // the chain tip. + // + // Will be `None` if the wallet hasn't been synced yet. + optional uint64 latest_lightning_wallet_sync_timestamp = 4; + + // The timestamp, in seconds since start of the UNIX epoch, when we last successfully synced our on-chain + // wallet to the chain tip. + // + // Will be `None` if the wallet hasn’t been synced since the node was initialized. + optional uint64 latest_onchain_wallet_sync_timestamp = 5; + + // The timestamp, in seconds since start of the UNIX epoch, when we last successfully update our fee rate cache. + // + // Will be `None` if the cache hasn’t been updated since the node was initialized. + optional uint64 latest_fee_rate_cache_update_timestamp = 6; + + // The timestamp, in seconds since start of the UNIX epoch, when the last rapid gossip sync (RGS) snapshot we + // successfully applied was generated. + // + // Will be `None` if RGS isn’t configured or the snapshot hasn’t been updated since the node was initialized. + optional uint64 latest_rgs_snapshot_timestamp = 7; + + // The timestamp, in seconds since start of the UNIX epoch, when we last broadcasted a node announcement. + // + // Will be `None` if we have no public channels or we haven’t broadcasted since the node was initialized. + optional uint64 latest_node_announcement_broadcast_timestamp = 8; + + // The addresses the node is currently listening on for incoming connections. + // + // Will be empty if the node is not listening on any addresses. + repeated string listening_addresses = 9; + + // The addresses the node announces to the network. + // + // Will be empty if no announcement addresses are configured. + repeated string announcement_addresses = 10; + + // The node alias, if configured. + // + // Will be `None` if no alias is configured. + optional string node_alias = 11; + + // The node URIs that can be used to connect to this node, in the format `node_id@address`. + // + // These are constructed from the announcement addresses and the node's public key. + // Will be empty if no announcement addresses are configured. + repeated string node_uris = 12; + + // The Bitcoin network the node is running on (e.g., "bitcoin", "testnet", "signet", "regtest"). + types.Network network = 13; +} + +// Retrieve a new on-chain funding address. +// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.OnchainPayment.html#method.new_address +message OnchainReceiveRequest { +} + +// The response for the `OnchainReceive` RPC. On failure, a gRPC error status is returned. +message OnchainReceiveResponse { + + // A Bitcoin on-chain address. + string address = 1; +} + +// Send an on-chain payment to the given address. +message OnchainSendRequest { + + // The address to send coins to. + string address = 1; + + // The amount in satoshis to send. + // While sending the specified amount, we will respect any on-chain reserve we need to keep, + // i.e., won't allow to cut into `total_anchor_channels_reserve_sats`. + // See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.OnchainPayment.html#method.send_to_address + optional uint64 amount_sats = 2; + + // If set, the amount_sats field should be unset. + // It indicates that node will send full balance to the specified address. + // + // Please note that when send_all is used this operation will **not** retain any on-chain reserves, + // which might be potentially dangerous if you have open Anchor channels for which you can't trust + // the counterparty to spend the Anchor output after channel closure. + // See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.OnchainPayment.html#method.send_all_to_address + optional bool send_all = 3; + + // If `fee_rate_sat_per_vb` is set it will be used on the resulting transaction. Otherwise we'll retrieve + // a reasonable estimate from BitcoinD. + optional uint64 fee_rate_sat_per_vb = 4; +} + +// The response for the `OnchainSend` RPC. On failure, a gRPC error status is returned. +message OnchainSendResponse { + + // The transaction ID of the broadcasted transaction. + string txid = 1; +} + +// Return a BOLT11 payable invoice that can be used to request and receive a payment +// for the given amount, if specified. +// The inbound payment will be automatically claimed upon arrival. +// See more: +// - https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.receive +// - https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.receive_variable_amount +message Bolt11ReceiveRequest { + + // The amount in millisatoshi to send. If unset, a "zero-amount" or variable-amount invoice is returned. + optional uint64 amount_msat = 1; + + // An optional description to attach along with the invoice. + // Will be set in the description field of the encoded payment request. + types.Bolt11InvoiceDescription description = 2; + + // Invoice expiry time in seconds. + uint32 expiry_secs = 3; +} + +// The response for the `Bolt11Receive` RPC. On failure, a gRPC error status is returned. +message Bolt11ReceiveResponse { + + // An invoice for a payment within the Lightning Network. + // With the details of the invoice, the sender has all the data necessary to send a payment + // to the recipient. + string invoice = 1; + + // The hex-encoded 32-byte payment hash. + string payment_hash = 2; + + // The hex-encoded 32-byte payment secret. + string payment_secret = 3; +} + +// Return a BOLT11 payable invoice for a given payment hash. +// The inbound payment will NOT be automatically claimed upon arrival. +// Instead, the payment will need to be manually claimed by calling `Bolt11ClaimForHash` +// or manually failed by calling `Bolt11FailForHash`. +// See more: +// - https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.receive_for_hash +// - https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.receive_variable_amount_for_hash +message Bolt11ReceiveForHashRequest { + + // The amount in millisatoshi to receive. If unset, a "zero-amount" or variable-amount invoice is returned. + optional uint64 amount_msat = 1; + + // An optional description to attach along with the invoice. + // Will be set in the description field of the encoded payment request. + types.Bolt11InvoiceDescription description = 2; + + // Invoice expiry time in seconds. + uint32 expiry_secs = 3; + + // The hex-encoded 32-byte payment hash to use for the invoice. + string payment_hash = 4; +} + +// The response for the `Bolt11ReceiveForHash` RPC. On failure, a gRPC error status is returned. +message Bolt11ReceiveForHashResponse { + + // An invoice for a payment within the Lightning Network. + // With the details of the invoice, the sender has all the data necessary to send a payment + // to the recipient. + string invoice = 1; +} + +// Manually claim a payment for a given payment hash with the corresponding preimage. +// This should be used to claim payments created via `Bolt11ReceiveForHash`. +// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.claim_for_hash +message Bolt11ClaimForHashRequest { + + // The hex-encoded 32-byte payment hash. + // If provided, it will be used to verify that the preimage matches. + optional string payment_hash = 1; + + // The amount in millisatoshi that is claimable. + // If not provided, skips amount verification. + optional uint64 claimable_amount_msat = 2; + + // The hex-encoded 32-byte payment preimage. + string preimage = 3; +} + +// The response for the `Bolt11ClaimForHash` RPC. On failure, a gRPC error status is returned. +message Bolt11ClaimForHashResponse {} + +// Manually fail a payment for a given payment hash. +// This should be used to reject payments created via `Bolt11ReceiveForHash`. +// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.fail_for_hash +message Bolt11FailForHashRequest { + + // The hex-encoded 32-byte payment hash. + string payment_hash = 1; +} + +// The response for the `Bolt11FailForHash` RPC. On failure, a gRPC error status is returned. +message Bolt11FailForHashResponse {} + +// Return a BOLT11 payable invoice that can be used to request and receive a payment via an +// LSPS2 just-in-time channel. +// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.receive_via_jit_channel +message Bolt11ReceiveViaJitChannelRequest { + + // The amount in millisatoshi to request. + uint64 amount_msat = 1; + + // An optional description to attach along with the invoice. + // Will be set in the description field of the encoded payment request. + types.Bolt11InvoiceDescription description = 2; + + // Invoice expiry time in seconds. + uint32 expiry_secs = 3; + + // Optional upper bound for the total fee an LSP may deduct when opening the JIT channel. + optional uint64 max_total_lsp_fee_limit_msat = 4; +} + +// The response for the `Bolt11ReceiveViaJitChannel` RPC. On failure, a gRPC error status is returned. +message Bolt11ReceiveViaJitChannelResponse { + + // An invoice for a payment within the Lightning Network. + string invoice = 1; +} + +// Return a variable-amount BOLT11 invoice that can be used to receive a payment via an LSPS2 +// just-in-time channel. +// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.receive_variable_amount_via_jit_channel +message Bolt11ReceiveVariableAmountViaJitChannelRequest { + + // An optional description to attach along with the invoice. + // Will be set in the description field of the encoded payment request. + types.Bolt11InvoiceDescription description = 1; + + // Invoice expiry time in seconds. + uint32 expiry_secs = 2; + + // Optional upper bound for the proportional fee, in parts-per-million millisatoshis, that an + // LSP may deduct when opening the JIT channel. + optional uint64 max_proportional_lsp_fee_limit_ppm_msat = 3; +} + +// The response for the `Bolt11ReceiveVariableAmountViaJitChannel` RPC. On failure, a gRPC error status is returned. +message Bolt11ReceiveVariableAmountViaJitChannelResponse { + + // An invoice for a payment within the Lightning Network. + string invoice = 1; +} + + +// Send a payment for a BOLT11 invoice. +// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.send +message Bolt11SendRequest { + + // An invoice for a payment within the Lightning Network. + string invoice = 1; + + // Set this field when paying a so-called "zero-amount" invoice, i.e., an invoice that leaves the + // amount paid to be determined by the user. + // This operation will fail if the amount specified is less than the value required by the given invoice. + optional uint64 amount_msat = 2; + + // Configuration options for payment routing and pathfinding. + optional types.RouteParametersConfig route_parameters = 3; + +} + +// The response for the `Bolt11Send` RPC. On failure, a gRPC error status is returned. +message Bolt11SendResponse { + + // An identifier used to uniquely identify a payment in hex-encoded form. + string payment_id = 1; +} + +// Returns a BOLT12 offer for the given amount, if specified. +// +// See more: +// - https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt12Payment.html#method.receive +// - https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt12Payment.html#method.receive_variable_amount +message Bolt12ReceiveRequest { + + // An optional description to attach along with the offer. + // Will be set in the description field of the encoded offer. + string description = 1; + + // The amount in millisatoshi to send. If unset, a "zero-amount" or variable-amount offer is returned. + optional uint64 amount_msat = 2; + + // Offer expiry time in seconds. + optional uint32 expiry_secs = 3; + + // If set, it represents the number of items requested, can only be set for fixed-amount offers. + optional uint64 quantity = 4; +} + +// The response for the `Bolt12Receive` RPC. On failure, a gRPC error status is returned. +message Bolt12ReceiveResponse { + + // An offer for a payment within the Lightning Network. + // With the details of the offer, the sender has all the data necessary to send a payment + // to the recipient. + string offer = 1; + + // The hex-encoded offer id. + string offer_id = 2; +} + +// Send a payment for a BOLT12 offer. +// See more: +// - https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt12Payment.html#method.send +// - https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt12Payment.html#method.send_using_amount +message Bolt12SendRequest { + + // An offer for a payment within the Lightning Network. + string offer = 1; + + // Set this field when paying a so-called "zero-amount" offer, i.e., an offer that leaves the + // amount paid to be determined by the user. + // This operation will fail if the amount specified is less than the value required by the given offer. + optional uint64 amount_msat = 2; + + // If set, it represents the number of items requested. + optional uint64 quantity = 3; + + // If set, it will be seen by the recipient and reflected back in the invoice. + optional string payer_note = 4; + + // Configuration options for payment routing and pathfinding. + optional types.RouteParametersConfig route_parameters = 5; +} + +// The response for the `Bolt12Send` RPC. On failure, a gRPC error status is returned. +message Bolt12SendResponse { + + // An identifier used to uniquely identify a payment in hex-encoded form. + string payment_id = 1; +} + +// Send a spontaneous payment, also known as "keysend", to a node. +// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.SpontaneousPayment.html#method.send +message SpontaneousSendRequest { + // The amount in millisatoshis to send. + uint64 amount_msat = 1; + + // The hex-encoded public key of the node to send the payment to. + string node_id = 2; + + // Configuration options for payment routing and pathfinding. + optional types.RouteParametersConfig route_parameters = 3; +} + +// The response for the `SpontaneousSend` RPC. On failure, a gRPC error status is returned. +message SpontaneousSendResponse { + // An identifier used to uniquely identify a payment in hex-encoded form. + string payment_id = 1; +} + +// Creates a new outbound channel to the given remote node. +// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.connect_open_channel +message OpenChannelRequest { + + // The hex-encoded public key of the node to open a channel with. + string node_pubkey = 1; + + // An address which can be used to connect to a remote peer. + // It can be of type IPv4:port, IPv6:port, OnionV3:port or hostname:port + string address = 2; + + // The amount of satoshis the caller is willing to commit to the channel. + uint64 channel_amount_sats = 3; + + // The amount of satoshis to push to the remote side as part of the initial commitment state. + optional uint64 push_to_counterparty_msat = 4; + + // The channel configuration to be used for opening this channel. If unset, default ChannelConfig is used. + optional types.ChannelConfig channel_config = 5; + + // Whether the channel should be public. + bool announce_channel = 6; + + // Allow the counterparty to spend all its channel balance. This cannot be set together with `announce_channel`. + bool disable_counterparty_reserve = 7; +} + +// The response for the `OpenChannel` RPC. On failure, a gRPC error status is returned. +message OpenChannelResponse { + + // The local channel id of the created channel that user can use to refer to channel. + string user_channel_id = 1; +} + +// Increases the channel balance by the given amount. +// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.splice_in +message SpliceInRequest { + + // The local `user_channel_id` of the channel. + string user_channel_id = 1; + + // The hex-encoded public key of the channel's counterparty node. + string counterparty_node_id = 2; + + // The amount of sats to splice into the channel. + uint64 splice_amount_sats = 3; +} + +// The response for the `SpliceIn` RPC. On failure, a gRPC error status is returned. +message SpliceInResponse {} + +// Decreases the channel balance by the given amount. +// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.splice_out +message SpliceOutRequest { + + // The local `user_channel_id` of this channel. + string user_channel_id = 1; + + // The hex-encoded public key of the channel's counterparty node. + string counterparty_node_id = 2; + + // A Bitcoin on-chain address to send the spliced-out funds. + // + // If not set, an address from the node's on-chain wallet will be used. + optional string address = 3; + + // The amount of sats to splice out of the channel. + uint64 splice_amount_sats = 4; +} + +// The response for the `SpliceOut` RPC. On failure, a gRPC error status is returned. +message SpliceOutResponse { + + // The Bitcoin on-chain address where the funds will be sent. + string address = 1; +} + +// Update the config for a previously opened channel. +// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.update_channel_config +message UpdateChannelConfigRequest { + + // The local `user_channel_id` of this channel. + string user_channel_id = 1; + + // The hex-encoded public key of the counterparty node to update channel config with. + string counterparty_node_id = 2; + + // The updated channel configuration settings for a channel. + types.ChannelConfig channel_config = 3; +} + +// The response for the `UpdateChannelConfig` RPC. On failure, a gRPC error status is returned. +message UpdateChannelConfigResponse { +} + +// Closes the channel specified by given request. +// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.close_channel +message CloseChannelRequest { + + // The local `user_channel_id` of this channel. + string user_channel_id = 1; + + // The hex-encoded public key of the node to close a channel with. + string counterparty_node_id = 2; +} + +// The response for the `CloseChannel` RPC. On failure, a gRPC error status is returned. +message CloseChannelResponse {} + +// Force closes the channel specified by given request. +// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.force_close_channel +message ForceCloseChannelRequest { + // The local `user_channel_id` of this channel. + string user_channel_id = 1; + // The hex-encoded public key of the node to close a channel with. + string counterparty_node_id = 2; + // The reason for force-closing. + optional string force_close_reason = 3; +} + +// The response for the `ForceCloseChannel` RPC. On failure, a gRPC error status is returned. +message ForceCloseChannelResponse {} + +// Returns a list of known channels. +// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.list_channels +message ListChannelsRequest {} + +// The response for the `ListChannels` RPC. On failure, a gRPC error status is returned. +message ListChannelsResponse { + + // List of channels. + repeated types.Channel channels = 1; +} + +// Returns payment details for a given payment_id. +// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.payment +message GetPaymentDetailsRequest { + // An identifier used to uniquely identify a payment in hex-encoded form. + string payment_id = 1; +} + +// The response for the `GetPaymentDetails` RPC. On failure, a gRPC error status is returned. +message GetPaymentDetailsResponse { + // Represents a payment. + // Will be `None` if payment doesn't exist. + types.Payment payment = 1; +} + +// Retrieves list of all payments. +// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.list_payments +message ListPaymentsRequest { + // `page_token` is a pagination token. + // + // To query for the first page, `page_token` must not be specified. + // + // For subsequent pages, use the value that was returned as `next_page_token` in the previous + // page's response. + optional types.PageToken page_token = 1; +} + +// The response for the `ListPayments` RPC. On failure, a gRPC error status is returned. +message ListPaymentsResponse { + // List of payments. + repeated types.Payment payments = 1; + + // `next_page_token` is a pagination token, used to retrieve the next page of results. + // Use this value to query for next-page of paginated operation, by specifying + // this value as the `page_token` in the next request. + // + // If `next_page_token` is `None`, then the "last page" of results has been processed and + // there is no more data to be retrieved. + // + // If `next_page_token` is not `None`, it does not necessarily mean that there is more data in the + // result set. The only way to know when you have reached the end of the result set is when + // `next_page_token` is `None`. + // + // **Caution**: Clients must not assume a specific number of records to be present in a page for + // paginated response. + optional types.PageToken next_page_token = 2; +} + +// Retrieves list of all forwarded payments. +// See more: https://docs.rs/ldk-node/latest/ldk_node/enum.Event.html#variant.PaymentForwarded +message ListForwardedPaymentsRequest { + // `page_token` is a pagination token. + // + // To query for the first page, `page_token` must not be specified. + // + // For subsequent pages, use the value that was returned as `next_page_token` in the previous + // page's response. + optional types.PageToken page_token = 1; +} + +// The response for the `ListForwardedPayments` RPC. On failure, a gRPC error status is returned. +message ListForwardedPaymentsResponse { + // List of forwarded payments. + repeated types.ForwardedPayment forwarded_payments = 1; + + // `next_page_token` is a pagination token, used to retrieve the next page of results. + // Use this value to query for next-page of paginated operation, by specifying + // this value as the `page_token` in the next request. + // + // If `next_page_token` is `None`, then the "last page" of results has been processed and + // there is no more data to be retrieved. + // + // If `next_page_token` is not `None`, it does not necessarily mean that there is more data in the + // result set. The only way to know when you have reached the end of the result set is when + // `next_page_token` is `None`. + // + // **Caution**: Clients must not assume a specific number of records to be present in a page for + // paginated response. + optional types.PageToken next_page_token = 2; +} + +// Sign a message with the node's secret key. +// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.sign_message +message SignMessageRequest { + // The message to sign, as raw bytes. + bytes message = 1; +} + +// The response for the `SignMessage` RPC. On failure, a gRPC error status is returned. +message SignMessageResponse { + // The signature of the message, as a zbase32-encoded string. + string signature = 1; +} + +// Verify a signature against a message and public key. +// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.verify_signature +message VerifySignatureRequest { + // The message that was signed, as raw bytes. + bytes message = 1; + + // The signature to verify, as a zbase32-encoded string. + string signature = 2; + + // The hex-encoded public key of the signer. + string public_key = 3; +} + +// The response for the `VerifySignature` RPC. On failure, a gRPC error status is returned. +message VerifySignatureResponse { + // Whether the signature is valid. + bool valid = 1; +} + +// Export the pathfinding scores used by the router. +// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.export_pathfinding_scores +message ExportPathfindingScoresRequest {} + +// The response for the `ExportPathfindingScores` RPC. On failure, a gRPC error status is returned. +message ExportPathfindingScoresResponse { + // The serialized pathfinding scores data. + bytes scores = 1; +} + +// Retrieves an overview of all known balances. +// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.list_balances +message GetBalancesRequest {} + +// The response for the `GetBalances` RPC. On failure, a gRPC error status is returned. +message GetBalancesResponse { + // The total balance of our on-chain wallet. + uint64 total_onchain_balance_sats = 1; + + // The currently spendable balance of our on-chain wallet. + // + // This includes any sufficiently confirmed funds, minus `total_anchor_channels_reserve_sats`. + uint64 spendable_onchain_balance_sats = 2; + + // The share of our total balance that we retain as an emergency reserve to (hopefully) be + // able to spend the Anchor outputs when one of our channels is closed. + uint64 total_anchor_channels_reserve_sats = 3; + + // The total balance that we would be able to claim across all our Lightning channels. + // + // Note this excludes balances that we are unsure if we are able to claim (e.g., as we are + // waiting for a preimage or for a timeout to expire). These balances will however be included + // as `MaybePreimageClaimableHTLC` and `MaybeTimeoutClaimableHTLC` in `lightning_balances`. + uint64 total_lightning_balance_sats = 4; + + // A detailed list of all known Lightning balances that would be claimable on channel closure. + // + // Note that less than the listed amounts are spendable over lightning as further reserve + // restrictions apply. Please refer to `Channel::outbound_capacity_msat` and + // Channel::next_outbound_htlc_limit_msat as returned by `ListChannels` + // for a better approximation of the spendable amounts. + repeated types.LightningBalance lightning_balances = 5; + + // A detailed list of balances currently being swept from the Lightning to the on-chain + // wallet. + // + // These are balances resulting from channel closures that may have been encumbered by a + // delay, but are now being claimed and useable once sufficiently confirmed on-chain. + // + // Note that, depending on the sync status of the wallets, swept balances listed here might or + // might not already be accounted for in `total_onchain_balance_sats`. + repeated types.PendingSweepBalance pending_balances_from_channel_closures = 6; +} + +// Connect to a peer on the Lightning Network. +// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.connect +message ConnectPeerRequest { + // The hex-encoded public key of the node to connect to. + string node_pubkey = 1; + + // An address which can be used to connect to a remote peer. + // It can be of type IPv4:port, IPv6:port, OnionV3:port or hostname:port + string address = 2; + + // Whether to persist the peer connection, i.e., whether the peer will be re-connected on + // restart. + bool persist = 3; +} + +// The response for the `ConnectPeer` RPC. On failure, a gRPC error status is returned. +message ConnectPeerResponse {} + +// Disconnect from a peer and remove it from the peer store. +// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.disconnect +message DisconnectPeerRequest { + // The hex-encoded public key of the node to disconnect from. + string node_pubkey = 1; +} + +// The response for the `DisconnectPeer` RPC. On failure, a gRPC error status is returned. +message DisconnectPeerResponse {} + +// Returns a list of peers. +// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.list_peers +message ListPeersRequest {} + +// The response for the `ListPeers` RPC. On failure, a gRPC error status is returned. +message ListPeersResponse { + + // List of peers. + repeated types.Peer peers = 1; +} + +// Returns a list of all known short channel IDs in the network graph. +// See more: https://docs.rs/ldk-node/latest/ldk_node/graph/struct.NetworkGraph.html#method.list_channels +message GraphListChannelsRequest {} + +// The response for the `GraphListChannels` RPC. On failure, a gRPC error status is returned. +message GraphListChannelsResponse { + // List of short channel IDs known to the network graph. + repeated uint64 short_channel_ids = 1; +} + +// Returns information on a channel with the given short channel ID from the network graph. +// See more: https://docs.rs/ldk-node/latest/ldk_node/graph/struct.NetworkGraph.html#method.channel +message GraphGetChannelRequest { + // The short channel ID to look up. + uint64 short_channel_id = 1; +} + +// The response for the `GraphGetChannel` RPC. On failure, a gRPC error status is returned. +message GraphGetChannelResponse { + // The channel information. + types.GraphChannel channel = 1; +} + +// Returns a list of all known node IDs in the network graph. +// See more: https://docs.rs/ldk-node/latest/ldk_node/graph/struct.NetworkGraph.html#method.list_nodes +message GraphListNodesRequest {} + +// The response for the `GraphListNodes` RPC. On failure, a gRPC error status is returned. +message GraphListNodesResponse { + // List of hex-encoded node IDs known to the network graph. + repeated string node_ids = 1; +} + +// Send a payment given a BIP 21 URI or BIP 353 Human-Readable Name. +// +// This method parses the provided URI string and attempts to send the payment. If the URI +// has an offer and/or invoice, it will try to pay the offer first followed by the invoice. +// If they both fail, the on-chain payment will be paid. +// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.UnifiedPayment.html#method.send +message UnifiedSendRequest { + + // A BIP 21 URI or BIP 353 Human-Readable Name to pay. + string uri = 1; + + // The amount in millisatoshis to send. Required for "zero-amount" or variable-amount URIs. + optional uint64 amount_msat = 2; + + // Configuration options for payment routing and pathfinding. + optional types.RouteParametersConfig route_parameters = 3; +} + +// The response for the `UnifiedSend` RPC. On failure, a gRPC error status is returned. +message UnifiedSendResponse { + + oneof payment_result { + + // An on-chain payment was made. Contains the transaction ID. + string txid = 1; + + // A BOLT11 payment was made. Contains the payment ID in hex-encoded form. + string bolt11_payment_id = 2; + + // A BOLT12 payment was made. Contains the payment ID in hex-encoded form. + string bolt12_payment_id = 3; + } +} + +// Returns information on a node with the given ID from the network graph. +// See more: https://docs.rs/ldk-node/latest/ldk_node/graph/struct.NetworkGraph.html#method.node +message GraphGetNodeRequest { + // The hex-encoded node ID to look up. + string node_id = 1; +} + +// The response for the `GraphGetNode` RPC. On failure, a gRPC error status is returned. +message GraphGetNodeResponse { + // The node information. + types.GraphNode node = 1; +} + +// Decode a BOLT11 invoice and return its parsed fields. +// This does not require a running node — it only parses the invoice string. +message DecodeInvoiceRequest { + // The BOLT11 invoice string to decode. + string invoice = 1; +} + +// The response for the `DecodeInvoice` RPC. On failure, a gRPC error status is returned. +message DecodeInvoiceResponse { + // The hex-encoded public key of the destination node. + string destination = 1; + + // The hex-encoded 32-byte payment hash. + string payment_hash = 2; + + // The amount in millisatoshis, if specified in the invoice. + optional uint64 amount_msat = 3; + + // The creation timestamp in seconds since the UNIX epoch. + uint64 timestamp = 4; + + // The invoice expiry time in seconds. + uint64 expiry = 5; + + // The invoice description, if a direct description was provided. + optional string description = 6; + + // The hex-encoded SHA-256 hash of the description, if a description hash was used. + optional string description_hash = 14; + + // The fallback on-chain address, if any. + optional string fallback_address = 7; + + // The minimum final CLTV expiry delta. + uint64 min_final_cltv_expiry_delta = 8; + + // The hex-encoded 32-byte payment secret. + string payment_secret = 9; + + // Route hints for finding a path to the payee. + repeated types.Bolt11RouteHint route_hints = 10; + + // Feature bits advertised in the invoice, keyed by bit number. + map features = 11; + + // The currency or network (e.g., "bitcoin", "testnet", "signet", "regtest"). + string currency = 12; + + // The payment metadata, hex-encoded. Only present if the invoice includes payment metadata. + optional string payment_metadata = 13; + + // Whether the invoice has expired. + bool is_expired = 15; +} + +// Decode a BOLT12 offer and return its parsed fields. +// This does not require a running node — it only parses the offer string. +message DecodeOfferRequest { + // The BOLT12 offer string to decode. + string offer = 1; +} + +// The response for the `DecodeOffer` RPC. On failure, a gRPC error status is returned. +message DecodeOfferResponse { + // The hex-encoded offer ID. + string offer_id = 1; + + // The description of the offer, if any. + optional string description = 2; + + // The issuer of the offer, if any. + optional string issuer = 3; + + // The amount, if specified. + types.OfferAmount amount = 4; + + // The hex-encoded public key used by the issuer to sign invoices, if any. + optional string issuer_signing_pubkey = 5; + + // The absolute expiry time in seconds since the UNIX epoch, if any. + optional uint64 absolute_expiry = 6; + + // The supported quantity of items. + types.OfferQuantity quantity = 7; + + // Blinded paths to the offer recipient. + repeated types.BlindedPath paths = 8; + + // Feature bits advertised in the offer, keyed by bit number. + map features = 9; + + // Supported blockchain networks (e.g., "bitcoin", "testnet", "signet", "regtest"). + repeated string chains = 10; + + // The metadata, hex-encoded, if any. + optional string metadata = 11; + + // Whether the offer has expired. + bool is_expired = 12; +} + +// Subscribe to a stream of server events. +message SubscribeEventsRequest {} + +service LightningNode { + // Retrieve the latest node info. + rpc GetNodeInfo(GetNodeInfoRequest) returns (GetNodeInfoResponse); + // Retrieve an overview of all known balances. + rpc GetBalances(GetBalancesRequest) returns (GetBalancesResponse); + // Retrieve a new on-chain funding address. + rpc OnchainReceive(OnchainReceiveRequest) returns (OnchainReceiveResponse); + // Send an on-chain payment to the given address. + rpc OnchainSend(OnchainSendRequest) returns (OnchainSendResponse); + // Return a BOLT11 payable invoice. + rpc Bolt11Receive(Bolt11ReceiveRequest) returns (Bolt11ReceiveResponse); + // Return a BOLT11 payable invoice for a given payment hash. + rpc Bolt11ReceiveForHash(Bolt11ReceiveForHashRequest) returns (Bolt11ReceiveForHashResponse); + // Manually claim a payment for a given payment hash. + rpc Bolt11ClaimForHash(Bolt11ClaimForHashRequest) returns (Bolt11ClaimForHashResponse); + // Manually fail a payment for a given payment hash. + rpc Bolt11FailForHash(Bolt11FailForHashRequest) returns (Bolt11FailForHashResponse); + // Return a BOLT11 invoice for receiving via a JIT channel. + rpc Bolt11ReceiveViaJitChannel(Bolt11ReceiveViaJitChannelRequest) returns (Bolt11ReceiveViaJitChannelResponse); + // Return a variable-amount BOLT11 invoice for receiving via a JIT channel. + rpc Bolt11ReceiveVariableAmountViaJitChannel(Bolt11ReceiveVariableAmountViaJitChannelRequest) returns (Bolt11ReceiveVariableAmountViaJitChannelResponse); + // Send a payment for a BOLT11 invoice. + rpc Bolt11Send(Bolt11SendRequest) returns (Bolt11SendResponse); + // Return a BOLT12 offer. + rpc Bolt12Receive(Bolt12ReceiveRequest) returns (Bolt12ReceiveResponse); + // Send a payment for a BOLT12 offer. + rpc Bolt12Send(Bolt12SendRequest) returns (Bolt12SendResponse); + // Send a spontaneous payment (keysend). + rpc SpontaneousSend(SpontaneousSendRequest) returns (SpontaneousSendResponse); + // Create a new outbound channel. + rpc OpenChannel(OpenChannelRequest) returns (OpenChannelResponse); + // Splice funds into a channel. + rpc SpliceIn(SpliceInRequest) returns (SpliceInResponse); + // Splice funds out of a channel. + rpc SpliceOut(SpliceOutRequest) returns (SpliceOutResponse); + // Update the config for a channel. + rpc UpdateChannelConfig(UpdateChannelConfigRequest) returns (UpdateChannelConfigResponse); + // Close a channel cooperatively. + rpc CloseChannel(CloseChannelRequest) returns (CloseChannelResponse); + // Force close a channel. + rpc ForceCloseChannel(ForceCloseChannelRequest) returns (ForceCloseChannelResponse); + // List known channels. + rpc ListChannels(ListChannelsRequest) returns (ListChannelsResponse); + // Get payment details by payment ID. + rpc GetPaymentDetails(GetPaymentDetailsRequest) returns (GetPaymentDetailsResponse); + // List all payments. + rpc ListPayments(ListPaymentsRequest) returns (ListPaymentsResponse); + // List all forwarded payments. + rpc ListForwardedPayments(ListForwardedPaymentsRequest) returns (ListForwardedPaymentsResponse); + // Connect to a peer. + rpc ConnectPeer(ConnectPeerRequest) returns (ConnectPeerResponse); + // Disconnect from a peer. + rpc DisconnectPeer(DisconnectPeerRequest) returns (DisconnectPeerResponse); + // List peers. + rpc ListPeers(ListPeersRequest) returns (ListPeersResponse); + // Sign a message with the node's secret key. + rpc SignMessage(SignMessageRequest) returns (SignMessageResponse); + // Verify a signature against a message and public key. + rpc VerifySignature(VerifySignatureRequest) returns (VerifySignatureResponse); + // Export the pathfinding scores used by the router. + rpc ExportPathfindingScores(ExportPathfindingScoresRequest) returns (ExportPathfindingScoresResponse); + // Send a payment given a BIP 21 URI or BIP 353 Human-Readable Name. + rpc UnifiedSend(UnifiedSendRequest) returns (UnifiedSendResponse); + // Decode a BOLT11 invoice and return its parsed fields. + rpc DecodeInvoice(DecodeInvoiceRequest) returns (DecodeInvoiceResponse); + // Decode a BOLT12 offer and return its parsed fields. + rpc DecodeOffer(DecodeOfferRequest) returns (DecodeOfferResponse); + // List all known short channel IDs in the network graph. + rpc GraphListChannels(GraphListChannelsRequest) returns (GraphListChannelsResponse); + // Get channel info from the network graph by short channel ID. + rpc GraphGetChannel(GraphGetChannelRequest) returns (GraphGetChannelResponse); + // List all known node IDs in the network graph. + rpc GraphListNodes(GraphListNodesRequest) returns (GraphListNodesResponse); + // Get node info from the network graph by node ID. + rpc GraphGetNode(GraphGetNodeRequest) returns (GraphGetNodeResponse); + // Subscribe to a stream of server events. + rpc SubscribeEvents(SubscribeEventsRequest) returns (stream events.EventEnvelope); +} diff --git a/proto/ldkserver/error.proto b/proto/ldkserver/error.proto new file mode 100644 index 0000000000..c5a75d7ddf --- /dev/null +++ b/proto/ldkserver/error.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; +package error; + +// When HttpStatusCode is not ok (200), the response `content` contains a serialized `ErrorResponse` +// with the relevant ErrorCode and `message` +message ErrorResponse { + + // The error message containing a generic description of the error condition in English. + // It is intended for a human audience only and should not be parsed to extract any information + // programmatically. Client-side code may use it for logging only. + string message = 1; + + // The error code uniquely identifying an error condition. + // It is meant to be read and understood programmatically by code that detects/handles errors by + // type. + // + // **Caution**: If a new type of `error_code` is introduced in the `ErrorCode` enum, `error_code` field will be set to + // `UnknownError`. + ErrorCode error_code = 2; +} + +enum ErrorCode { + + // Will never be used as `error_code` by server. + // + // **Caution**: If a new type of `error_code` is introduced in the `ErrorCode` enum, `error_code` field will be set to + // `UnknownError`. + UNKNOWN_ERROR = 0; + + // Used in the following cases: + // - The request was missing a required argument. + // - The specified argument was invalid, incomplete or in the wrong format. + // - The request body of api cannot be deserialized into corresponding protobuf object. + // - The request does not follow api contract. + INVALID_REQUEST_ERROR = 1; + + // Used when authentication fails or in case of an unauthorized request. + AUTH_ERROR = 2; + + // Used to represent an error while doing a Lightning operation. + LIGHTNING_ERROR = 3; + + // Used when an internal server error occurred. The client is probably at no fault. + INTERNAL_SERVER_ERROR = 4; +} diff --git a/proto/ldkserver/events.proto b/proto/ldkserver/events.proto new file mode 100644 index 0000000000..97524fc45c --- /dev/null +++ b/proto/ldkserver/events.proto @@ -0,0 +1,123 @@ +syntax = "proto3"; +import "types.proto"; +package events; + +// EventEnvelope wraps different event types in a single message to be used by EventPublisher. +message EventEnvelope { + oneof event { + PaymentReceived payment_received = 2; + PaymentSuccessful payment_successful = 3; + PaymentFailed payment_failed = 4; + PaymentForwarded payment_forwarded = 6; + PaymentClaimable payment_claimable = 7; + ChannelStateChanged channel_state_changed = 8; + } +} + +enum ChannelState { + CHANNEL_STATE_UNSPECIFIED = 0; + CHANNEL_STATE_PENDING = 1; + CHANNEL_STATE_READY = 2; + CHANNEL_STATE_OPEN_FAILED = 3; + CHANNEL_STATE_CLOSED = 4; +} + +enum ChannelClosureInitiator { + CHANNEL_CLOSURE_INITIATOR_UNSPECIFIED = 0; + CHANNEL_CLOSURE_INITIATOR_LOCAL = 1; + CHANNEL_CLOSURE_INITIATOR_REMOTE = 2; + CHANNEL_CLOSURE_INITIATOR_UNKNOWN = 3; +} + +enum ChannelStateChangeReasonKind { + CHANNEL_STATE_CHANGE_REASON_KIND_UNSPECIFIED = 0; + CHANNEL_STATE_CHANGE_REASON_KIND_COUNTERPARTY_FORCE_CLOSED = 1; + CHANNEL_STATE_CHANGE_REASON_KIND_HOLDER_FORCE_CLOSED = 2; + CHANNEL_STATE_CHANGE_REASON_KIND_LEGACY_COOPERATIVE_CLOSURE = 3; + CHANNEL_STATE_CHANGE_REASON_KIND_COUNTERPARTY_INITIATED_COOPERATIVE_CLOSURE = 4; + CHANNEL_STATE_CHANGE_REASON_KIND_LOCALLY_INITIATED_COOPERATIVE_CLOSURE = 5; + CHANNEL_STATE_CHANGE_REASON_KIND_COMMITMENT_TX_CONFIRMED = 6; + CHANNEL_STATE_CHANGE_REASON_KIND_FUNDING_TIMED_OUT = 7; + CHANNEL_STATE_CHANGE_REASON_KIND_PROCESSING_ERROR = 8; + CHANNEL_STATE_CHANGE_REASON_KIND_DISCONNECTED_PEER = 9; + CHANNEL_STATE_CHANGE_REASON_KIND_OUTDATED_CHANNEL_MANAGER = 10; + CHANNEL_STATE_CHANGE_REASON_KIND_COUNTERPARTY_COOP_CLOSED_UNFUNDED_CHANNEL = 11; + CHANNEL_STATE_CHANGE_REASON_KIND_LOCALLY_COOP_CLOSED_UNFUNDED_CHANNEL = 12; + CHANNEL_STATE_CHANGE_REASON_KIND_FUNDING_BATCH_CLOSURE = 13; + CHANNEL_STATE_CHANGE_REASON_KIND_HTLCS_TIMED_OUT = 14; + CHANNEL_STATE_CHANGE_REASON_KIND_PEER_FEERATE_TOO_LOW = 15; +} + +message CounterpartyForceClosedDetails { + string peer_msg = 1; +} + +message HolderForceClosedDetails { + optional bool broadcasted_latest_txn = 1; + string message = 2; +} + +message ProcessingErrorDetails { + string err = 1; +} + +message HtlcsTimedOutDetails { + optional string payment_hash = 1; +} + +message PeerFeerateTooLowDetails { + uint32 peer_feerate_sat_per_kw = 1; + uint32 required_feerate_sat_per_kw = 2; +} + +message ChannelStateChangeReason { + ChannelStateChangeReasonKind kind = 1; + string message = 2; + oneof details { + CounterpartyForceClosedDetails counterparty_force_closed = 3; + HolderForceClosedDetails holder_force_closed = 4; + ProcessingErrorDetails processing_error = 5; + HtlcsTimedOutDetails htlcs_timed_out = 6; + PeerFeerateTooLowDetails peer_feerate_too_low = 7; + } +} + +message ChannelStateChanged { + string channel_id = 1; + string user_channel_id = 2; + optional string counterparty_node_id = 3; + ChannelState state = 4; + optional string funding_txo = 5; + optional ChannelStateChangeReason reason = 6; + ChannelClosureInitiator closure_initiator = 7; +} + +// PaymentReceived indicates a payment has been received. +message PaymentReceived { + // The payment details for the payment in event. + types.Payment payment = 1; +} + +// PaymentSuccessful indicates a sent payment was successful. +message PaymentSuccessful { + // The payment details for the payment in event. + types.Payment payment = 1; +} + +// PaymentFailed indicates a sent payment has failed. +message PaymentFailed { + // The payment details for the payment in event. + types.Payment payment = 1; +} + +// PaymentClaimable indicates a payment has arrived and is waiting to be manually claimed or failed. +// This event is only emitted for payments created via `Bolt11ReceiveForHash`. +message PaymentClaimable { + // The payment details for the claimable payment. + types.Payment payment = 1; +} + +// PaymentForwarded indicates a payment was forwarded through the node. +message PaymentForwarded { + types.ForwardedPayment forwarded_payment = 1; +} diff --git a/proto/ldkserver/types.proto b/proto/ldkserver/types.proto new file mode 100644 index 0000000000..83be8be896 --- /dev/null +++ b/proto/ldkserver/types.proto @@ -0,0 +1,947 @@ +syntax = "proto3"; +package types; + +// Represents a payment. +// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.PaymentDetails.html +message Payment { + // An identifier used to uniquely identify a payment in hex-encoded form. + string id = 1; + + // The kind of the payment. + PaymentKind kind = 2; + + // The amount transferred. + optional uint64 amount_msat = 3; + + // The fees that were paid for this payment. + // + // For Lightning payments, this will only be updated for outbound payments once they + // succeeded. + optional uint64 fee_paid_msat = 7; + + // The direction of the payment. + PaymentDirection direction = 4; + + // The status of the payment. + PaymentStatus status = 5; + + // The timestamp, in seconds since start of the UNIX epoch, when this entry was last updated. + uint64 latest_update_timestamp = 6; +} + +message PaymentKind { + oneof kind { + Onchain onchain = 1; + Bolt11 bolt11 = 2; + Bolt11Jit bolt11_jit = 3; + Bolt12Offer bolt12_offer = 4; + Bolt12Refund bolt12_refund = 5; + Spontaneous spontaneous = 6; + } +} + +// Represents an on-chain payment. +message Onchain { + // The transaction identifier of this payment. + string txid = 1; + + // The confirmation status of this payment. + ConfirmationStatus status = 2; +} + +message ConfirmationStatus { + oneof status { + Confirmed confirmed = 1; + Unconfirmed unconfirmed = 2; + } +} + +// The on-chain transaction is confirmed in the best chain. +message Confirmed { + // The hex representation of hash of the block in which the transaction was confirmed. + string block_hash = 1; + + // The height under which the block was confirmed. + uint32 height = 2; + + // The timestamp, in seconds since start of the UNIX epoch, when this entry was last updated. + uint64 timestamp = 3; +} + +// The on-chain transaction is unconfirmed. +message Unconfirmed {} + +// Represents a BOLT 11 payment. +message Bolt11 { + // The payment hash, i.e., the hash of the preimage. + string hash = 1; + + // The pre-image used by the payment. + optional string preimage = 2; + + // The secret used by the payment. + optional bytes secret = 3; +} + +// Represents a BOLT 11 payment intended to open an LSPS 2 just-in-time channel. +message Bolt11Jit { + // The payment hash, i.e., the hash of the preimage. + string hash = 1; + + // The pre-image used by the payment. + optional string preimage = 2; + + // The secret used by the payment. + optional bytes secret = 3; + + // Limits applying to how much fee we allow an LSP to deduct from the payment amount. + // + // Allowing them to deduct this fee from the first inbound payment will pay for the LSP’s channel opening fees. + // + // See [`LdkChannelConfig::accept_underpaying_htlcs`](https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html#structfield.accept_underpaying_htlcs) + // for more information. + LSPFeeLimits lsp_fee_limits = 4; + + // The value, in thousands of a satoshi, that was deducted from this payment as an extra + // fee taken by our channel counterparty. + // + // Will only be `Some` once we received the payment. + optional uint64 counterparty_skimmed_fee_msat = 5; +} + +// Represents a BOLT 12 ‘offer’ payment, i.e., a payment for an Offer. +message Bolt12Offer { + // The payment hash, i.e., the hash of the preimage. + optional string hash = 1; + + // The pre-image used by the payment. + optional string preimage = 2; + + // The secret used by the payment. + optional bytes secret = 3; + + // The hex-encoded ID of the offer this payment is for. + string offer_id = 4; + + // The payer's note for the payment. + // Truncated to [PAYER_NOTE_LIMIT](https://docs.rs/lightning/latest/lightning/offers/invoice_request/constant.PAYER_NOTE_LIMIT.html). + // + // **Caution**: The `payer_note` field may come from an untrusted source. To prevent potential misuse, + // all non-printable characters will be sanitized and replaced with safe characters. + optional string payer_note = 5; + + // The quantity of an item requested in the offer. + optional uint64 quantity = 6; +} + +// Represents a BOLT 12 ‘refund’ payment, i.e., a payment for a Refund. +message Bolt12Refund { + // The payment hash, i.e., the hash of the preimage. + optional string hash = 1; + + // The pre-image used by the payment. + optional string preimage = 2; + + // The secret used by the payment. + optional bytes secret = 3; + + // The payer's note for the payment. + // Truncated to [PAYER_NOTE_LIMIT](https://docs.rs/lightning/latest/lightning/offers/invoice_request/constant.PAYER_NOTE_LIMIT.html). + // + // **Caution**: The `payer_note` field may come from an untrusted source. To prevent potential misuse, + // all non-printable characters will be sanitized and replaced with safe characters. + optional string payer_note = 5; + + // The quantity of an item requested in the offer. + optional uint64 quantity = 6; + +} + +// Represents a spontaneous (“keysend”) payment. +message Spontaneous { + // The payment hash, i.e., the hash of the preimage. + string hash = 1; + + // The pre-image used by the payment. + optional string preimage = 2; +} + +// Limits applying to how much fee we allow an LSP to deduct from the payment amount. +// See [`LdkChannelConfig::accept_underpaying_htlcs`] for more information. +// +// [`LdkChannelConfig::accept_underpaying_htlcs`]: lightning::util::config::ChannelConfig::accept_underpaying_htlcs +message LSPFeeLimits { + // The maximal total amount we allow any configured LSP withhold from us when forwarding the + // payment. + optional uint64 max_total_opening_fee_msat = 1; + + // The maximal proportional fee, in parts-per-million millisatoshi, we allow any configured + // LSP withhold from us when forwarding the payment. + optional uint64 max_proportional_opening_fee_ppm_msat = 2; +} + +// Represents the direction of a payment. +enum PaymentDirection { + // The payment is inbound. + INBOUND = 0; + + // The payment is outbound. + OUTBOUND = 1; +} + +// Represents the current status of a payment. +enum PaymentStatus { + // The payment is still pending. + PENDING = 0; + + // The payment succeeded. + SUCCEEDED = 1; + + // The payment failed. + FAILED = 2; +} + +// The Bitcoin network the node is running on. +enum Network { + // Mainnet Bitcoin. + BITCOIN = 0; + + // Bitcoin's testnet (testnet3) network. + TESTNET = 1; + + // Bitcoin's testnet4 network. + TESTNET4 = 2; + + // Bitcoin's signet network. + SIGNET = 3; + + // Bitcoin's regtest network. + REGTEST = 4; +} + +// A forwarded payment through our node. +// See more: https://docs.rs/ldk-node/latest/ldk_node/enum.Event.html#variant.PaymentForwarded +message ForwardedPayment{ + // The channel id of the incoming channel between the previous node and us. + string prev_channel_id = 1; + + // The channel id of the outgoing channel between the next node and us. + string next_channel_id = 2; + + // The `user_channel_id` of the incoming channel between the previous node and us. + string prev_user_channel_id = 3; + + // The node id of the previous node. + string prev_node_id = 9; + + // The node id of the next node. + string next_node_id = 10; + + // The `user_channel_id` of the outgoing channel between the next node and us. + // This will be `None` if the payment was settled via an on-chain transaction. + // See the caveat described for the `total_fee_earned_msat` field. + optional string next_user_channel_id = 4; + + // The total fee, in milli-satoshis, which was earned as a result of the payment. + // + // Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC was pending, the amount the + // next hop claimed will have been rounded down to the nearest whole satoshi. Thus, the fee calculated here may be + // higher than expected as we still claimed the full value in millisatoshis from the source. + // In this case, `claim_from_onchain_tx` will be set. + // + // If the channel which sent us the payment has been force-closed, we will claim the funds via an on-chain transaction. + // In that case we do not yet know the on-chain transaction fees which we will spend and will instead set this to `None`. + optional uint64 total_fee_earned_msat = 5; + + // The share of the total fee, in milli-satoshis, which was withheld in addition to the forwarding fee. + // This will only be set if we forwarded an intercepted HTLC with less than the expected amount. This means our + // counterparty accepted to receive less than the invoice amount. + // + // The caveat described above the `total_fee_earned_msat` field applies here as well. + optional uint64 skimmed_fee_msat = 6; + + // If this is true, the forwarded HTLC was claimed by our counterparty via an on-chain transaction. + bool claim_from_onchain_tx = 7; + + // The final amount forwarded, in milli-satoshis, after the fee is deducted. + // + // The caveat described above the `total_fee_earned_msat` field applies here as well. + optional uint64 outbound_amount_forwarded_msat = 8; + +} + +message Channel { + // The channel ID (prior to funding transaction generation, this is a random 32-byte + // identifier, afterwards this is the transaction ID of the funding transaction XOR the + // funding transaction output). + // + // Note that this means this value is *not* persistent - it can change once during the + // lifetime of the channel. + string channel_id = 1; + + // The node ID of our the channel's remote counterparty. + string counterparty_node_id = 2; + + // The channel's funding transaction output, if we've negotiated the funding transaction with + // our counterparty already. + optional OutPoint funding_txo = 3; + + // The hex-encoded local `user_channel_id` of this channel. + string user_channel_id = 4; + + // The value, in satoshis, that must always be held as a reserve in the channel for us. This + // value ensures that if we broadcast a revoked state, our counterparty can punish us by + // claiming at least this value on chain. + // + // This value is not included in [`outbound_capacity_msat`] as it can never be spent. + // + // This value will be `None` for outbound channels until the counterparty accepts the channel. + optional uint64 unspendable_punishment_reserve = 5; + + // The value, in satoshis, of this channel as it appears in the funding output. + uint64 channel_value_sats = 6; + + // The currently negotiated fee rate denominated in satoshi per 1000 weight units, + // which is applied to commitment and HTLC transactions. + uint32 feerate_sat_per_1000_weight = 7; + + // The available outbound capacity for sending HTLCs to the remote peer. + // + // The amount does not include any pending HTLCs which are not yet resolved (and, thus, whose + // balance is not available for inclusion in new outbound HTLCs). This further does not include + // any pending outgoing HTLCs which are awaiting some other resolution to be sent. + uint64 outbound_capacity_msat = 8; + + // The available outbound capacity for sending HTLCs to the remote peer. + // + // The amount does not include any pending HTLCs which are not yet resolved + // (and, thus, whose balance is not available for inclusion in new inbound HTLCs). This further + // does not include any pending outgoing HTLCs which are awaiting some other resolution to be + // sent. + uint64 inbound_capacity_msat = 9; + + // The number of required confirmations on the funding transactions before the funding is + // considered "locked". The amount is selected by the channel fundee. + // + // The value will be `None` for outbound channels until the counterparty accepts the channel. + optional uint32 confirmations_required = 10; + + // The current number of confirmations on the funding transaction. + optional uint32 confirmations = 11; + + // Is `true` if the channel was initiated (and therefore funded) by us. + bool is_outbound = 12; + + // Is `true` if both parties have exchanged `channel_ready` messages, and the channel is + // not currently being shut down. Both parties exchange `channel_ready` messages upon + // independently verifying that the required confirmations count provided by + // `confirmations_required` has been reached. + bool is_channel_ready = 13; + + // Is `true` if the channel (a) `channel_ready` messages have been exchanged, (b) the + // peer is connected, and (c) the channel is not currently negotiating shutdown. + // + // This is a strict superset of `is_channel_ready`. + bool is_usable = 14; + + // Is `true` if this channel is (or will be) publicly-announced + bool is_announced = 15; + + // Set of configurable parameters set by self that affect channel operation. + ChannelConfig channel_config = 16; + + // The available outbound capacity for sending a single HTLC to the remote peer. This is + // similar to `outbound_capacity_msat` but it may be further restricted by + // the current state and per-HTLC limit(s). This is intended for use when routing, allowing us + // to use a limit as close as possible to the HTLC limit we can currently send. + uint64 next_outbound_htlc_limit_msat = 17; + + // The minimum value for sending a single HTLC to the remote peer. This is the equivalent of + // `next_outbound_htlc_limit_msat` but represents a lower-bound, rather than + // an upper-bound. This is intended for use when routing, allowing us to ensure we pick a + // route which is valid. + uint64 next_outbound_htlc_minimum_msat = 18; + + // The number of blocks (after our commitment transaction confirms) that we will need to wait + // until we can claim our funds after we force-close the channel. During this time our + // counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty + // force-closes the channel and broadcasts a commitment transaction we do not have to wait any + // time to claim our non-HTLC-encumbered funds. + // + // This value will be `None` for outbound channels until the counterparty accepts the channel. + optional uint32 force_close_spend_delay = 19; + + // The smallest value HTLC (in msat) the remote peer will accept, for this channel. + // + // This field is only `None` before we have received either the `OpenChannel` or + // `AcceptChannel` message from the remote peer. + optional uint64 counterparty_outbound_htlc_minimum_msat = 20; + + // The largest value HTLC (in msat) the remote peer currently will accept, for this channel. + optional uint64 counterparty_outbound_htlc_maximum_msat = 21; + + // The value, in satoshis, that must always be held in the channel for our counterparty. This + // value ensures that if our counterparty broadcasts a revoked state, we can punish them by + // claiming at least this value on chain. + // + // This value is not included in `inbound_capacity_msat` as it can never be spent. + uint64 counterparty_unspendable_punishment_reserve = 22; + + // Base routing fee in millisatoshis. + optional uint32 counterparty_forwarding_info_fee_base_msat = 23; + + // Proportional fee, in millionths of a satoshi the channel will charge per transferred satoshi. + optional uint32 counterparty_forwarding_info_fee_proportional_millionths = 24; + + // The minimum difference in CLTV expiry between an ingoing HTLC and its outgoing counterpart, + // such that the outgoing HTLC is forwardable to this counterparty. + optional uint32 counterparty_forwarding_info_cltv_expiry_delta = 25; +} + +// ChannelConfig represents the configuration settings for a channel in a Lightning Network node. +// See more: https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html +message ChannelConfig { + // Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound + // over the channel. + // See more: https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html#structfield.forwarding_fee_proportional_millionths + optional uint32 forwarding_fee_proportional_millionths = 1; + + // Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, + // in excess of forwarding_fee_proportional_millionths. + // See more: https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html#structfield.forwarding_fee_base_msat + optional uint32 forwarding_fee_base_msat = 2; + + // The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded + // over the channel this config applies to. + // See more: https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html#structfield.cltv_expiry_delta + optional uint32 cltv_expiry_delta = 3; + + // The maximum additional fee we’re willing to pay to avoid waiting for the counterparty’s + // to_self_delay to reclaim funds. + // See more: https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html#structfield.force_close_avoidance_max_fee_satoshis + optional uint64 force_close_avoidance_max_fee_satoshis = 4; + + // If set, allows this channel’s counterparty to skim an additional fee off this node’s + // inbound HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users. + // See more: https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html#structfield.accept_underpaying_htlcs + optional bool accept_underpaying_htlcs = 5; + + // Limit our total exposure to potential loss to on-chain fees on close, including + // in-flight HTLCs which are burned to fees as they are too small to claim on-chain + // and fees on commitment transaction(s) broadcasted by our counterparty in excess of + // our own fee estimate. + // See more: https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html#structfield.max_dust_htlc_exposure + oneof max_dust_htlc_exposure { + + // This sets a fixed limit on the total dust exposure in millisatoshis. + // See more: https://docs.rs/lightning/latest/lightning/util/config/enum.MaxDustHTLCExposure.html#variant.FixedLimitMsat + uint64 fixed_limit_msat = 6; + + // This sets a multiplier on the ConfirmationTarget::OnChainSweep feerate (in sats/KW) to determine the maximum allowed dust exposure. + // See more: https://docs.rs/lightning/latest/lightning/util/config/enum.MaxDustHTLCExposure.html#variant.FeeRateMultiplier + uint64 fee_rate_multiplier = 7; + } +} + +// Represent a transaction outpoint. +message OutPoint { + // The referenced transaction's txid. + string txid = 1; + + // The index of the referenced output in its transaction's vout. + uint32 vout = 2; +} + +message BestBlock { + // The block’s hash + string block_hash = 1; + + // The height at which the block was confirmed. + uint32 height = 2; +} + +// Details about the status of a known Lightning balance. +message LightningBalance { + oneof balance_type { + ClaimableOnChannelClose claimable_on_channel_close = 1; + ClaimableAwaitingConfirmations claimable_awaiting_confirmations = 2; + ContentiousClaimable contentious_claimable = 3; + MaybeTimeoutClaimableHTLC maybe_timeout_claimable_htlc = 4; + MaybePreimageClaimableHTLC maybe_preimage_claimable_htlc = 5; + CounterpartyRevokedOutputClaimable counterparty_revoked_output_claimable = 6; + } +} + +// The channel is not yet closed (or the commitment or closing transaction has not yet appeared in a block). +// The given balance is claimable (less on-chain fees) if the channel is force-closed now. +// See more: https://docs.rs/ldk-node/latest/ldk_node/enum.LightningBalance.html#variant.ClaimableOnChannelClose +message ClaimableOnChannelClose { + // The identifier of the channel this balance belongs to. + string channel_id = 1; + + // The identifier of our channel counterparty. + string counterparty_node_id = 2; + + // The amount available to claim, in satoshis, excluding the on-chain fees which will be required to do so. + uint64 amount_satoshis = 3; + + // The transaction fee we pay for the closing commitment transaction. + // This amount is not included in the `amount_satoshis` value. + // + // Note that if this channel is inbound (and thus our counterparty pays the commitment transaction fee) this value + // will be zero. + uint64 transaction_fee_satoshis = 4; + + // The amount of millisatoshis which has been burned to fees from HTLCs which are outbound from us and are related to + // a payment which was sent by us. This is the sum of the millisatoshis part of all HTLCs which are otherwise + // represented by `LightningBalance::MaybeTimeoutClaimableHTLC` with their + // `LightningBalance::MaybeTimeoutClaimableHTLC::outbound_payment` flag set, as well as any dust HTLCs which would + // otherwise be represented the same. + // + // This amount (rounded up to a whole satoshi value) will not be included in `amount_satoshis`. + uint64 outbound_payment_htlc_rounded_msat = 5; + + // The amount of millisatoshis which has been burned to fees from HTLCs which are outbound from us and are related to + // a forwarded HTLC. This is the sum of the millisatoshis part of all HTLCs which are otherwise represented by + // `LightningBalance::MaybeTimeoutClaimableHTLC` with their `LightningBalance::MaybeTimeoutClaimableHTLC::outbound_payment` + // flag not set, as well as any dust HTLCs which would otherwise be represented the same. + // + // This amount (rounded up to a whole satoshi value) will not be included in `amount_satoshis`. + uint64 outbound_forwarded_htlc_rounded_msat = 6; + + // The amount of millisatoshis which has been burned to fees from HTLCs which are inbound to us and for which we know + // the preimage. This is the sum of the millisatoshis part of all HTLCs which would be represented by + // `LightningBalance::ContentiousClaimable` on channel close, but whose current value is included in `amount_satoshis`, + // as well as any dust HTLCs which would otherwise be represented the same. + // + // This amount (rounded up to a whole satoshi value) will not be included in `amount_satoshis`. + uint64 inbound_claiming_htlc_rounded_msat = 7; + + // The amount of millisatoshis which has been burned to fees from HTLCs which are inbound to us and for which we do + // not know the preimage. This is the sum of the millisatoshis part of all HTLCs which would be represented by + // `LightningBalance::MaybePreimageClaimableHTLC` on channel close, as well as any dust HTLCs which would otherwise be + // represented the same. + // + // This amount (rounded up to a whole satoshi value) will not be included in the counterparty’s `amount_satoshis`. + uint64 inbound_htlc_rounded_msat = 8; +} + +// The channel has been closed, and the given balance is ours but awaiting confirmations until we consider it spendable. +// See more: https://docs.rs/ldk-node/latest/ldk_node/enum.LightningBalance.html#variant.ClaimableAwaitingConfirmations +message ClaimableAwaitingConfirmations { + // The identifier of the channel this balance belongs to. + string channel_id = 1; + + // The identifier of our channel counterparty. + string counterparty_node_id = 2; + + // The amount available to claim, in satoshis, possibly excluding the on-chain fees which were spent in broadcasting + // the transaction. + uint64 amount_satoshis = 3; + + // The height at which we start tracking it as `SpendableOutput`. + uint32 confirmation_height = 4; + + // Whether this balance is a result of cooperative close, a force-close, or an HTLC. + BalanceSource source = 5; +} + +// Indicates whether the balance is derived from a cooperative close, a force-close (for holder or counterparty), +// or whether it is for an HTLC. +enum BalanceSource { + // The channel was force closed by the holder. + HOLDER_FORCE_CLOSED = 0; + + // The channel was force closed by the counterparty. + COUNTERPARTY_FORCE_CLOSED = 1; + + // The channel was cooperatively closed. + COOP_CLOSE = 2; + + // This balance is the result of an HTLC. + HTLC = 3; +} + +// The channel has been closed, and the given balance should be ours but awaiting spending transaction confirmation. +// If the spending transaction does not confirm in time, it is possible our counterparty can take the funds by +// broadcasting an HTLC timeout on-chain. +// +// Once the spending transaction confirms, before it has reached enough confirmations to be considered safe from chain +// reorganizations, the balance will instead be provided via `LightningBalance::ClaimableAwaitingConfirmations`. +// See more: https://docs.rs/ldk-node/latest/ldk_node/enum.LightningBalance.html#variant.ContentiousClaimable +message ContentiousClaimable { + // The identifier of the channel this balance belongs to. + string channel_id = 1; + + // The identifier of our channel counterparty. + string counterparty_node_id = 2; + + // The amount available to claim, in satoshis, excluding the on-chain fees which were spent in broadcasting + // the transaction. + uint64 amount_satoshis = 3; + + // The height at which the counterparty may be able to claim the balance if we have not done so. + uint32 timeout_height = 4; + + // The payment hash that locks this HTLC. + string payment_hash = 5; + + // The preimage that can be used to claim this HTLC. + string payment_preimage = 6; +} + +// HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain fees) if the counterparty +// does not know the preimage for the HTLCs. These are somewhat likely to be claimed by our counterparty before we do. +// See more: https://docs.rs/ldk-node/latest/ldk_node/enum.LightningBalance.html#variant.MaybeTimeoutClaimableHTLC +message MaybeTimeoutClaimableHTLC { + // The identifier of the channel this balance belongs to. + string channel_id = 1; + + // The identifier of our channel counterparty. + string counterparty_node_id = 2; + + // The amount available to claim, in satoshis, excluding the on-chain fees which were spent in broadcasting + // the transaction. + uint64 amount_satoshis = 3; + + // The height at which we will be able to claim the balance if our counterparty has not done so. + uint32 claimable_height = 4; + + // The payment hash whose preimage our counterparty needs to claim this HTLC. + string payment_hash = 5; + + // Indicates whether this HTLC represents a payment which was sent outbound from us. + bool outbound_payment = 6; +} + +// HTLCs which we received from our counterparty which are claimable with a preimage which we do not currently have. +// This will only be claimable if we receive the preimage from the node to which we forwarded this HTLC before the +// timeout. +// See more: https://docs.rs/ldk-node/latest/ldk_node/enum.LightningBalance.html#variant.MaybePreimageClaimableHTLC +message MaybePreimageClaimableHTLC { + // The identifier of the channel this balance belongs to. + string channel_id = 1; + + // The identifier of our channel counterparty. + string counterparty_node_id = 2; + + // The amount available to claim, in satoshis, excluding the on-chain fees which were spent in broadcasting + // the transaction. + uint64 amount_satoshis = 3; + + // The height at which our counterparty will be able to claim the balance if we have not yet received the preimage and + // claimed it ourselves. + uint32 expiry_height = 4; + + // The payment hash whose preimage we need to claim this HTLC. + string payment_hash = 5; +} +// The channel has been closed, and our counterparty broadcasted a revoked commitment transaction. +// +// Thus, we’re able to claim all outputs in the commitment transaction, one of which has the following amount. +// +// See more: https://docs.rs/ldk-node/latest/ldk_node/enum.LightningBalance.html#variant.CounterpartyRevokedOutputClaimable +message CounterpartyRevokedOutputClaimable { + // The identifier of the channel this balance belongs to. + string channel_id = 1; + + // The identifier of our channel counterparty. + string counterparty_node_id = 2; + + // The amount, in satoshis, of the output which we can claim. + uint64 amount_satoshis = 3; +} + +// Details about the status of a known balance currently being swept to our on-chain wallet. +message PendingSweepBalance { + oneof balance_type { + PendingBroadcast pending_broadcast = 1; + BroadcastAwaitingConfirmation broadcast_awaiting_confirmation = 2; + AwaitingThresholdConfirmations awaiting_threshold_confirmations = 3; + } +} + +// The spendable output is about to be swept, but a spending transaction has yet to be generated and broadcast. +// See more: https://docs.rs/ldk-node/latest/ldk_node/enum.PendingSweepBalance.html#variant.PendingBroadcast +message PendingBroadcast { + // The identifier of the channel this balance belongs to. + optional string channel_id = 1; + + // The amount, in satoshis, of the output being swept. + uint64 amount_satoshis = 2; +} + +// A spending transaction has been generated and broadcast and is awaiting confirmation on-chain. +// See more: https://docs.rs/ldk-node/latest/ldk_node/enum.PendingSweepBalance.html#variant.BroadcastAwaitingConfirmation +message BroadcastAwaitingConfirmation { + // The identifier of the channel this balance belongs to. + optional string channel_id = 1; + + // The best height when we last broadcast a transaction spending the output being swept. + uint32 latest_broadcast_height = 2; + + // The identifier of the transaction spending the swept output we last broadcast. + string latest_spending_txid = 3; + + // The amount, in satoshis, of the output being swept. + uint64 amount_satoshis = 4; +} + +// A spending transaction has been confirmed on-chain and is awaiting threshold confirmations. +// +// It will be considered irrevocably confirmed after reaching `ANTI_REORG_DELAY`. +// See more: https://docs.rs/ldk-node/latest/ldk_node/enum.PendingSweepBalance.html#variant.AwaitingThresholdConfirmations +message AwaitingThresholdConfirmations { + // The identifier of the channel this balance belongs to. + optional string channel_id = 1; + + // The identifier of the confirmed transaction spending the swept output. + string latest_spending_txid = 2; + + // The hash of the block in which the spending transaction was confirmed. + string confirmation_hash = 3; + + // The height at which the spending transaction was confirmed. + uint32 confirmation_height = 4; + + // The amount, in satoshis, of the output being swept. + uint64 amount_satoshis = 5; +} + +// Token used to determine start of next page in paginated APIs. +message PageToken { + string token = 1; + int64 index = 2; +} + +message Bolt11InvoiceDescription { + oneof kind { + string direct = 1; + string hash = 2; + } +} + +// Configuration options for payment routing and pathfinding. +// See https://docs.rs/lightning/0.2.0/lightning/routing/router/struct.RouteParametersConfig.html for more details on each field. +message RouteParametersConfig { + // The maximum total fees, in millisatoshi, that may accrue during route finding. + // Defaults to 1% of the payment amount + 50 sats + optional uint64 max_total_routing_fee_msat = 1; + + // The maximum total CLTV delta we accept for the route. + // Defaults to 1008. + uint32 max_total_cltv_expiry_delta = 2; + + // The maximum number of paths that may be used by (MPP) payments. + // Defaults to 10. + uint32 max_path_count = 3; + + // Selects the maximum share of a channel's total capacity which will be + // sent over a channel, as a power of 1/2. + // Default value: 2 + uint32 max_channel_saturation_power_of_half = 4; +} + +// Routing fees for a channel as part of the network graph. +message GraphRoutingFees { + // Flat routing fee in millisatoshis. + uint32 base_msat = 1; + + // Liquidity-based routing fee in millionths of a routed amount. + uint32 proportional_millionths = 2; +} + +// Details about one direction of a channel in the network graph, +// as received within a `ChannelUpdate`. +message GraphChannelUpdate { + // When the last update to the channel direction was issued. + // Value is opaque, as set in the announcement. + uint32 last_update = 1; + + // Whether the channel can be currently used for payments (in this one direction). + bool enabled = 2; + + // The difference in CLTV values that you must have when routing through this channel. + uint32 cltv_expiry_delta = 3; + + // The minimum value, which must be relayed to the next hop via the channel. + uint64 htlc_minimum_msat = 4; + + // The maximum value which may be relayed to the next hop via the channel. + uint64 htlc_maximum_msat = 5; + + // Fees charged when the channel is used for routing. + GraphRoutingFees fees = 6; +} + +// Details about a channel in the network graph (both directions). +// Received within a channel announcement. +message GraphChannel { + // Source node of the first direction of the channel (hex-encoded public key). + string node_one = 1; + + // Source node of the second direction of the channel (hex-encoded public key). + string node_two = 2; + + // The channel capacity as seen on-chain, if chain lookup is available. + optional uint64 capacity_sats = 3; + + // Details about the first direction of a channel. + GraphChannelUpdate one_to_two = 4; + + // Details about the second direction of a channel. + GraphChannelUpdate two_to_one = 5; +} + +// Information received in the latest node_announcement from this node. +message GraphNodeAnnouncement { + // When the last known update to the node state was issued. + // Value is opaque, as set in the announcement. + uint32 last_update = 1; + + // Moniker assigned to the node. + // May be invalid or malicious (eg control chars), should not be exposed to the user. + string alias = 2; + + // Color assigned to the node as a hex-encoded RGB string, e.g. "ff0000". + string rgb = 3; + + // List of addresses on which this node is reachable. + repeated string addresses = 4; +} + +// Details of a known Lightning peer. +// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.list_peers +message Peer { + // The hex-encoded node ID of the peer. + string node_id = 1; + + // The network address of the peer. + string address = 2; + + // Indicates whether we'll try to reconnect to this peer after restarts. + bool is_persisted = 3; + + // Indicates whether we currently have an active connection with the peer. + bool is_connected = 4; +} + +// Details about a node in the network graph, known from the network announcement. +message GraphNode { + // All valid channels a node has announced. + repeated uint64 channels = 1; + + // More information about a node from node_announcement. + // Optional because we store a node entry after learning about it from + // a channel announcement, but before receiving a node announcement. + GraphNodeAnnouncement announcement_info = 2; +} + +// Route hint for finding a path to the payee in a BOLT11 invoice. +message Bolt11RouteHint { + // The hops in this route hint. + repeated Bolt11HopHint hop_hints = 1; +} + +// A hop in a BOLT11 route hint. +message Bolt11HopHint { + // The hex-encoded public key of the node at this hop. + string node_id = 1; + + // The short channel ID. + uint64 short_channel_id = 2; + + // The base fee in millisatoshis charged for routing through this hop. + uint32 fee_base_msat = 3; + + // Fee proportional millionths charged for routing through this hop. + uint32 fee_proportional_millionths = 4; + + // The CLTV expiry delta for this hop. + uint32 cltv_expiry_delta = 5; +} + +// The amount specified in a BOLT12 offer. +message OfferAmount { + oneof amount { + // Amount in millisatoshis for Bitcoin payments. + uint64 bitcoin_amount_msats = 1; + + // Amount in a non-Bitcoin currency. + CurrencyAmount currency_amount = 2; + } +} + +// A non-Bitcoin currency amount. +message CurrencyAmount { + // ISO 4217 currency code (e.g., "USD", "EUR"). + string iso4217_code = 1; + + // The amount in the specified currency's minor unit. + uint64 amount = 2; +} + +// The quantity of items supported by a BOLT12 offer. +message OfferQuantity { + oneof quantity { + // Only one item may be requested. + bool one = 1; + + // Up to this many items may be requested. + uint64 bounded = 2; + + // Any number of items may be requested. + bool unbounded = 3; + } +} + +// A blinded path to the offer recipient. +message BlindedPath { + // Identifies the introduction node of the blinded path, either directly by + // node id or indirectly via a directed short channel ID. + oneof introduction_node { + // The hex-encoded public key of the introduction node. + string node_id = 1; + + // The directed short channel ID identifying the introduction node. + DirectedShortChannelId directed_scid = 2; + } + + // The hex-encoded blinding point. + string blinding_point = 3; + + // The number of blinded hops in the path. + uint32 num_hops = 4; +} + +// A short channel ID together with a direction byte identifying one of the +// channel's two endpoints. +message DirectedShortChannelId { + // The short channel ID. + uint64 scid = 1; + + // Which endpoint of the channel is being referred to. + ChannelDirection direction = 2; +} + +// Identifies one of the two endpoints of a channel, by lexicographic order of +// node ids. +enum ChannelDirection { + // The endpoint whose node id is lexicographically smaller. + NODE_ONE = 0; + + // The endpoint whose node id is lexicographically greater. + NODE_TWO = 1; +} + +// A feature bit advertised in a BOLT11 invoice. +message Bolt11Feature { + // Human-readable feature name. + string name = 1; + + // Whether this feature is required. + bool is_required = 2; + + // Whether this feature is known. + bool is_known = 3; +} diff --git a/stores/ChannelsStore.ts b/stores/ChannelsStore.ts index 85e4e1d9a1..a98138901b 100644 --- a/stores/ChannelsStore.ts +++ b/stores/ChannelsStore.ts @@ -470,10 +470,7 @@ export default class ChannelsStore { this.loading = false; }); - if ( - this.settingsStore.implementation === 'ldk-node' && - setPendingHtlcs - ) { + if (BackendUtils.isLDKBackend() && setPendingHtlcs) { try { const data = await BackendUtils.getPayments(); const pendingPayments = (data?.payments || []).filter( @@ -1071,8 +1068,8 @@ export default class ChannelsStore { request?.additionalChannels && request.additionalChannels?.length > 0; - // LDK Node needs the host for openChannel, other backends don't - if (this.settingsStore.implementation !== 'ldk-node') { + // LDK-based backends need the host for openChannel, other backends don't + if (!BackendUtils.isLDKBackend()) { delete request.host; } // LDK Node doesn't support announced channels - always force private diff --git a/stores/SettingsStore.ts b/stores/SettingsStore.ts index bbd6c71822..f67dff15d4 100644 --- a/stores/SettingsStore.ts +++ b/stores/SettingsStore.ts @@ -400,6 +400,7 @@ export const INTERFACE_KEYS: { { key: 'Embedded LND', value: 'embedded-lnd' }, { key: 'Remote', value: '', isHeader: true }, { key: 'LND (REST)', value: 'lnd' }, + { key: 'LDK Server', value: 'ldk-server' }, { key: 'LND (Lightning Node Connect)', value: 'lightning-node-connect' }, { key: 'Core Lightning (CLNRest)', value: 'cln-rest' }, { key: 'Nostr Wallet Connect', value: 'nostr-wallet-connect' }, @@ -409,6 +410,7 @@ export const INTERFACE_KEYS: { export type Implementations = | 'embedded-lnd' | 'ldk-node' + | 'ldk-server' | 'lnd' | 'lightning-node-connect' | 'cln-rest' diff --git a/stores/TransactionsStore.ts b/stores/TransactionsStore.ts index f4dd5d9339..4fd4021818 100644 --- a/stores/TransactionsStore.ts +++ b/stores/TransactionsStore.ts @@ -657,7 +657,7 @@ export default class TransactionsStore { const payFunc = (this.settingsStore.implementation === 'cln-rest' || this.settingsStore.implementation === 'embedded-lnd' || - this.settingsStore.implementation === 'ldk-node') && + BackendUtils.isLDKBackend()) && pubkey ? BackendUtils.sendKeysend : BackendUtils.payLightningInvoice; diff --git a/utils/BackendUtils.ts b/utils/BackendUtils.ts index 554bd4da13..0a22679d80 100644 --- a/utils/BackendUtils.ts +++ b/utils/BackendUtils.ts @@ -6,6 +6,7 @@ import LightningNodeConnect from '../backends/LightningNodeConnect'; import EmbeddedLND from '../backends/EmbeddedLND'; // LDK Node import LdkNode from '../backends/LdkNode'; +import LdkServer from '../backends/LdkServer'; // Core Lightning import CLNRest from '../backends/CLNRest'; // Custodial @@ -17,6 +18,7 @@ class BackendUtils { lightningNodeConnect: LightningNodeConnect; embeddedLND: EmbeddedLND; ldkNode: LdkNode; + ldkServer: LdkServer; clnRest: CLNRest; lndHub: LndHub; nostrWalletConnect: NostrWalletConnect; @@ -25,6 +27,7 @@ class BackendUtils { this.lightningNodeConnect = new LightningNodeConnect(); this.embeddedLND = new EmbeddedLND(); this.ldkNode = new LdkNode(); + this.ldkServer = new LdkServer(); this.clnRest = new CLNRest(); this.lndHub = new LndHub(); this.nostrWalletConnect = new NostrWalletConnect(); @@ -41,6 +44,8 @@ class BackendUtils { return this.embeddedLND; case 'ldk-node': return this.ldkNode; + case 'ldk-server': + return this.ldkServer; case 'cln-rest': return this.clnRest; case 'lndhub': @@ -272,6 +277,10 @@ class BackendUtils { }; // Implementation type checks + isLDKBackend = (implementation = settingsStore.implementation) => { + return implementation === 'ldk-node' || implementation === 'ldk-server'; + }; + isLocalWallet = () => { const { implementation } = settingsStore; return ( diff --git a/utils/ClientInfoUtils.ts b/utils/ClientInfoUtils.ts index 85eb5f4c01..99d4b5e8f6 100644 --- a/utils/ClientInfoUtils.ts +++ b/utils/ClientInfoUtils.ts @@ -4,6 +4,7 @@ import { Implementations } from '../stores/SettingsStore'; // Only backends that support LSP (Flow, LSPS1, or LSPS7) const NODE_NAMES: Partial> = { 'ldk-node': 'LDK', + 'ldk-server': 'LDK', 'embedded-lnd': 'LND', lnd: 'LND', 'lightning-node-connect': 'LND', diff --git a/views/Receive.tsx b/views/Receive.tsx index 1836a83f24..2534b9d5e1 100644 --- a/views/Receive.tsx +++ b/views/Receive.tsx @@ -1001,7 +1001,7 @@ export default class Receive extends React.Component< }); } - if (implementation === 'lnd') { + if (implementation === 'lnd' || implementation === 'ldk-server') { if (rHash) { this.lnInterval = setInterval(() => { // only fetch the last 10 invoices diff --git a/views/Settings/SetWalletPicture.tsx b/views/Settings/SetWalletPicture.tsx index 54fd746e51..734608392f 100644 --- a/views/Settings/SetWalletPicture.tsx +++ b/views/Settings/SetWalletPicture.tsx @@ -79,7 +79,8 @@ export default class SetWalletPicture extends React.Component< require('../../assets/images/cln.jpg'), require('../../assets/images/btcpay.jpg') ], - 'ldk-node': [require('../../assets/images/ldk.png')] + 'ldk-node': [require('../../assets/images/ldk.png')], + 'ldk-server': [require('../../assets/images/ldk.png')] }; if (implementation && implementation in implementationImagesMap) { diff --git a/views/Settings/WalletConfiguration.tsx b/views/Settings/WalletConfiguration.tsx index d42161d183..2aa7daeae4 100644 --- a/views/Settings/WalletConfiguration.tsx +++ b/views/Settings/WalletConfiguration.tsx @@ -109,6 +109,7 @@ interface WalletConfigurationState { port: string; // lnd macaroonHex: string; // lnd rune: string; // CLN-rest + accessKey: string; // ldk-server lndhubUrl: string; // lndhub username: string | undefined; // lndhub password: string | undefined; // lndhub @@ -190,6 +191,7 @@ export default class WalletConfiguration extends React.Component< port: '', macaroonHex: '', rune: '', + accessKey: '', saved: false, index: null as number | null, active: false, @@ -422,6 +424,7 @@ export default class WalletConfiguration extends React.Component< port, macaroonHex, rune, + accessKey, implementation, certVerification, enableTor, @@ -463,6 +466,7 @@ export default class WalletConfiguration extends React.Component< port, macaroonHex, rune, + accessKey, implementation: implementation || 'lnd', certVerification, index, @@ -525,6 +529,7 @@ export default class WalletConfiguration extends React.Component< existingAccount, macaroonHex, rune, + accessKey, username, password, implementation, @@ -569,6 +574,7 @@ export default class WalletConfiguration extends React.Component< existingAccount, macaroonHex, rune, + accessKey, username, password, implementation, @@ -687,6 +693,7 @@ export default class WalletConfiguration extends React.Component< existingAccount, macaroonHex, rune, + accessKey, username, password, implementation, @@ -707,6 +714,7 @@ export default class WalletConfiguration extends React.Component< existingAccount, macaroonHex, rune, + accessKey, username, password, implementation, @@ -1190,6 +1198,7 @@ export default class WalletConfiguration extends React.Component< lndhubUrl, macaroonHex, rune, + accessKey, username, password, saved, @@ -2058,7 +2067,8 @@ export default class WalletConfiguration extends React.Component< )} {(implementation === 'lnd' || - implementation === 'cln-rest') && ( + implementation === 'cln-rest' || + implementation === 'ldk-server') && ( <> + ) : implementation === 'ldk-server' ? ( + <> + + {localeString( + 'views.Settings.AddEditNode.accessKey' + )} + + + + this.setState({ + accessKey: + text.trim(), + saved: false + }) + } + locked={loading} + /> + + this.setState({ + hidden: !this.state + .hidden + }) + } + /> + + ) : ( <>