From 0e882b083fdaf0704f77e0e9df073dfe54d26b67 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Thu, 19 Mar 2026 12:55:04 -0500 Subject: [PATCH] Add ldk-server provider Integrate ldk-server as a ThunderHub lightning provider using its gRPC API. The provider supports core wallet, channel, payment, invoice, peer, forward, graph, and event flows while documenting the remaining gaps. Keep ldk-server connections resilient to gRPC session errors and avoid sending explicit amounts for fixed-amount BOLT11 invoices. --- docs/LDK_SERVER_GAPS.md | 327 + docs/LDK_SERVER_SETUP.md | 215 + eslint.config.js | 1 + nest-cli.json | 10 +- package-lock.json | 99 +- package.json | 1 + .../modules/accounts/accounts.service.ts | 1 + src/server/modules/files/files.service.ts | 2 + src/server/modules/files/files.types.ts | 3 + .../node/ldk-server/ldk-server.events.ts | 103 + .../node/ldk-server/ldk-server.helpers.ts | 297 + .../node/ldk-server/ldk-server.module.ts | 8 + .../node/ldk-server/ldk-server.service.ts | 1241 + .../modules/node/ldk-server/proto/api.proto | 979 + .../modules/node/ldk-server/proto/error.proto | 45 + .../node/ldk-server/proto/events.proto | 123 + .../node/ldk-server/proto/ldk-server.d.ts | 14510 +++++++ .../node/ldk-server/proto/ldk-server.js | 34366 ++++++++++++++++ .../modules/node/ldk-server/proto/types.proto | 947 + src/server/modules/node/lightning.types.ts | 2 + .../modules/node/provider-registry.module.ts | 3 +- .../modules/node/provider-registry.service.ts | 8 +- src/server/modules/sub/sub.service.ts | 49 + 23 files changed, 53308 insertions(+), 32 deletions(-) create mode 100644 docs/LDK_SERVER_GAPS.md create mode 100644 docs/LDK_SERVER_SETUP.md create mode 100644 src/server/modules/node/ldk-server/ldk-server.events.ts create mode 100644 src/server/modules/node/ldk-server/ldk-server.helpers.ts create mode 100644 src/server/modules/node/ldk-server/ldk-server.module.ts create mode 100644 src/server/modules/node/ldk-server/ldk-server.service.ts create mode 100644 src/server/modules/node/ldk-server/proto/api.proto create mode 100644 src/server/modules/node/ldk-server/proto/error.proto create mode 100644 src/server/modules/node/ldk-server/proto/events.proto create mode 100644 src/server/modules/node/ldk-server/proto/ldk-server.d.ts create mode 100644 src/server/modules/node/ldk-server/proto/ldk-server.js create mode 100644 src/server/modules/node/ldk-server/proto/types.proto diff --git a/docs/LDK_SERVER_GAPS.md b/docs/LDK_SERVER_GAPS.md new file mode 100644 index 000000000..29cd8cf13 --- /dev/null +++ b/docs/LDK_SERVER_GAPS.md @@ -0,0 +1,327 @@ +# ldk-server Gap Analysis for ThunderHub + +This document tracks the remaining gaps between ThunderHub's +`LightningProvider` interface and the current ldk-server gRPC API. + +The ThunderHub integration uses ldk-server's gRPC service over HTTP/2 with +HMAC auth. Real-time invoice, payment, forward, and channel notifications are +handled through ldk-server's `SubscribeEvents` stream, so event delivery is not +considered a gap. + +## Unsupported Methods + +These ThunderHub provider methods currently throw `Not supported by ldk-server`. + +### Backups + +| Method | Notes | +| ---------------------------------- | -------------------------------------------- | +| `getBackups()` | No backup export endpoint in ldk-server | +| `verifyBackup(backup)` | No backup verification endpoint | +| `verifyBackups(args)` | No multi-backup verification endpoint | +| `recoverFundsFromChannels(backup)` | No static channel backup recovery equivalent | + +**What ldk-server would need:** Backup export/import/verify endpoints. LDK Node +state is persisted in its storage backend, so the closest equivalent may be a +database snapshot/restore API. + +### Macaroons / Access Tokens + +| Method | Notes | +| -------------------------- | ----------------------------------------------- | +| `grantAccess(permissions)` | ldk-server uses one HMAC API key, not macaroons | +| `getAccessIds()` | No scoped-token inventory endpoint | +| `bakeMacaroon(options)` | No scoped token/API key creation endpoint | + +**What ldk-server would need:** A scoped API key system, or the ability to +create restricted credentials with ThunderHub-style permissions. + +### Route Construction + +| Method | Notes | +| -------------------------------- | -------------------------------------------------------------------------------- | +| `payViaRoutes(routes)` | ThunderHub passes explicit LND-style routes; ldk-server does its own pathfinding | +| `getRouteToDestination(options)` | No endpoint that returns a ThunderHub/LND route object | + +**What ldk-server would need:** A route query endpoint and/or support for paying +an explicit route. ldk-server does expose route parameter configuration on send +requests, but that is not equivalent to ThunderHub's route object. + +### Diffie-Hellman + +| Method | Notes | +| ------------------------------------- | -------------------------- | +| `diffieHellmanComputeSecret(options)` | No key derivation endpoint | + +**What ldk-server would need:** An endpoint wrapping LDK key material to compute +ECDH shared secrets from `partner_public_key`, `key_family`, and `key_index`. + +### Network Aggregate Info + +| Method | Notes | +| ------------------ | ------------------------------------------ | +| `getNetworkInfo()` | No endpoint for graph aggregate statistics | + +**What ldk-server would need:** A `GetNetworkInfo` endpoint aggregating graph +statistics such as node count, channel count, total capacity, and channel size +distribution. + +### UTXOs + +| Method | Notes | +| ------------ | ------------------------------------------ | +| `getUtxos()` | No endpoint exposing on-chain wallet UTXOs | + +**What ldk-server would need:** A `ListUtxos` endpoint exposing the BDK wallet's +unspent outputs. + +## Partial Gaps + +These methods work, but ThunderHub fills some fields with defaults or has to +work around API shape differences. + +### Wallet Info + +#### `getWalletInfo()` + +`GetNodeInfo`, `ListChannels`, and `ListPeers` provide enough data for the main +dashboard, but these fields are incomplete: + +| ThunderHub Field | Current Behavior | What ldk-server would need | +| ----------------------- | ----------------------------------------- | ------------------------------------------------------------ | +| `color` | `'#000000'` | Add `node_color` to `GetNodeInfoResponse` | +| `version` | Static `'1.0.0 ldk-server'` | Add ldk-server and ldk-node version fields | +| `chains` | Currently mapped as `['bitcoin']` | Map or expose network in ThunderHub's expected string format | +| `closed_channels_count` | `0` | Requires closed-channel history | +| `active_channels_count` | Computed via `ListChannels` | Optional count in `GetNodeInfoResponse` | +| `peers_count` | Computed via `ListPeers` | Optional count in `GetNodeInfoResponse` | +| `latest_block_at` | Current time | Add best-block timestamp | +| `is_synced_to_chain` | Derived from sync timestamps | Add explicit sync status | +| `is_synced_to_graph` | Derived from RGS timestamp or wallet sync | Add explicit graph sync status | + +#### `getWalletVersion()` + +Returns dummy LND-style capability flags because those fields do not apply to +ldk-server. + +**What ldk-server would need:** A version endpoint returning ldk-server and +ldk-node versions. ThunderHub could also hide LND-specific capability flags for +non-LND providers. + +### Channels + +#### `getClosedChannels()` + +Returns an empty list. ldk-server does not expose historical closed channel +records. + +**What ldk-server would need:** A `ListClosedChannels` endpoint or persisted +channel state-change history based on LDK channel events. + +#### `getPendingChannels()` + +Uses `ListChannels` entries where `is_channel_ready` is false. This covers +opening channels, but it does not fully model LND's pending channel categories. + +**What ldk-server would need:** More detailed pending/opening/closing channel +state if ThunderHub needs to distinguish every LND pending channel variant. + +#### `getChannel(id)` + +Local channels are mapped from `ListChannels`; public graph channels fall back +to `GraphGetChannel`. + +Missing fields: + +| Field | Notes | +| ------------------ | ------------------------------- | +| `time_offline` | Not tracked | +| `time_online` | Not tracked | +| `pending_payments` | In-flight HTLCs are not exposed | + +**What ldk-server would need:** HTLC details per channel and optional uptime +tracking. + +#### `getChannelBalance()` + +Returns `total_lightning_balance_sats` from `GetBalances`. + +**Missing:** `pending_balance` is returned as `0`. ldk-server exposes pending +on-chain sweep and lightning balance details, but they do not map cleanly to the +single LND `pending_balance` field. + +#### `openChannel()` + +ldk-server's `OpenChannel` requires a peer address. ThunderHub's implementation +looks up the address from `ListPeers`, so the peer must already be connected. +This is an API mismatch rather than a missing core feature. + +### Chain + +#### `getChainTransactions()` + +Returns an empty list. ldk-server does not have a chain transaction history +endpoint. + +**What ldk-server would need:** A `ListChainTransactions` endpoint, or enough +on-chain payment metadata in `ListPayments` to reconstruct ThunderHub's chain +transaction shape. + +#### `getPendingChainBalance()` + +Works by combining `GetBalances` fields: + +- total on-chain balance +- spendable on-chain balance +- anchor reserve +- pending balances from channel closures +- claimable lightning balances awaiting on-chain settlement + +This is a best-effort mapping and may not match LND exactly. + +#### `sendToChainAddress()` + +Works via `OnchainSend`, but the response only contains `txid`. + +Missing response fields: confirmation count, confirmation status, actual amount +sent, and fee. + +### Payments + +#### `pay()` + +Works via `Bolt11Send`. ThunderHub now decodes the invoice first and only sends +`amount_msat` for zero-amount invoices, matching ldk-server's API contract. + +`Bolt11SendResponse` only returns `payment_id`, so ThunderHub returns a minimal +payment result. + +Missing response fields: fee, route hops, confirmation state, amount, and +preimage. `PaymentSuccessful` events can later provide richer payment data for +UI refreshes. + +#### `payViaPaymentDetails()` + +Maps to ldk-server `SpontaneousSend` for keysend-style payments. The send works, +but the immediate response is minimal and uses default values for fee, hops, and +preimage. + +#### `getPayments()` + +Works via `ListPayments` filtered to outbound payments. + +Current compatibility note: if ldk-server fails to decode older persisted +payment records, ThunderHub returns an empty list instead of surfacing the +server-side decode failure to the UI. + +Missing fields per payment: + +| Field | What ldk-server would need | +| ------------- | -------------------------------------- | +| `destination` | Add `destination_node_id` to `Payment` | +| `hops` | Persist route hop data | +| `request` | Store original BOLT11 invoice string | + +### Invoices + +#### `createInvoice()` + +Works via `Bolt11Receive`. ldk-server returns the invoice, payment hash, and +payment secret. + +#### `getInvoices()` + +Works via `ListPayments` filtered to inbound payments. + +Current compatibility note: if ldk-server fails to decode older persisted +payment records, ThunderHub returns an empty list instead of surfacing the +server-side decode failure to the UI. + +Missing fields per invoice: description, description hash, expiry, original +BOLT11 request string, and HTLC/payment attempt details. + +**What ldk-server would need:** Store and return richer inbound payment metadata. + +#### `subscribeToInvoice(id)` + +Works by polling `GetPaymentDetails` every 2 seconds using the payment hash. +Global real-time updates use the `SubscribeEvents` gRPC stream. + +### Network Graph + +#### `getNode(public_key)` + +Works via `GraphGetNode`. + +Minor gap: `GraphNode` lists channel IDs, but not full channel capacities and +policies. ThunderHub currently returns those channel entries with default +capacity/policy values. + +### Routing Fees + +#### `updateRoutingFees()` + +Works via `UpdateChannelConfig` after locating the channel with `ListChannels`. + +Missing fields: `max_htlc_mtokens` and `min_htlc_mtokens` are not mappable to +ldk-server's current `ChannelConfig`. + +### Peers + +#### `getPeers()` + +Works via `ListPeers`, but several LND peer stats are unavailable. + +Missing fields: bytes received, bytes sent, inbound/outbound direction, sync +peer status, ping time, tokens received, and tokens sent. + +### Forwards + +#### `getForwards()` + +Works via `ListForwardedPayments`. + +Missing field: original forward timestamp. ThunderHub currently uses the current +time as `created_at`. + +**What ldk-server would need:** Add a timestamp to `ForwardedPayment`. + +### Signatures + +#### `verifyMessage(message, signature)` + +ldk-server's `VerifySignature` requires a `public_key`. ThunderHub's +provider-level interface does not pass one because the LND implementation can +return the signer. The current workaround verifies against the node's own public +key, so only self-signed messages can be verified. + +**What ldk-server or ThunderHub would need:** Either return the signer from +verification, or change ThunderHub's provider interface to pass an expected +public key. + +## Priority Additions for ldk-server + +### High Priority + +1. Add `destination_node_id` to `Payment`. +2. Add timestamps to `ForwardedPayment`. +3. Add ldk-server/ldk-node version fields to `GetNodeInfoResponse` or a version endpoint. +4. Add closed-channel history. +5. Add chain transaction history. + +### Medium Priority + +6. Add `ListUtxos`. +7. Add `GetNetworkInfo` aggregate graph statistics. +8. Return richer `Bolt11SendResponse`, `SpontaneousSendResponse`, and `OnchainSendResponse` data. +9. Store invoice metadata: description, expiry, request string, and HTLC attempts. +10. Expose channel HTLC details and richer pending channel states. + +### Low Priority + +11. Add peer traffic statistics. +12. Add channel uptime tracking. +13. Add `max_htlc_msat` / `min_htlc_msat` support to channel config. +14. Add backup/restore endpoints. +15. Add scoped API keys. +16. Add ECDH shared secret computation. diff --git a/docs/LDK_SERVER_SETUP.md b/docs/LDK_SERVER_SETUP.md new file mode 100644 index 000000000..b9a74e354 --- /dev/null +++ b/docs/LDK_SERVER_SETUP.md @@ -0,0 +1,215 @@ +# Using ThunderHub with ldk-server + +This guide explains how to connect ThunderHub to an +[ldk-server](https://github.com/lightningdevkit/ldk-server) node over +ldk-server's gRPC API. + +## Prerequisites + +- A running ldk-server instance. +- ThunderHub installed and configured. +- The ldk-server gRPC address, API key, and TLS certificate. + +ldk-server's default gRPC address is `127.0.0.1:3536`. If your +`ldk-server-config.toml` sets `[node].grpc_service_address`, use that value +instead. + +## Account Configuration + +Add an ldk-server account to your ThunderHub YAML config file. The default path +is `~/.thunderhub/thubConfig.yaml`. + +```yaml +masterPassword: 'your-password' +accounts: + - name: 'My LDK Node' + type: ldk-server + serverUrl: 'https://localhost:3536' + authToken: '' + tlsCertPath: '/path/to/storage_dir/tls.crt' + password: 'account-password' +``` + +### Required Fields + +| Field | Description | +| ----------- | ------------------------------------------------------------------------------- | +| `name` | Display name for the node in ThunderHub | +| `type` | Must be `ldk-server` | +| `serverUrl` | HTTPS URL for the ldk-server gRPC service, for example `https://localhost:3536` | +| `authToken` | Hex-encoded ldk-server API key | +| `password` | Account password in ThunderHub, unless `masterPassword` is set | + +### Recommended Fields + +| Field | Description | +| ------------- | --------------------------------------------------------------------------------------- | +| `tlsCertPath` | Path to ldk-server's PEM TLS certificate. Use this outside throwaway local development. | + +ThunderHub also accepts ldk-server configs without a URL scheme and will treat +them as HTTPS, so `serverUrl: '127.0.0.1:3536'` is equivalent to +`serverUrl: 'https://127.0.0.1:3536'`. + +## Finding the ldk-server Values + +### gRPC Address + +In `ldk-server-config.toml`, the gRPC address is configured under `[node]`: + +```toml +[node] +grpc_service_address = "127.0.0.1:3536" +``` + +If that line is omitted, ldk-server defaults to `127.0.0.1:3536`. + +Use the same address in ThunderHub's `serverUrl` with an HTTPS scheme: + +```yaml +serverUrl: 'https://localhost:3536' +``` + +### API Key + +ldk-server generates a 32-byte random API key on first startup. It is stored as +raw bytes in the network-specific storage directory: + +```text +//api_key +``` + +Examples: + +```text +~/.ldk-server/regtest/api_key +~/.ldk-server/signet/api_key +/tmp/ldk-server/regtest/api_key +``` + +`storage_dir` comes from `[storage.disk].dir_path` in +`ldk-server-config.toml`. `network` comes from `[node].network`. + +ThunderHub's `authToken` field expects this key as lowercase hex. Convert it +with: + +```bash +xxd -p -c 32 /path/to/storage_dir/regtest/api_key +``` + +Do not use `cat`; the file contains raw bytes, not text. + +### TLS Certificate + +ldk-server serves gRPC over TLS. By default it stores the certificate at: + +```text +/tls.crt +``` + +If `[tls].cert_path` is set in `ldk-server-config.toml`, use that path instead. + +Point ThunderHub at the certificate with `tlsCertPath`: + +```yaml +tlsCertPath: '/path/to/storage_dir/tls.crt' +``` + +If `tlsCertPath` is omitted, ThunderHub skips TLS verification for ldk-server +connections. That is convenient for local testing, but production setups should +provide the certificate or use a publicly trusted TLS certificate. + +## Real-Time Events + +ThunderHub subscribes to ldk-server's gRPC `SubscribeEvents` stream using the +same `serverUrl`, `authToken`, and TLS certificate as regular API calls. + +No RabbitMQ or separate event broker is required. + +Current behavior: if the event stream disconnects, restart ThunderHub to +establish a fresh subscription. + +## Supported Features + +With ldk-server, ThunderHub currently supports: + +- Node info dashboard: alias, block height, sync status, peers, channels, and balances. +- Channel management: list, open, close, force-close, and routing fee updates. +- On-chain wallet: new address, send, chain balance, and pending chain balance. +- Lightning payments: send BOLT11 invoices and keysend-style spontaneous payments. +- Invoice creation, invoice listing, and invoice payment polling. +- Peer management: connect, disconnect, and list peers. +- Forward history. +- Message signing and self-signature verification. +- Network graph node/channel queries. +- Real-time invoice/payment/forward/channel refreshes through `SubscribeEvents`. + +## Known Limitations + +Some ThunderHub features are LND-specific or need additional ldk-server API +support: + +- Channel backups and channel recovery. +- UTXO listing. +- On-chain transaction history. +- Network aggregate statistics. +- Macaroon-style scoped credential management. +- Explicit route construction and paying via explicit routes. +- Diffie-Hellman shared secret computation. +- Full payment, invoice, peer, and forward metadata parity with LND. + +See [LDK_SERVER_GAPS.md](./LDK_SERVER_GAPS.md) for the detailed method-level +breakdown. + +## Example: LND and ldk-server Together + +You can run LND and ldk-server accounts side by side: + +```yaml +masterPassword: 'your-master-password' +accounts: + - name: 'LND Node' + serverUrl: 'localhost:10009' + macaroonPath: '/path/to/admin.macaroon' + certificatePath: '/path/to/tls.cert' + + - name: 'LDK Node' + type: ldk-server + serverUrl: 'https://localhost:3536' + authToken: '' + tlsCertPath: '/path/to/ldk-server/tls.crt' +``` + +The first account defaults to `type: lnd` when omitted. Switch between accounts +in the ThunderHub UI. + +## Troubleshooting + +### Connection Refused + +If ThunderHub logs `ECONNREFUSED`, check the configured `serverUrl` against the +actual ldk-server gRPC listener: + +```bash +ss -ltnp | grep ldk-server +``` + +Make sure you use the gRPC port, not the Lightning P2P port. + +### Authentication Errors + +If ldk-server rejects the request as unauthenticated, verify that `authToken` is +the hex encoding of the raw API key file for the same network ldk-server is +running on. + +### TLS Errors + +If TLS verification fails, set `tlsCertPath` to the certificate used by the +running ldk-server instance. The default path is usually +`/tls.crt`. + +### Payment Fails with Route Not Found + +If paying an invoice fails with `RouteNotFound`, the request reached ldk-server +successfully, but ldk-server could not find a route. Check that the destination +is reachable, channels are usable, and the node has sufficient outbound +liquidity. diff --git a/eslint.config.js b/eslint.config.js index bb0005af7..bf07aea0f 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -69,4 +69,5 @@ module.exports = defineConfig([{ "**/dist", "**/*.generated.tsx", "drizzle.config.ts", + "**/ldk-server/proto/**", ])]); diff --git a/nest-cli.json b/nest-cli.json index 5b70fd63f..f91e6ee1a 100644 --- a/nest-cli.json +++ b/nest-cli.json @@ -1,4 +1,12 @@ { "collection": "@nestjs/schematics", - "sourceRoot": "src/server" + "sourceRoot": "src/server", + "compilerOptions": { + "assets": [ + { + "include": "modules/node/ldk-server/proto/*.js", + "outDir": "dist" + } + ] + } } diff --git a/package-lock.json b/package-lock.json index 15e53c13c..5e98f8ffa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -66,6 +66,7 @@ "passport": "^0.7.0", "passport-jwt": "^4.0.1", "postgres": "^3.4.8", + "protobufjs": "^8.0.0", "qrcode.react": "^4.2.0", "radix-ui": "^1.4.3", "react": "^18.2.0", @@ -3896,6 +3897,30 @@ "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", "license": "Apache-2.0" }, + "node_modules/@grpc/proto-loader/node_modules/protobufjs": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.6.0.tgz", + "integrity": "sha512-LtESOsMPTZgyYtwxhvdgdjGL0HmXEaRA/hVD6sol4zA60hVXXXP/SGmxnqDbgGE8gy7pYex7cym+5vYPcmaXBQ==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.5", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.1", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.2", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.1", + "@types/node": ">=13.7.0", + "long": "^5.3.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/@hono/node-server": { "version": "1.19.11", "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.11.tgz", @@ -5060,6 +5085,30 @@ "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", "license": "Apache-2.0" }, + "node_modules/@lightningpolar/tapd-api/node_modules/protobufjs": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.6.0.tgz", + "integrity": "sha512-LtESOsMPTZgyYtwxhvdgdjGL0HmXEaRA/hVD6sol4zA60hVXXXP/SGmxnqDbgGE8gy7pYex7cym+5vYPcmaXBQ==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.5", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.1", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.2", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.1", + "@types/node": ">=13.7.0", + "long": "^5.3.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/@lukeed/csprng": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz", @@ -6201,9 +6250,10 @@ "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" }, "node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.5.tgz", + "integrity": "sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/eventemitter": { "version": "1.1.0", @@ -6211,12 +6261,12 @@ "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" }, "node_modules/@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.1.tgz", + "integrity": "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==", + "license": "BSD-3-Clause", "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" + "@protobufjs/aspromise": "^1.1.1" } }, "node_modules/@protobufjs/float": { @@ -6225,9 +6275,10 @@ "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" }, "node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.2.tgz", + "integrity": "sha512-pa0vFRuws4wkvaXKK1uXZMAwAX4/t8ANaJo45iw/oQHNQ9q5xUzwgFmVJGXiga2BeN+zpX7Vf9vmsiIa2J+MUw==", + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/path": { "version": "1.1.2", @@ -6240,9 +6291,10 @@ "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" }, "node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.1.tgz", + "integrity": "sha512-oOAWABowe8EAbMyWKM0tYDKi8Yaox52D+HWZhAIJqQXbqe0xI/GV7FhLWqlEKreMkfDjshR5FKgi3mnle0h6Eg==", + "license": "BSD-3-Clause" }, "node_modules/@radix-ui/number": { "version": "1.1.1", @@ -18832,24 +18884,13 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, "node_modules/protobufjs": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz", - "integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-8.4.0.tgz", + "integrity": "sha512-iriNhQ57SYA5Jbdi+41AyPdx6jPPkFO7DODzkOBmqFhgYn/JzX2HxgxYPY18eQAs3CP/AWqtPvkWn8rclRAxdQ==", "hasInstallScript": true, "license": "BSD-3-Clause", "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/node": ">=13.7.0", - "long": "^5.0.0" + "long": "^5.3.2" }, "engines": { "node": ">=12.0.0" diff --git a/package.json b/package.json index 391fcfb9a..c25745c17 100644 --- a/package.json +++ b/package.json @@ -117,6 +117,7 @@ "passport": "^0.7.0", "passport-jwt": "^4.0.1", "postgres": "^3.4.8", + "protobufjs": "^8.0.0", "qrcode.react": "^4.2.0", "radix-ui": "^1.4.3", "react": "^18.2.0", diff --git a/src/server/modules/accounts/accounts.service.ts b/src/server/modules/accounts/accounts.service.ts index 1c239dfcf..5636d4d10 100644 --- a/src/server/modules/accounts/accounts.service.ts +++ b/src/server/modules/accounts/accounts.service.ts @@ -96,6 +96,7 @@ export class AccountsService implements OnModuleInit { cert: account.cert || undefined, macaroon: account.macaroon || undefined, authToken: account.authToken, + tlsCertPath: account.tlsCertPath, }); this.accounts[account.hash] = { diff --git a/src/server/modules/files/files.service.ts b/src/server/modules/files/files.service.ts index a72033328..a58e4babe 100644 --- a/src/server/modules/files/files.service.ts +++ b/src/server/modules/files/files.service.ts @@ -269,6 +269,7 @@ export class FilesService { encrypted, twofaSecret, authToken, + tlsCertPath, } = resolvedAccount; const nodeType = (accountType as NodeType) || NodeType.LND; @@ -350,6 +351,7 @@ export class FilesService { password: password || masterPassword || '', twofaSecret: twofaSecret || '', authToken: authToken || undefined, + tlsCertPath: tlsCertPath || undefined, ...encryptedProps, }; } diff --git a/src/server/modules/files/files.types.ts b/src/server/modules/files/files.types.ts index 2f650217a..9401cdac6 100644 --- a/src/server/modules/files/files.types.ts +++ b/src/server/modules/files/files.types.ts @@ -23,6 +23,7 @@ export type AccountType = { encrypted?: boolean; twofaSecret?: string | null; authToken?: string; + tlsCertPath?: string; }; export type UnresolvedAccountType = { @@ -39,6 +40,7 @@ export type UnresolvedAccountType = { certificate?: string; encrypted?: boolean | string; authToken?: string; + tlsCertPath?: string; }; export type ParsedAccount = { @@ -55,6 +57,7 @@ export type ParsedAccount = { encryptedMacaroon: string; twofaSecret: string; authToken?: string; + tlsCertPath?: string; }; export type AccountConfigType = { diff --git a/src/server/modules/node/ldk-server/ldk-server.events.ts b/src/server/modules/node/ldk-server/ldk-server.events.ts new file mode 100644 index 000000000..27461827f --- /dev/null +++ b/src/server/modules/node/ldk-server/ldk-server.events.ts @@ -0,0 +1,103 @@ +import { events, types } from './proto/ldk-server'; +import { msatToSat, toNumber } from './ldk-server.helpers'; + +export type LdkServerSseEvent = + | { name: 'invoice_updated'; data: Record } + | { name: 'payment'; data: Record } + | { name: 'forward'; data: Record } + | { name: 'channel_updated'; data: Record }; + +export function mapLdkServerEvent( + envelope: events.IEventEnvelope +): LdkServerSseEvent | undefined { + if (envelope.paymentReceived?.payment) { + return { + name: 'invoice_updated', + data: mapPaymentToInvoiceEvent(envelope.paymentReceived.payment), + }; + } + + if (envelope.paymentClaimable?.payment) { + return { + name: 'invoice_updated', + data: mapPaymentToInvoiceEvent(envelope.paymentClaimable.payment), + }; + } + + if (envelope.paymentSuccessful?.payment) { + const payment = envelope.paymentSuccessful.payment; + return payment.direction === types.PaymentDirection.OUTBOUND + ? { name: 'payment', data: mapPaymentToPaymentEvent(payment) } + : { name: 'invoice_updated', data: mapPaymentToInvoiceEvent(payment) }; + } + + if (envelope.paymentFailed?.payment) { + const payment = envelope.paymentFailed.payment; + if (payment.direction === types.PaymentDirection.OUTBOUND) { + return { name: 'payment', data: mapPaymentToPaymentEvent(payment) }; + } + } + + if (envelope.paymentForwarded?.forwardedPayment) { + return { + name: 'forward', + data: mapForwardedPaymentToForwardEvent( + envelope.paymentForwarded.forwardedPayment + ), + }; + } + + if (envelope.channelStateChanged) { + return { + name: 'channel_updated', + data: { + id: envelope.channelStateChanged.channelId || '', + partner_public_key: envelope.channelStateChanged.counterpartyNodeId, + transaction_id: envelope.channelStateChanged.fundingTxo, + }, + }; + } + + return undefined; +} + +function mapPaymentToInvoiceEvent(payment: types.IPayment) { + const amountMsat = toNumber(payment.amountMsat); + const tokens = msatToSat(amountMsat); + const isConfirmed = payment.status === types.PaymentStatus.SUCCEEDED; + + return { + tokens, + is_confirmed: isConfirmed, + description: '', + description_hash: '', + received: isConfirmed ? tokens : 0, + }; +} + +function mapPaymentToPaymentEvent(payment: types.IPayment) { + const amountMsat = toNumber(payment.amountMsat); + const feeMsat = toNumber(payment.feePaidMsat); + + return { + hops: [], + fee: msatToSat(feeMsat), + destination: '', + tokens: msatToSat(amountMsat), + }; +} + +function mapForwardedPaymentToForwardEvent(forward: types.IForwardedPayment) { + const feeMsat = toNumber(forward.totalFeeEarnedMsat); + const amountMsat = toNumber(forward.outboundAmountForwardedMsat); + + return { + is_confirmed: true, + is_receive: false, + is_send: false, + in_channel: forward.prevChannelId || '', + out_channel: forward.nextChannelId || '', + fee: msatToSat(feeMsat), + tokens: msatToSat(amountMsat), + }; +} diff --git a/src/server/modules/node/ldk-server/ldk-server.helpers.ts b/src/server/modules/node/ldk-server/ldk-server.helpers.ts new file mode 100644 index 000000000..b70e7492c --- /dev/null +++ b/src/server/modules/node/ldk-server/ldk-server.helpers.ts @@ -0,0 +1,297 @@ +import crypto from 'crypto'; +import EventEmitter from 'events'; +import fs from 'fs'; +import http2 from 'http2'; + +const GRPC_SERVICE_PREFIX = '/api.LightningNode/'; + +export class LdkServerClient { + readonly authority: string; + readonly scheme: 'http' | 'https'; + readonly apiKey: string; + readonly ca?: Buffer; + + constructor( + baseUrl: string, + apiKey: string, + tlsCertPath?: string, + cert?: string + ) { + const normalized = normalizeGrpcAddress(baseUrl); + this.authority = normalized.authority; + this.scheme = normalized.scheme; + this.apiKey = apiKey; + + this.ca = tlsCertPath + ? fs.readFileSync(tlsCertPath) + : cert + ? Buffer.from(cert) + : undefined; + } + + private computeHmac(timestamp: bigint, body: Uint8Array): string { + const hmac = crypto.createHmac('sha256', this.apiKey); + const tsBytes = Buffer.alloc(8); + tsBytes.writeBigUInt64BE(timestamp); + hmac.update(tsBytes); + hmac.update(body); + return hmac.digest('hex'); + } + + async request( + endpoint: string, + RequestClass: { encode(message: any, writer?: any): any }, + ResponseClass: { decode(reader: Uint8Array, length?: number): Res }, + data: Record + ): Promise { + const body = encodeGrpcFrame(RequestClass.encode(data).finish()); + + const resp = await this.doRequest(endpoint, body); + const messages = decodeGrpcFrames(resp.data); + const payload = messages[0] || new Uint8Array(); + return ResponseClass.decode(payload); + } + + subscribe( + endpoint: string, + RequestClass: { encode(message: any, writer?: any): any }, + ResponseClass: { decode(reader: Uint8Array, length?: number): Res }, + data: Record + ): EventEmitter & { stop: () => void } { + const emitter = new EventEmitter() as EventEmitter & { stop: () => void }; + const body = encodeGrpcFrame(RequestClass.encode(data).finish()); + const session = this.createSession(); + const req = session.request(this.grpcHeaders(endpoint, body)); + const chunks: Buffer[] = []; + + emitter.stop = () => { + req.close(); + session.close(); + }; + + req.on('response', headers => { + const error = grpcErrorFromHeaders(headers); + if (error) emitter.emit('error', error); + }); + + req.on('trailers', headers => { + const error = grpcErrorFromHeaders(headers); + if (error) emitter.emit('error', error); + }); + + req.on('data', (chunk: Buffer) => { + chunks.push(chunk); + const parsed = takeGrpcFrames(Buffer.concat(chunks)); + chunks.splice(0, chunks.length, parsed.remaining); + parsed.messages.forEach(message => { + try { + emitter.emit('data', ResponseClass.decode(message)); + } catch (error) { + emitter.emit('error', error); + } + }); + }); + + req.on('error', error => emitter.emit('error', error)); + session.on('error', error => emitter.emit('error', error)); + req.on('end', () => { + session.close(); + emitter.emit('end'); + }); + + req.end(body); + return emitter; + } + + private doRequest(endpoint: string, body: Buffer): Promise<{ data: Buffer }> { + return new Promise((resolve, reject) => { + const session = this.createSession(); + const req = session.request(this.grpcHeaders(endpoint, body)); + const chunks: Buffer[] = []; + let grpcError: Error | undefined; + + req.on('response', headers => { + grpcError = grpcErrorFromHeaders(headers) || grpcError; + }); + + req.on('trailers', headers => { + grpcError = grpcErrorFromHeaders(headers) || grpcError; + }); + + req.on('error', reject); + session.on('error', reject); + req.on('data', (chunk: Buffer) => chunks.push(chunk)); + req.on('end', () => { + session.close(); + const data = Buffer.concat(chunks); + if (grpcError) { + reject(grpcError); + return; + } + resolve({ data }); + }); + req.end(body); + }); + } + + private createSession(): http2.ClientHttp2Session { + return http2.connect(`${this.scheme}://${this.authority}`, { + ca: this.ca, + rejectUnauthorized: this.scheme === 'https' ? Boolean(this.ca) : false, + }); + } + + private grpcHeaders( + endpoint: string, + body: Buffer + ): http2.OutgoingHttpHeaders { + const timestamp = BigInt(Math.floor(Date.now() / 1000)); + const hmacHex = this.computeHmac(timestamp, body); + + return { + [http2.constants.HTTP2_HEADER_METHOD]: 'POST', + [http2.constants.HTTP2_HEADER_PATH]: `${GRPC_SERVICE_PREFIX}${endpoint}`, + [http2.constants.HTTP2_HEADER_SCHEME]: this.scheme, + [http2.constants.HTTP2_HEADER_AUTHORITY]: this.authority, + [http2.constants.HTTP2_HEADER_CONTENT_TYPE]: 'application/grpc+proto', + te: 'trailers', + 'x-auth': `HMAC ${timestamp.toString()}:${hmacHex}`, + }; + } +} + +export function createLdkServerClient(config: { + socket: string; + cert?: string; + authToken?: string; + tlsCertPath?: string; +}): LdkServerClient { + if (!config.authToken) { + throw new Error( + 'ldk-server requires an authToken (API key) in the account configuration' + ); + } + return new LdkServerClient( + config.socket, + config.authToken, + config.tlsCertPath, + config.cert + ); +} + +/** Convert Long/number protobuf values to number */ +export function toNumber(val: any): number { + if (val == null) return 0; + if (typeof val === 'number') return val; + // protobufjs Long + if (typeof val.toNumber === 'function') return val.toNumber(); + return Number(val); +} + +/** Convert msat to sat (tokens) */ +export function msatToSat(msat: any): number { + return Math.floor(toNumber(msat) / 1000); +} + +/** + * Endpoint path constants matching ldk-server's routing. + * Must match ldk-server-protos/src/endpoints.rs exactly. + */ +export const Endpoints = { + GET_NODE_INFO: 'GetNodeInfo', + GET_BALANCES: 'GetBalances', + ONCHAIN_RECEIVE: 'OnchainReceive', + ONCHAIN_SEND: 'OnchainSend', + BOLT11_RECEIVE: 'Bolt11Receive', + BOLT11_SEND: 'Bolt11Send', + BOLT12_RECEIVE: 'Bolt12Receive', + BOLT12_SEND: 'Bolt12Send', + OPEN_CHANNEL: 'OpenChannel', + SPLICE_IN: 'SpliceIn', + SPLICE_OUT: 'SpliceOut', + CLOSE_CHANNEL: 'CloseChannel', + FORCE_CLOSE_CHANNEL: 'ForceCloseChannel', + LIST_CHANNELS: 'ListChannels', + UPDATE_CHANNEL_CONFIG: 'UpdateChannelConfig', + GET_PAYMENT_DETAILS: 'GetPaymentDetails', + LIST_PAYMENTS: 'ListPayments', + LIST_FORWARDED_PAYMENTS: 'ListForwardedPayments', + LIST_PEERS: 'ListPeers', + CONNECT_PEER: 'ConnectPeer', + DISCONNECT_PEER: 'DisconnectPeer', + SPONTANEOUS_SEND: 'SpontaneousSend', + SIGN_MESSAGE: 'SignMessage', + VERIFY_SIGNATURE: 'VerifySignature', + GRAPH_LIST_CHANNELS: 'GraphListChannels', + GRAPH_GET_CHANNEL: 'GraphGetChannel', + GRAPH_LIST_NODES: 'GraphListNodes', + GRAPH_GET_NODE: 'GraphGetNode', + DECODE_INVOICE: 'DecodeInvoice', + SUBSCRIBE_EVENTS: 'SubscribeEvents', +} as const; + +function normalizeGrpcAddress(baseUrl: string): { + scheme: 'http' | 'https'; + authority: string; +} { + const withScheme = /^[a-z]+:\/\//i.test(baseUrl) + ? baseUrl + : `https://${baseUrl}`; + const url = new URL(withScheme); + return { + scheme: url.protocol === 'http:' ? 'http' : 'https', + authority: url.host, + }; +} + +function encodeGrpcFrame(payload: Uint8Array): Buffer { + const frame = Buffer.alloc(5 + payload.length); + frame.writeUInt8(0, 0); + frame.writeUInt32BE(payload.length, 1); + Buffer.from(payload).copy(frame, 5); + return frame; +} + +function decodeGrpcFrames(data: Buffer): Uint8Array[] { + return takeGrpcFrames(data).messages; +} + +function takeGrpcFrames(data: Buffer): { + messages: Uint8Array[]; + remaining: Buffer; +} { + const messages: Uint8Array[] = []; + let offset = 0; + + while (data.length - offset >= 5) { + const compressed = data.readUInt8(offset); + const length = data.readUInt32BE(offset + 1); + + if (data.length - offset - 5 < length) break; + if (compressed) { + throw new Error('ldk-server returned compressed gRPC frames'); + } + + messages.push(data.subarray(offset + 5, offset + 5 + length)); + offset += 5 + length; + } + + return { messages, remaining: data.subarray(offset) }; +} + +function grpcErrorFromHeaders( + headers: http2.IncomingHttpHeaders +): Error | undefined { + const status = headerValue(headers['grpc-status']); + if (!status || status === '0') return undefined; + + const message = decodeURIComponent( + headerValue(headers['grpc-message']) || `gRPC status ${status}` + ); + return new Error(`ldk-server error (${status}): ${message}`); +} + +function headerValue(value: string | string[] | number | undefined): string { + if (Array.isArray(value)) return value[0] || ''; + return value == null ? '' : String(value); +} diff --git a/src/server/modules/node/ldk-server/ldk-server.module.ts b/src/server/modules/node/ldk-server/ldk-server.module.ts new file mode 100644 index 000000000..a768760bb --- /dev/null +++ b/src/server/modules/node/ldk-server/ldk-server.module.ts @@ -0,0 +1,8 @@ +import { Module } from '@nestjs/common'; +import { LdkServerService } from './ldk-server.service'; + +@Module({ + providers: [LdkServerService], + exports: [LdkServerService], +}) +export class LdkServerModule {} diff --git a/src/server/modules/node/ldk-server/ldk-server.service.ts b/src/server/modules/node/ldk-server/ldk-server.service.ts new file mode 100644 index 000000000..9f8fba678 --- /dev/null +++ b/src/server/modules/node/ldk-server/ldk-server.service.ts @@ -0,0 +1,1241 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +import { Injectable } from '@nestjs/common'; +import EventEmitter from 'events'; +import { + Capability, + LightningProvider, + GetChannelsOptions, + GetForwardsOptions, + GetPaymentsOptions, + GetInvoicesOptions, + CloseChannelOptions, + OpenChannelOptions, + PayOptions, + CreateInvoiceOptions, + PayViaPaymentDetailsOptions, + PayViaRoutesOptions, + GetRouteToDestinationOptions, + GetRouteToDestinationResult, + SendToChainAddressOptions, + CreateChainAddressFormat, + UpdateRoutingFeesOptions, + VerifyBackupsOptions, + GrantAccessOptions, + BakeMacaroonOptions, + BakeMacaroonResult, + DiffieHellmanComputeSecretOptions, +} from '../lightning.types'; +import { + LdkServerClient, + createLdkServerClient, + Endpoints, + toNumber, + msatToSat, +} from './ldk-server.helpers'; +import { api, events, types } from './proto/ldk-server'; + +const NOT_SUPPORTED = 'Not supported by ldk-server'; + +@Injectable() +export class LdkServerService implements LightningProvider { + getCapabilities(): Set { + return new Set([ + Capability.WALLET_INFO, + Capability.CHANNELS, + Capability.CHAIN, + Capability.PAYMENTS, + Capability.INVOICES, + Capability.PEERS, + Capability.FORWARDS, + Capability.SIGN_MESSAGE, + Capability.NETWORK_INFO, + Capability.ROUTING_FEES, + ]); + } + + connect(config: { + socket: string; + cert?: string; + macaroon?: string; + authToken?: string; + tlsCertPath?: string; + }): LdkServerClient { + return createLdkServerClient(config); + } + + async verifyConnection(connection: LdkServerClient): Promise { + await this.getWalletInfo(connection); + } + + getSubscriptionConnection(_connection: LdkServerClient) { + return null; + } + + subscribeEvents(connection: LdkServerClient): EventEmitter { + return connection.subscribe( + Endpoints.SUBSCRIBE_EVENTS, + api.SubscribeEventsRequest, + events.EventEnvelope, + {} + ); + } + + // ── Wallet ── + + async getWalletInfo(connection: LdkServerClient) { + const [nodeInfo, channels, peers] = await Promise.all([ + connection.request( + Endpoints.GET_NODE_INFO, + api.GetNodeInfoRequest, + api.GetNodeInfoResponse, + {} + ), + connection + .request( + Endpoints.LIST_CHANNELS, + api.ListChannelsRequest, + api.ListChannelsResponse, + {} + ) + .catch(() => ({ channels: [] })), + connection + .request( + Endpoints.LIST_PEERS, + api.ListPeersRequest, + api.ListPeersResponse, + {} + ) + .catch(() => ({ peers: [] })), + ]); + + const activeChannels = (channels.channels || []).filter( + (c: types.IChannel) => c.isUsable + ); + + const isSynced = + nodeInfo.latestLightningWalletSyncTimestamp != null && + nodeInfo.latestOnchainWalletSyncTimestamp != null; + + return { + public_key: nodeInfo.nodeId || '', + alias: nodeInfo.nodeAlias || '', + color: '#000000', + chains: ['bitcoin'], + current_block_hash: nodeInfo.currentBestBlock?.blockHash || '', + current_block_height: nodeInfo.currentBestBlock?.height || 0, + is_synced_to_chain: isSynced, + is_synced_to_graph: + nodeInfo.latestRgsSnapshotTimestamp != null || isSynced, + latest_block_at: new Date().toISOString(), + peers_count: (peers.peers || []).length, + version: '1.0.0 ldk-server', + uris: nodeInfo.nodeUris || [], + active_channels_count: activeChannels.length, + closed_channels_count: 0, + pending_channels_count: 0, + }; + } + + async getIdentity(connection: LdkServerClient) { + const info = await connection.request( + Endpoints.GET_NODE_INFO, + api.GetNodeInfoRequest, + api.GetNodeInfoResponse, + {} + ); + return { public_key: info.nodeId || '' }; + } + + async getWalletVersion(_connection: LdkServerClient) { + // ldk-server has no wallet version endpoint + return { + build_tags: [], + commit_hash: '', + is_autopilotrpc_enabled: false, + is_chainrpc_enabled: false, + is_invoicesrpc_enabled: false, + is_signrpc_enabled: false, + is_walletrpc_enabled: false, + is_watchtowerrpc_enabled: false, + is_wtclientrpc_enabled: false, + }; + } + + async getHeight(connection: LdkServerClient) { + const info = await connection.request( + Endpoints.GET_NODE_INFO, + api.GetNodeInfoRequest, + api.GetNodeInfoResponse, + {} + ); + return { + current_block_hash: info.currentBestBlock?.blockHash || '', + current_block_height: info.currentBestBlock?.height || 0, + }; + } + + // ── Channels ── + + async getChannels(connection: LdkServerClient, options?: GetChannelsOptions) { + const resp = await connection.request( + Endpoints.LIST_CHANNELS, + api.ListChannelsRequest, + api.ListChannelsResponse, + {} + ); + + let channels = (resp.channels || []).map(mapChannel); + + if (options?.is_active !== undefined) { + channels = channels.filter(c => c.is_active === options.is_active); + } + if (options?.is_private !== undefined) { + channels = channels.filter(c => c.is_private === options.is_private); + } + if (options?.is_public !== undefined) { + channels = channels.filter(c => !c.is_private === options.is_public); + } + if (options?.partner_public_key) { + channels = channels.filter( + c => c.partner_public_key === options.partner_public_key + ); + } + + return { channels }; + } + + async getClosedChannels(_connection: LdkServerClient) { + // ldk-server doesn't track closed channel history + return { channels: [] }; + } + + async getPendingChannels(connection: LdkServerClient) { + const resp = await connection.request( + Endpoints.LIST_CHANNELS, + api.ListChannelsRequest, + api.ListChannelsResponse, + {} + ); + + const pending = (resp.channels || []) + .filter((c: types.IChannel) => !c.isChannelReady) + .map(ch => ({ + partner_public_key: ch.counterpartyNodeId || '', + local_balance: msatToSat(ch.outboundCapacityMsat), + remote_balance: msatToSat(ch.inboundCapacityMsat), + local_reserve: toNumber(ch.unspendablePunishmentReserve), + remote_reserve: toNumber(ch.counterpartyUnspendablePunishmentReserve), + transaction_id: ch.fundingTxo?.txid || '', + transaction_vout: ch.fundingTxo?.vout || 0, + is_active: false, + is_closing: false, + is_opening: true, + is_timelocked: false, + received: 0, + sent: 0, + transaction_fee: 0, + })); + + return { pending_channels: pending }; + } + + async getChannel(connection: LdkServerClient, id: string) { + // First try to find it in our local channels (for fee policy editing) + const channelsResp = await connection.request( + Endpoints.LIST_CHANNELS, + api.ListChannelsRequest, + api.ListChannelsResponse, + {} + ); + + const nodeInfo = await connection.request( + Endpoints.GET_NODE_INFO, + api.GetNodeInfoRequest, + api.GetNodeInfoResponse, + {} + ); + + const localChannel = (channelsResp.channels || []).find( + (c: types.IChannel) => c.channelId === id + ); + + if (localChannel) { + const config = localChannel.channelConfig; + const myKey = nodeInfo.nodeId || ''; + const partnerKey = localChannel.counterpartyNodeId || ''; + + return { + capacity: toNumber(localChannel.channelValueSats), + id, + policies: [ + { + public_key: myKey, + base_fee_mtokens: toNumber( + config?.forwardingFeeBaseMsat + ).toString(), + cltv_delta: config?.cltvExpiryDelta || 0, + fee_rate: toNumber(config?.forwardingFeeProportionalMillionths), + is_disabled: !localChannel.isUsable, + max_htlc_mtokens: toNumber( + localChannel.nextOutboundHtlcLimitMsat + ).toString(), + min_htlc_mtokens: toNumber( + localChannel.nextOutboundHtlcMinimumMsat + ).toString(), + updated_at: '', + }, + { + public_key: partnerKey, + base_fee_mtokens: toNumber( + localChannel.counterpartyForwardingInfoFeeBaseMsat + ).toString(), + cltv_delta: + localChannel.counterpartyForwardingInfoCltvExpiryDelta || 0, + fee_rate: toNumber( + localChannel.counterpartyForwardingInfoFeeProportionalMillionths + ), + is_disabled: !localChannel.isUsable, + max_htlc_mtokens: toNumber( + localChannel.counterpartyOutboundHtlcMaximumMsat + ).toString(), + min_htlc_mtokens: toNumber( + localChannel.counterpartyOutboundHtlcMinimumMsat + ).toString(), + updated_at: '', + }, + ], + transaction_id: localChannel.fundingTxo?.txid || '', + transaction_vout: localChannel.fundingTxo?.vout || 0, + updated_at: '', + }; + } + + // Fall back to network graph for numeric short channel IDs + try { + const scid = parseInt(id); + if (!isNaN(scid)) { + const resp = await connection.request( + Endpoints.GRAPH_GET_CHANNEL, + api.GraphGetChannelRequest, + api.GraphGetChannelResponse, + { shortChannelId: scid } + ); + const ch = resp.channel; + if (ch) { + return { + capacity: toNumber(ch.capacitySats), + id, + policies: [ + mapGraphChannelUpdate(ch.oneToTwo, ch.nodeOne || ''), + mapGraphChannelUpdate(ch.twoToOne, ch.nodeTwo || ''), + ], + transaction_id: '', + transaction_vout: 0, + updated_at: '', + }; + } + } + } catch { + // Fall through + } + throw new Error(`Channel ${id} not found`); + } + + async openChannel(connection: LdkServerClient, options: OpenChannelOptions) { + // ldk-server requires a peer address. We'll try to connect first using + // the partner's known address, then open channel. + const peers = await connection + .request( + Endpoints.LIST_PEERS, + api.ListPeersRequest, + api.ListPeersResponse, + {} + ) + .catch(() => ({ peers: [] })); + + const existingPeer = (peers.peers || []).find( + (p: types.IPeer) => p.nodeId === options.partner_public_key + ); + + const address = existingPeer?.address || ''; + + const resp = await connection.request( + Endpoints.OPEN_CHANNEL, + api.OpenChannelRequest, + api.OpenChannelResponse, + { + nodePubkey: options.partner_public_key, + address, + channelAmountSats: options.local_tokens, + pushToCounterpartyMsat: options.give_tokens + ? options.give_tokens * 1000 + : undefined, + announceChannel: !options.is_private, + } + ); + + return { + transaction_id: resp.userChannelId || '', + transaction_vout: 0, + }; + } + + async closeChannel( + connection: LdkServerClient, + options: CloseChannelOptions + ) { + // ldk-server uses user_channel_id + counterparty_node_id for close. + // ThunderHub passes transaction_id+vout or channel id. + // We need to find the channel first to get the counterparty. + const channelsResp = await connection.request( + Endpoints.LIST_CHANNELS, + api.ListChannelsRequest, + api.ListChannelsResponse, + {} + ); + + const channel = (channelsResp.channels || []).find( + (c: types.IChannel) => + c.userChannelId === options.id || + c.channelId === options.id || + (options.transaction_id && + c.fundingTxo?.txid === options.transaction_id && + (options.transaction_vout === undefined || + c.fundingTxo?.vout === options.transaction_vout)) + ); + + if (!channel) { + throw new Error('Channel not found'); + } + + if (options.is_force_close) { + await connection.request( + Endpoints.FORCE_CLOSE_CHANNEL, + api.ForceCloseChannelRequest, + api.ForceCloseChannelResponse, + { + userChannelId: channel.userChannelId, + counterpartyNodeId: channel.counterpartyNodeId, + } + ); + } else { + await connection.request( + Endpoints.CLOSE_CHANNEL, + api.CloseChannelRequest, + api.CloseChannelResponse, + { + userChannelId: channel.userChannelId, + counterpartyNodeId: channel.counterpartyNodeId, + } + ); + } + + return { + transaction_id: channel.fundingTxo?.txid || '', + transaction_vout: channel.fundingTxo?.vout || 0, + }; + } + + async getChannelBalance(connection: LdkServerClient) { + const balances = await connection.request( + Endpoints.GET_BALANCES, + api.GetBalancesRequest, + api.GetBalancesResponse, + {} + ); + return { + channel_balance: toNumber(balances.totalLightningBalanceSats), + pending_balance: 0, + }; + } + + // ── Chain ── + + async getChainBalance(connection: LdkServerClient) { + const balances = await connection.request( + Endpoints.GET_BALANCES, + api.GetBalancesRequest, + api.GetBalancesResponse, + {} + ); + return { + chain_balance: toNumber(balances.spendableOnchainBalanceSats), + }; + } + + async getPendingChainBalance(connection: LdkServerClient) { + const balances = await connection.request( + Endpoints.GET_BALANCES, + api.GetBalancesRequest, + api.GetBalancesResponse, + {} + ); + const total = toNumber(balances.totalOnchainBalanceSats); + const spendable = toNumber(balances.spendableOnchainBalanceSats); + const anchorReserve = toNumber(balances.totalAnchorChannelsReserveSats); + + // Sum up funds being swept from closed channels + const pendingSweep = ( + balances.pendingBalancesFromChannelClosures || [] + ).reduce((sum, b) => { + if (b.pendingBroadcast) { + return sum + toNumber(b.pendingBroadcast.amountSatoshis); + } + if (b.broadcastAwaitingConfirmation) { + return sum + toNumber(b.broadcastAwaitingConfirmation.amountSatoshis); + } + if (b.awaitingThresholdConfirmations) { + return sum + toNumber(b.awaitingThresholdConfirmations.amountSatoshis); + } + return sum; + }, 0); + + // Sum up lightning balances that are pending on-chain settlement + const pendingLightning = (balances.lightningBalances || []).reduce( + (sum, b) => { + if (b.claimableAwaitingConfirmations) { + return ( + sum + toNumber(b.claimableAwaitingConfirmations.amountSatoshis) + ); + } + if (b.contentiousClaimable) { + return sum + toNumber(b.contentiousClaimable.amountSatoshis); + } + if (b.counterpartyRevokedOutputClaimable) { + return ( + sum + toNumber(b.counterpartyRevokedOutputClaimable.amountSatoshis) + ); + } + return sum; + }, + 0 + ); + + const unconfirmed = Math.max(0, total - spendable - anchorReserve); + + return { + pending_chain_balance: unconfirmed + pendingSweep + pendingLightning, + }; + } + + async getChainTransactions(_connection: LdkServerClient) { + // ldk-server doesn't have a dedicated chain transactions endpoint. + // On-chain payments are included in ListPayments but with different shape. + return { transactions: [] }; + } + + async getUtxos(_connection: LdkServerClient) { + throw new Error(NOT_SUPPORTED); + } + + async createChainAddress( + connection: LdkServerClient, + _is_unused: boolean, + _format: CreateChainAddressFormat + ) { + const resp = await connection.request( + Endpoints.ONCHAIN_RECEIVE, + api.OnchainReceiveRequest, + api.OnchainReceiveResponse, + {} + ); + return { address: resp.address || '' }; + } + + async sendToChainAddress( + connection: LdkServerClient, + options: SendToChainAddressOptions + ) { + const resp = await connection.request( + Endpoints.ONCHAIN_SEND, + api.OnchainSendRequest, + api.OnchainSendResponse, + { + address: options.address, + amountSats: options.is_send_all ? undefined : options.tokens, + sendAll: options.is_send_all || undefined, + feeRateSatPerVb: options.fee_tokens_per_vbyte, + } + ); + return { + confirmation_count: 0, + id: resp.txid || '', + is_confirmed: false, + is_outgoing: true, + tokens: options.tokens || 0, + }; + } + + // ── Payments ── + + async pay(connection: LdkServerClient, options: PayOptions) { + const decoded = await connection.request( + Endpoints.DECODE_INVOICE, + api.DecodeInvoiceRequest, + api.DecodeInvoiceResponse, + { invoice: options.request } + ); + const amountMsat = toNumber(decoded.amountMsat); + + const resp = await connection.request( + Endpoints.BOLT11_SEND, + api.Bolt11SendRequest, + api.Bolt11SendResponse, + { + invoice: options.request, + amountMsat: + amountMsat === 0 && options.tokens + ? options.tokens * 1000 + : undefined, + } + ); + return { id: resp.paymentId || '' }; + } + + async payViaPaymentDetails( + connection: LdkServerClient, + options: PayViaPaymentDetailsOptions + ) { + // Map to SpontaneousSend (keysend) + const amountMsat = options.mtokens + ? parseInt(options.mtokens) + : (options.tokens || 0) * 1000; + + const resp = await connection.request( + Endpoints.SPONTANEOUS_SEND, + api.SpontaneousSendRequest, + api.SpontaneousSendResponse, + { + amountMsat, + nodeId: options.destination, + } + ); + + return { + fee: 0, + fee_mtokens: '0', + hops: [], + id: resp.paymentId || '', + is_confirmed: true, + is_outgoing: true, + mtokens: amountMsat.toString(), + secret: '', + safe_fee: 0, + safe_tokens: options.tokens || msatToSat(amountMsat), + tokens: options.tokens || msatToSat(amountMsat), + }; + } + + async payViaRoutes( + _connection: LdkServerClient, + _options: PayViaRoutesOptions + ) { + throw new Error(NOT_SUPPORTED); + } + + async getRouteToDestination( + _connection: LdkServerClient, + _options: GetRouteToDestinationOptions + ): Promise { + throw new Error(NOT_SUPPORTED); + } + + async decodePaymentRequest(connection: LdkServerClient, request: string) { + const resp = await connection.request( + Endpoints.DECODE_INVOICE, + api.DecodeInvoiceRequest, + api.DecodeInvoiceResponse, + { invoice: request } + ); + + const amountMsat = toNumber(resp.amountMsat); + const timestamp = toNumber(resp.timestamp); + const expiry = toNumber(resp.expiry); + + return { + chain_addresses: resp.fallbackAddress ? [resp.fallbackAddress] : [], + cltv_delta: toNumber(resp.minFinalCltvExpiryDelta), + created_at: timestamp ? new Date(timestamp * 1000).toISOString() : '', + description: resp.description || '', + description_hash: resp.descriptionHash || '', + destination: resp.destination || '', + expires_at: + timestamp && expiry + ? new Date((timestamp + expiry) * 1000).toISOString() + : '', + id: resp.paymentHash || '', + mtokens: amountMsat.toString(), + payment: resp.paymentSecret || '', + routes: (resp.routeHints || []).map(rh => ({ + hops: (rh.hopHints || []).map(h => ({ + public_key: h.nodeId || '', + channel: toNumber(h.shortChannelId).toString(), + base_fee_mtokens: toNumber(h.feeBaseMsat).toString(), + fee_rate: toNumber(h.feeProportionalMillionths), + cltv_delta: h.cltvExpiryDelta || 0, + })), + })), + safe_tokens: msatToSat(amountMsat), + tokens: msatToSat(amountMsat), + }; + } + + async getPayments(connection: LdkServerClient, options: GetPaymentsOptions) { + const resp = await listPayments(connection, options); + + // Filter to outbound Lightning payments (not on-chain) + const outbound = (resp.payments || []).filter( + (p: types.IPayment) => + p.direction === types.PaymentDirection.OUTBOUND && + p.kind?.onchain == null + ); + + const payments = outbound.map(mapPayment); + + return { + payments, + next: resp.nextPageToken?.token || undefined, + }; + } + + // ── Invoices ── + + async createInvoice( + connection: LdkServerClient, + options: CreateInvoiceOptions + ) { + const resp = await connection.request( + Endpoints.BOLT11_RECEIVE, + api.Bolt11ReceiveRequest, + api.Bolt11ReceiveResponse, + { + amountMsat: options.tokens ? options.tokens * 1000 : undefined, + description: options.description + ? { direct: options.description } + : options.description_hash + ? { hash: options.description_hash } + : undefined, + expirySecs: options.expires_at + ? Math.max( + 1, + Math.floor( + (new Date(options.expires_at).getTime() - Date.now()) / 1000 + ) + ) + : 3600, + } + ); + + return { + chain_address: undefined, + created_at: new Date().toISOString(), + description: options.description || '', + id: resp.paymentHash || '', + mtokens: options.tokens ? (options.tokens * 1000).toString() : '0', + request: resp.invoice || '', + secret: resp.paymentSecret || '', + tokens: options.tokens || 0, + }; + } + + async getInvoices(connection: LdkServerClient, options: GetInvoicesOptions) { + const resp = await listPayments(connection, options); + + // Filter to inbound payments (received invoices) + const inbound = (resp.payments || []).filter( + (p: types.IPayment) => + p.direction === types.PaymentDirection.INBOUND && + p.kind?.onchain == null + ); + + const invoices = inbound.map(mapInvoice); + + return { + invoices, + next: resp.nextPageToken?.token || undefined, + }; + } + + subscribeToInvoice(connection: LdkServerClient, id: string): EventEmitter { + const emitter = new EventEmitter(); + + // Poll GetPaymentDetails until the invoice is paid or we give up + const pollInterval = 2000; + const maxAttempts = 45; // ~90 seconds total + let attempts = 0; + + const poll = async () => { + try { + const resp = await connection.request( + Endpoints.GET_PAYMENT_DETAILS, + api.GetPaymentDetailsRequest, + api.GetPaymentDetailsResponse, + { paymentId: id } + ); + + const payment = resp.payment; + if (payment?.status === types.PaymentStatus.SUCCEEDED) { + emitter.emit('invoice_updated', { + is_confirmed: true, + received: msatToSat(toNumber(payment.amountMsat)), + tokens: msatToSat(toNumber(payment.amountMsat)), + }); + return; + } + } catch { + // Payment not found yet — keep polling + } + + attempts++; + if (attempts < maxAttempts) { + setTimeout(poll, pollInterval); + } + }; + + poll(); + return emitter; + } + + // ── Peers ── + + async getPeers(connection: LdkServerClient) { + const resp = await connection.request( + Endpoints.LIST_PEERS, + api.ListPeersRequest, + api.ListPeersResponse, + {} + ); + + const peers = (resp.peers || []).map((p: types.IPeer) => ({ + bytes_received: 0, + bytes_sent: 0, + is_inbound: false, + is_sync_peer: false, + ping_time: 0, + public_key: p.nodeId || '', + socket: p.address || '', + tokens_received: 0, + tokens_sent: 0, + })); + + return { peers }; + } + + async addPeer( + connection: LdkServerClient, + public_key: string, + socket: string, + is_temporary: boolean + ) { + await connection.request( + Endpoints.CONNECT_PEER, + api.ConnectPeerRequest, + api.ConnectPeerResponse, + { + nodePubkey: public_key, + address: socket, + persist: !is_temporary, + } + ); + return {}; + } + + async removePeer(connection: LdkServerClient, public_key: string) { + await connection.request( + Endpoints.DISCONNECT_PEER, + api.DisconnectPeerRequest, + api.DisconnectPeerResponse, + { + nodePubkey: public_key, + } + ); + return {}; + } + + // ── Forwards ── + + async getForwards(connection: LdkServerClient, options: GetForwardsOptions) { + const resp = await connection.request( + Endpoints.LIST_FORWARDED_PAYMENTS, + api.ListForwardedPaymentsRequest, + api.ListForwardedPaymentsResponse, + { + pageToken: options.token + ? { token: options.token, index: 0 } + : undefined, + } + ); + + const forwards = (resp.forwardedPayments || []).map( + (f: types.IForwardedPayment) => ({ + created_at: new Date().toISOString(), + fee: msatToSat(f.totalFeeEarnedMsat), + fee_mtokens: toNumber(f.totalFeeEarnedMsat).toString(), + incoming_channel: f.prevChannelId || '', + mtokens: toNumber(f.outboundAmountForwardedMsat).toString(), + outgoing_channel: f.nextChannelId || '', + tokens: msatToSat(f.outboundAmountForwardedMsat), + }) + ); + + return { + forwards, + next: resp.nextPageToken?.token || undefined, + }; + } + + // ── Routing ── + + async updateRoutingFees( + connection: LdkServerClient, + options: UpdateRoutingFeesOptions + ) { + // ldk-server uses UpdateChannelConfig which requires user_channel_id + counterparty. + // Find the channel by transaction_id/vout. + const channelsResp = await connection.request( + Endpoints.LIST_CHANNELS, + api.ListChannelsRequest, + api.ListChannelsResponse, + {} + ); + + const channel = (channelsResp.channels || []).find( + (c: types.IChannel) => + options.transaction_id && + c.fundingTxo?.txid === options.transaction_id && + (options.transaction_vout === undefined || + c.fundingTxo?.vout === options.transaction_vout) + ); + + if (!channel) { + throw new Error('Channel not found for fee update'); + } + + const channelConfig: any = {}; + if (options.fee_rate !== undefined) { + channelConfig.forwardingFeeProportionalMillionths = options.fee_rate; + } + if (options.base_fee_mtokens !== undefined) { + channelConfig.forwardingFeeBaseMsat = parseInt(options.base_fee_mtokens); + } else if (options.base_fee_tokens !== undefined) { + channelConfig.forwardingFeeBaseMsat = options.base_fee_tokens * 1000; + } + if (options.cltv_delta !== undefined) { + channelConfig.cltvExpiryDelta = options.cltv_delta; + } + + await connection.request( + Endpoints.UPDATE_CHANNEL_CONFIG, + api.UpdateChannelConfigRequest, + api.UpdateChannelConfigResponse, + { + userChannelId: channel.userChannelId, + counterpartyNodeId: channel.counterpartyNodeId, + channelConfig, + } + ); + + return {}; + } + + // ── Network ── + + async getNode( + connection: LdkServerClient, + public_key: string, + _is_omitting_channels = true + ) { + const resp = await connection.request( + Endpoints.GRAPH_GET_NODE, + api.GraphGetNodeRequest, + api.GraphGetNodeResponse, + { nodeId: public_key } + ); + + const node = resp.node; + const announcement = node?.announcementInfo; + + return { + alias: announcement?.alias || '', + color: announcement?.rgb ? `#${announcement.rgb}` : '#000000', + sockets: (announcement?.addresses || []).map((a: string) => ({ + socket: a, + type: 'tcp', + })), + updated_at: announcement?.lastUpdate + ? new Date(toNumber(announcement.lastUpdate) * 1000).toISOString() + : '', + channels: (node?.channels || []).map((scid: any) => ({ + id: toNumber(scid).toString(), + capacity: 0, + policies: [], + })), + }; + } + + async getNetworkInfo(_connection: LdkServerClient) { + throw new Error(NOT_SUPPORTED); + } + + // ── Messages ── + + async signMessage(connection: LdkServerClient, message: string) { + const resp = await connection.request( + Endpoints.SIGN_MESSAGE, + api.SignMessageRequest, + api.SignMessageResponse, + { message: Buffer.from(message, 'utf-8') } + ); + return { signature: resp.signature || '' }; + } + + async verifyMessage( + connection: LdkServerClient, + message: string, + signature: string + ) { + // ldk-server's VerifySignature requires a public_key. + // ThunderHub's interface doesn't pass it — we use our own node's pubkey. + const identity = await this.getIdentity(connection); + + const resp = await connection.request( + Endpoints.VERIFY_SIGNATURE, + api.VerifySignatureRequest, + api.VerifySignatureResponse, + { + message: Buffer.from(message, 'utf-8'), + signature, + publicKey: identity.public_key, + } + ); + return { + signed_by: resp.valid ? identity.public_key : '', + signature, + is_valid: resp.valid || false, + }; + } + + // ── Backups (not supported) ── + + async getBackups(_connection: LdkServerClient) { + throw new Error(NOT_SUPPORTED); + } + + async verifyBackup(_connection: LdkServerClient, _backup: string) { + throw new Error(NOT_SUPPORTED); + } + + async verifyBackups( + _connection: LdkServerClient, + _args: VerifyBackupsOptions + ) { + throw new Error(NOT_SUPPORTED); + } + + async recoverFundsFromChannels( + _connection: LdkServerClient, + _backup: string + ) { + throw new Error(NOT_SUPPORTED); + } + + // ── Access (not supported) ── + + async grantAccess( + _connection: LdkServerClient, + _permissions: GrantAccessOptions + ) { + throw new Error(NOT_SUPPORTED); + } + + async getAccessIds(_connection: LdkServerClient) { + throw new Error(NOT_SUPPORTED); + } + + async bakeMacaroon( + _connection: LdkServerClient, + _options: BakeMacaroonOptions + ): Promise { + throw new Error(NOT_SUPPORTED); + } + + // ── Crypto (not supported) ── + + async diffieHellmanComputeSecret( + _connection: LdkServerClient, + _options: DiffieHellmanComputeSecretOptions + ) { + throw new Error(NOT_SUPPORTED); + } +} + +// ── Mapping helpers ── + +function mapChannel(ch: types.IChannel) { + return { + capacity: toNumber(ch.channelValueSats), + commit_transaction_fee: 0, + commit_transaction_weight: 0, + id: ch.channelId || '', + is_active: ch.isUsable || false, + is_closing: false, + is_opening: !ch.isChannelReady, + is_partner_initiated: !ch.isOutbound, + is_private: !ch.isAnnounced, + local_balance: msatToSat(ch.outboundCapacityMsat), + local_reserve: toNumber(ch.unspendablePunishmentReserve), + partner_public_key: ch.counterpartyNodeId || '', + past_states: 0, + received: 0, + remote_balance: msatToSat(ch.inboundCapacityMsat), + remote_reserve: toNumber(ch.counterpartyUnspendablePunishmentReserve), + sent: 0, + time_offline: 0, + time_online: 0, + transaction_id: ch.fundingTxo?.txid || '', + transaction_vout: ch.fundingTxo?.vout || 0, + unsettled_balance: 0, + pending_payments: [], + }; +} + +async function listPayments( + connection: LdkServerClient, + options: GetPaymentsOptions | GetInvoicesOptions +): Promise { + try { + return await connection.request( + Endpoints.LIST_PAYMENTS, + api.ListPaymentsRequest, + api.ListPaymentsResponse, + { + pageToken: options.token + ? { token: options.token, index: 0 } + : undefined, + } + ); + } catch (error) { + const message = error instanceof Error ? error.message : `${error}`; + if (message.includes('Failed to decode payment')) { + return { payments: [] }; + } + throw error; + } +} + +function mapGraphChannelUpdate( + update: types.IGraphChannelUpdate | null | undefined, + publicKey: string +) { + if (!update) { + return { + public_key: publicKey, + base_fee_mtokens: '0', + cltv_delta: 0, + fee_rate: 0, + is_disabled: true, + max_htlc_mtokens: '0', + min_htlc_mtokens: '0', + updated_at: '', + }; + } + return { + public_key: publicKey, + base_fee_mtokens: toNumber(update.fees?.baseMsat).toString(), + cltv_delta: update.cltvExpiryDelta || 0, + fee_rate: toNumber(update.fees?.proportionalMillionths), + is_disabled: !update.enabled, + max_htlc_mtokens: toNumber(update.htlcMaximumMsat).toString(), + min_htlc_mtokens: toNumber(update.htlcMinimumMsat).toString(), + updated_at: update.lastUpdate + ? new Date(toNumber(update.lastUpdate) * 1000).toISOString() + : '', + }; +} + +function mapPayment(p: types.IPayment) { + const amountMsat = toNumber(p.amountMsat); + const feeMsat = toNumber(p.feePaidMsat); + const timestamp = toNumber(p.latestUpdateTimestamp); + + let hash = ''; + let preimage = ''; + if (p.kind?.bolt11) { + hash = p.kind.bolt11.hash || ''; + preimage = p.kind.bolt11.preimage || ''; + } else if (p.kind?.spontaneous) { + hash = p.kind.spontaneous.hash || ''; + preimage = p.kind.spontaneous.preimage || ''; + } else if (p.kind?.bolt12Offer) { + hash = p.kind.bolt12Offer.hash || ''; + preimage = p.kind.bolt12Offer.preimage || ''; + } + + return { + created_at: timestamp + ? new Date(timestamp * 1000).toISOString() + : new Date().toISOString(), + destination: '', + fee: msatToSat(feeMsat), + fee_mtokens: feeMsat.toString(), + hops: [], + id: p.id || hash || '', + index: 0, + is_confirmed: p.status === types.PaymentStatus.SUCCEEDED, + is_outgoing: p.direction === types.PaymentDirection.OUTBOUND, + mtokens: amountMsat.toString(), + request: '', + safe_fee: msatToSat(feeMsat), + safe_tokens: msatToSat(amountMsat), + secret: preimage, + tokens: msatToSat(amountMsat), + }; +} + +function mapInvoice(p: types.IPayment) { + const amountMsat = toNumber(p.amountMsat); + const timestamp = toNumber(p.latestUpdateTimestamp); + const isConfirmed = p.status === types.PaymentStatus.SUCCEEDED; + + let hash = ''; + let preimage = ''; + let secret: Uint8Array | null = null; + if (p.kind?.bolt11) { + hash = p.kind.bolt11.hash || ''; + preimage = p.kind.bolt11.preimage || ''; + secret = (p.kind.bolt11.secret as Uint8Array) || null; + } else if (p.kind?.bolt11Jit) { + hash = p.kind.bolt11Jit.hash || ''; + preimage = p.kind.bolt11Jit.preimage || ''; + secret = (p.kind.bolt11Jit.secret as Uint8Array) || null; + } else if (p.kind?.bolt12Offer) { + hash = p.kind.bolt12Offer.hash || ''; + preimage = p.kind.bolt12Offer.preimage || ''; + secret = (p.kind.bolt12Offer.secret as Uint8Array) || null; + } + + const dateStr = timestamp + ? new Date(timestamp * 1000).toISOString() + : new Date().toISOString(); + + return { + chain_address: undefined, + confirmed_at: isConfirmed ? dateStr : undefined, + created_at: dateStr, + description: '', + description_hash: '', + expires_at: '', + id: hash || p.id || '', + is_canceled: p.status === types.PaymentStatus.FAILED, + is_confirmed: isConfirmed, + is_held: false, + is_private: false, + is_push: false, + received: isConfirmed ? msatToSat(amountMsat) : 0, + received_mtokens: isConfirmed ? amountMsat.toString() : '0', + request: '', + secret: secret ? Buffer.from(secret).toString('hex') : preimage || '', + tokens: msatToSat(amountMsat), + payments: [], + }; +} diff --git a/src/server/modules/node/ldk-server/proto/api.proto b/src/server/modules/node/ldk-server/proto/api.proto new file mode 100644 index 000000000..ba6e5a1e1 --- /dev/null +++ b/src/server/modules/node/ldk-server/proto/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/src/server/modules/node/ldk-server/proto/error.proto b/src/server/modules/node/ldk-server/proto/error.proto new file mode 100644 index 000000000..c5a75d7dd --- /dev/null +++ b/src/server/modules/node/ldk-server/proto/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/src/server/modules/node/ldk-server/proto/events.proto b/src/server/modules/node/ldk-server/proto/events.proto new file mode 100644 index 000000000..97524fc45 --- /dev/null +++ b/src/server/modules/node/ldk-server/proto/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/src/server/modules/node/ldk-server/proto/ldk-server.d.ts b/src/server/modules/node/ldk-server/proto/ldk-server.d.ts new file mode 100644 index 000000000..d872a8f2b --- /dev/null +++ b/src/server/modules/node/ldk-server/proto/ldk-server.d.ts @@ -0,0 +1,14510 @@ +import * as $protobuf from "@apollo/protobufjs"; +/** 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 }; + } + + /** Properties of a GetNodeInfoResponse. */ + interface IGetNodeInfoResponse { + + /** GetNodeInfoResponse nodeId */ + nodeId?: (string|null); + + /** GetNodeInfoResponse currentBestBlock */ + currentBestBlock?: (types.IBestBlock|null); + + /** GetNodeInfoResponse latestLightningWalletSyncTimestamp */ + latestLightningWalletSyncTimestamp?: (number|Long|null); + + /** GetNodeInfoResponse latestOnchainWalletSyncTimestamp */ + latestOnchainWalletSyncTimestamp?: (number|Long|null); + + /** GetNodeInfoResponse latestFeeRateCacheUpdateTimestamp */ + latestFeeRateCacheUpdateTimestamp?: (number|Long|null); + + /** GetNodeInfoResponse latestRgsSnapshotTimestamp */ + latestRgsSnapshotTimestamp?: (number|Long|null); + + /** GetNodeInfoResponse latestNodeAnnouncementBroadcastTimestamp */ + latestNodeAnnouncementBroadcastTimestamp?: (number|Long|null); + + /** GetNodeInfoResponse listeningAddresses */ + listeningAddresses?: (string[]|null); + + /** GetNodeInfoResponse announcementAddresses */ + announcementAddresses?: (string[]|null); + + /** GetNodeInfoResponse nodeAlias */ + nodeAlias?: (string|null); + + /** GetNodeInfoResponse nodeUris */ + nodeUris?: (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 nodeId. */ + public nodeId: string; + + /** GetNodeInfoResponse currentBestBlock. */ + public currentBestBlock?: (types.IBestBlock|null); + + /** GetNodeInfoResponse latestLightningWalletSyncTimestamp. */ + public latestLightningWalletSyncTimestamp: (number|Long); + + /** GetNodeInfoResponse latestOnchainWalletSyncTimestamp. */ + public latestOnchainWalletSyncTimestamp: (number|Long); + + /** GetNodeInfoResponse latestFeeRateCacheUpdateTimestamp. */ + public latestFeeRateCacheUpdateTimestamp: (number|Long); + + /** GetNodeInfoResponse latestRgsSnapshotTimestamp. */ + public latestRgsSnapshotTimestamp: (number|Long); + + /** GetNodeInfoResponse latestNodeAnnouncementBroadcastTimestamp. */ + public latestNodeAnnouncementBroadcastTimestamp: (number|Long); + + /** GetNodeInfoResponse listeningAddresses. */ + public listeningAddresses: string[]; + + /** GetNodeInfoResponse announcementAddresses. */ + public announcementAddresses: string[]; + + /** GetNodeInfoResponse nodeAlias. */ + public nodeAlias: string; + + /** GetNodeInfoResponse nodeUris. */ + public nodeUris: 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** Properties of an OnchainSendRequest. */ + interface IOnchainSendRequest { + + /** OnchainSendRequest address */ + address?: (string|null); + + /** OnchainSendRequest amountSats */ + amountSats?: (number|Long|null); + + /** OnchainSendRequest sendAll */ + sendAll?: (boolean|null); + + /** OnchainSendRequest feeRateSatPerVb */ + feeRateSatPerVb?: (number|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 amountSats. */ + public amountSats: (number|Long); + + /** OnchainSendRequest sendAll. */ + public sendAll: boolean; + + /** OnchainSendRequest feeRateSatPerVb. */ + public feeRateSatPerVb: (number|Long); + + /** + * 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 }; + } + + /** 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 }; + } + + /** Properties of a Bolt11ReceiveRequest. */ + interface IBolt11ReceiveRequest { + + /** Bolt11ReceiveRequest amountMsat */ + amountMsat?: (number|Long|null); + + /** Bolt11ReceiveRequest description */ + description?: (types.IBolt11InvoiceDescription|null); + + /** Bolt11ReceiveRequest expirySecs */ + expirySecs?: (number|null); + } + + /** Represents a Bolt11ReceiveRequest. */ + class Bolt11ReceiveRequest implements IBolt11ReceiveRequest { + + /** + * Constructs a new Bolt11ReceiveRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11ReceiveRequest); + + /** Bolt11ReceiveRequest amountMsat. */ + public amountMsat: (number|Long); + + /** Bolt11ReceiveRequest description. */ + public description?: (types.IBolt11InvoiceDescription|null); + + /** Bolt11ReceiveRequest expirySecs. */ + public expirySecs: 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 }; + } + + /** Properties of a Bolt11ReceiveResponse. */ + interface IBolt11ReceiveResponse { + + /** Bolt11ReceiveResponse invoice */ + invoice?: (string|null); + + /** Bolt11ReceiveResponse paymentHash */ + paymentHash?: (string|null); + + /** Bolt11ReceiveResponse paymentSecret */ + paymentSecret?: (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 paymentHash. */ + public paymentHash: string; + + /** Bolt11ReceiveResponse paymentSecret. */ + public paymentSecret: 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 }; + } + + /** Properties of a Bolt11ReceiveForHashRequest. */ + interface IBolt11ReceiveForHashRequest { + + /** Bolt11ReceiveForHashRequest amountMsat */ + amountMsat?: (number|Long|null); + + /** Bolt11ReceiveForHashRequest description */ + description?: (types.IBolt11InvoiceDescription|null); + + /** Bolt11ReceiveForHashRequest expirySecs */ + expirySecs?: (number|null); + + /** Bolt11ReceiveForHashRequest paymentHash */ + paymentHash?: (string|null); + } + + /** Represents a Bolt11ReceiveForHashRequest. */ + class Bolt11ReceiveForHashRequest implements IBolt11ReceiveForHashRequest { + + /** + * Constructs a new Bolt11ReceiveForHashRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11ReceiveForHashRequest); + + /** Bolt11ReceiveForHashRequest amountMsat. */ + public amountMsat: (number|Long); + + /** Bolt11ReceiveForHashRequest description. */ + public description?: (types.IBolt11InvoiceDescription|null); + + /** Bolt11ReceiveForHashRequest expirySecs. */ + public expirySecs: number; + + /** Bolt11ReceiveForHashRequest paymentHash. */ + public paymentHash: 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 }; + } + + /** 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 }; + } + + /** Properties of a Bolt11ClaimForHashRequest. */ + interface IBolt11ClaimForHashRequest { + + /** Bolt11ClaimForHashRequest paymentHash */ + paymentHash?: (string|null); + + /** Bolt11ClaimForHashRequest claimableAmountMsat */ + claimableAmountMsat?: (number|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 paymentHash. */ + public paymentHash: string; + + /** Bolt11ClaimForHashRequest claimableAmountMsat. */ + public claimableAmountMsat: (number|Long); + + /** 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 }; + } + + /** 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 }; + } + + /** Properties of a Bolt11FailForHashRequest. */ + interface IBolt11FailForHashRequest { + + /** Bolt11FailForHashRequest paymentHash */ + paymentHash?: (string|null); + } + + /** Represents a Bolt11FailForHashRequest. */ + class Bolt11FailForHashRequest implements IBolt11FailForHashRequest { + + /** + * Constructs a new Bolt11FailForHashRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11FailForHashRequest); + + /** Bolt11FailForHashRequest paymentHash. */ + public paymentHash: 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 }; + } + + /** 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 }; + } + + /** Properties of a Bolt11ReceiveViaJitChannelRequest. */ + interface IBolt11ReceiveViaJitChannelRequest { + + /** Bolt11ReceiveViaJitChannelRequest amountMsat */ + amountMsat?: (number|Long|null); + + /** Bolt11ReceiveViaJitChannelRequest description */ + description?: (types.IBolt11InvoiceDescription|null); + + /** Bolt11ReceiveViaJitChannelRequest expirySecs */ + expirySecs?: (number|null); + + /** Bolt11ReceiveViaJitChannelRequest maxTotalLspFeeLimitMsat */ + maxTotalLspFeeLimitMsat?: (number|Long|null); + } + + /** Represents a Bolt11ReceiveViaJitChannelRequest. */ + class Bolt11ReceiveViaJitChannelRequest implements IBolt11ReceiveViaJitChannelRequest { + + /** + * Constructs a new Bolt11ReceiveViaJitChannelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11ReceiveViaJitChannelRequest); + + /** Bolt11ReceiveViaJitChannelRequest amountMsat. */ + public amountMsat: (number|Long); + + /** Bolt11ReceiveViaJitChannelRequest description. */ + public description?: (types.IBolt11InvoiceDescription|null); + + /** Bolt11ReceiveViaJitChannelRequest expirySecs. */ + public expirySecs: number; + + /** Bolt11ReceiveViaJitChannelRequest maxTotalLspFeeLimitMsat. */ + public maxTotalLspFeeLimitMsat: (number|Long); + + /** + * 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 }; + } + + /** 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 }; + } + + /** Properties of a Bolt11ReceiveVariableAmountViaJitChannelRequest. */ + interface IBolt11ReceiveVariableAmountViaJitChannelRequest { + + /** Bolt11ReceiveVariableAmountViaJitChannelRequest description */ + description?: (types.IBolt11InvoiceDescription|null); + + /** Bolt11ReceiveVariableAmountViaJitChannelRequest expirySecs */ + expirySecs?: (number|null); + + /** Bolt11ReceiveVariableAmountViaJitChannelRequest maxProportionalLspFeeLimitPpmMsat */ + maxProportionalLspFeeLimitPpmMsat?: (number|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 expirySecs. */ + public expirySecs: number; + + /** Bolt11ReceiveVariableAmountViaJitChannelRequest maxProportionalLspFeeLimitPpmMsat. */ + public maxProportionalLspFeeLimitPpmMsat: (number|Long); + + /** + * 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 }; + } + + /** 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 }; + } + + /** Properties of a Bolt11SendRequest. */ + interface IBolt11SendRequest { + + /** Bolt11SendRequest invoice */ + invoice?: (string|null); + + /** Bolt11SendRequest amountMsat */ + amountMsat?: (number|Long|null); + + /** Bolt11SendRequest routeParameters */ + routeParameters?: (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 amountMsat. */ + public amountMsat: (number|Long); + + /** Bolt11SendRequest routeParameters. */ + public routeParameters?: (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 }; + } + + /** Properties of a Bolt11SendResponse. */ + interface IBolt11SendResponse { + + /** Bolt11SendResponse paymentId */ + paymentId?: (string|null); + } + + /** Represents a Bolt11SendResponse. */ + class Bolt11SendResponse implements IBolt11SendResponse { + + /** + * Constructs a new Bolt11SendResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11SendResponse); + + /** Bolt11SendResponse paymentId. */ + public paymentId: 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 }; + } + + /** Properties of a Bolt12ReceiveRequest. */ + interface IBolt12ReceiveRequest { + + /** Bolt12ReceiveRequest description */ + description?: (string|null); + + /** Bolt12ReceiveRequest amountMsat */ + amountMsat?: (number|Long|null); + + /** Bolt12ReceiveRequest expirySecs */ + expirySecs?: (number|null); + + /** Bolt12ReceiveRequest quantity */ + quantity?: (number|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 amountMsat. */ + public amountMsat: (number|Long); + + /** Bolt12ReceiveRequest expirySecs. */ + public expirySecs: number; + + /** Bolt12ReceiveRequest quantity. */ + public quantity: (number|Long); + + /** + * 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 }; + } + + /** Properties of a Bolt12ReceiveResponse. */ + interface IBolt12ReceiveResponse { + + /** Bolt12ReceiveResponse offer */ + offer?: (string|null); + + /** Bolt12ReceiveResponse offerId */ + offerId?: (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 offerId. */ + public offerId: 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 }; + } + + /** Properties of a Bolt12SendRequest. */ + interface IBolt12SendRequest { + + /** Bolt12SendRequest offer */ + offer?: (string|null); + + /** Bolt12SendRequest amountMsat */ + amountMsat?: (number|Long|null); + + /** Bolt12SendRequest quantity */ + quantity?: (number|Long|null); + + /** Bolt12SendRequest payerNote */ + payerNote?: (string|null); + + /** Bolt12SendRequest routeParameters */ + routeParameters?: (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 amountMsat. */ + public amountMsat: (number|Long); + + /** Bolt12SendRequest quantity. */ + public quantity: (number|Long); + + /** Bolt12SendRequest payerNote. */ + public payerNote: string; + + /** Bolt12SendRequest routeParameters. */ + public routeParameters?: (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 }; + } + + /** Properties of a Bolt12SendResponse. */ + interface IBolt12SendResponse { + + /** Bolt12SendResponse paymentId */ + paymentId?: (string|null); + } + + /** Represents a Bolt12SendResponse. */ + class Bolt12SendResponse implements IBolt12SendResponse { + + /** + * Constructs a new Bolt12SendResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt12SendResponse); + + /** Bolt12SendResponse paymentId. */ + public paymentId: 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 }; + } + + /** Properties of a SpontaneousSendRequest. */ + interface ISpontaneousSendRequest { + + /** SpontaneousSendRequest amountMsat */ + amountMsat?: (number|Long|null); + + /** SpontaneousSendRequest nodeId */ + nodeId?: (string|null); + + /** SpontaneousSendRequest routeParameters */ + routeParameters?: (types.IRouteParametersConfig|null); + } + + /** Represents a SpontaneousSendRequest. */ + class SpontaneousSendRequest implements ISpontaneousSendRequest { + + /** + * Constructs a new SpontaneousSendRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.ISpontaneousSendRequest); + + /** SpontaneousSendRequest amountMsat. */ + public amountMsat: (number|Long); + + /** SpontaneousSendRequest nodeId. */ + public nodeId: string; + + /** SpontaneousSendRequest routeParameters. */ + public routeParameters?: (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 }; + } + + /** Properties of a SpontaneousSendResponse. */ + interface ISpontaneousSendResponse { + + /** SpontaneousSendResponse paymentId */ + paymentId?: (string|null); + } + + /** Represents a SpontaneousSendResponse. */ + class SpontaneousSendResponse implements ISpontaneousSendResponse { + + /** + * Constructs a new SpontaneousSendResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.ISpontaneousSendResponse); + + /** SpontaneousSendResponse paymentId. */ + public paymentId: 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 }; + } + + /** Properties of an OpenChannelRequest. */ + interface IOpenChannelRequest { + + /** OpenChannelRequest nodePubkey */ + nodePubkey?: (string|null); + + /** OpenChannelRequest address */ + address?: (string|null); + + /** OpenChannelRequest channelAmountSats */ + channelAmountSats?: (number|Long|null); + + /** OpenChannelRequest pushToCounterpartyMsat */ + pushToCounterpartyMsat?: (number|Long|null); + + /** OpenChannelRequest channelConfig */ + channelConfig?: (types.IChannelConfig|null); + + /** OpenChannelRequest announceChannel */ + announceChannel?: (boolean|null); + + /** OpenChannelRequest disableCounterpartyReserve */ + disableCounterpartyReserve?: (boolean|null); + } + + /** Represents an OpenChannelRequest. */ + class OpenChannelRequest implements IOpenChannelRequest { + + /** + * Constructs a new OpenChannelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IOpenChannelRequest); + + /** OpenChannelRequest nodePubkey. */ + public nodePubkey: string; + + /** OpenChannelRequest address. */ + public address: string; + + /** OpenChannelRequest channelAmountSats. */ + public channelAmountSats: (number|Long); + + /** OpenChannelRequest pushToCounterpartyMsat. */ + public pushToCounterpartyMsat: (number|Long); + + /** OpenChannelRequest channelConfig. */ + public channelConfig?: (types.IChannelConfig|null); + + /** OpenChannelRequest announceChannel. */ + public announceChannel: boolean; + + /** OpenChannelRequest disableCounterpartyReserve. */ + public disableCounterpartyReserve: 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 }; + } + + /** Properties of an OpenChannelResponse. */ + interface IOpenChannelResponse { + + /** OpenChannelResponse userChannelId */ + userChannelId?: (string|null); + } + + /** Represents an OpenChannelResponse. */ + class OpenChannelResponse implements IOpenChannelResponse { + + /** + * Constructs a new OpenChannelResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IOpenChannelResponse); + + /** OpenChannelResponse userChannelId. */ + public userChannelId: 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 }; + } + + /** Properties of a SpliceInRequest. */ + interface ISpliceInRequest { + + /** SpliceInRequest userChannelId */ + userChannelId?: (string|null); + + /** SpliceInRequest counterpartyNodeId */ + counterpartyNodeId?: (string|null); + + /** SpliceInRequest spliceAmountSats */ + spliceAmountSats?: (number|Long|null); + } + + /** Represents a SpliceInRequest. */ + class SpliceInRequest implements ISpliceInRequest { + + /** + * Constructs a new SpliceInRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.ISpliceInRequest); + + /** SpliceInRequest userChannelId. */ + public userChannelId: string; + + /** SpliceInRequest counterpartyNodeId. */ + public counterpartyNodeId: string; + + /** SpliceInRequest spliceAmountSats. */ + public spliceAmountSats: (number|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 }; + } + + /** 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 }; + } + + /** Properties of a SpliceOutRequest. */ + interface ISpliceOutRequest { + + /** SpliceOutRequest userChannelId */ + userChannelId?: (string|null); + + /** SpliceOutRequest counterpartyNodeId */ + counterpartyNodeId?: (string|null); + + /** SpliceOutRequest address */ + address?: (string|null); + + /** SpliceOutRequest spliceAmountSats */ + spliceAmountSats?: (number|Long|null); + } + + /** Represents a SpliceOutRequest. */ + class SpliceOutRequest implements ISpliceOutRequest { + + /** + * Constructs a new SpliceOutRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.ISpliceOutRequest); + + /** SpliceOutRequest userChannelId. */ + public userChannelId: string; + + /** SpliceOutRequest counterpartyNodeId. */ + public counterpartyNodeId: string; + + /** SpliceOutRequest address. */ + public address: string; + + /** SpliceOutRequest spliceAmountSats. */ + public spliceAmountSats: (number|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 }; + } + + /** 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 }; + } + + /** Properties of an UpdateChannelConfigRequest. */ + interface IUpdateChannelConfigRequest { + + /** UpdateChannelConfigRequest userChannelId */ + userChannelId?: (string|null); + + /** UpdateChannelConfigRequest counterpartyNodeId */ + counterpartyNodeId?: (string|null); + + /** UpdateChannelConfigRequest channelConfig */ + channelConfig?: (types.IChannelConfig|null); + } + + /** Represents an UpdateChannelConfigRequest. */ + class UpdateChannelConfigRequest implements IUpdateChannelConfigRequest { + + /** + * Constructs a new UpdateChannelConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IUpdateChannelConfigRequest); + + /** UpdateChannelConfigRequest userChannelId. */ + public userChannelId: string; + + /** UpdateChannelConfigRequest counterpartyNodeId. */ + public counterpartyNodeId: string; + + /** UpdateChannelConfigRequest channelConfig. */ + public channelConfig?: (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 }; + } + + /** 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 }; + } + + /** Properties of a CloseChannelRequest. */ + interface ICloseChannelRequest { + + /** CloseChannelRequest userChannelId */ + userChannelId?: (string|null); + + /** CloseChannelRequest counterpartyNodeId */ + counterpartyNodeId?: (string|null); + } + + /** Represents a CloseChannelRequest. */ + class CloseChannelRequest implements ICloseChannelRequest { + + /** + * Constructs a new CloseChannelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.ICloseChannelRequest); + + /** CloseChannelRequest userChannelId. */ + public userChannelId: string; + + /** CloseChannelRequest counterpartyNodeId. */ + public counterpartyNodeId: 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 }; + } + + /** 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 }; + } + + /** Properties of a ForceCloseChannelRequest. */ + interface IForceCloseChannelRequest { + + /** ForceCloseChannelRequest userChannelId */ + userChannelId?: (string|null); + + /** ForceCloseChannelRequest counterpartyNodeId */ + counterpartyNodeId?: (string|null); + + /** ForceCloseChannelRequest forceCloseReason */ + forceCloseReason?: (string|null); + } + + /** Represents a ForceCloseChannelRequest. */ + class ForceCloseChannelRequest implements IForceCloseChannelRequest { + + /** + * Constructs a new ForceCloseChannelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IForceCloseChannelRequest); + + /** ForceCloseChannelRequest userChannelId. */ + public userChannelId: string; + + /** ForceCloseChannelRequest counterpartyNodeId. */ + public counterpartyNodeId: string; + + /** ForceCloseChannelRequest forceCloseReason. */ + public forceCloseReason: string; + + /** + * 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** Properties of a GetPaymentDetailsRequest. */ + interface IGetPaymentDetailsRequest { + + /** GetPaymentDetailsRequest paymentId */ + paymentId?: (string|null); + } + + /** Represents a GetPaymentDetailsRequest. */ + class GetPaymentDetailsRequest implements IGetPaymentDetailsRequest { + + /** + * Constructs a new GetPaymentDetailsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGetPaymentDetailsRequest); + + /** GetPaymentDetailsRequest paymentId. */ + public paymentId: 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 }; + } + + /** 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 }; + } + + /** Properties of a ListPaymentsRequest. */ + interface IListPaymentsRequest { + + /** ListPaymentsRequest pageToken */ + pageToken?: (types.IPageToken|null); + } + + /** Represents a ListPaymentsRequest. */ + class ListPaymentsRequest implements IListPaymentsRequest { + + /** + * Constructs a new ListPaymentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IListPaymentsRequest); + + /** ListPaymentsRequest pageToken. */ + public pageToken?: (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 }; + } + + /** Properties of a ListPaymentsResponse. */ + interface IListPaymentsResponse { + + /** ListPaymentsResponse payments */ + payments?: (types.IPayment[]|null); + + /** ListPaymentsResponse nextPageToken */ + nextPageToken?: (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 nextPageToken. */ + public nextPageToken?: (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 }; + } + + /** Properties of a ListForwardedPaymentsRequest. */ + interface IListForwardedPaymentsRequest { + + /** ListForwardedPaymentsRequest pageToken */ + pageToken?: (types.IPageToken|null); + } + + /** Represents a ListForwardedPaymentsRequest. */ + class ListForwardedPaymentsRequest implements IListForwardedPaymentsRequest { + + /** + * Constructs a new ListForwardedPaymentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IListForwardedPaymentsRequest); + + /** ListForwardedPaymentsRequest pageToken. */ + public pageToken?: (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 }; + } + + /** Properties of a ListForwardedPaymentsResponse. */ + interface IListForwardedPaymentsResponse { + + /** ListForwardedPaymentsResponse forwardedPayments */ + forwardedPayments?: (types.IForwardedPayment[]|null); + + /** ListForwardedPaymentsResponse nextPageToken */ + nextPageToken?: (types.IPageToken|null); + } + + /** Represents a ListForwardedPaymentsResponse. */ + class ListForwardedPaymentsResponse implements IListForwardedPaymentsResponse { + + /** + * Constructs a new ListForwardedPaymentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IListForwardedPaymentsResponse); + + /** ListForwardedPaymentsResponse forwardedPayments. */ + public forwardedPayments: types.IForwardedPayment[]; + + /** ListForwardedPaymentsResponse nextPageToken. */ + public nextPageToken?: (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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** Properties of a VerifySignatureRequest. */ + interface IVerifySignatureRequest { + + /** VerifySignatureRequest message */ + message?: (Uint8Array|null); + + /** VerifySignatureRequest signature */ + signature?: (string|null); + + /** VerifySignatureRequest publicKey */ + publicKey?: (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 publicKey. */ + public publicKey: 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** Properties of a GetBalancesResponse. */ + interface IGetBalancesResponse { + + /** GetBalancesResponse totalOnchainBalanceSats */ + totalOnchainBalanceSats?: (number|Long|null); + + /** GetBalancesResponse spendableOnchainBalanceSats */ + spendableOnchainBalanceSats?: (number|Long|null); + + /** GetBalancesResponse totalAnchorChannelsReserveSats */ + totalAnchorChannelsReserveSats?: (number|Long|null); + + /** GetBalancesResponse totalLightningBalanceSats */ + totalLightningBalanceSats?: (number|Long|null); + + /** GetBalancesResponse lightningBalances */ + lightningBalances?: (types.ILightningBalance[]|null); + + /** GetBalancesResponse pendingBalancesFromChannelClosures */ + pendingBalancesFromChannelClosures?: (types.IPendingSweepBalance[]|null); + } + + /** Represents a GetBalancesResponse. */ + class GetBalancesResponse implements IGetBalancesResponse { + + /** + * Constructs a new GetBalancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGetBalancesResponse); + + /** GetBalancesResponse totalOnchainBalanceSats. */ + public totalOnchainBalanceSats: (number|Long); + + /** GetBalancesResponse spendableOnchainBalanceSats. */ + public spendableOnchainBalanceSats: (number|Long); + + /** GetBalancesResponse totalAnchorChannelsReserveSats. */ + public totalAnchorChannelsReserveSats: (number|Long); + + /** GetBalancesResponse totalLightningBalanceSats. */ + public totalLightningBalanceSats: (number|Long); + + /** GetBalancesResponse lightningBalances. */ + public lightningBalances: types.ILightningBalance[]; + + /** GetBalancesResponse pendingBalancesFromChannelClosures. */ + public pendingBalancesFromChannelClosures: 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 }; + } + + /** Properties of a ConnectPeerRequest. */ + interface IConnectPeerRequest { + + /** ConnectPeerRequest nodePubkey */ + nodePubkey?: (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 nodePubkey. */ + public nodePubkey: 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 }; + } + + /** 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 }; + } + + /** Properties of a DisconnectPeerRequest. */ + interface IDisconnectPeerRequest { + + /** DisconnectPeerRequest nodePubkey */ + nodePubkey?: (string|null); + } + + /** Represents a DisconnectPeerRequest. */ + class DisconnectPeerRequest implements IDisconnectPeerRequest { + + /** + * Constructs a new DisconnectPeerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IDisconnectPeerRequest); + + /** DisconnectPeerRequest nodePubkey. */ + public nodePubkey: 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** Properties of a GraphListChannelsResponse. */ + interface IGraphListChannelsResponse { + + /** GraphListChannelsResponse shortChannelIds */ + shortChannelIds?: ((number|Long)[]|null); + } + + /** Represents a GraphListChannelsResponse. */ + class GraphListChannelsResponse implements IGraphListChannelsResponse { + + /** + * Constructs a new GraphListChannelsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGraphListChannelsResponse); + + /** GraphListChannelsResponse shortChannelIds. */ + public shortChannelIds: (number|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 }; + } + + /** Properties of a GraphGetChannelRequest. */ + interface IGraphGetChannelRequest { + + /** GraphGetChannelRequest shortChannelId */ + shortChannelId?: (number|Long|null); + } + + /** Represents a GraphGetChannelRequest. */ + class GraphGetChannelRequest implements IGraphGetChannelRequest { + + /** + * Constructs a new GraphGetChannelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGraphGetChannelRequest); + + /** GraphGetChannelRequest shortChannelId. */ + public shortChannelId: (number|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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** Properties of a GraphListNodesResponse. */ + interface IGraphListNodesResponse { + + /** GraphListNodesResponse nodeIds */ + nodeIds?: (string[]|null); + } + + /** Represents a GraphListNodesResponse. */ + class GraphListNodesResponse implements IGraphListNodesResponse { + + /** + * Constructs a new GraphListNodesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGraphListNodesResponse); + + /** GraphListNodesResponse nodeIds. */ + public nodeIds: 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 }; + } + + /** Properties of an UnifiedSendRequest. */ + interface IUnifiedSendRequest { + + /** UnifiedSendRequest uri */ + uri?: (string|null); + + /** UnifiedSendRequest amountMsat */ + amountMsat?: (number|Long|null); + + /** UnifiedSendRequest routeParameters */ + routeParameters?: (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 amountMsat. */ + public amountMsat: (number|Long); + + /** UnifiedSendRequest routeParameters. */ + public routeParameters?: (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 }; + } + + /** Properties of an UnifiedSendResponse. */ + interface IUnifiedSendResponse { + + /** UnifiedSendResponse txid */ + txid?: (string|null); + + /** UnifiedSendResponse bolt11PaymentId */ + bolt11PaymentId?: (string|null); + + /** UnifiedSendResponse bolt12PaymentId */ + bolt12PaymentId?: (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; + + /** UnifiedSendResponse bolt11PaymentId. */ + public bolt11PaymentId: string; + + /** UnifiedSendResponse bolt12PaymentId. */ + public bolt12PaymentId: string; + + /** UnifiedSendResponse paymentResult. */ + public paymentResult?: ("txid"|"bolt11PaymentId"|"bolt12PaymentId"); + + /** + * 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 }; + } + + /** Properties of a GraphGetNodeRequest. */ + interface IGraphGetNodeRequest { + + /** GraphGetNodeRequest nodeId */ + nodeId?: (string|null); + } + + /** Represents a GraphGetNodeRequest. */ + class GraphGetNodeRequest implements IGraphGetNodeRequest { + + /** + * Constructs a new GraphGetNodeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGraphGetNodeRequest); + + /** GraphGetNodeRequest nodeId. */ + public nodeId: 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** Properties of a DecodeInvoiceResponse. */ + interface IDecodeInvoiceResponse { + + /** DecodeInvoiceResponse destination */ + destination?: (string|null); + + /** DecodeInvoiceResponse paymentHash */ + paymentHash?: (string|null); + + /** DecodeInvoiceResponse amountMsat */ + amountMsat?: (number|Long|null); + + /** DecodeInvoiceResponse timestamp */ + timestamp?: (number|Long|null); + + /** DecodeInvoiceResponse expiry */ + expiry?: (number|Long|null); + + /** DecodeInvoiceResponse description */ + description?: (string|null); + + /** DecodeInvoiceResponse descriptionHash */ + descriptionHash?: (string|null); + + /** DecodeInvoiceResponse fallbackAddress */ + fallbackAddress?: (string|null); + + /** DecodeInvoiceResponse minFinalCltvExpiryDelta */ + minFinalCltvExpiryDelta?: (number|Long|null); + + /** DecodeInvoiceResponse paymentSecret */ + paymentSecret?: (string|null); + + /** DecodeInvoiceResponse routeHints */ + routeHints?: (types.IBolt11RouteHint[]|null); + + /** DecodeInvoiceResponse features */ + features?: ({ [k: string]: types.IBolt11Feature }|null); + + /** DecodeInvoiceResponse currency */ + currency?: (string|null); + + /** DecodeInvoiceResponse paymentMetadata */ + paymentMetadata?: (string|null); + + /** DecodeInvoiceResponse isExpired */ + isExpired?: (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 paymentHash. */ + public paymentHash: string; + + /** DecodeInvoiceResponse amountMsat. */ + public amountMsat: (number|Long); + + /** DecodeInvoiceResponse timestamp. */ + public timestamp: (number|Long); + + /** DecodeInvoiceResponse expiry. */ + public expiry: (number|Long); + + /** DecodeInvoiceResponse description. */ + public description: string; + + /** DecodeInvoiceResponse descriptionHash. */ + public descriptionHash: string; + + /** DecodeInvoiceResponse fallbackAddress. */ + public fallbackAddress: string; + + /** DecodeInvoiceResponse minFinalCltvExpiryDelta. */ + public minFinalCltvExpiryDelta: (number|Long); + + /** DecodeInvoiceResponse paymentSecret. */ + public paymentSecret: string; + + /** DecodeInvoiceResponse routeHints. */ + public routeHints: types.IBolt11RouteHint[]; + + /** DecodeInvoiceResponse features. */ + public features: { [k: string]: types.IBolt11Feature }; + + /** DecodeInvoiceResponse currency. */ + public currency: string; + + /** DecodeInvoiceResponse paymentMetadata. */ + public paymentMetadata: string; + + /** DecodeInvoiceResponse isExpired. */ + public isExpired: 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 }; + } + + /** 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 }; + } + + /** Properties of a DecodeOfferResponse. */ + interface IDecodeOfferResponse { + + /** DecodeOfferResponse offerId */ + offerId?: (string|null); + + /** DecodeOfferResponse description */ + description?: (string|null); + + /** DecodeOfferResponse issuer */ + issuer?: (string|null); + + /** DecodeOfferResponse amount */ + amount?: (types.IOfferAmount|null); + + /** DecodeOfferResponse issuerSigningPubkey */ + issuerSigningPubkey?: (string|null); + + /** DecodeOfferResponse absoluteExpiry */ + absoluteExpiry?: (number|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 isExpired */ + isExpired?: (boolean|null); + } + + /** Represents a DecodeOfferResponse. */ + class DecodeOfferResponse implements IDecodeOfferResponse { + + /** + * Constructs a new DecodeOfferResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IDecodeOfferResponse); + + /** DecodeOfferResponse offerId. */ + public offerId: string; + + /** DecodeOfferResponse description. */ + public description: string; + + /** DecodeOfferResponse issuer. */ + public issuer: string; + + /** DecodeOfferResponse amount. */ + public amount?: (types.IOfferAmount|null); + + /** DecodeOfferResponse issuerSigningPubkey. */ + public issuerSigningPubkey: string; + + /** DecodeOfferResponse absoluteExpiry. */ + public absoluteExpiry: (number|Long); + + /** 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; + + /** DecodeOfferResponse isExpired. */ + public isExpired: 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 }; + } + + /** 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 }; + } + + /** 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 amountMsat */ + amountMsat?: (number|Long|null); + + /** Payment feePaidMsat */ + feePaidMsat?: (number|Long|null); + + /** Payment direction */ + direction?: (types.PaymentDirection|null); + + /** Payment status */ + status?: (types.PaymentStatus|null); + + /** Payment latestUpdateTimestamp */ + latestUpdateTimestamp?: (number|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 amountMsat. */ + public amountMsat: (number|Long); + + /** Payment feePaidMsat. */ + public feePaidMsat: (number|Long); + + /** Payment direction. */ + public direction: types.PaymentDirection; + + /** Payment status. */ + public status: types.PaymentStatus; + + /** Payment latestUpdateTimestamp. */ + public latestUpdateTimestamp: (number|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 }; + } + + /** Properties of a PaymentKind. */ + interface IPaymentKind { + + /** PaymentKind onchain */ + onchain?: (types.IOnchain|null); + + /** PaymentKind bolt11 */ + bolt11?: (types.IBolt11|null); + + /** PaymentKind bolt11Jit */ + bolt11Jit?: (types.IBolt11Jit|null); + + /** PaymentKind bolt12Offer */ + bolt12Offer?: (types.IBolt12Offer|null); + + /** PaymentKind bolt12Refund */ + bolt12Refund?: (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 bolt11Jit. */ + public bolt11Jit?: (types.IBolt11Jit|null); + + /** PaymentKind bolt12Offer. */ + public bolt12Offer?: (types.IBolt12Offer|null); + + /** PaymentKind bolt12Refund. */ + public bolt12Refund?: (types.IBolt12Refund|null); + + /** PaymentKind spontaneous. */ + public spontaneous?: (types.ISpontaneous|null); + + /** PaymentKind kind. */ + public kind?: ("onchain"|"bolt11"|"bolt11Jit"|"bolt12Offer"|"bolt12Refund"|"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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** Properties of a Confirmed. */ + interface IConfirmed { + + /** Confirmed blockHash */ + blockHash?: (string|null); + + /** Confirmed height */ + height?: (number|null); + + /** Confirmed timestamp */ + timestamp?: (number|Long|null); + } + + /** Represents a Confirmed. */ + class Confirmed implements IConfirmed { + + /** + * Constructs a new Confirmed. + * @param [properties] Properties to set + */ + constructor(properties?: types.IConfirmed); + + /** Confirmed blockHash. */ + public blockHash: string; + + /** Confirmed height. */ + public height: number; + + /** Confirmed timestamp. */ + public timestamp: (number|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 }; + } + + /** 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 }; + } + + /** 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; + + /** Bolt11 secret. */ + public secret: Uint8Array; + + /** + * 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 }; + } + + /** Properties of a Bolt11Jit. */ + interface IBolt11Jit { + + /** Bolt11Jit hash */ + hash?: (string|null); + + /** Bolt11Jit preimage */ + preimage?: (string|null); + + /** Bolt11Jit secret */ + secret?: (Uint8Array|null); + + /** Bolt11Jit lspFeeLimits */ + lspFeeLimits?: (types.ILSPFeeLimits|null); + + /** Bolt11Jit counterpartySkimmedFeeMsat */ + counterpartySkimmedFeeMsat?: (number|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; + + /** Bolt11Jit secret. */ + public secret: Uint8Array; + + /** Bolt11Jit lspFeeLimits. */ + public lspFeeLimits?: (types.ILSPFeeLimits|null); + + /** Bolt11Jit counterpartySkimmedFeeMsat. */ + public counterpartySkimmedFeeMsat: (number|Long); + + /** + * 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 }; + } + + /** Properties of a Bolt12Offer. */ + interface IBolt12Offer { + + /** Bolt12Offer hash */ + hash?: (string|null); + + /** Bolt12Offer preimage */ + preimage?: (string|null); + + /** Bolt12Offer secret */ + secret?: (Uint8Array|null); + + /** Bolt12Offer offerId */ + offerId?: (string|null); + + /** Bolt12Offer payerNote */ + payerNote?: (string|null); + + /** Bolt12Offer quantity */ + quantity?: (number|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; + + /** Bolt12Offer preimage. */ + public preimage: string; + + /** Bolt12Offer secret. */ + public secret: Uint8Array; + + /** Bolt12Offer offerId. */ + public offerId: string; + + /** Bolt12Offer payerNote. */ + public payerNote: string; + + /** Bolt12Offer quantity. */ + public quantity: (number|Long); + + /** + * 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 }; + } + + /** Properties of a Bolt12Refund. */ + interface IBolt12Refund { + + /** Bolt12Refund hash */ + hash?: (string|null); + + /** Bolt12Refund preimage */ + preimage?: (string|null); + + /** Bolt12Refund secret */ + secret?: (Uint8Array|null); + + /** Bolt12Refund payerNote */ + payerNote?: (string|null); + + /** Bolt12Refund quantity */ + quantity?: (number|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; + + /** Bolt12Refund preimage. */ + public preimage: string; + + /** Bolt12Refund secret. */ + public secret: Uint8Array; + + /** Bolt12Refund payerNote. */ + public payerNote: string; + + /** Bolt12Refund quantity. */ + public quantity: (number|Long); + + /** + * 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 }; + } + + /** 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; + + /** + * 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 }; + } + + /** Properties of a LSPFeeLimits. */ + interface ILSPFeeLimits { + + /** LSPFeeLimits maxTotalOpeningFeeMsat */ + maxTotalOpeningFeeMsat?: (number|Long|null); + + /** LSPFeeLimits maxProportionalOpeningFeePpmMsat */ + maxProportionalOpeningFeePpmMsat?: (number|Long|null); + } + + /** Represents a LSPFeeLimits. */ + class LSPFeeLimits implements ILSPFeeLimits { + + /** + * Constructs a new LSPFeeLimits. + * @param [properties] Properties to set + */ + constructor(properties?: types.ILSPFeeLimits); + + /** LSPFeeLimits maxTotalOpeningFeeMsat. */ + public maxTotalOpeningFeeMsat: (number|Long); + + /** LSPFeeLimits maxProportionalOpeningFeePpmMsat. */ + public maxProportionalOpeningFeePpmMsat: (number|Long); + + /** + * 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 }; + } + + /** 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 prevChannelId */ + prevChannelId?: (string|null); + + /** ForwardedPayment nextChannelId */ + nextChannelId?: (string|null); + + /** ForwardedPayment prevUserChannelId */ + prevUserChannelId?: (string|null); + + /** ForwardedPayment prevNodeId */ + prevNodeId?: (string|null); + + /** ForwardedPayment nextNodeId */ + nextNodeId?: (string|null); + + /** ForwardedPayment nextUserChannelId */ + nextUserChannelId?: (string|null); + + /** ForwardedPayment totalFeeEarnedMsat */ + totalFeeEarnedMsat?: (number|Long|null); + + /** ForwardedPayment skimmedFeeMsat */ + skimmedFeeMsat?: (number|Long|null); + + /** ForwardedPayment claimFromOnchainTx */ + claimFromOnchainTx?: (boolean|null); + + /** ForwardedPayment outboundAmountForwardedMsat */ + outboundAmountForwardedMsat?: (number|Long|null); + } + + /** Represents a ForwardedPayment. */ + class ForwardedPayment implements IForwardedPayment { + + /** + * Constructs a new ForwardedPayment. + * @param [properties] Properties to set + */ + constructor(properties?: types.IForwardedPayment); + + /** ForwardedPayment prevChannelId. */ + public prevChannelId: string; + + /** ForwardedPayment nextChannelId. */ + public nextChannelId: string; + + /** ForwardedPayment prevUserChannelId. */ + public prevUserChannelId: string; + + /** ForwardedPayment prevNodeId. */ + public prevNodeId: string; + + /** ForwardedPayment nextNodeId. */ + public nextNodeId: string; + + /** ForwardedPayment nextUserChannelId. */ + public nextUserChannelId: string; + + /** ForwardedPayment totalFeeEarnedMsat. */ + public totalFeeEarnedMsat: (number|Long); + + /** ForwardedPayment skimmedFeeMsat. */ + public skimmedFeeMsat: (number|Long); + + /** ForwardedPayment claimFromOnchainTx. */ + public claimFromOnchainTx: boolean; + + /** ForwardedPayment outboundAmountForwardedMsat. */ + public outboundAmountForwardedMsat: (number|Long); + + /** + * 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 }; + } + + /** Properties of a Channel. */ + interface IChannel { + + /** Channel channelId */ + channelId?: (string|null); + + /** Channel counterpartyNodeId */ + counterpartyNodeId?: (string|null); + + /** Channel fundingTxo */ + fundingTxo?: (types.IOutPoint|null); + + /** Channel userChannelId */ + userChannelId?: (string|null); + + /** Channel unspendablePunishmentReserve */ + unspendablePunishmentReserve?: (number|Long|null); + + /** Channel channelValueSats */ + channelValueSats?: (number|Long|null); + + /** Channel feerateSatPer_1000Weight */ + feerateSatPer_1000Weight?: (number|null); + + /** Channel outboundCapacityMsat */ + outboundCapacityMsat?: (number|Long|null); + + /** Channel inboundCapacityMsat */ + inboundCapacityMsat?: (number|Long|null); + + /** Channel confirmationsRequired */ + confirmationsRequired?: (number|null); + + /** Channel confirmations */ + confirmations?: (number|null); + + /** Channel isOutbound */ + isOutbound?: (boolean|null); + + /** Channel isChannelReady */ + isChannelReady?: (boolean|null); + + /** Channel isUsable */ + isUsable?: (boolean|null); + + /** Channel isAnnounced */ + isAnnounced?: (boolean|null); + + /** Channel channelConfig */ + channelConfig?: (types.IChannelConfig|null); + + /** Channel nextOutboundHtlcLimitMsat */ + nextOutboundHtlcLimitMsat?: (number|Long|null); + + /** Channel nextOutboundHtlcMinimumMsat */ + nextOutboundHtlcMinimumMsat?: (number|Long|null); + + /** Channel forceCloseSpendDelay */ + forceCloseSpendDelay?: (number|null); + + /** Channel counterpartyOutboundHtlcMinimumMsat */ + counterpartyOutboundHtlcMinimumMsat?: (number|Long|null); + + /** Channel counterpartyOutboundHtlcMaximumMsat */ + counterpartyOutboundHtlcMaximumMsat?: (number|Long|null); + + /** Channel counterpartyUnspendablePunishmentReserve */ + counterpartyUnspendablePunishmentReserve?: (number|Long|null); + + /** Channel counterpartyForwardingInfoFeeBaseMsat */ + counterpartyForwardingInfoFeeBaseMsat?: (number|null); + + /** Channel counterpartyForwardingInfoFeeProportionalMillionths */ + counterpartyForwardingInfoFeeProportionalMillionths?: (number|null); + + /** Channel counterpartyForwardingInfoCltvExpiryDelta */ + counterpartyForwardingInfoCltvExpiryDelta?: (number|null); + } + + /** Represents a Channel. */ + class Channel implements IChannel { + + /** + * Constructs a new Channel. + * @param [properties] Properties to set + */ + constructor(properties?: types.IChannel); + + /** Channel channelId. */ + public channelId: string; + + /** Channel counterpartyNodeId. */ + public counterpartyNodeId: string; + + /** Channel fundingTxo. */ + public fundingTxo?: (types.IOutPoint|null); + + /** Channel userChannelId. */ + public userChannelId: string; + + /** Channel unspendablePunishmentReserve. */ + public unspendablePunishmentReserve: (number|Long); + + /** Channel channelValueSats. */ + public channelValueSats: (number|Long); + + /** Channel feerateSatPer_1000Weight. */ + public feerateSatPer_1000Weight: number; + + /** Channel outboundCapacityMsat. */ + public outboundCapacityMsat: (number|Long); + + /** Channel inboundCapacityMsat. */ + public inboundCapacityMsat: (number|Long); + + /** Channel confirmationsRequired. */ + public confirmationsRequired: number; + + /** Channel confirmations. */ + public confirmations: number; + + /** Channel isOutbound. */ + public isOutbound: boolean; + + /** Channel isChannelReady. */ + public isChannelReady: boolean; + + /** Channel isUsable. */ + public isUsable: boolean; + + /** Channel isAnnounced. */ + public isAnnounced: boolean; + + /** Channel channelConfig. */ + public channelConfig?: (types.IChannelConfig|null); + + /** Channel nextOutboundHtlcLimitMsat. */ + public nextOutboundHtlcLimitMsat: (number|Long); + + /** Channel nextOutboundHtlcMinimumMsat. */ + public nextOutboundHtlcMinimumMsat: (number|Long); + + /** Channel forceCloseSpendDelay. */ + public forceCloseSpendDelay: number; + + /** Channel counterpartyOutboundHtlcMinimumMsat. */ + public counterpartyOutboundHtlcMinimumMsat: (number|Long); + + /** Channel counterpartyOutboundHtlcMaximumMsat. */ + public counterpartyOutboundHtlcMaximumMsat: (number|Long); + + /** Channel counterpartyUnspendablePunishmentReserve. */ + public counterpartyUnspendablePunishmentReserve: (number|Long); + + /** Channel counterpartyForwardingInfoFeeBaseMsat. */ + public counterpartyForwardingInfoFeeBaseMsat: number; + + /** Channel counterpartyForwardingInfoFeeProportionalMillionths. */ + public counterpartyForwardingInfoFeeProportionalMillionths: number; + + /** Channel counterpartyForwardingInfoCltvExpiryDelta. */ + public counterpartyForwardingInfoCltvExpiryDelta: number; + + /** + * 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 }; + } + + /** Properties of a ChannelConfig. */ + interface IChannelConfig { + + /** ChannelConfig forwardingFeeProportionalMillionths */ + forwardingFeeProportionalMillionths?: (number|null); + + /** ChannelConfig forwardingFeeBaseMsat */ + forwardingFeeBaseMsat?: (number|null); + + /** ChannelConfig cltvExpiryDelta */ + cltvExpiryDelta?: (number|null); + + /** ChannelConfig forceCloseAvoidanceMaxFeeSatoshis */ + forceCloseAvoidanceMaxFeeSatoshis?: (number|Long|null); + + /** ChannelConfig acceptUnderpayingHtlcs */ + acceptUnderpayingHtlcs?: (boolean|null); + + /** ChannelConfig fixedLimitMsat */ + fixedLimitMsat?: (number|Long|null); + + /** ChannelConfig feeRateMultiplier */ + feeRateMultiplier?: (number|Long|null); + } + + /** Represents a ChannelConfig. */ + class ChannelConfig implements IChannelConfig { + + /** + * Constructs a new ChannelConfig. + * @param [properties] Properties to set + */ + constructor(properties?: types.IChannelConfig); + + /** ChannelConfig forwardingFeeProportionalMillionths. */ + public forwardingFeeProportionalMillionths: number; + + /** ChannelConfig forwardingFeeBaseMsat. */ + public forwardingFeeBaseMsat: number; + + /** ChannelConfig cltvExpiryDelta. */ + public cltvExpiryDelta: number; + + /** ChannelConfig forceCloseAvoidanceMaxFeeSatoshis. */ + public forceCloseAvoidanceMaxFeeSatoshis: (number|Long); + + /** ChannelConfig acceptUnderpayingHtlcs. */ + public acceptUnderpayingHtlcs: boolean; + + /** ChannelConfig fixedLimitMsat. */ + public fixedLimitMsat: (number|Long); + + /** ChannelConfig feeRateMultiplier. */ + public feeRateMultiplier: (number|Long); + + /** ChannelConfig maxDustHtlcExposure. */ + public maxDustHtlcExposure?: ("fixedLimitMsat"|"feeRateMultiplier"); + + /** + * 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 }; + } + + /** 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 }; + } + + /** Properties of a BestBlock. */ + interface IBestBlock { + + /** BestBlock blockHash */ + blockHash?: (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 blockHash. */ + public blockHash: 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 }; + } + + /** Properties of a LightningBalance. */ + interface ILightningBalance { + + /** LightningBalance claimableOnChannelClose */ + claimableOnChannelClose?: (types.IClaimableOnChannelClose|null); + + /** LightningBalance claimableAwaitingConfirmations */ + claimableAwaitingConfirmations?: (types.IClaimableAwaitingConfirmations|null); + + /** LightningBalance contentiousClaimable */ + contentiousClaimable?: (types.IContentiousClaimable|null); + + /** LightningBalance maybeTimeoutClaimableHtlc */ + maybeTimeoutClaimableHtlc?: (types.IMaybeTimeoutClaimableHTLC|null); + + /** LightningBalance maybePreimageClaimableHtlc */ + maybePreimageClaimableHtlc?: (types.IMaybePreimageClaimableHTLC|null); + + /** LightningBalance counterpartyRevokedOutputClaimable */ + counterpartyRevokedOutputClaimable?: (types.ICounterpartyRevokedOutputClaimable|null); + } + + /** Represents a LightningBalance. */ + class LightningBalance implements ILightningBalance { + + /** + * Constructs a new LightningBalance. + * @param [properties] Properties to set + */ + constructor(properties?: types.ILightningBalance); + + /** LightningBalance claimableOnChannelClose. */ + public claimableOnChannelClose?: (types.IClaimableOnChannelClose|null); + + /** LightningBalance claimableAwaitingConfirmations. */ + public claimableAwaitingConfirmations?: (types.IClaimableAwaitingConfirmations|null); + + /** LightningBalance contentiousClaimable. */ + public contentiousClaimable?: (types.IContentiousClaimable|null); + + /** LightningBalance maybeTimeoutClaimableHtlc. */ + public maybeTimeoutClaimableHtlc?: (types.IMaybeTimeoutClaimableHTLC|null); + + /** LightningBalance maybePreimageClaimableHtlc. */ + public maybePreimageClaimableHtlc?: (types.IMaybePreimageClaimableHTLC|null); + + /** LightningBalance counterpartyRevokedOutputClaimable. */ + public counterpartyRevokedOutputClaimable?: (types.ICounterpartyRevokedOutputClaimable|null); + + /** LightningBalance balanceType. */ + public balanceType?: ("claimableOnChannelClose"|"claimableAwaitingConfirmations"|"contentiousClaimable"|"maybeTimeoutClaimableHtlc"|"maybePreimageClaimableHtlc"|"counterpartyRevokedOutputClaimable"); + + /** + * 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 }; + } + + /** Properties of a ClaimableOnChannelClose. */ + interface IClaimableOnChannelClose { + + /** ClaimableOnChannelClose channelId */ + channelId?: (string|null); + + /** ClaimableOnChannelClose counterpartyNodeId */ + counterpartyNodeId?: (string|null); + + /** ClaimableOnChannelClose amountSatoshis */ + amountSatoshis?: (number|Long|null); + + /** ClaimableOnChannelClose transactionFeeSatoshis */ + transactionFeeSatoshis?: (number|Long|null); + + /** ClaimableOnChannelClose outboundPaymentHtlcRoundedMsat */ + outboundPaymentHtlcRoundedMsat?: (number|Long|null); + + /** ClaimableOnChannelClose outboundForwardedHtlcRoundedMsat */ + outboundForwardedHtlcRoundedMsat?: (number|Long|null); + + /** ClaimableOnChannelClose inboundClaimingHtlcRoundedMsat */ + inboundClaimingHtlcRoundedMsat?: (number|Long|null); + + /** ClaimableOnChannelClose inboundHtlcRoundedMsat */ + inboundHtlcRoundedMsat?: (number|Long|null); + } + + /** Represents a ClaimableOnChannelClose. */ + class ClaimableOnChannelClose implements IClaimableOnChannelClose { + + /** + * Constructs a new ClaimableOnChannelClose. + * @param [properties] Properties to set + */ + constructor(properties?: types.IClaimableOnChannelClose); + + /** ClaimableOnChannelClose channelId. */ + public channelId: string; + + /** ClaimableOnChannelClose counterpartyNodeId. */ + public counterpartyNodeId: string; + + /** ClaimableOnChannelClose amountSatoshis. */ + public amountSatoshis: (number|Long); + + /** ClaimableOnChannelClose transactionFeeSatoshis. */ + public transactionFeeSatoshis: (number|Long); + + /** ClaimableOnChannelClose outboundPaymentHtlcRoundedMsat. */ + public outboundPaymentHtlcRoundedMsat: (number|Long); + + /** ClaimableOnChannelClose outboundForwardedHtlcRoundedMsat. */ + public outboundForwardedHtlcRoundedMsat: (number|Long); + + /** ClaimableOnChannelClose inboundClaimingHtlcRoundedMsat. */ + public inboundClaimingHtlcRoundedMsat: (number|Long); + + /** ClaimableOnChannelClose inboundHtlcRoundedMsat. */ + public inboundHtlcRoundedMsat: (number|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 }; + } + + /** Properties of a ClaimableAwaitingConfirmations. */ + interface IClaimableAwaitingConfirmations { + + /** ClaimableAwaitingConfirmations channelId */ + channelId?: (string|null); + + /** ClaimableAwaitingConfirmations counterpartyNodeId */ + counterpartyNodeId?: (string|null); + + /** ClaimableAwaitingConfirmations amountSatoshis */ + amountSatoshis?: (number|Long|null); + + /** ClaimableAwaitingConfirmations confirmationHeight */ + confirmationHeight?: (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 channelId. */ + public channelId: string; + + /** ClaimableAwaitingConfirmations counterpartyNodeId. */ + public counterpartyNodeId: string; + + /** ClaimableAwaitingConfirmations amountSatoshis. */ + public amountSatoshis: (number|Long); + + /** ClaimableAwaitingConfirmations confirmationHeight. */ + public confirmationHeight: 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 }; + } + + /** BalanceSource enum. */ + enum BalanceSource { + HOLDER_FORCE_CLOSED = 0, + COUNTERPARTY_FORCE_CLOSED = 1, + COOP_CLOSE = 2, + HTLC = 3 + } + + /** Properties of a ContentiousClaimable. */ + interface IContentiousClaimable { + + /** ContentiousClaimable channelId */ + channelId?: (string|null); + + /** ContentiousClaimable counterpartyNodeId */ + counterpartyNodeId?: (string|null); + + /** ContentiousClaimable amountSatoshis */ + amountSatoshis?: (number|Long|null); + + /** ContentiousClaimable timeoutHeight */ + timeoutHeight?: (number|null); + + /** ContentiousClaimable paymentHash */ + paymentHash?: (string|null); + + /** ContentiousClaimable paymentPreimage */ + paymentPreimage?: (string|null); + } + + /** Represents a ContentiousClaimable. */ + class ContentiousClaimable implements IContentiousClaimable { + + /** + * Constructs a new ContentiousClaimable. + * @param [properties] Properties to set + */ + constructor(properties?: types.IContentiousClaimable); + + /** ContentiousClaimable channelId. */ + public channelId: string; + + /** ContentiousClaimable counterpartyNodeId. */ + public counterpartyNodeId: string; + + /** ContentiousClaimable amountSatoshis. */ + public amountSatoshis: (number|Long); + + /** ContentiousClaimable timeoutHeight. */ + public timeoutHeight: number; + + /** ContentiousClaimable paymentHash. */ + public paymentHash: string; + + /** ContentiousClaimable paymentPreimage. */ + public paymentPreimage: 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 }; + } + + /** Properties of a MaybeTimeoutClaimableHTLC. */ + interface IMaybeTimeoutClaimableHTLC { + + /** MaybeTimeoutClaimableHTLC channelId */ + channelId?: (string|null); + + /** MaybeTimeoutClaimableHTLC counterpartyNodeId */ + counterpartyNodeId?: (string|null); + + /** MaybeTimeoutClaimableHTLC amountSatoshis */ + amountSatoshis?: (number|Long|null); + + /** MaybeTimeoutClaimableHTLC claimableHeight */ + claimableHeight?: (number|null); + + /** MaybeTimeoutClaimableHTLC paymentHash */ + paymentHash?: (string|null); + + /** MaybeTimeoutClaimableHTLC outboundPayment */ + outboundPayment?: (boolean|null); + } + + /** Represents a MaybeTimeoutClaimableHTLC. */ + class MaybeTimeoutClaimableHTLC implements IMaybeTimeoutClaimableHTLC { + + /** + * Constructs a new MaybeTimeoutClaimableHTLC. + * @param [properties] Properties to set + */ + constructor(properties?: types.IMaybeTimeoutClaimableHTLC); + + /** MaybeTimeoutClaimableHTLC channelId. */ + public channelId: string; + + /** MaybeTimeoutClaimableHTLC counterpartyNodeId. */ + public counterpartyNodeId: string; + + /** MaybeTimeoutClaimableHTLC amountSatoshis. */ + public amountSatoshis: (number|Long); + + /** MaybeTimeoutClaimableHTLC claimableHeight. */ + public claimableHeight: number; + + /** MaybeTimeoutClaimableHTLC paymentHash. */ + public paymentHash: string; + + /** MaybeTimeoutClaimableHTLC outboundPayment. */ + public outboundPayment: 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 }; + } + + /** Properties of a MaybePreimageClaimableHTLC. */ + interface IMaybePreimageClaimableHTLC { + + /** MaybePreimageClaimableHTLC channelId */ + channelId?: (string|null); + + /** MaybePreimageClaimableHTLC counterpartyNodeId */ + counterpartyNodeId?: (string|null); + + /** MaybePreimageClaimableHTLC amountSatoshis */ + amountSatoshis?: (number|Long|null); + + /** MaybePreimageClaimableHTLC expiryHeight */ + expiryHeight?: (number|null); + + /** MaybePreimageClaimableHTLC paymentHash */ + paymentHash?: (string|null); + } + + /** Represents a MaybePreimageClaimableHTLC. */ + class MaybePreimageClaimableHTLC implements IMaybePreimageClaimableHTLC { + + /** + * Constructs a new MaybePreimageClaimableHTLC. + * @param [properties] Properties to set + */ + constructor(properties?: types.IMaybePreimageClaimableHTLC); + + /** MaybePreimageClaimableHTLC channelId. */ + public channelId: string; + + /** MaybePreimageClaimableHTLC counterpartyNodeId. */ + public counterpartyNodeId: string; + + /** MaybePreimageClaimableHTLC amountSatoshis. */ + public amountSatoshis: (number|Long); + + /** MaybePreimageClaimableHTLC expiryHeight. */ + public expiryHeight: number; + + /** MaybePreimageClaimableHTLC paymentHash. */ + public paymentHash: 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 }; + } + + /** Properties of a CounterpartyRevokedOutputClaimable. */ + interface ICounterpartyRevokedOutputClaimable { + + /** CounterpartyRevokedOutputClaimable channelId */ + channelId?: (string|null); + + /** CounterpartyRevokedOutputClaimable counterpartyNodeId */ + counterpartyNodeId?: (string|null); + + /** CounterpartyRevokedOutputClaimable amountSatoshis */ + amountSatoshis?: (number|Long|null); + } + + /** Represents a CounterpartyRevokedOutputClaimable. */ + class CounterpartyRevokedOutputClaimable implements ICounterpartyRevokedOutputClaimable { + + /** + * Constructs a new CounterpartyRevokedOutputClaimable. + * @param [properties] Properties to set + */ + constructor(properties?: types.ICounterpartyRevokedOutputClaimable); + + /** CounterpartyRevokedOutputClaimable channelId. */ + public channelId: string; + + /** CounterpartyRevokedOutputClaimable counterpartyNodeId. */ + public counterpartyNodeId: string; + + /** CounterpartyRevokedOutputClaimable amountSatoshis. */ + public amountSatoshis: (number|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 }; + } + + /** Properties of a PendingSweepBalance. */ + interface IPendingSweepBalance { + + /** PendingSweepBalance pendingBroadcast */ + pendingBroadcast?: (types.IPendingBroadcast|null); + + /** PendingSweepBalance broadcastAwaitingConfirmation */ + broadcastAwaitingConfirmation?: (types.IBroadcastAwaitingConfirmation|null); + + /** PendingSweepBalance awaitingThresholdConfirmations */ + awaitingThresholdConfirmations?: (types.IAwaitingThresholdConfirmations|null); + } + + /** Represents a PendingSweepBalance. */ + class PendingSweepBalance implements IPendingSweepBalance { + + /** + * Constructs a new PendingSweepBalance. + * @param [properties] Properties to set + */ + constructor(properties?: types.IPendingSweepBalance); + + /** PendingSweepBalance pendingBroadcast. */ + public pendingBroadcast?: (types.IPendingBroadcast|null); + + /** PendingSweepBalance broadcastAwaitingConfirmation. */ + public broadcastAwaitingConfirmation?: (types.IBroadcastAwaitingConfirmation|null); + + /** PendingSweepBalance awaitingThresholdConfirmations. */ + public awaitingThresholdConfirmations?: (types.IAwaitingThresholdConfirmations|null); + + /** PendingSweepBalance balanceType. */ + public balanceType?: ("pendingBroadcast"|"broadcastAwaitingConfirmation"|"awaitingThresholdConfirmations"); + + /** + * 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 }; + } + + /** Properties of a PendingBroadcast. */ + interface IPendingBroadcast { + + /** PendingBroadcast channelId */ + channelId?: (string|null); + + /** PendingBroadcast amountSatoshis */ + amountSatoshis?: (number|Long|null); + } + + /** Represents a PendingBroadcast. */ + class PendingBroadcast implements IPendingBroadcast { + + /** + * Constructs a new PendingBroadcast. + * @param [properties] Properties to set + */ + constructor(properties?: types.IPendingBroadcast); + + /** PendingBroadcast channelId. */ + public channelId: string; + + /** PendingBroadcast amountSatoshis. */ + public amountSatoshis: (number|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 }; + } + + /** Properties of a BroadcastAwaitingConfirmation. */ + interface IBroadcastAwaitingConfirmation { + + /** BroadcastAwaitingConfirmation channelId */ + channelId?: (string|null); + + /** BroadcastAwaitingConfirmation latestBroadcastHeight */ + latestBroadcastHeight?: (number|null); + + /** BroadcastAwaitingConfirmation latestSpendingTxid */ + latestSpendingTxid?: (string|null); + + /** BroadcastAwaitingConfirmation amountSatoshis */ + amountSatoshis?: (number|Long|null); + } + + /** Represents a BroadcastAwaitingConfirmation. */ + class BroadcastAwaitingConfirmation implements IBroadcastAwaitingConfirmation { + + /** + * Constructs a new BroadcastAwaitingConfirmation. + * @param [properties] Properties to set + */ + constructor(properties?: types.IBroadcastAwaitingConfirmation); + + /** BroadcastAwaitingConfirmation channelId. */ + public channelId: string; + + /** BroadcastAwaitingConfirmation latestBroadcastHeight. */ + public latestBroadcastHeight: number; + + /** BroadcastAwaitingConfirmation latestSpendingTxid. */ + public latestSpendingTxid: string; + + /** BroadcastAwaitingConfirmation amountSatoshis. */ + public amountSatoshis: (number|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 }; + } + + /** Properties of an AwaitingThresholdConfirmations. */ + interface IAwaitingThresholdConfirmations { + + /** AwaitingThresholdConfirmations channelId */ + channelId?: (string|null); + + /** AwaitingThresholdConfirmations latestSpendingTxid */ + latestSpendingTxid?: (string|null); + + /** AwaitingThresholdConfirmations confirmationHash */ + confirmationHash?: (string|null); + + /** AwaitingThresholdConfirmations confirmationHeight */ + confirmationHeight?: (number|null); + + /** AwaitingThresholdConfirmations amountSatoshis */ + amountSatoshis?: (number|Long|null); + } + + /** Represents an AwaitingThresholdConfirmations. */ + class AwaitingThresholdConfirmations implements IAwaitingThresholdConfirmations { + + /** + * Constructs a new AwaitingThresholdConfirmations. + * @param [properties] Properties to set + */ + constructor(properties?: types.IAwaitingThresholdConfirmations); + + /** AwaitingThresholdConfirmations channelId. */ + public channelId: string; + + /** AwaitingThresholdConfirmations latestSpendingTxid. */ + public latestSpendingTxid: string; + + /** AwaitingThresholdConfirmations confirmationHash. */ + public confirmationHash: string; + + /** AwaitingThresholdConfirmations confirmationHeight. */ + public confirmationHeight: number; + + /** AwaitingThresholdConfirmations amountSatoshis. */ + public amountSatoshis: (number|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 }; + } + + /** Properties of a PageToken. */ + interface IPageToken { + + /** PageToken token */ + token?: (string|null); + + /** PageToken index */ + index?: (number|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: (number|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 }; + } + + /** 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; + + /** Bolt11InvoiceDescription hash. */ + public hash: string; + + /** 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 }; + } + + /** Properties of a RouteParametersConfig. */ + interface IRouteParametersConfig { + + /** RouteParametersConfig maxTotalRoutingFeeMsat */ + maxTotalRoutingFeeMsat?: (number|Long|null); + + /** RouteParametersConfig maxTotalCltvExpiryDelta */ + maxTotalCltvExpiryDelta?: (number|null); + + /** RouteParametersConfig maxPathCount */ + maxPathCount?: (number|null); + + /** RouteParametersConfig maxChannelSaturationPowerOfHalf */ + maxChannelSaturationPowerOfHalf?: (number|null); + } + + /** Represents a RouteParametersConfig. */ + class RouteParametersConfig implements IRouteParametersConfig { + + /** + * Constructs a new RouteParametersConfig. + * @param [properties] Properties to set + */ + constructor(properties?: types.IRouteParametersConfig); + + /** RouteParametersConfig maxTotalRoutingFeeMsat. */ + public maxTotalRoutingFeeMsat: (number|Long); + + /** RouteParametersConfig maxTotalCltvExpiryDelta. */ + public maxTotalCltvExpiryDelta: number; + + /** RouteParametersConfig maxPathCount. */ + public maxPathCount: number; + + /** RouteParametersConfig maxChannelSaturationPowerOfHalf. */ + public maxChannelSaturationPowerOfHalf: 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 }; + } + + /** Properties of a GraphRoutingFees. */ + interface IGraphRoutingFees { + + /** GraphRoutingFees baseMsat */ + baseMsat?: (number|null); + + /** GraphRoutingFees proportionalMillionths */ + proportionalMillionths?: (number|null); + } + + /** Represents a GraphRoutingFees. */ + class GraphRoutingFees implements IGraphRoutingFees { + + /** + * Constructs a new GraphRoutingFees. + * @param [properties] Properties to set + */ + constructor(properties?: types.IGraphRoutingFees); + + /** GraphRoutingFees baseMsat. */ + public baseMsat: number; + + /** GraphRoutingFees proportionalMillionths. */ + public proportionalMillionths: 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 }; + } + + /** Properties of a GraphChannelUpdate. */ + interface IGraphChannelUpdate { + + /** GraphChannelUpdate lastUpdate */ + lastUpdate?: (number|null); + + /** GraphChannelUpdate enabled */ + enabled?: (boolean|null); + + /** GraphChannelUpdate cltvExpiryDelta */ + cltvExpiryDelta?: (number|null); + + /** GraphChannelUpdate htlcMinimumMsat */ + htlcMinimumMsat?: (number|Long|null); + + /** GraphChannelUpdate htlcMaximumMsat */ + htlcMaximumMsat?: (number|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 lastUpdate. */ + public lastUpdate: number; + + /** GraphChannelUpdate enabled. */ + public enabled: boolean; + + /** GraphChannelUpdate cltvExpiryDelta. */ + public cltvExpiryDelta: number; + + /** GraphChannelUpdate htlcMinimumMsat. */ + public htlcMinimumMsat: (number|Long); + + /** GraphChannelUpdate htlcMaximumMsat. */ + public htlcMaximumMsat: (number|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 }; + } + + /** Properties of a GraphChannel. */ + interface IGraphChannel { + + /** GraphChannel nodeOne */ + nodeOne?: (string|null); + + /** GraphChannel nodeTwo */ + nodeTwo?: (string|null); + + /** GraphChannel capacitySats */ + capacitySats?: (number|Long|null); + + /** GraphChannel oneToTwo */ + oneToTwo?: (types.IGraphChannelUpdate|null); + + /** GraphChannel twoToOne */ + twoToOne?: (types.IGraphChannelUpdate|null); + } + + /** Represents a GraphChannel. */ + class GraphChannel implements IGraphChannel { + + /** + * Constructs a new GraphChannel. + * @param [properties] Properties to set + */ + constructor(properties?: types.IGraphChannel); + + /** GraphChannel nodeOne. */ + public nodeOne: string; + + /** GraphChannel nodeTwo. */ + public nodeTwo: string; + + /** GraphChannel capacitySats. */ + public capacitySats: (number|Long); + + /** GraphChannel oneToTwo. */ + public oneToTwo?: (types.IGraphChannelUpdate|null); + + /** GraphChannel twoToOne. */ + public twoToOne?: (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 }; + } + + /** Properties of a GraphNodeAnnouncement. */ + interface IGraphNodeAnnouncement { + + /** GraphNodeAnnouncement lastUpdate */ + lastUpdate?: (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 lastUpdate. */ + public lastUpdate: 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 }; + } + + /** Properties of a Peer. */ + interface IPeer { + + /** Peer nodeId */ + nodeId?: (string|null); + + /** Peer address */ + address?: (string|null); + + /** Peer isPersisted */ + isPersisted?: (boolean|null); + + /** Peer isConnected */ + isConnected?: (boolean|null); + } + + /** Represents a Peer. */ + class Peer implements IPeer { + + /** + * Constructs a new Peer. + * @param [properties] Properties to set + */ + constructor(properties?: types.IPeer); + + /** Peer nodeId. */ + public nodeId: string; + + /** Peer address. */ + public address: string; + + /** Peer isPersisted. */ + public isPersisted: boolean; + + /** Peer isConnected. */ + public isConnected: 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 }; + } + + /** Properties of a GraphNode. */ + interface IGraphNode { + + /** GraphNode channels */ + channels?: ((number|Long)[]|null); + + /** GraphNode announcementInfo */ + announcementInfo?: (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: (number|Long)[]; + + /** GraphNode announcementInfo. */ + public announcementInfo?: (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 }; + } + + /** Properties of a Bolt11RouteHint. */ + interface IBolt11RouteHint { + + /** Bolt11RouteHint hopHints */ + hopHints?: (types.IBolt11HopHint[]|null); + } + + /** Represents a Bolt11RouteHint. */ + class Bolt11RouteHint implements IBolt11RouteHint { + + /** + * Constructs a new Bolt11RouteHint. + * @param [properties] Properties to set + */ + constructor(properties?: types.IBolt11RouteHint); + + /** Bolt11RouteHint hopHints. */ + public hopHints: 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 }; + } + + /** Properties of a Bolt11HopHint. */ + interface IBolt11HopHint { + + /** Bolt11HopHint nodeId */ + nodeId?: (string|null); + + /** Bolt11HopHint shortChannelId */ + shortChannelId?: (number|Long|null); + + /** Bolt11HopHint feeBaseMsat */ + feeBaseMsat?: (number|null); + + /** Bolt11HopHint feeProportionalMillionths */ + feeProportionalMillionths?: (number|null); + + /** Bolt11HopHint cltvExpiryDelta */ + cltvExpiryDelta?: (number|null); + } + + /** Represents a Bolt11HopHint. */ + class Bolt11HopHint implements IBolt11HopHint { + + /** + * Constructs a new Bolt11HopHint. + * @param [properties] Properties to set + */ + constructor(properties?: types.IBolt11HopHint); + + /** Bolt11HopHint nodeId. */ + public nodeId: string; + + /** Bolt11HopHint shortChannelId. */ + public shortChannelId: (number|Long); + + /** Bolt11HopHint feeBaseMsat. */ + public feeBaseMsat: number; + + /** Bolt11HopHint feeProportionalMillionths. */ + public feeProportionalMillionths: number; + + /** Bolt11HopHint cltvExpiryDelta. */ + public cltvExpiryDelta: 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 }; + } + + /** Properties of an OfferAmount. */ + interface IOfferAmount { + + /** OfferAmount bitcoinAmountMsats */ + bitcoinAmountMsats?: (number|Long|null); + + /** OfferAmount currencyAmount */ + currencyAmount?: (types.ICurrencyAmount|null); + } + + /** Represents an OfferAmount. */ + class OfferAmount implements IOfferAmount { + + /** + * Constructs a new OfferAmount. + * @param [properties] Properties to set + */ + constructor(properties?: types.IOfferAmount); + + /** OfferAmount bitcoinAmountMsats. */ + public bitcoinAmountMsats: (number|Long); + + /** OfferAmount currencyAmount. */ + public currencyAmount?: (types.ICurrencyAmount|null); + + /** OfferAmount amount. */ + public amount?: ("bitcoinAmountMsats"|"currencyAmount"); + + /** + * 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 }; + } + + /** Properties of a CurrencyAmount. */ + interface ICurrencyAmount { + + /** CurrencyAmount iso4217Code */ + iso4217Code?: (string|null); + + /** CurrencyAmount amount */ + amount?: (number|Long|null); + } + + /** Represents a CurrencyAmount. */ + class CurrencyAmount implements ICurrencyAmount { + + /** + * Constructs a new CurrencyAmount. + * @param [properties] Properties to set + */ + constructor(properties?: types.ICurrencyAmount); + + /** CurrencyAmount iso4217Code. */ + public iso4217Code: string; + + /** CurrencyAmount amount. */ + public amount: (number|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 }; + } + + /** Properties of an OfferQuantity. */ + interface IOfferQuantity { + + /** OfferQuantity one */ + one?: (boolean|null); + + /** OfferQuantity bounded */ + bounded?: (number|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; + + /** OfferQuantity bounded. */ + public bounded: (number|Long); + + /** OfferQuantity unbounded. */ + public unbounded: boolean; + + /** 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 }; + } + + /** Properties of a BlindedPath. */ + interface IBlindedPath { + + /** BlindedPath nodeId */ + nodeId?: (string|null); + + /** BlindedPath directedScid */ + directedScid?: (types.IDirectedShortChannelId|null); + + /** BlindedPath blindingPoint */ + blindingPoint?: (string|null); + + /** BlindedPath numHops */ + numHops?: (number|null); + } + + /** Represents a BlindedPath. */ + class BlindedPath implements IBlindedPath { + + /** + * Constructs a new BlindedPath. + * @param [properties] Properties to set + */ + constructor(properties?: types.IBlindedPath); + + /** BlindedPath nodeId. */ + public nodeId: string; + + /** BlindedPath directedScid. */ + public directedScid?: (types.IDirectedShortChannelId|null); + + /** BlindedPath blindingPoint. */ + public blindingPoint: string; + + /** BlindedPath numHops. */ + public numHops: number; + + /** BlindedPath introductionNode. */ + public introductionNode?: ("nodeId"|"directedScid"); + + /** + * 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 }; + } + + /** Properties of a DirectedShortChannelId. */ + interface IDirectedShortChannelId { + + /** DirectedShortChannelId scid */ + scid?: (number|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: (number|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 }; + } + + /** ChannelDirection enum. */ + enum ChannelDirection { + NODE_ONE = 0, + NODE_TWO = 1 + } + + /** Properties of a Bolt11Feature. */ + interface IBolt11Feature { + + /** Bolt11Feature name */ + name?: (string|null); + + /** Bolt11Feature isRequired */ + isRequired?: (boolean|null); + + /** Bolt11Feature isKnown */ + isKnown?: (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 isRequired. */ + public isRequired: boolean; + + /** Bolt11Feature isKnown. */ + public isKnown: 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 }; + } +} + +/** Namespace events. */ +export namespace events { + + /** Properties of an EventEnvelope. */ + interface IEventEnvelope { + + /** EventEnvelope paymentReceived */ + paymentReceived?: (events.IPaymentReceived|null); + + /** EventEnvelope paymentSuccessful */ + paymentSuccessful?: (events.IPaymentSuccessful|null); + + /** EventEnvelope paymentFailed */ + paymentFailed?: (events.IPaymentFailed|null); + + /** EventEnvelope paymentForwarded */ + paymentForwarded?: (events.IPaymentForwarded|null); + + /** EventEnvelope paymentClaimable */ + paymentClaimable?: (events.IPaymentClaimable|null); + + /** EventEnvelope channelStateChanged */ + channelStateChanged?: (events.IChannelStateChanged|null); + } + + /** Represents an EventEnvelope. */ + class EventEnvelope implements IEventEnvelope { + + /** + * Constructs a new EventEnvelope. + * @param [properties] Properties to set + */ + constructor(properties?: events.IEventEnvelope); + + /** EventEnvelope paymentReceived. */ + public paymentReceived?: (events.IPaymentReceived|null); + + /** EventEnvelope paymentSuccessful. */ + public paymentSuccessful?: (events.IPaymentSuccessful|null); + + /** EventEnvelope paymentFailed. */ + public paymentFailed?: (events.IPaymentFailed|null); + + /** EventEnvelope paymentForwarded. */ + public paymentForwarded?: (events.IPaymentForwarded|null); + + /** EventEnvelope paymentClaimable. */ + public paymentClaimable?: (events.IPaymentClaimable|null); + + /** EventEnvelope channelStateChanged. */ + public channelStateChanged?: (events.IChannelStateChanged|null); + + /** EventEnvelope event. */ + public event?: ("paymentReceived"|"paymentSuccessful"|"paymentFailed"|"paymentForwarded"|"paymentClaimable"|"channelStateChanged"); + + /** + * 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 }; + } + + /** 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 peerMsg */ + peerMsg?: (string|null); + } + + /** Represents a CounterpartyForceClosedDetails. */ + class CounterpartyForceClosedDetails implements ICounterpartyForceClosedDetails { + + /** + * Constructs a new CounterpartyForceClosedDetails. + * @param [properties] Properties to set + */ + constructor(properties?: events.ICounterpartyForceClosedDetails); + + /** CounterpartyForceClosedDetails peerMsg. */ + public peerMsg: 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 }; + } + + /** Properties of a HolderForceClosedDetails. */ + interface IHolderForceClosedDetails { + + /** HolderForceClosedDetails broadcastedLatestTxn */ + broadcastedLatestTxn?: (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 broadcastedLatestTxn. */ + public broadcastedLatestTxn: boolean; + + /** 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 }; + } + + /** 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 }; + } + + /** Properties of a HtlcsTimedOutDetails. */ + interface IHtlcsTimedOutDetails { + + /** HtlcsTimedOutDetails paymentHash */ + paymentHash?: (string|null); + } + + /** Represents a HtlcsTimedOutDetails. */ + class HtlcsTimedOutDetails implements IHtlcsTimedOutDetails { + + /** + * Constructs a new HtlcsTimedOutDetails. + * @param [properties] Properties to set + */ + constructor(properties?: events.IHtlcsTimedOutDetails); + + /** HtlcsTimedOutDetails paymentHash. */ + public paymentHash: string; + + /** + * 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 }; + } + + /** Properties of a PeerFeerateTooLowDetails. */ + interface IPeerFeerateTooLowDetails { + + /** PeerFeerateTooLowDetails peerFeerateSatPerKw */ + peerFeerateSatPerKw?: (number|null); + + /** PeerFeerateTooLowDetails requiredFeerateSatPerKw */ + requiredFeerateSatPerKw?: (number|null); + } + + /** Represents a PeerFeerateTooLowDetails. */ + class PeerFeerateTooLowDetails implements IPeerFeerateTooLowDetails { + + /** + * Constructs a new PeerFeerateTooLowDetails. + * @param [properties] Properties to set + */ + constructor(properties?: events.IPeerFeerateTooLowDetails); + + /** PeerFeerateTooLowDetails peerFeerateSatPerKw. */ + public peerFeerateSatPerKw: number; + + /** PeerFeerateTooLowDetails requiredFeerateSatPerKw. */ + public requiredFeerateSatPerKw: 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 }; + } + + /** Properties of a ChannelStateChangeReason. */ + interface IChannelStateChangeReason { + + /** ChannelStateChangeReason kind */ + kind?: (events.ChannelStateChangeReasonKind|null); + + /** ChannelStateChangeReason message */ + message?: (string|null); + + /** ChannelStateChangeReason counterpartyForceClosed */ + counterpartyForceClosed?: (events.ICounterpartyForceClosedDetails|null); + + /** ChannelStateChangeReason holderForceClosed */ + holderForceClosed?: (events.IHolderForceClosedDetails|null); + + /** ChannelStateChangeReason processingError */ + processingError?: (events.IProcessingErrorDetails|null); + + /** ChannelStateChangeReason htlcsTimedOut */ + htlcsTimedOut?: (events.IHtlcsTimedOutDetails|null); + + /** ChannelStateChangeReason peerFeerateTooLow */ + peerFeerateTooLow?: (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 counterpartyForceClosed. */ + public counterpartyForceClosed?: (events.ICounterpartyForceClosedDetails|null); + + /** ChannelStateChangeReason holderForceClosed. */ + public holderForceClosed?: (events.IHolderForceClosedDetails|null); + + /** ChannelStateChangeReason processingError. */ + public processingError?: (events.IProcessingErrorDetails|null); + + /** ChannelStateChangeReason htlcsTimedOut. */ + public htlcsTimedOut?: (events.IHtlcsTimedOutDetails|null); + + /** ChannelStateChangeReason peerFeerateTooLow. */ + public peerFeerateTooLow?: (events.IPeerFeerateTooLowDetails|null); + + /** ChannelStateChangeReason details. */ + public details?: ("counterpartyForceClosed"|"holderForceClosed"|"processingError"|"htlcsTimedOut"|"peerFeerateTooLow"); + + /** + * 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 }; + } + + /** Properties of a ChannelStateChanged. */ + interface IChannelStateChanged { + + /** ChannelStateChanged channelId */ + channelId?: (string|null); + + /** ChannelStateChanged userChannelId */ + userChannelId?: (string|null); + + /** ChannelStateChanged counterpartyNodeId */ + counterpartyNodeId?: (string|null); + + /** ChannelStateChanged state */ + state?: (events.ChannelState|null); + + /** ChannelStateChanged fundingTxo */ + fundingTxo?: (string|null); + + /** ChannelStateChanged reason */ + reason?: (events.IChannelStateChangeReason|null); + + /** ChannelStateChanged closureInitiator */ + closureInitiator?: (events.ChannelClosureInitiator|null); + } + + /** Represents a ChannelStateChanged. */ + class ChannelStateChanged implements IChannelStateChanged { + + /** + * Constructs a new ChannelStateChanged. + * @param [properties] Properties to set + */ + constructor(properties?: events.IChannelStateChanged); + + /** ChannelStateChanged channelId. */ + public channelId: string; + + /** ChannelStateChanged userChannelId. */ + public userChannelId: string; + + /** ChannelStateChanged counterpartyNodeId. */ + public counterpartyNodeId: string; + + /** ChannelStateChanged state. */ + public state: events.ChannelState; + + /** ChannelStateChanged fundingTxo. */ + public fundingTxo: string; + + /** ChannelStateChanged reason. */ + public reason?: (events.IChannelStateChangeReason|null); + + /** ChannelStateChanged closureInitiator. */ + public closureInitiator: 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** Properties of a PaymentForwarded. */ + interface IPaymentForwarded { + + /** PaymentForwarded forwardedPayment */ + forwardedPayment?: (types.IForwardedPayment|null); + } + + /** Represents a PaymentForwarded. */ + class PaymentForwarded implements IPaymentForwarded { + + /** + * Constructs a new PaymentForwarded. + * @param [properties] Properties to set + */ + constructor(properties?: events.IPaymentForwarded); + + /** PaymentForwarded forwardedPayment. */ + public forwardedPayment?: (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 }; + } +} + +/** Namespace error. */ +export namespace error { + + /** Properties of an ErrorResponse. */ + interface IErrorResponse { + + /** ErrorResponse message */ + message?: (string|null); + + /** ErrorResponse errorCode */ + errorCode?: (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 errorCode. */ + public errorCode: 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 }; + } + + /** ErrorCode enum. */ + enum ErrorCode { + UNKNOWN_ERROR = 0, + INVALID_REQUEST_ERROR = 1, + AUTH_ERROR = 2, + LIGHTNING_ERROR = 3, + INTERNAL_SERVER_ERROR = 4 + } +} diff --git a/src/server/modules/node/ldk-server/proto/ldk-server.js b/src/server/modules/node/ldk-server/proto/ldk-server.js new file mode 100644 index 000000000..8ac4b33fe --- /dev/null +++ b/src/server/modules/node/ldk-server/proto/ldk-server.js @@ -0,0 +1,34366 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +"use strict"; + +var $protobuf = require("@apollo/protobufjs/minimal"); + +// Common aliases +var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + +// Exported root namespace +var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + +$root.api = (function() { + + /** + * Namespace api. + * @exports api + * @namespace + */ + var 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GetNodeInfoRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.GetNodeInfoRequest) + return object; + 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); + }; + + return GetNodeInfoRequest; + })(); + + api.GetNodeInfoResponse = (function() { + + /** + * Properties of a GetNodeInfoResponse. + * @memberof api + * @interface IGetNodeInfoResponse + * @property {string|null} [nodeId] GetNodeInfoResponse nodeId + * @property {types.IBestBlock|null} [currentBestBlock] GetNodeInfoResponse currentBestBlock + * @property {number|Long|null} [latestLightningWalletSyncTimestamp] GetNodeInfoResponse latestLightningWalletSyncTimestamp + * @property {number|Long|null} [latestOnchainWalletSyncTimestamp] GetNodeInfoResponse latestOnchainWalletSyncTimestamp + * @property {number|Long|null} [latestFeeRateCacheUpdateTimestamp] GetNodeInfoResponse latestFeeRateCacheUpdateTimestamp + * @property {number|Long|null} [latestRgsSnapshotTimestamp] GetNodeInfoResponse latestRgsSnapshotTimestamp + * @property {number|Long|null} [latestNodeAnnouncementBroadcastTimestamp] GetNodeInfoResponse latestNodeAnnouncementBroadcastTimestamp + * @property {Array.|null} [listeningAddresses] GetNodeInfoResponse listeningAddresses + * @property {Array.|null} [announcementAddresses] GetNodeInfoResponse announcementAddresses + * @property {string|null} [nodeAlias] GetNodeInfoResponse nodeAlias + * @property {Array.|null} [nodeUris] GetNodeInfoResponse nodeUris + * @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.listeningAddresses = []; + this.announcementAddresses = []; + this.nodeUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetNodeInfoResponse nodeId. + * @member {string} nodeId + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.nodeId = ""; + + /** + * GetNodeInfoResponse currentBestBlock. + * @member {types.IBestBlock|null|undefined} currentBestBlock + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.currentBestBlock = null; + + /** + * GetNodeInfoResponse latestLightningWalletSyncTimestamp. + * @member {number|Long} latestLightningWalletSyncTimestamp + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.latestLightningWalletSyncTimestamp = 0; + + /** + * GetNodeInfoResponse latestOnchainWalletSyncTimestamp. + * @member {number|Long} latestOnchainWalletSyncTimestamp + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.latestOnchainWalletSyncTimestamp = 0; + + /** + * GetNodeInfoResponse latestFeeRateCacheUpdateTimestamp. + * @member {number|Long} latestFeeRateCacheUpdateTimestamp + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.latestFeeRateCacheUpdateTimestamp = 0; + + /** + * GetNodeInfoResponse latestRgsSnapshotTimestamp. + * @member {number|Long} latestRgsSnapshotTimestamp + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.latestRgsSnapshotTimestamp = 0; + + /** + * GetNodeInfoResponse latestNodeAnnouncementBroadcastTimestamp. + * @member {number|Long} latestNodeAnnouncementBroadcastTimestamp + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.latestNodeAnnouncementBroadcastTimestamp = 0; + + /** + * GetNodeInfoResponse listeningAddresses. + * @member {Array.} listeningAddresses + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.listeningAddresses = $util.emptyArray; + + /** + * GetNodeInfoResponse announcementAddresses. + * @member {Array.} announcementAddresses + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.announcementAddresses = $util.emptyArray; + + /** + * GetNodeInfoResponse nodeAlias. + * @member {string} nodeAlias + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.nodeAlias = ""; + + /** + * GetNodeInfoResponse nodeUris. + * @member {Array.} nodeUris + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.nodeUris = $util.emptyArray; + + /** + * GetNodeInfoResponse network. + * @member {types.Network} network + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.network = 0; + + /** + * 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.nodeId != null && Object.hasOwnProperty.call(message, "nodeId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeId); + if (message.currentBestBlock != null && Object.hasOwnProperty.call(message, "currentBestBlock")) + $root.types.BestBlock.encode(message.currentBestBlock, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.latestLightningWalletSyncTimestamp != null && Object.hasOwnProperty.call(message, "latestLightningWalletSyncTimestamp")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.latestLightningWalletSyncTimestamp); + if (message.latestOnchainWalletSyncTimestamp != null && Object.hasOwnProperty.call(message, "latestOnchainWalletSyncTimestamp")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.latestOnchainWalletSyncTimestamp); + if (message.latestFeeRateCacheUpdateTimestamp != null && Object.hasOwnProperty.call(message, "latestFeeRateCacheUpdateTimestamp")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.latestFeeRateCacheUpdateTimestamp); + if (message.latestRgsSnapshotTimestamp != null && Object.hasOwnProperty.call(message, "latestRgsSnapshotTimestamp")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.latestRgsSnapshotTimestamp); + if (message.latestNodeAnnouncementBroadcastTimestamp != null && Object.hasOwnProperty.call(message, "latestNodeAnnouncementBroadcastTimestamp")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.latestNodeAnnouncementBroadcastTimestamp); + if (message.listeningAddresses != null && message.listeningAddresses.length) + for (var i = 0; i < message.listeningAddresses.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.listeningAddresses[i]); + if (message.announcementAddresses != null && message.announcementAddresses.length) + for (var i = 0; i < message.announcementAddresses.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.announcementAddresses[i]); + if (message.nodeAlias != null && Object.hasOwnProperty.call(message, "nodeAlias")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.nodeAlias); + if (message.nodeUris != null && message.nodeUris.length) + for (var i = 0; i < message.nodeUris.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.nodeUris[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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GetNodeInfoResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nodeId = reader.string(); + break; + case 3: + message.currentBestBlock = $root.types.BestBlock.decode(reader, reader.uint32()); + break; + case 4: + message.latestLightningWalletSyncTimestamp = reader.uint64(); + break; + case 5: + message.latestOnchainWalletSyncTimestamp = reader.uint64(); + break; + case 6: + message.latestFeeRateCacheUpdateTimestamp = reader.uint64(); + break; + case 7: + message.latestRgsSnapshotTimestamp = reader.uint64(); + break; + case 8: + message.latestNodeAnnouncementBroadcastTimestamp = reader.uint64(); + break; + case 9: + if (!(message.listeningAddresses && message.listeningAddresses.length)) + message.listeningAddresses = []; + message.listeningAddresses.push(reader.string()); + break; + case 10: + if (!(message.announcementAddresses && message.announcementAddresses.length)) + message.announcementAddresses = []; + message.announcementAddresses.push(reader.string()); + break; + case 11: + message.nodeAlias = reader.string(); + break; + case 12: + if (!(message.nodeUris && message.nodeUris.length)) + message.nodeUris = []; + message.nodeUris.push(reader.string()); + break; + case 13: + message.network = reader.int32(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + if (!$util.isString(message.nodeId)) + return "nodeId: string expected"; + if (message.currentBestBlock != null && message.hasOwnProperty("currentBestBlock")) { + var error = $root.types.BestBlock.verify(message.currentBestBlock); + if (error) + return "currentBestBlock." + error; + } + if (message.latestLightningWalletSyncTimestamp != null && message.hasOwnProperty("latestLightningWalletSyncTimestamp")) + if (!$util.isInteger(message.latestLightningWalletSyncTimestamp) && !(message.latestLightningWalletSyncTimestamp && $util.isInteger(message.latestLightningWalletSyncTimestamp.low) && $util.isInteger(message.latestLightningWalletSyncTimestamp.high))) + return "latestLightningWalletSyncTimestamp: integer|Long expected"; + if (message.latestOnchainWalletSyncTimestamp != null && message.hasOwnProperty("latestOnchainWalletSyncTimestamp")) + if (!$util.isInteger(message.latestOnchainWalletSyncTimestamp) && !(message.latestOnchainWalletSyncTimestamp && $util.isInteger(message.latestOnchainWalletSyncTimestamp.low) && $util.isInteger(message.latestOnchainWalletSyncTimestamp.high))) + return "latestOnchainWalletSyncTimestamp: integer|Long expected"; + if (message.latestFeeRateCacheUpdateTimestamp != null && message.hasOwnProperty("latestFeeRateCacheUpdateTimestamp")) + if (!$util.isInteger(message.latestFeeRateCacheUpdateTimestamp) && !(message.latestFeeRateCacheUpdateTimestamp && $util.isInteger(message.latestFeeRateCacheUpdateTimestamp.low) && $util.isInteger(message.latestFeeRateCacheUpdateTimestamp.high))) + return "latestFeeRateCacheUpdateTimestamp: integer|Long expected"; + if (message.latestRgsSnapshotTimestamp != null && message.hasOwnProperty("latestRgsSnapshotTimestamp")) + if (!$util.isInteger(message.latestRgsSnapshotTimestamp) && !(message.latestRgsSnapshotTimestamp && $util.isInteger(message.latestRgsSnapshotTimestamp.low) && $util.isInteger(message.latestRgsSnapshotTimestamp.high))) + return "latestRgsSnapshotTimestamp: integer|Long expected"; + if (message.latestNodeAnnouncementBroadcastTimestamp != null && message.hasOwnProperty("latestNodeAnnouncementBroadcastTimestamp")) + if (!$util.isInteger(message.latestNodeAnnouncementBroadcastTimestamp) && !(message.latestNodeAnnouncementBroadcastTimestamp && $util.isInteger(message.latestNodeAnnouncementBroadcastTimestamp.low) && $util.isInteger(message.latestNodeAnnouncementBroadcastTimestamp.high))) + return "latestNodeAnnouncementBroadcastTimestamp: integer|Long expected"; + if (message.listeningAddresses != null && message.hasOwnProperty("listeningAddresses")) { + if (!Array.isArray(message.listeningAddresses)) + return "listeningAddresses: array expected"; + for (var i = 0; i < message.listeningAddresses.length; ++i) + if (!$util.isString(message.listeningAddresses[i])) + return "listeningAddresses: string[] expected"; + } + if (message.announcementAddresses != null && message.hasOwnProperty("announcementAddresses")) { + if (!Array.isArray(message.announcementAddresses)) + return "announcementAddresses: array expected"; + for (var i = 0; i < message.announcementAddresses.length; ++i) + if (!$util.isString(message.announcementAddresses[i])) + return "announcementAddresses: string[] expected"; + } + if (message.nodeAlias != null && message.hasOwnProperty("nodeAlias")) + if (!$util.isString(message.nodeAlias)) + return "nodeAlias: string expected"; + if (message.nodeUris != null && message.hasOwnProperty("nodeUris")) { + if (!Array.isArray(message.nodeUris)) + return "nodeUris: array expected"; + for (var i = 0; i < message.nodeUris.length; ++i) + if (!$util.isString(message.nodeUris[i])) + return "nodeUris: 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) { + if (object instanceof $root.api.GetNodeInfoResponse) + return object; + var message = new $root.api.GetNodeInfoResponse(); + if (object.nodeId != null) + message.nodeId = String(object.nodeId); + if (object.currentBestBlock != null) { + if (typeof object.currentBestBlock !== "object") + throw TypeError(".api.GetNodeInfoResponse.currentBestBlock: object expected"); + message.currentBestBlock = $root.types.BestBlock.fromObject(object.currentBestBlock); + } + if (object.latestLightningWalletSyncTimestamp != null) + if ($util.Long) + (message.latestLightningWalletSyncTimestamp = $util.Long.fromValue(object.latestLightningWalletSyncTimestamp)).unsigned = true; + else if (typeof object.latestLightningWalletSyncTimestamp === "string") + message.latestLightningWalletSyncTimestamp = parseInt(object.latestLightningWalletSyncTimestamp, 10); + else if (typeof object.latestLightningWalletSyncTimestamp === "number") + message.latestLightningWalletSyncTimestamp = object.latestLightningWalletSyncTimestamp; + else if (typeof object.latestLightningWalletSyncTimestamp === "object") + message.latestLightningWalletSyncTimestamp = new $util.LongBits(object.latestLightningWalletSyncTimestamp.low >>> 0, object.latestLightningWalletSyncTimestamp.high >>> 0).toNumber(true); + if (object.latestOnchainWalletSyncTimestamp != null) + if ($util.Long) + (message.latestOnchainWalletSyncTimestamp = $util.Long.fromValue(object.latestOnchainWalletSyncTimestamp)).unsigned = true; + else if (typeof object.latestOnchainWalletSyncTimestamp === "string") + message.latestOnchainWalletSyncTimestamp = parseInt(object.latestOnchainWalletSyncTimestamp, 10); + else if (typeof object.latestOnchainWalletSyncTimestamp === "number") + message.latestOnchainWalletSyncTimestamp = object.latestOnchainWalletSyncTimestamp; + else if (typeof object.latestOnchainWalletSyncTimestamp === "object") + message.latestOnchainWalletSyncTimestamp = new $util.LongBits(object.latestOnchainWalletSyncTimestamp.low >>> 0, object.latestOnchainWalletSyncTimestamp.high >>> 0).toNumber(true); + if (object.latestFeeRateCacheUpdateTimestamp != null) + if ($util.Long) + (message.latestFeeRateCacheUpdateTimestamp = $util.Long.fromValue(object.latestFeeRateCacheUpdateTimestamp)).unsigned = true; + else if (typeof object.latestFeeRateCacheUpdateTimestamp === "string") + message.latestFeeRateCacheUpdateTimestamp = parseInt(object.latestFeeRateCacheUpdateTimestamp, 10); + else if (typeof object.latestFeeRateCacheUpdateTimestamp === "number") + message.latestFeeRateCacheUpdateTimestamp = object.latestFeeRateCacheUpdateTimestamp; + else if (typeof object.latestFeeRateCacheUpdateTimestamp === "object") + message.latestFeeRateCacheUpdateTimestamp = new $util.LongBits(object.latestFeeRateCacheUpdateTimestamp.low >>> 0, object.latestFeeRateCacheUpdateTimestamp.high >>> 0).toNumber(true); + if (object.latestRgsSnapshotTimestamp != null) + if ($util.Long) + (message.latestRgsSnapshotTimestamp = $util.Long.fromValue(object.latestRgsSnapshotTimestamp)).unsigned = true; + else if (typeof object.latestRgsSnapshotTimestamp === "string") + message.latestRgsSnapshotTimestamp = parseInt(object.latestRgsSnapshotTimestamp, 10); + else if (typeof object.latestRgsSnapshotTimestamp === "number") + message.latestRgsSnapshotTimestamp = object.latestRgsSnapshotTimestamp; + else if (typeof object.latestRgsSnapshotTimestamp === "object") + message.latestRgsSnapshotTimestamp = new $util.LongBits(object.latestRgsSnapshotTimestamp.low >>> 0, object.latestRgsSnapshotTimestamp.high >>> 0).toNumber(true); + if (object.latestNodeAnnouncementBroadcastTimestamp != null) + if ($util.Long) + (message.latestNodeAnnouncementBroadcastTimestamp = $util.Long.fromValue(object.latestNodeAnnouncementBroadcastTimestamp)).unsigned = true; + else if (typeof object.latestNodeAnnouncementBroadcastTimestamp === "string") + message.latestNodeAnnouncementBroadcastTimestamp = parseInt(object.latestNodeAnnouncementBroadcastTimestamp, 10); + else if (typeof object.latestNodeAnnouncementBroadcastTimestamp === "number") + message.latestNodeAnnouncementBroadcastTimestamp = object.latestNodeAnnouncementBroadcastTimestamp; + else if (typeof object.latestNodeAnnouncementBroadcastTimestamp === "object") + message.latestNodeAnnouncementBroadcastTimestamp = new $util.LongBits(object.latestNodeAnnouncementBroadcastTimestamp.low >>> 0, object.latestNodeAnnouncementBroadcastTimestamp.high >>> 0).toNumber(true); + if (object.listeningAddresses) { + if (!Array.isArray(object.listeningAddresses)) + throw TypeError(".api.GetNodeInfoResponse.listeningAddresses: array expected"); + message.listeningAddresses = []; + for (var i = 0; i < object.listeningAddresses.length; ++i) + message.listeningAddresses[i] = String(object.listeningAddresses[i]); + } + if (object.announcementAddresses) { + if (!Array.isArray(object.announcementAddresses)) + throw TypeError(".api.GetNodeInfoResponse.announcementAddresses: array expected"); + message.announcementAddresses = []; + for (var i = 0; i < object.announcementAddresses.length; ++i) + message.announcementAddresses[i] = String(object.announcementAddresses[i]); + } + if (object.nodeAlias != null) + message.nodeAlias = String(object.nodeAlias); + if (object.nodeUris) { + if (!Array.isArray(object.nodeUris)) + throw TypeError(".api.GetNodeInfoResponse.nodeUris: array expected"); + message.nodeUris = []; + for (var i = 0; i < object.nodeUris.length; ++i) + message.nodeUris[i] = String(object.nodeUris[i]); + } + switch (object.network) { + 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 = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.listeningAddresses = []; + object.announcementAddresses = []; + object.nodeUris = []; + } + if (options.defaults) { + object.nodeId = ""; + object.currentBestBlock = null; + object.latestLightningWalletSyncTimestamp = 0; + object.latestOnchainWalletSyncTimestamp = 0; + object.latestFeeRateCacheUpdateTimestamp = 0; + object.latestRgsSnapshotTimestamp = 0; + object.latestNodeAnnouncementBroadcastTimestamp = 0; + object.nodeAlias = ""; + object.network = options.enums === String ? "BITCOIN" : 0; + } + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + object.nodeId = message.nodeId; + if (message.currentBestBlock != null && message.hasOwnProperty("currentBestBlock")) + object.currentBestBlock = $root.types.BestBlock.toObject(message.currentBestBlock, options); + if (message.latestLightningWalletSyncTimestamp != null && message.hasOwnProperty("latestLightningWalletSyncTimestamp")) + if (typeof message.latestLightningWalletSyncTimestamp === "number") + object.latestLightningWalletSyncTimestamp = options.longs === String ? String(message.latestLightningWalletSyncTimestamp) : message.latestLightningWalletSyncTimestamp; + else + object.latestLightningWalletSyncTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.latestLightningWalletSyncTimestamp) : options.longs === Number ? new $util.LongBits(message.latestLightningWalletSyncTimestamp.low >>> 0, message.latestLightningWalletSyncTimestamp.high >>> 0).toNumber(true) : message.latestLightningWalletSyncTimestamp; + if (message.latestOnchainWalletSyncTimestamp != null && message.hasOwnProperty("latestOnchainWalletSyncTimestamp")) + if (typeof message.latestOnchainWalletSyncTimestamp === "number") + object.latestOnchainWalletSyncTimestamp = options.longs === String ? String(message.latestOnchainWalletSyncTimestamp) : message.latestOnchainWalletSyncTimestamp; + else + object.latestOnchainWalletSyncTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.latestOnchainWalletSyncTimestamp) : options.longs === Number ? new $util.LongBits(message.latestOnchainWalletSyncTimestamp.low >>> 0, message.latestOnchainWalletSyncTimestamp.high >>> 0).toNumber(true) : message.latestOnchainWalletSyncTimestamp; + if (message.latestFeeRateCacheUpdateTimestamp != null && message.hasOwnProperty("latestFeeRateCacheUpdateTimestamp")) + if (typeof message.latestFeeRateCacheUpdateTimestamp === "number") + object.latestFeeRateCacheUpdateTimestamp = options.longs === String ? String(message.latestFeeRateCacheUpdateTimestamp) : message.latestFeeRateCacheUpdateTimestamp; + else + object.latestFeeRateCacheUpdateTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.latestFeeRateCacheUpdateTimestamp) : options.longs === Number ? new $util.LongBits(message.latestFeeRateCacheUpdateTimestamp.low >>> 0, message.latestFeeRateCacheUpdateTimestamp.high >>> 0).toNumber(true) : message.latestFeeRateCacheUpdateTimestamp; + if (message.latestRgsSnapshotTimestamp != null && message.hasOwnProperty("latestRgsSnapshotTimestamp")) + if (typeof message.latestRgsSnapshotTimestamp === "number") + object.latestRgsSnapshotTimestamp = options.longs === String ? String(message.latestRgsSnapshotTimestamp) : message.latestRgsSnapshotTimestamp; + else + object.latestRgsSnapshotTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.latestRgsSnapshotTimestamp) : options.longs === Number ? new $util.LongBits(message.latestRgsSnapshotTimestamp.low >>> 0, message.latestRgsSnapshotTimestamp.high >>> 0).toNumber(true) : message.latestRgsSnapshotTimestamp; + if (message.latestNodeAnnouncementBroadcastTimestamp != null && message.hasOwnProperty("latestNodeAnnouncementBroadcastTimestamp")) + if (typeof message.latestNodeAnnouncementBroadcastTimestamp === "number") + object.latestNodeAnnouncementBroadcastTimestamp = options.longs === String ? String(message.latestNodeAnnouncementBroadcastTimestamp) : message.latestNodeAnnouncementBroadcastTimestamp; + else + object.latestNodeAnnouncementBroadcastTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.latestNodeAnnouncementBroadcastTimestamp) : options.longs === Number ? new $util.LongBits(message.latestNodeAnnouncementBroadcastTimestamp.low >>> 0, message.latestNodeAnnouncementBroadcastTimestamp.high >>> 0).toNumber(true) : message.latestNodeAnnouncementBroadcastTimestamp; + if (message.listeningAddresses && message.listeningAddresses.length) { + object.listeningAddresses = []; + for (var j = 0; j < message.listeningAddresses.length; ++j) + object.listeningAddresses[j] = message.listeningAddresses[j]; + } + if (message.announcementAddresses && message.announcementAddresses.length) { + object.announcementAddresses = []; + for (var j = 0; j < message.announcementAddresses.length; ++j) + object.announcementAddresses[j] = message.announcementAddresses[j]; + } + if (message.nodeAlias != null && message.hasOwnProperty("nodeAlias")) + object.nodeAlias = message.nodeAlias; + if (message.nodeUris && message.nodeUris.length) { + object.nodeUris = []; + for (var j = 0; j < message.nodeUris.length; ++j) + object.nodeUris[j] = message.nodeUris[j]; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = options.enums === String ? $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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.OnchainReceiveRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.OnchainReceiveRequest) + return object; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.OnchainReceiveResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.OnchainReceiveResponse) + return object; + var 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 = {}; + var 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); + }; + + return OnchainReceiveResponse; + })(); + + api.OnchainSendRequest = (function() { + + /** + * Properties of an OnchainSendRequest. + * @memberof api + * @interface IOnchainSendRequest + * @property {string|null} [address] OnchainSendRequest address + * @property {number|Long|null} [amountSats] OnchainSendRequest amountSats + * @property {boolean|null} [sendAll] OnchainSendRequest sendAll + * @property {number|Long|null} [feeRateSatPerVb] OnchainSendRequest feeRateSatPerVb + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OnchainSendRequest address. + * @member {string} address + * @memberof api.OnchainSendRequest + * @instance + */ + OnchainSendRequest.prototype.address = ""; + + /** + * OnchainSendRequest amountSats. + * @member {number|Long} amountSats + * @memberof api.OnchainSendRequest + * @instance + */ + OnchainSendRequest.prototype.amountSats = 0; + + /** + * OnchainSendRequest sendAll. + * @member {boolean} sendAll + * @memberof api.OnchainSendRequest + * @instance + */ + OnchainSendRequest.prototype.sendAll = false; + + /** + * OnchainSendRequest feeRateSatPerVb. + * @member {number|Long} feeRateSatPerVb + * @memberof api.OnchainSendRequest + * @instance + */ + OnchainSendRequest.prototype.feeRateSatPerVb = 0; + + /** + * 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.amountSats != null && Object.hasOwnProperty.call(message, "amountSats")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amountSats); + if (message.sendAll != null && Object.hasOwnProperty.call(message, "sendAll")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.sendAll); + if (message.feeRateSatPerVb != null && Object.hasOwnProperty.call(message, "feeRateSatPerVb")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.feeRateSatPerVb); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.OnchainSendRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + case 2: + message.amountSats = reader.uint64(); + break; + case 3: + message.sendAll = reader.bool(); + break; + case 4: + message.feeRateSatPerVb = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.amountSats != null && message.hasOwnProperty("amountSats")) + if (!$util.isInteger(message.amountSats) && !(message.amountSats && $util.isInteger(message.amountSats.low) && $util.isInteger(message.amountSats.high))) + return "amountSats: integer|Long expected"; + if (message.sendAll != null && message.hasOwnProperty("sendAll")) + if (typeof message.sendAll !== "boolean") + return "sendAll: boolean expected"; + if (message.feeRateSatPerVb != null && message.hasOwnProperty("feeRateSatPerVb")) + if (!$util.isInteger(message.feeRateSatPerVb) && !(message.feeRateSatPerVb && $util.isInteger(message.feeRateSatPerVb.low) && $util.isInteger(message.feeRateSatPerVb.high))) + return "feeRateSatPerVb: 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) { + if (object instanceof $root.api.OnchainSendRequest) + return object; + var message = new $root.api.OnchainSendRequest(); + if (object.address != null) + message.address = String(object.address); + if (object.amountSats != null) + if ($util.Long) + (message.amountSats = $util.Long.fromValue(object.amountSats)).unsigned = true; + else if (typeof object.amountSats === "string") + message.amountSats = parseInt(object.amountSats, 10); + else if (typeof object.amountSats === "number") + message.amountSats = object.amountSats; + else if (typeof object.amountSats === "object") + message.amountSats = new $util.LongBits(object.amountSats.low >>> 0, object.amountSats.high >>> 0).toNumber(true); + if (object.sendAll != null) + message.sendAll = Boolean(object.sendAll); + if (object.feeRateSatPerVb != null) + if ($util.Long) + (message.feeRateSatPerVb = $util.Long.fromValue(object.feeRateSatPerVb)).unsigned = true; + else if (typeof object.feeRateSatPerVb === "string") + message.feeRateSatPerVb = parseInt(object.feeRateSatPerVb, 10); + else if (typeof object.feeRateSatPerVb === "number") + message.feeRateSatPerVb = object.feeRateSatPerVb; + else if (typeof object.feeRateSatPerVb === "object") + message.feeRateSatPerVb = new $util.LongBits(object.feeRateSatPerVb.low >>> 0, object.feeRateSatPerVb.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 = {}; + var object = {}; + if (options.defaults) { + object.address = ""; + object.amountSats = 0; + object.sendAll = false; + object.feeRateSatPerVb = 0; + } + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.amountSats != null && message.hasOwnProperty("amountSats")) + if (typeof message.amountSats === "number") + object.amountSats = options.longs === String ? String(message.amountSats) : message.amountSats; + else + object.amountSats = options.longs === String ? $util.Long.prototype.toString.call(message.amountSats) : options.longs === Number ? new $util.LongBits(message.amountSats.low >>> 0, message.amountSats.high >>> 0).toNumber(true) : message.amountSats; + if (message.sendAll != null && message.hasOwnProperty("sendAll")) + object.sendAll = message.sendAll; + if (message.feeRateSatPerVb != null && message.hasOwnProperty("feeRateSatPerVb")) + if (typeof message.feeRateSatPerVb === "number") + object.feeRateSatPerVb = options.longs === String ? String(message.feeRateSatPerVb) : message.feeRateSatPerVb; + else + object.feeRateSatPerVb = options.longs === String ? $util.Long.prototype.toString.call(message.feeRateSatPerVb) : options.longs === Number ? new $util.LongBits(message.feeRateSatPerVb.low >>> 0, message.feeRateSatPerVb.high >>> 0).toNumber(true) : message.feeRateSatPerVb; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.OnchainSendResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txid = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.OnchainSendResponse) + return object; + var 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 = {}; + var 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); + }; + + return OnchainSendResponse; + })(); + + api.Bolt11ReceiveRequest = (function() { + + /** + * Properties of a Bolt11ReceiveRequest. + * @memberof api + * @interface IBolt11ReceiveRequest + * @property {number|Long|null} [amountMsat] Bolt11ReceiveRequest amountMsat + * @property {types.IBolt11InvoiceDescription|null} [description] Bolt11ReceiveRequest description + * @property {number|null} [expirySecs] Bolt11ReceiveRequest expirySecs + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11ReceiveRequest amountMsat. + * @member {number|Long} amountMsat + * @memberof api.Bolt11ReceiveRequest + * @instance + */ + Bolt11ReceiveRequest.prototype.amountMsat = 0; + + /** + * Bolt11ReceiveRequest description. + * @member {types.IBolt11InvoiceDescription|null|undefined} description + * @memberof api.Bolt11ReceiveRequest + * @instance + */ + Bolt11ReceiveRequest.prototype.description = null; + + /** + * Bolt11ReceiveRequest expirySecs. + * @member {number} expirySecs + * @memberof api.Bolt11ReceiveRequest + * @instance + */ + Bolt11ReceiveRequest.prototype.expirySecs = 0; + + /** + * 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.amountMsat != null && Object.hasOwnProperty.call(message, "amountMsat")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amountMsat); + 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.expirySecs != null && Object.hasOwnProperty.call(message, "expirySecs")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.expirySecs); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ReceiveRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amountMsat = reader.uint64(); + break; + case 2: + message.description = $root.types.Bolt11InvoiceDescription.decode(reader, reader.uint32()); + break; + case 3: + message.expirySecs = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (!$util.isInteger(message.amountMsat) && !(message.amountMsat && $util.isInteger(message.amountMsat.low) && $util.isInteger(message.amountMsat.high))) + return "amountMsat: integer|Long expected"; + if (message.description != null && message.hasOwnProperty("description")) { + var error = $root.types.Bolt11InvoiceDescription.verify(message.description); + if (error) + return "description." + error; + } + if (message.expirySecs != null && message.hasOwnProperty("expirySecs")) + if (!$util.isInteger(message.expirySecs)) + return "expirySecs: 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) { + if (object instanceof $root.api.Bolt11ReceiveRequest) + return object; + var message = new $root.api.Bolt11ReceiveRequest(); + if (object.amountMsat != null) + if ($util.Long) + (message.amountMsat = $util.Long.fromValue(object.amountMsat)).unsigned = true; + else if (typeof object.amountMsat === "string") + message.amountMsat = parseInt(object.amountMsat, 10); + else if (typeof object.amountMsat === "number") + message.amountMsat = object.amountMsat; + else if (typeof object.amountMsat === "object") + message.amountMsat = new $util.LongBits(object.amountMsat.low >>> 0, object.amountMsat.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); + } + if (object.expirySecs != null) + message.expirySecs = object.expirySecs >>> 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 = {}; + var object = {}; + if (options.defaults) { + object.amountMsat = 0; + object.description = null; + object.expirySecs = 0; + } + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (typeof message.amountMsat === "number") + object.amountMsat = options.longs === String ? String(message.amountMsat) : message.amountMsat; + else + object.amountMsat = options.longs === String ? $util.Long.prototype.toString.call(message.amountMsat) : options.longs === Number ? new $util.LongBits(message.amountMsat.low >>> 0, message.amountMsat.high >>> 0).toNumber(true) : message.amountMsat; + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.types.Bolt11InvoiceDescription.toObject(message.description, options); + if (message.expirySecs != null && message.hasOwnProperty("expirySecs")) + object.expirySecs = message.expirySecs; + 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); + }; + + return Bolt11ReceiveRequest; + })(); + + api.Bolt11ReceiveResponse = (function() { + + /** + * Properties of a Bolt11ReceiveResponse. + * @memberof api + * @interface IBolt11ReceiveResponse + * @property {string|null} [invoice] Bolt11ReceiveResponse invoice + * @property {string|null} [paymentHash] Bolt11ReceiveResponse paymentHash + * @property {string|null} [paymentSecret] Bolt11ReceiveResponse paymentSecret + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11ReceiveResponse invoice. + * @member {string} invoice + * @memberof api.Bolt11ReceiveResponse + * @instance + */ + Bolt11ReceiveResponse.prototype.invoice = ""; + + /** + * Bolt11ReceiveResponse paymentHash. + * @member {string} paymentHash + * @memberof api.Bolt11ReceiveResponse + * @instance + */ + Bolt11ReceiveResponse.prototype.paymentHash = ""; + + /** + * Bolt11ReceiveResponse paymentSecret. + * @member {string} paymentSecret + * @memberof api.Bolt11ReceiveResponse + * @instance + */ + Bolt11ReceiveResponse.prototype.paymentSecret = ""; + + /** + * 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.paymentHash != null && Object.hasOwnProperty.call(message, "paymentHash")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.paymentHash); + if (message.paymentSecret != null && Object.hasOwnProperty.call(message, "paymentSecret")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.paymentSecret); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ReceiveResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.invoice = reader.string(); + break; + case 2: + message.paymentHash = reader.string(); + break; + case 3: + message.paymentSecret = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.invoice != null && message.hasOwnProperty("invoice")) + if (!$util.isString(message.invoice)) + return "invoice: string expected"; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) + if (!$util.isString(message.paymentHash)) + return "paymentHash: string expected"; + if (message.paymentSecret != null && message.hasOwnProperty("paymentSecret")) + if (!$util.isString(message.paymentSecret)) + return "paymentSecret: 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) { + if (object instanceof $root.api.Bolt11ReceiveResponse) + return object; + var message = new $root.api.Bolt11ReceiveResponse(); + if (object.invoice != null) + message.invoice = String(object.invoice); + if (object.paymentHash != null) + message.paymentHash = String(object.paymentHash); + if (object.paymentSecret != null) + message.paymentSecret = String(object.paymentSecret); + 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 = {}; + var object = {}; + if (options.defaults) { + object.invoice = ""; + object.paymentHash = ""; + object.paymentSecret = ""; + } + if (message.invoice != null && message.hasOwnProperty("invoice")) + object.invoice = message.invoice; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) + object.paymentHash = message.paymentHash; + if (message.paymentSecret != null && message.hasOwnProperty("paymentSecret")) + object.paymentSecret = message.paymentSecret; + 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); + }; + + return Bolt11ReceiveResponse; + })(); + + api.Bolt11ReceiveForHashRequest = (function() { + + /** + * Properties of a Bolt11ReceiveForHashRequest. + * @memberof api + * @interface IBolt11ReceiveForHashRequest + * @property {number|Long|null} [amountMsat] Bolt11ReceiveForHashRequest amountMsat + * @property {types.IBolt11InvoiceDescription|null} [description] Bolt11ReceiveForHashRequest description + * @property {number|null} [expirySecs] Bolt11ReceiveForHashRequest expirySecs + * @property {string|null} [paymentHash] Bolt11ReceiveForHashRequest paymentHash + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11ReceiveForHashRequest amountMsat. + * @member {number|Long} amountMsat + * @memberof api.Bolt11ReceiveForHashRequest + * @instance + */ + Bolt11ReceiveForHashRequest.prototype.amountMsat = 0; + + /** + * Bolt11ReceiveForHashRequest description. + * @member {types.IBolt11InvoiceDescription|null|undefined} description + * @memberof api.Bolt11ReceiveForHashRequest + * @instance + */ + Bolt11ReceiveForHashRequest.prototype.description = null; + + /** + * Bolt11ReceiveForHashRequest expirySecs. + * @member {number} expirySecs + * @memberof api.Bolt11ReceiveForHashRequest + * @instance + */ + Bolt11ReceiveForHashRequest.prototype.expirySecs = 0; + + /** + * Bolt11ReceiveForHashRequest paymentHash. + * @member {string} paymentHash + * @memberof api.Bolt11ReceiveForHashRequest + * @instance + */ + Bolt11ReceiveForHashRequest.prototype.paymentHash = ""; + + /** + * 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.amountMsat != null && Object.hasOwnProperty.call(message, "amountMsat")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amountMsat); + 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.expirySecs != null && Object.hasOwnProperty.call(message, "expirySecs")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.expirySecs); + if (message.paymentHash != null && Object.hasOwnProperty.call(message, "paymentHash")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.paymentHash); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ReceiveForHashRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amountMsat = reader.uint64(); + break; + case 2: + message.description = $root.types.Bolt11InvoiceDescription.decode(reader, reader.uint32()); + break; + case 3: + message.expirySecs = reader.uint32(); + break; + case 4: + message.paymentHash = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (!$util.isInteger(message.amountMsat) && !(message.amountMsat && $util.isInteger(message.amountMsat.low) && $util.isInteger(message.amountMsat.high))) + return "amountMsat: integer|Long expected"; + if (message.description != null && message.hasOwnProperty("description")) { + var error = $root.types.Bolt11InvoiceDescription.verify(message.description); + if (error) + return "description." + error; + } + if (message.expirySecs != null && message.hasOwnProperty("expirySecs")) + if (!$util.isInteger(message.expirySecs)) + return "expirySecs: integer expected"; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) + if (!$util.isString(message.paymentHash)) + return "paymentHash: 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) { + if (object instanceof $root.api.Bolt11ReceiveForHashRequest) + return object; + var message = new $root.api.Bolt11ReceiveForHashRequest(); + if (object.amountMsat != null) + if ($util.Long) + (message.amountMsat = $util.Long.fromValue(object.amountMsat)).unsigned = true; + else if (typeof object.amountMsat === "string") + message.amountMsat = parseInt(object.amountMsat, 10); + else if (typeof object.amountMsat === "number") + message.amountMsat = object.amountMsat; + else if (typeof object.amountMsat === "object") + message.amountMsat = new $util.LongBits(object.amountMsat.low >>> 0, object.amountMsat.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); + } + if (object.expirySecs != null) + message.expirySecs = object.expirySecs >>> 0; + if (object.paymentHash != null) + message.paymentHash = String(object.paymentHash); + 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 = {}; + var object = {}; + if (options.defaults) { + object.amountMsat = 0; + object.description = null; + object.expirySecs = 0; + object.paymentHash = ""; + } + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (typeof message.amountMsat === "number") + object.amountMsat = options.longs === String ? String(message.amountMsat) : message.amountMsat; + else + object.amountMsat = options.longs === String ? $util.Long.prototype.toString.call(message.amountMsat) : options.longs === Number ? new $util.LongBits(message.amountMsat.low >>> 0, message.amountMsat.high >>> 0).toNumber(true) : message.amountMsat; + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.types.Bolt11InvoiceDescription.toObject(message.description, options); + if (message.expirySecs != null && message.hasOwnProperty("expirySecs")) + object.expirySecs = message.expirySecs; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) + object.paymentHash = message.paymentHash; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ReceiveForHashResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.invoice = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.Bolt11ReceiveForHashResponse) + return object; + var 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 = {}; + var 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); + }; + + return Bolt11ReceiveForHashResponse; + })(); + + api.Bolt11ClaimForHashRequest = (function() { + + /** + * Properties of a Bolt11ClaimForHashRequest. + * @memberof api + * @interface IBolt11ClaimForHashRequest + * @property {string|null} [paymentHash] Bolt11ClaimForHashRequest paymentHash + * @property {number|Long|null} [claimableAmountMsat] Bolt11ClaimForHashRequest claimableAmountMsat + * @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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11ClaimForHashRequest paymentHash. + * @member {string} paymentHash + * @memberof api.Bolt11ClaimForHashRequest + * @instance + */ + Bolt11ClaimForHashRequest.prototype.paymentHash = ""; + + /** + * Bolt11ClaimForHashRequest claimableAmountMsat. + * @member {number|Long} claimableAmountMsat + * @memberof api.Bolt11ClaimForHashRequest + * @instance + */ + Bolt11ClaimForHashRequest.prototype.claimableAmountMsat = 0; + + /** + * Bolt11ClaimForHashRequest preimage. + * @member {string} preimage + * @memberof api.Bolt11ClaimForHashRequest + * @instance + */ + Bolt11ClaimForHashRequest.prototype.preimage = ""; + + /** + * 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.paymentHash != null && Object.hasOwnProperty.call(message, "paymentHash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paymentHash); + if (message.claimableAmountMsat != null && Object.hasOwnProperty.call(message, "claimableAmountMsat")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.claimableAmountMsat); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ClaimForHashRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paymentHash = reader.string(); + break; + case 2: + message.claimableAmountMsat = reader.uint64(); + break; + case 3: + message.preimage = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) + if (!$util.isString(message.paymentHash)) + return "paymentHash: string expected"; + if (message.claimableAmountMsat != null && message.hasOwnProperty("claimableAmountMsat")) + if (!$util.isInteger(message.claimableAmountMsat) && !(message.claimableAmountMsat && $util.isInteger(message.claimableAmountMsat.low) && $util.isInteger(message.claimableAmountMsat.high))) + return "claimableAmountMsat: 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) { + if (object instanceof $root.api.Bolt11ClaimForHashRequest) + return object; + var message = new $root.api.Bolt11ClaimForHashRequest(); + if (object.paymentHash != null) + message.paymentHash = String(object.paymentHash); + if (object.claimableAmountMsat != null) + if ($util.Long) + (message.claimableAmountMsat = $util.Long.fromValue(object.claimableAmountMsat)).unsigned = true; + else if (typeof object.claimableAmountMsat === "string") + message.claimableAmountMsat = parseInt(object.claimableAmountMsat, 10); + else if (typeof object.claimableAmountMsat === "number") + message.claimableAmountMsat = object.claimableAmountMsat; + else if (typeof object.claimableAmountMsat === "object") + message.claimableAmountMsat = new $util.LongBits(object.claimableAmountMsat.low >>> 0, object.claimableAmountMsat.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 = {}; + var object = {}; + if (options.defaults) { + object.paymentHash = ""; + object.claimableAmountMsat = 0; + object.preimage = ""; + } + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) + object.paymentHash = message.paymentHash; + if (message.claimableAmountMsat != null && message.hasOwnProperty("claimableAmountMsat")) + if (typeof message.claimableAmountMsat === "number") + object.claimableAmountMsat = options.longs === String ? String(message.claimableAmountMsat) : message.claimableAmountMsat; + else + object.claimableAmountMsat = options.longs === String ? $util.Long.prototype.toString.call(message.claimableAmountMsat) : options.longs === Number ? new $util.LongBits(message.claimableAmountMsat.low >>> 0, message.claimableAmountMsat.high >>> 0).toNumber(true) : message.claimableAmountMsat; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ClaimForHashResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.Bolt11ClaimForHashResponse) + return object; + 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); + }; + + return Bolt11ClaimForHashResponse; + })(); + + api.Bolt11FailForHashRequest = (function() { + + /** + * Properties of a Bolt11FailForHashRequest. + * @memberof api + * @interface IBolt11FailForHashRequest + * @property {string|null} [paymentHash] Bolt11FailForHashRequest paymentHash + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11FailForHashRequest paymentHash. + * @member {string} paymentHash + * @memberof api.Bolt11FailForHashRequest + * @instance + */ + Bolt11FailForHashRequest.prototype.paymentHash = ""; + + /** + * 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.paymentHash != null && Object.hasOwnProperty.call(message, "paymentHash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paymentHash); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11FailForHashRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paymentHash = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) + if (!$util.isString(message.paymentHash)) + return "paymentHash: 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) { + if (object instanceof $root.api.Bolt11FailForHashRequest) + return object; + var message = new $root.api.Bolt11FailForHashRequest(); + if (object.paymentHash != null) + message.paymentHash = String(object.paymentHash); + 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 = {}; + var object = {}; + if (options.defaults) + object.paymentHash = ""; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) + object.paymentHash = message.paymentHash; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11FailForHashResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.Bolt11FailForHashResponse) + return object; + 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); + }; + + return Bolt11FailForHashResponse; + })(); + + api.Bolt11ReceiveViaJitChannelRequest = (function() { + + /** + * Properties of a Bolt11ReceiveViaJitChannelRequest. + * @memberof api + * @interface IBolt11ReceiveViaJitChannelRequest + * @property {number|Long|null} [amountMsat] Bolt11ReceiveViaJitChannelRequest amountMsat + * @property {types.IBolt11InvoiceDescription|null} [description] Bolt11ReceiveViaJitChannelRequest description + * @property {number|null} [expirySecs] Bolt11ReceiveViaJitChannelRequest expirySecs + * @property {number|Long|null} [maxTotalLspFeeLimitMsat] Bolt11ReceiveViaJitChannelRequest maxTotalLspFeeLimitMsat + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11ReceiveViaJitChannelRequest amountMsat. + * @member {number|Long} amountMsat + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @instance + */ + Bolt11ReceiveViaJitChannelRequest.prototype.amountMsat = 0; + + /** + * Bolt11ReceiveViaJitChannelRequest description. + * @member {types.IBolt11InvoiceDescription|null|undefined} description + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @instance + */ + Bolt11ReceiveViaJitChannelRequest.prototype.description = null; + + /** + * Bolt11ReceiveViaJitChannelRequest expirySecs. + * @member {number} expirySecs + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @instance + */ + Bolt11ReceiveViaJitChannelRequest.prototype.expirySecs = 0; + + /** + * Bolt11ReceiveViaJitChannelRequest maxTotalLspFeeLimitMsat. + * @member {number|Long} maxTotalLspFeeLimitMsat + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @instance + */ + Bolt11ReceiveViaJitChannelRequest.prototype.maxTotalLspFeeLimitMsat = 0; + + /** + * 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.amountMsat != null && Object.hasOwnProperty.call(message, "amountMsat")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amountMsat); + 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.expirySecs != null && Object.hasOwnProperty.call(message, "expirySecs")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.expirySecs); + if (message.maxTotalLspFeeLimitMsat != null && Object.hasOwnProperty.call(message, "maxTotalLspFeeLimitMsat")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.maxTotalLspFeeLimitMsat); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ReceiveViaJitChannelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amountMsat = reader.uint64(); + break; + case 2: + message.description = $root.types.Bolt11InvoiceDescription.decode(reader, reader.uint32()); + break; + case 3: + message.expirySecs = reader.uint32(); + break; + case 4: + message.maxTotalLspFeeLimitMsat = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (!$util.isInteger(message.amountMsat) && !(message.amountMsat && $util.isInteger(message.amountMsat.low) && $util.isInteger(message.amountMsat.high))) + return "amountMsat: integer|Long expected"; + if (message.description != null && message.hasOwnProperty("description")) { + var error = $root.types.Bolt11InvoiceDescription.verify(message.description); + if (error) + return "description." + error; + } + if (message.expirySecs != null && message.hasOwnProperty("expirySecs")) + if (!$util.isInteger(message.expirySecs)) + return "expirySecs: integer expected"; + if (message.maxTotalLspFeeLimitMsat != null && message.hasOwnProperty("maxTotalLspFeeLimitMsat")) + if (!$util.isInteger(message.maxTotalLspFeeLimitMsat) && !(message.maxTotalLspFeeLimitMsat && $util.isInteger(message.maxTotalLspFeeLimitMsat.low) && $util.isInteger(message.maxTotalLspFeeLimitMsat.high))) + return "maxTotalLspFeeLimitMsat: 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) { + if (object instanceof $root.api.Bolt11ReceiveViaJitChannelRequest) + return object; + var message = new $root.api.Bolt11ReceiveViaJitChannelRequest(); + if (object.amountMsat != null) + if ($util.Long) + (message.amountMsat = $util.Long.fromValue(object.amountMsat)).unsigned = true; + else if (typeof object.amountMsat === "string") + message.amountMsat = parseInt(object.amountMsat, 10); + else if (typeof object.amountMsat === "number") + message.amountMsat = object.amountMsat; + else if (typeof object.amountMsat === "object") + message.amountMsat = new $util.LongBits(object.amountMsat.low >>> 0, object.amountMsat.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); + } + if (object.expirySecs != null) + message.expirySecs = object.expirySecs >>> 0; + if (object.maxTotalLspFeeLimitMsat != null) + if ($util.Long) + (message.maxTotalLspFeeLimitMsat = $util.Long.fromValue(object.maxTotalLspFeeLimitMsat)).unsigned = true; + else if (typeof object.maxTotalLspFeeLimitMsat === "string") + message.maxTotalLspFeeLimitMsat = parseInt(object.maxTotalLspFeeLimitMsat, 10); + else if (typeof object.maxTotalLspFeeLimitMsat === "number") + message.maxTotalLspFeeLimitMsat = object.maxTotalLspFeeLimitMsat; + else if (typeof object.maxTotalLspFeeLimitMsat === "object") + message.maxTotalLspFeeLimitMsat = new $util.LongBits(object.maxTotalLspFeeLimitMsat.low >>> 0, object.maxTotalLspFeeLimitMsat.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 = {}; + var object = {}; + if (options.defaults) { + object.amountMsat = 0; + object.description = null; + object.expirySecs = 0; + object.maxTotalLspFeeLimitMsat = 0; + } + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (typeof message.amountMsat === "number") + object.amountMsat = options.longs === String ? String(message.amountMsat) : message.amountMsat; + else + object.amountMsat = options.longs === String ? $util.Long.prototype.toString.call(message.amountMsat) : options.longs === Number ? new $util.LongBits(message.amountMsat.low >>> 0, message.amountMsat.high >>> 0).toNumber(true) : message.amountMsat; + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.types.Bolt11InvoiceDescription.toObject(message.description, options); + if (message.expirySecs != null && message.hasOwnProperty("expirySecs")) + object.expirySecs = message.expirySecs; + if (message.maxTotalLspFeeLimitMsat != null && message.hasOwnProperty("maxTotalLspFeeLimitMsat")) + if (typeof message.maxTotalLspFeeLimitMsat === "number") + object.maxTotalLspFeeLimitMsat = options.longs === String ? String(message.maxTotalLspFeeLimitMsat) : message.maxTotalLspFeeLimitMsat; + else + object.maxTotalLspFeeLimitMsat = options.longs === String ? $util.Long.prototype.toString.call(message.maxTotalLspFeeLimitMsat) : options.longs === Number ? new $util.LongBits(message.maxTotalLspFeeLimitMsat.low >>> 0, message.maxTotalLspFeeLimitMsat.high >>> 0).toNumber(true) : message.maxTotalLspFeeLimitMsat; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ReceiveViaJitChannelResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.invoice = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.Bolt11ReceiveViaJitChannelResponse) + return object; + var 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 = {}; + var 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); + }; + + return Bolt11ReceiveViaJitChannelResponse; + })(); + + api.Bolt11ReceiveVariableAmountViaJitChannelRequest = (function() { + + /** + * Properties of a Bolt11ReceiveVariableAmountViaJitChannelRequest. + * @memberof api + * @interface IBolt11ReceiveVariableAmountViaJitChannelRequest + * @property {types.IBolt11InvoiceDescription|null} [description] Bolt11ReceiveVariableAmountViaJitChannelRequest description + * @property {number|null} [expirySecs] Bolt11ReceiveVariableAmountViaJitChannelRequest expirySecs + * @property {number|Long|null} [maxProportionalLspFeeLimitPpmMsat] Bolt11ReceiveVariableAmountViaJitChannelRequest maxProportionalLspFeeLimitPpmMsat + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11ReceiveVariableAmountViaJitChannelRequest description. + * @member {types.IBolt11InvoiceDescription|null|undefined} description + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @instance + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.prototype.description = null; + + /** + * Bolt11ReceiveVariableAmountViaJitChannelRequest expirySecs. + * @member {number} expirySecs + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @instance + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.prototype.expirySecs = 0; + + /** + * Bolt11ReceiveVariableAmountViaJitChannelRequest maxProportionalLspFeeLimitPpmMsat. + * @member {number|Long} maxProportionalLspFeeLimitPpmMsat + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @instance + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.prototype.maxProportionalLspFeeLimitPpmMsat = 0; + + /** + * 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.expirySecs != null && Object.hasOwnProperty.call(message, "expirySecs")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.expirySecs); + if (message.maxProportionalLspFeeLimitPpmMsat != null && Object.hasOwnProperty.call(message, "maxProportionalLspFeeLimitPpmMsat")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.maxProportionalLspFeeLimitPpmMsat); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ReceiveVariableAmountViaJitChannelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = $root.types.Bolt11InvoiceDescription.decode(reader, reader.uint32()); + break; + case 2: + message.expirySecs = reader.uint32(); + break; + case 3: + message.maxProportionalLspFeeLimitPpmMsat = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) { + var error = $root.types.Bolt11InvoiceDescription.verify(message.description); + if (error) + return "description." + error; + } + if (message.expirySecs != null && message.hasOwnProperty("expirySecs")) + if (!$util.isInteger(message.expirySecs)) + return "expirySecs: integer expected"; + if (message.maxProportionalLspFeeLimitPpmMsat != null && message.hasOwnProperty("maxProportionalLspFeeLimitPpmMsat")) + if (!$util.isInteger(message.maxProportionalLspFeeLimitPpmMsat) && !(message.maxProportionalLspFeeLimitPpmMsat && $util.isInteger(message.maxProportionalLspFeeLimitPpmMsat.low) && $util.isInteger(message.maxProportionalLspFeeLimitPpmMsat.high))) + return "maxProportionalLspFeeLimitPpmMsat: 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) { + if (object instanceof $root.api.Bolt11ReceiveVariableAmountViaJitChannelRequest) + return object; + var 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); + } + if (object.expirySecs != null) + message.expirySecs = object.expirySecs >>> 0; + if (object.maxProportionalLspFeeLimitPpmMsat != null) + if ($util.Long) + (message.maxProportionalLspFeeLimitPpmMsat = $util.Long.fromValue(object.maxProportionalLspFeeLimitPpmMsat)).unsigned = true; + else if (typeof object.maxProportionalLspFeeLimitPpmMsat === "string") + message.maxProportionalLspFeeLimitPpmMsat = parseInt(object.maxProportionalLspFeeLimitPpmMsat, 10); + else if (typeof object.maxProportionalLspFeeLimitPpmMsat === "number") + message.maxProportionalLspFeeLimitPpmMsat = object.maxProportionalLspFeeLimitPpmMsat; + else if (typeof object.maxProportionalLspFeeLimitPpmMsat === "object") + message.maxProportionalLspFeeLimitPpmMsat = new $util.LongBits(object.maxProportionalLspFeeLimitPpmMsat.low >>> 0, object.maxProportionalLspFeeLimitPpmMsat.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 = {}; + var object = {}; + if (options.defaults) { + object.description = null; + object.expirySecs = 0; + object.maxProportionalLspFeeLimitPpmMsat = 0; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = $root.types.Bolt11InvoiceDescription.toObject(message.description, options); + if (message.expirySecs != null && message.hasOwnProperty("expirySecs")) + object.expirySecs = message.expirySecs; + if (message.maxProportionalLspFeeLimitPpmMsat != null && message.hasOwnProperty("maxProportionalLspFeeLimitPpmMsat")) + if (typeof message.maxProportionalLspFeeLimitPpmMsat === "number") + object.maxProportionalLspFeeLimitPpmMsat = options.longs === String ? String(message.maxProportionalLspFeeLimitPpmMsat) : message.maxProportionalLspFeeLimitPpmMsat; + else + object.maxProportionalLspFeeLimitPpmMsat = options.longs === String ? $util.Long.prototype.toString.call(message.maxProportionalLspFeeLimitPpmMsat) : options.longs === Number ? new $util.LongBits(message.maxProportionalLspFeeLimitPpmMsat.low >>> 0, message.maxProportionalLspFeeLimitPpmMsat.high >>> 0).toNumber(true) : message.maxProportionalLspFeeLimitPpmMsat; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11ReceiveVariableAmountViaJitChannelResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.invoice = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.Bolt11ReceiveVariableAmountViaJitChannelResponse) + return object; + var 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 = {}; + var 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); + }; + + return Bolt11ReceiveVariableAmountViaJitChannelResponse; + })(); + + api.Bolt11SendRequest = (function() { + + /** + * Properties of a Bolt11SendRequest. + * @memberof api + * @interface IBolt11SendRequest + * @property {string|null} [invoice] Bolt11SendRequest invoice + * @property {number|Long|null} [amountMsat] Bolt11SendRequest amountMsat + * @property {types.IRouteParametersConfig|null} [routeParameters] Bolt11SendRequest routeParameters + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11SendRequest invoice. + * @member {string} invoice + * @memberof api.Bolt11SendRequest + * @instance + */ + Bolt11SendRequest.prototype.invoice = ""; + + /** + * Bolt11SendRequest amountMsat. + * @member {number|Long} amountMsat + * @memberof api.Bolt11SendRequest + * @instance + */ + Bolt11SendRequest.prototype.amountMsat = 0; + + /** + * Bolt11SendRequest routeParameters. + * @member {types.IRouteParametersConfig|null|undefined} routeParameters + * @memberof api.Bolt11SendRequest + * @instance + */ + Bolt11SendRequest.prototype.routeParameters = null; + + /** + * 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.amountMsat != null && Object.hasOwnProperty.call(message, "amountMsat")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amountMsat); + if (message.routeParameters != null && Object.hasOwnProperty.call(message, "routeParameters")) + $root.types.RouteParametersConfig.encode(message.routeParameters, 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11SendRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.invoice = reader.string(); + break; + case 2: + message.amountMsat = reader.uint64(); + break; + case 3: + message.routeParameters = $root.types.RouteParametersConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.invoice != null && message.hasOwnProperty("invoice")) + if (!$util.isString(message.invoice)) + return "invoice: string expected"; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (!$util.isInteger(message.amountMsat) && !(message.amountMsat && $util.isInteger(message.amountMsat.low) && $util.isInteger(message.amountMsat.high))) + return "amountMsat: integer|Long expected"; + if (message.routeParameters != null && message.hasOwnProperty("routeParameters")) { + var error = $root.types.RouteParametersConfig.verify(message.routeParameters); + if (error) + return "routeParameters." + 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) { + if (object instanceof $root.api.Bolt11SendRequest) + return object; + var message = new $root.api.Bolt11SendRequest(); + if (object.invoice != null) + message.invoice = String(object.invoice); + if (object.amountMsat != null) + if ($util.Long) + (message.amountMsat = $util.Long.fromValue(object.amountMsat)).unsigned = true; + else if (typeof object.amountMsat === "string") + message.amountMsat = parseInt(object.amountMsat, 10); + else if (typeof object.amountMsat === "number") + message.amountMsat = object.amountMsat; + else if (typeof object.amountMsat === "object") + message.amountMsat = new $util.LongBits(object.amountMsat.low >>> 0, object.amountMsat.high >>> 0).toNumber(true); + if (object.routeParameters != null) { + if (typeof object.routeParameters !== "object") + throw TypeError(".api.Bolt11SendRequest.routeParameters: object expected"); + message.routeParameters = $root.types.RouteParametersConfig.fromObject(object.routeParameters); + } + 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 = {}; + var object = {}; + if (options.defaults) { + object.invoice = ""; + object.amountMsat = 0; + object.routeParameters = null; + } + if (message.invoice != null && message.hasOwnProperty("invoice")) + object.invoice = message.invoice; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (typeof message.amountMsat === "number") + object.amountMsat = options.longs === String ? String(message.amountMsat) : message.amountMsat; + else + object.amountMsat = options.longs === String ? $util.Long.prototype.toString.call(message.amountMsat) : options.longs === Number ? new $util.LongBits(message.amountMsat.low >>> 0, message.amountMsat.high >>> 0).toNumber(true) : message.amountMsat; + if (message.routeParameters != null && message.hasOwnProperty("routeParameters")) + object.routeParameters = $root.types.RouteParametersConfig.toObject(message.routeParameters, options); + 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); + }; + + return Bolt11SendRequest; + })(); + + api.Bolt11SendResponse = (function() { + + /** + * Properties of a Bolt11SendResponse. + * @memberof api + * @interface IBolt11SendResponse + * @property {string|null} [paymentId] Bolt11SendResponse paymentId + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11SendResponse paymentId. + * @member {string} paymentId + * @memberof api.Bolt11SendResponse + * @instance + */ + Bolt11SendResponse.prototype.paymentId = ""; + + /** + * 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.paymentId != null && Object.hasOwnProperty.call(message, "paymentId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paymentId); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt11SendResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paymentId = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paymentId != null && message.hasOwnProperty("paymentId")) + if (!$util.isString(message.paymentId)) + return "paymentId: 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) { + if (object instanceof $root.api.Bolt11SendResponse) + return object; + var message = new $root.api.Bolt11SendResponse(); + if (object.paymentId != null) + message.paymentId = String(object.paymentId); + 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 = {}; + var object = {}; + if (options.defaults) + object.paymentId = ""; + if (message.paymentId != null && message.hasOwnProperty("paymentId")) + object.paymentId = message.paymentId; + 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); + }; + + return Bolt11SendResponse; + })(); + + api.Bolt12ReceiveRequest = (function() { + + /** + * Properties of a Bolt12ReceiveRequest. + * @memberof api + * @interface IBolt12ReceiveRequest + * @property {string|null} [description] Bolt12ReceiveRequest description + * @property {number|Long|null} [amountMsat] Bolt12ReceiveRequest amountMsat + * @property {number|null} [expirySecs] Bolt12ReceiveRequest expirySecs + * @property {number|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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt12ReceiveRequest description. + * @member {string} description + * @memberof api.Bolt12ReceiveRequest + * @instance + */ + Bolt12ReceiveRequest.prototype.description = ""; + + /** + * Bolt12ReceiveRequest amountMsat. + * @member {number|Long} amountMsat + * @memberof api.Bolt12ReceiveRequest + * @instance + */ + Bolt12ReceiveRequest.prototype.amountMsat = 0; + + /** + * Bolt12ReceiveRequest expirySecs. + * @member {number} expirySecs + * @memberof api.Bolt12ReceiveRequest + * @instance + */ + Bolt12ReceiveRequest.prototype.expirySecs = 0; + + /** + * Bolt12ReceiveRequest quantity. + * @member {number|Long} quantity + * @memberof api.Bolt12ReceiveRequest + * @instance + */ + Bolt12ReceiveRequest.prototype.quantity = 0; + + /** + * 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.amountMsat != null && Object.hasOwnProperty.call(message, "amountMsat")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amountMsat); + if (message.expirySecs != null && Object.hasOwnProperty.call(message, "expirySecs")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.expirySecs); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt12ReceiveRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = reader.string(); + break; + case 2: + message.amountMsat = reader.uint64(); + break; + case 3: + message.expirySecs = reader.uint32(); + break; + case 4: + message.quantity = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (!$util.isInteger(message.amountMsat) && !(message.amountMsat && $util.isInteger(message.amountMsat.low) && $util.isInteger(message.amountMsat.high))) + return "amountMsat: integer|Long expected"; + if (message.expirySecs != null && message.hasOwnProperty("expirySecs")) + if (!$util.isInteger(message.expirySecs)) + return "expirySecs: integer expected"; + if (message.quantity != null && message.hasOwnProperty("quantity")) + 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) { + if (object instanceof $root.api.Bolt12ReceiveRequest) + return object; + var message = new $root.api.Bolt12ReceiveRequest(); + if (object.description != null) + message.description = String(object.description); + if (object.amountMsat != null) + if ($util.Long) + (message.amountMsat = $util.Long.fromValue(object.amountMsat)).unsigned = true; + else if (typeof object.amountMsat === "string") + message.amountMsat = parseInt(object.amountMsat, 10); + else if (typeof object.amountMsat === "number") + message.amountMsat = object.amountMsat; + else if (typeof object.amountMsat === "object") + message.amountMsat = new $util.LongBits(object.amountMsat.low >>> 0, object.amountMsat.high >>> 0).toNumber(true); + if (object.expirySecs != null) + message.expirySecs = object.expirySecs >>> 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 = {}; + var object = {}; + if (options.defaults) { + object.description = ""; + object.amountMsat = 0; + object.expirySecs = 0; + object.quantity = 0; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (typeof message.amountMsat === "number") + object.amountMsat = options.longs === String ? String(message.amountMsat) : message.amountMsat; + else + object.amountMsat = options.longs === String ? $util.Long.prototype.toString.call(message.amountMsat) : options.longs === Number ? new $util.LongBits(message.amountMsat.low >>> 0, message.amountMsat.high >>> 0).toNumber(true) : message.amountMsat; + if (message.expirySecs != null && message.hasOwnProperty("expirySecs")) + object.expirySecs = message.expirySecs; + if (message.quantity != null && message.hasOwnProperty("quantity")) + 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; + 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); + }; + + return Bolt12ReceiveRequest; + })(); + + api.Bolt12ReceiveResponse = (function() { + + /** + * Properties of a Bolt12ReceiveResponse. + * @memberof api + * @interface IBolt12ReceiveResponse + * @property {string|null} [offer] Bolt12ReceiveResponse offer + * @property {string|null} [offerId] Bolt12ReceiveResponse offerId + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt12ReceiveResponse offer. + * @member {string} offer + * @memberof api.Bolt12ReceiveResponse + * @instance + */ + Bolt12ReceiveResponse.prototype.offer = ""; + + /** + * Bolt12ReceiveResponse offerId. + * @member {string} offerId + * @memberof api.Bolt12ReceiveResponse + * @instance + */ + Bolt12ReceiveResponse.prototype.offerId = ""; + + /** + * 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.offerId != null && Object.hasOwnProperty.call(message, "offerId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.offerId); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt12ReceiveResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.offer = reader.string(); + break; + case 2: + message.offerId = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.offer != null && message.hasOwnProperty("offer")) + if (!$util.isString(message.offer)) + return "offer: string expected"; + if (message.offerId != null && message.hasOwnProperty("offerId")) + if (!$util.isString(message.offerId)) + return "offerId: 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) { + if (object instanceof $root.api.Bolt12ReceiveResponse) + return object; + var message = new $root.api.Bolt12ReceiveResponse(); + if (object.offer != null) + message.offer = String(object.offer); + if (object.offerId != null) + message.offerId = String(object.offerId); + 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 = {}; + var object = {}; + if (options.defaults) { + object.offer = ""; + object.offerId = ""; + } + if (message.offer != null && message.hasOwnProperty("offer")) + object.offer = message.offer; + if (message.offerId != null && message.hasOwnProperty("offerId")) + object.offerId = message.offerId; + 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); + }; + + return Bolt12ReceiveResponse; + })(); + + api.Bolt12SendRequest = (function() { + + /** + * Properties of a Bolt12SendRequest. + * @memberof api + * @interface IBolt12SendRequest + * @property {string|null} [offer] Bolt12SendRequest offer + * @property {number|Long|null} [amountMsat] Bolt12SendRequest amountMsat + * @property {number|Long|null} [quantity] Bolt12SendRequest quantity + * @property {string|null} [payerNote] Bolt12SendRequest payerNote + * @property {types.IRouteParametersConfig|null} [routeParameters] Bolt12SendRequest routeParameters + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt12SendRequest offer. + * @member {string} offer + * @memberof api.Bolt12SendRequest + * @instance + */ + Bolt12SendRequest.prototype.offer = ""; + + /** + * Bolt12SendRequest amountMsat. + * @member {number|Long} amountMsat + * @memberof api.Bolt12SendRequest + * @instance + */ + Bolt12SendRequest.prototype.amountMsat = 0; + + /** + * Bolt12SendRequest quantity. + * @member {number|Long} quantity + * @memberof api.Bolt12SendRequest + * @instance + */ + Bolt12SendRequest.prototype.quantity = 0; + + /** + * Bolt12SendRequest payerNote. + * @member {string} payerNote + * @memberof api.Bolt12SendRequest + * @instance + */ + Bolt12SendRequest.prototype.payerNote = ""; + + /** + * Bolt12SendRequest routeParameters. + * @member {types.IRouteParametersConfig|null|undefined} routeParameters + * @memberof api.Bolt12SendRequest + * @instance + */ + Bolt12SendRequest.prototype.routeParameters = null; + + /** + * 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.amountMsat != null && Object.hasOwnProperty.call(message, "amountMsat")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amountMsat); + if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.quantity); + if (message.payerNote != null && Object.hasOwnProperty.call(message, "payerNote")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.payerNote); + if (message.routeParameters != null && Object.hasOwnProperty.call(message, "routeParameters")) + $root.types.RouteParametersConfig.encode(message.routeParameters, 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt12SendRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.offer = reader.string(); + break; + case 2: + message.amountMsat = reader.uint64(); + break; + case 3: + message.quantity = reader.uint64(); + break; + case 4: + message.payerNote = reader.string(); + break; + case 5: + message.routeParameters = $root.types.RouteParametersConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.offer != null && message.hasOwnProperty("offer")) + if (!$util.isString(message.offer)) + return "offer: string expected"; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (!$util.isInteger(message.amountMsat) && !(message.amountMsat && $util.isInteger(message.amountMsat.low) && $util.isInteger(message.amountMsat.high))) + return "amountMsat: integer|Long expected"; + if (message.quantity != null && message.hasOwnProperty("quantity")) + if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) + return "quantity: integer|Long expected"; + if (message.payerNote != null && message.hasOwnProperty("payerNote")) + if (!$util.isString(message.payerNote)) + return "payerNote: string expected"; + if (message.routeParameters != null && message.hasOwnProperty("routeParameters")) { + var error = $root.types.RouteParametersConfig.verify(message.routeParameters); + if (error) + return "routeParameters." + 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) { + if (object instanceof $root.api.Bolt12SendRequest) + return object; + var message = new $root.api.Bolt12SendRequest(); + if (object.offer != null) + message.offer = String(object.offer); + if (object.amountMsat != null) + if ($util.Long) + (message.amountMsat = $util.Long.fromValue(object.amountMsat)).unsigned = true; + else if (typeof object.amountMsat === "string") + message.amountMsat = parseInt(object.amountMsat, 10); + else if (typeof object.amountMsat === "number") + message.amountMsat = object.amountMsat; + else if (typeof object.amountMsat === "object") + message.amountMsat = new $util.LongBits(object.amountMsat.low >>> 0, object.amountMsat.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.payerNote != null) + message.payerNote = String(object.payerNote); + if (object.routeParameters != null) { + if (typeof object.routeParameters !== "object") + throw TypeError(".api.Bolt12SendRequest.routeParameters: object expected"); + message.routeParameters = $root.types.RouteParametersConfig.fromObject(object.routeParameters); + } + 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 = {}; + var object = {}; + if (options.defaults) { + object.offer = ""; + object.amountMsat = 0; + object.quantity = 0; + object.payerNote = ""; + object.routeParameters = null; + } + if (message.offer != null && message.hasOwnProperty("offer")) + object.offer = message.offer; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (typeof message.amountMsat === "number") + object.amountMsat = options.longs === String ? String(message.amountMsat) : message.amountMsat; + else + object.amountMsat = options.longs === String ? $util.Long.prototype.toString.call(message.amountMsat) : options.longs === Number ? new $util.LongBits(message.amountMsat.low >>> 0, message.amountMsat.high >>> 0).toNumber(true) : message.amountMsat; + if (message.quantity != null && message.hasOwnProperty("quantity")) + 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 (message.payerNote != null && message.hasOwnProperty("payerNote")) + object.payerNote = message.payerNote; + if (message.routeParameters != null && message.hasOwnProperty("routeParameters")) + object.routeParameters = $root.types.RouteParametersConfig.toObject(message.routeParameters, options); + 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); + }; + + return Bolt12SendRequest; + })(); + + api.Bolt12SendResponse = (function() { + + /** + * Properties of a Bolt12SendResponse. + * @memberof api + * @interface IBolt12SendResponse + * @property {string|null} [paymentId] Bolt12SendResponse paymentId + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt12SendResponse paymentId. + * @member {string} paymentId + * @memberof api.Bolt12SendResponse + * @instance + */ + Bolt12SendResponse.prototype.paymentId = ""; + + /** + * 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.paymentId != null && Object.hasOwnProperty.call(message, "paymentId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paymentId); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.Bolt12SendResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paymentId = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paymentId != null && message.hasOwnProperty("paymentId")) + if (!$util.isString(message.paymentId)) + return "paymentId: 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) { + if (object instanceof $root.api.Bolt12SendResponse) + return object; + var message = new $root.api.Bolt12SendResponse(); + if (object.paymentId != null) + message.paymentId = String(object.paymentId); + 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 = {}; + var object = {}; + if (options.defaults) + object.paymentId = ""; + if (message.paymentId != null && message.hasOwnProperty("paymentId")) + object.paymentId = message.paymentId; + 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); + }; + + return Bolt12SendResponse; + })(); + + api.SpontaneousSendRequest = (function() { + + /** + * Properties of a SpontaneousSendRequest. + * @memberof api + * @interface ISpontaneousSendRequest + * @property {number|Long|null} [amountMsat] SpontaneousSendRequest amountMsat + * @property {string|null} [nodeId] SpontaneousSendRequest nodeId + * @property {types.IRouteParametersConfig|null} [routeParameters] SpontaneousSendRequest routeParameters + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpontaneousSendRequest amountMsat. + * @member {number|Long} amountMsat + * @memberof api.SpontaneousSendRequest + * @instance + */ + SpontaneousSendRequest.prototype.amountMsat = 0; + + /** + * SpontaneousSendRequest nodeId. + * @member {string} nodeId + * @memberof api.SpontaneousSendRequest + * @instance + */ + SpontaneousSendRequest.prototype.nodeId = ""; + + /** + * SpontaneousSendRequest routeParameters. + * @member {types.IRouteParametersConfig|null|undefined} routeParameters + * @memberof api.SpontaneousSendRequest + * @instance + */ + SpontaneousSendRequest.prototype.routeParameters = null; + + /** + * 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.amountMsat != null && Object.hasOwnProperty.call(message, "amountMsat")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amountMsat); + if (message.nodeId != null && Object.hasOwnProperty.call(message, "nodeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeId); + if (message.routeParameters != null && Object.hasOwnProperty.call(message, "routeParameters")) + $root.types.RouteParametersConfig.encode(message.routeParameters, 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.SpontaneousSendRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amountMsat = reader.uint64(); + break; + case 2: + message.nodeId = reader.string(); + break; + case 3: + message.routeParameters = $root.types.RouteParametersConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (!$util.isInteger(message.amountMsat) && !(message.amountMsat && $util.isInteger(message.amountMsat.low) && $util.isInteger(message.amountMsat.high))) + return "amountMsat: integer|Long expected"; + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + if (!$util.isString(message.nodeId)) + return "nodeId: string expected"; + if (message.routeParameters != null && message.hasOwnProperty("routeParameters")) { + var error = $root.types.RouteParametersConfig.verify(message.routeParameters); + if (error) + return "routeParameters." + 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) { + if (object instanceof $root.api.SpontaneousSendRequest) + return object; + var message = new $root.api.SpontaneousSendRequest(); + if (object.amountMsat != null) + if ($util.Long) + (message.amountMsat = $util.Long.fromValue(object.amountMsat)).unsigned = true; + else if (typeof object.amountMsat === "string") + message.amountMsat = parseInt(object.amountMsat, 10); + else if (typeof object.amountMsat === "number") + message.amountMsat = object.amountMsat; + else if (typeof object.amountMsat === "object") + message.amountMsat = new $util.LongBits(object.amountMsat.low >>> 0, object.amountMsat.high >>> 0).toNumber(true); + if (object.nodeId != null) + message.nodeId = String(object.nodeId); + if (object.routeParameters != null) { + if (typeof object.routeParameters !== "object") + throw TypeError(".api.SpontaneousSendRequest.routeParameters: object expected"); + message.routeParameters = $root.types.RouteParametersConfig.fromObject(object.routeParameters); + } + 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 = {}; + var object = {}; + if (options.defaults) { + object.amountMsat = 0; + object.nodeId = ""; + object.routeParameters = null; + } + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (typeof message.amountMsat === "number") + object.amountMsat = options.longs === String ? String(message.amountMsat) : message.amountMsat; + else + object.amountMsat = options.longs === String ? $util.Long.prototype.toString.call(message.amountMsat) : options.longs === Number ? new $util.LongBits(message.amountMsat.low >>> 0, message.amountMsat.high >>> 0).toNumber(true) : message.amountMsat; + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + object.nodeId = message.nodeId; + if (message.routeParameters != null && message.hasOwnProperty("routeParameters")) + object.routeParameters = $root.types.RouteParametersConfig.toObject(message.routeParameters, options); + 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); + }; + + return SpontaneousSendRequest; + })(); + + api.SpontaneousSendResponse = (function() { + + /** + * Properties of a SpontaneousSendResponse. + * @memberof api + * @interface ISpontaneousSendResponse + * @property {string|null} [paymentId] SpontaneousSendResponse paymentId + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpontaneousSendResponse paymentId. + * @member {string} paymentId + * @memberof api.SpontaneousSendResponse + * @instance + */ + SpontaneousSendResponse.prototype.paymentId = ""; + + /** + * 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.paymentId != null && Object.hasOwnProperty.call(message, "paymentId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paymentId); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.SpontaneousSendResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paymentId = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paymentId != null && message.hasOwnProperty("paymentId")) + if (!$util.isString(message.paymentId)) + return "paymentId: 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) { + if (object instanceof $root.api.SpontaneousSendResponse) + return object; + var message = new $root.api.SpontaneousSendResponse(); + if (object.paymentId != null) + message.paymentId = String(object.paymentId); + 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 = {}; + var object = {}; + if (options.defaults) + object.paymentId = ""; + if (message.paymentId != null && message.hasOwnProperty("paymentId")) + object.paymentId = message.paymentId; + 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); + }; + + return SpontaneousSendResponse; + })(); + + api.OpenChannelRequest = (function() { + + /** + * Properties of an OpenChannelRequest. + * @memberof api + * @interface IOpenChannelRequest + * @property {string|null} [nodePubkey] OpenChannelRequest nodePubkey + * @property {string|null} [address] OpenChannelRequest address + * @property {number|Long|null} [channelAmountSats] OpenChannelRequest channelAmountSats + * @property {number|Long|null} [pushToCounterpartyMsat] OpenChannelRequest pushToCounterpartyMsat + * @property {types.IChannelConfig|null} [channelConfig] OpenChannelRequest channelConfig + * @property {boolean|null} [announceChannel] OpenChannelRequest announceChannel + * @property {boolean|null} [disableCounterpartyReserve] OpenChannelRequest disableCounterpartyReserve + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpenChannelRequest nodePubkey. + * @member {string} nodePubkey + * @memberof api.OpenChannelRequest + * @instance + */ + OpenChannelRequest.prototype.nodePubkey = ""; + + /** + * OpenChannelRequest address. + * @member {string} address + * @memberof api.OpenChannelRequest + * @instance + */ + OpenChannelRequest.prototype.address = ""; + + /** + * OpenChannelRequest channelAmountSats. + * @member {number|Long} channelAmountSats + * @memberof api.OpenChannelRequest + * @instance + */ + OpenChannelRequest.prototype.channelAmountSats = 0; + + /** + * OpenChannelRequest pushToCounterpartyMsat. + * @member {number|Long} pushToCounterpartyMsat + * @memberof api.OpenChannelRequest + * @instance + */ + OpenChannelRequest.prototype.pushToCounterpartyMsat = 0; + + /** + * OpenChannelRequest channelConfig. + * @member {types.IChannelConfig|null|undefined} channelConfig + * @memberof api.OpenChannelRequest + * @instance + */ + OpenChannelRequest.prototype.channelConfig = null; + + /** + * OpenChannelRequest announceChannel. + * @member {boolean} announceChannel + * @memberof api.OpenChannelRequest + * @instance + */ + OpenChannelRequest.prototype.announceChannel = false; + + /** + * OpenChannelRequest disableCounterpartyReserve. + * @member {boolean} disableCounterpartyReserve + * @memberof api.OpenChannelRequest + * @instance + */ + OpenChannelRequest.prototype.disableCounterpartyReserve = false; + + /** + * 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.nodePubkey != null && Object.hasOwnProperty.call(message, "nodePubkey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodePubkey); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.address); + if (message.channelAmountSats != null && Object.hasOwnProperty.call(message, "channelAmountSats")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.channelAmountSats); + if (message.pushToCounterpartyMsat != null && Object.hasOwnProperty.call(message, "pushToCounterpartyMsat")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.pushToCounterpartyMsat); + if (message.channelConfig != null && Object.hasOwnProperty.call(message, "channelConfig")) + $root.types.ChannelConfig.encode(message.channelConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.announceChannel != null && Object.hasOwnProperty.call(message, "announceChannel")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.announceChannel); + if (message.disableCounterpartyReserve != null && Object.hasOwnProperty.call(message, "disableCounterpartyReserve")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.disableCounterpartyReserve); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.OpenChannelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nodePubkey = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + case 3: + message.channelAmountSats = reader.uint64(); + break; + case 4: + message.pushToCounterpartyMsat = reader.uint64(); + break; + case 5: + message.channelConfig = $root.types.ChannelConfig.decode(reader, reader.uint32()); + break; + case 6: + message.announceChannel = reader.bool(); + break; + case 7: + message.disableCounterpartyReserve = reader.bool(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodePubkey != null && message.hasOwnProperty("nodePubkey")) + if (!$util.isString(message.nodePubkey)) + return "nodePubkey: string expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.channelAmountSats != null && message.hasOwnProperty("channelAmountSats")) + if (!$util.isInteger(message.channelAmountSats) && !(message.channelAmountSats && $util.isInteger(message.channelAmountSats.low) && $util.isInteger(message.channelAmountSats.high))) + return "channelAmountSats: integer|Long expected"; + if (message.pushToCounterpartyMsat != null && message.hasOwnProperty("pushToCounterpartyMsat")) + if (!$util.isInteger(message.pushToCounterpartyMsat) && !(message.pushToCounterpartyMsat && $util.isInteger(message.pushToCounterpartyMsat.low) && $util.isInteger(message.pushToCounterpartyMsat.high))) + return "pushToCounterpartyMsat: integer|Long expected"; + if (message.channelConfig != null && message.hasOwnProperty("channelConfig")) { + var error = $root.types.ChannelConfig.verify(message.channelConfig); + if (error) + return "channelConfig." + error; + } + if (message.announceChannel != null && message.hasOwnProperty("announceChannel")) + if (typeof message.announceChannel !== "boolean") + return "announceChannel: boolean expected"; + if (message.disableCounterpartyReserve != null && message.hasOwnProperty("disableCounterpartyReserve")) + if (typeof message.disableCounterpartyReserve !== "boolean") + return "disableCounterpartyReserve: 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) { + if (object instanceof $root.api.OpenChannelRequest) + return object; + var message = new $root.api.OpenChannelRequest(); + if (object.nodePubkey != null) + message.nodePubkey = String(object.nodePubkey); + if (object.address != null) + message.address = String(object.address); + if (object.channelAmountSats != null) + if ($util.Long) + (message.channelAmountSats = $util.Long.fromValue(object.channelAmountSats)).unsigned = true; + else if (typeof object.channelAmountSats === "string") + message.channelAmountSats = parseInt(object.channelAmountSats, 10); + else if (typeof object.channelAmountSats === "number") + message.channelAmountSats = object.channelAmountSats; + else if (typeof object.channelAmountSats === "object") + message.channelAmountSats = new $util.LongBits(object.channelAmountSats.low >>> 0, object.channelAmountSats.high >>> 0).toNumber(true); + if (object.pushToCounterpartyMsat != null) + if ($util.Long) + (message.pushToCounterpartyMsat = $util.Long.fromValue(object.pushToCounterpartyMsat)).unsigned = true; + else if (typeof object.pushToCounterpartyMsat === "string") + message.pushToCounterpartyMsat = parseInt(object.pushToCounterpartyMsat, 10); + else if (typeof object.pushToCounterpartyMsat === "number") + message.pushToCounterpartyMsat = object.pushToCounterpartyMsat; + else if (typeof object.pushToCounterpartyMsat === "object") + message.pushToCounterpartyMsat = new $util.LongBits(object.pushToCounterpartyMsat.low >>> 0, object.pushToCounterpartyMsat.high >>> 0).toNumber(true); + if (object.channelConfig != null) { + if (typeof object.channelConfig !== "object") + throw TypeError(".api.OpenChannelRequest.channelConfig: object expected"); + message.channelConfig = $root.types.ChannelConfig.fromObject(object.channelConfig); + } + if (object.announceChannel != null) + message.announceChannel = Boolean(object.announceChannel); + if (object.disableCounterpartyReserve != null) + message.disableCounterpartyReserve = Boolean(object.disableCounterpartyReserve); + 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 = {}; + var object = {}; + if (options.defaults) { + object.nodePubkey = ""; + object.address = ""; + object.channelAmountSats = 0; + object.pushToCounterpartyMsat = 0; + object.channelConfig = null; + object.announceChannel = false; + object.disableCounterpartyReserve = false; + } + if (message.nodePubkey != null && message.hasOwnProperty("nodePubkey")) + object.nodePubkey = message.nodePubkey; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.channelAmountSats != null && message.hasOwnProperty("channelAmountSats")) + if (typeof message.channelAmountSats === "number") + object.channelAmountSats = options.longs === String ? String(message.channelAmountSats) : message.channelAmountSats; + else + object.channelAmountSats = options.longs === String ? $util.Long.prototype.toString.call(message.channelAmountSats) : options.longs === Number ? new $util.LongBits(message.channelAmountSats.low >>> 0, message.channelAmountSats.high >>> 0).toNumber(true) : message.channelAmountSats; + if (message.pushToCounterpartyMsat != null && message.hasOwnProperty("pushToCounterpartyMsat")) + if (typeof message.pushToCounterpartyMsat === "number") + object.pushToCounterpartyMsat = options.longs === String ? String(message.pushToCounterpartyMsat) : message.pushToCounterpartyMsat; + else + object.pushToCounterpartyMsat = options.longs === String ? $util.Long.prototype.toString.call(message.pushToCounterpartyMsat) : options.longs === Number ? new $util.LongBits(message.pushToCounterpartyMsat.low >>> 0, message.pushToCounterpartyMsat.high >>> 0).toNumber(true) : message.pushToCounterpartyMsat; + if (message.channelConfig != null && message.hasOwnProperty("channelConfig")) + object.channelConfig = $root.types.ChannelConfig.toObject(message.channelConfig, options); + if (message.announceChannel != null && message.hasOwnProperty("announceChannel")) + object.announceChannel = message.announceChannel; + if (message.disableCounterpartyReserve != null && message.hasOwnProperty("disableCounterpartyReserve")) + object.disableCounterpartyReserve = message.disableCounterpartyReserve; + 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); + }; + + return OpenChannelRequest; + })(); + + api.OpenChannelResponse = (function() { + + /** + * Properties of an OpenChannelResponse. + * @memberof api + * @interface IOpenChannelResponse + * @property {string|null} [userChannelId] OpenChannelResponse userChannelId + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpenChannelResponse userChannelId. + * @member {string} userChannelId + * @memberof api.OpenChannelResponse + * @instance + */ + OpenChannelResponse.prototype.userChannelId = ""; + + /** + * 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.userChannelId != null && Object.hasOwnProperty.call(message, "userChannelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userChannelId); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.OpenChannelResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userChannelId = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userChannelId != null && message.hasOwnProperty("userChannelId")) + if (!$util.isString(message.userChannelId)) + return "userChannelId: 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) { + if (object instanceof $root.api.OpenChannelResponse) + return object; + var message = new $root.api.OpenChannelResponse(); + if (object.userChannelId != null) + message.userChannelId = String(object.userChannelId); + 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 = {}; + var object = {}; + if (options.defaults) + object.userChannelId = ""; + if (message.userChannelId != null && message.hasOwnProperty("userChannelId")) + object.userChannelId = message.userChannelId; + 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); + }; + + return OpenChannelResponse; + })(); + + api.SpliceInRequest = (function() { + + /** + * Properties of a SpliceInRequest. + * @memberof api + * @interface ISpliceInRequest + * @property {string|null} [userChannelId] SpliceInRequest userChannelId + * @property {string|null} [counterpartyNodeId] SpliceInRequest counterpartyNodeId + * @property {number|Long|null} [spliceAmountSats] SpliceInRequest spliceAmountSats + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpliceInRequest userChannelId. + * @member {string} userChannelId + * @memberof api.SpliceInRequest + * @instance + */ + SpliceInRequest.prototype.userChannelId = ""; + + /** + * SpliceInRequest counterpartyNodeId. + * @member {string} counterpartyNodeId + * @memberof api.SpliceInRequest + * @instance + */ + SpliceInRequest.prototype.counterpartyNodeId = ""; + + /** + * SpliceInRequest spliceAmountSats. + * @member {number|Long} spliceAmountSats + * @memberof api.SpliceInRequest + * @instance + */ + SpliceInRequest.prototype.spliceAmountSats = 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.userChannelId != null && Object.hasOwnProperty.call(message, "userChannelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userChannelId); + if (message.counterpartyNodeId != null && Object.hasOwnProperty.call(message, "counterpartyNodeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterpartyNodeId); + if (message.spliceAmountSats != null && Object.hasOwnProperty.call(message, "spliceAmountSats")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.spliceAmountSats); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.SpliceInRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userChannelId = reader.string(); + break; + case 2: + message.counterpartyNodeId = reader.string(); + break; + case 3: + message.spliceAmountSats = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userChannelId != null && message.hasOwnProperty("userChannelId")) + if (!$util.isString(message.userChannelId)) + return "userChannelId: string expected"; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + if (!$util.isString(message.counterpartyNodeId)) + return "counterpartyNodeId: string expected"; + if (message.spliceAmountSats != null && message.hasOwnProperty("spliceAmountSats")) + if (!$util.isInteger(message.spliceAmountSats) && !(message.spliceAmountSats && $util.isInteger(message.spliceAmountSats.low) && $util.isInteger(message.spliceAmountSats.high))) + return "spliceAmountSats: 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) { + if (object instanceof $root.api.SpliceInRequest) + return object; + var message = new $root.api.SpliceInRequest(); + if (object.userChannelId != null) + message.userChannelId = String(object.userChannelId); + if (object.counterpartyNodeId != null) + message.counterpartyNodeId = String(object.counterpartyNodeId); + if (object.spliceAmountSats != null) + if ($util.Long) + (message.spliceAmountSats = $util.Long.fromValue(object.spliceAmountSats)).unsigned = true; + else if (typeof object.spliceAmountSats === "string") + message.spliceAmountSats = parseInt(object.spliceAmountSats, 10); + else if (typeof object.spliceAmountSats === "number") + message.spliceAmountSats = object.spliceAmountSats; + else if (typeof object.spliceAmountSats === "object") + message.spliceAmountSats = new $util.LongBits(object.spliceAmountSats.low >>> 0, object.spliceAmountSats.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 = {}; + var object = {}; + if (options.defaults) { + object.userChannelId = ""; + object.counterpartyNodeId = ""; + object.spliceAmountSats = 0; + } + if (message.userChannelId != null && message.hasOwnProperty("userChannelId")) + object.userChannelId = message.userChannelId; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + object.counterpartyNodeId = message.counterpartyNodeId; + if (message.spliceAmountSats != null && message.hasOwnProperty("spliceAmountSats")) + if (typeof message.spliceAmountSats === "number") + object.spliceAmountSats = options.longs === String ? String(message.spliceAmountSats) : message.spliceAmountSats; + else + object.spliceAmountSats = options.longs === String ? $util.Long.prototype.toString.call(message.spliceAmountSats) : options.longs === Number ? new $util.LongBits(message.spliceAmountSats.low >>> 0, message.spliceAmountSats.high >>> 0).toNumber(true) : message.spliceAmountSats; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.SpliceInResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.SpliceInResponse) + return object; + 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); + }; + + return SpliceInResponse; + })(); + + api.SpliceOutRequest = (function() { + + /** + * Properties of a SpliceOutRequest. + * @memberof api + * @interface ISpliceOutRequest + * @property {string|null} [userChannelId] SpliceOutRequest userChannelId + * @property {string|null} [counterpartyNodeId] SpliceOutRequest counterpartyNodeId + * @property {string|null} [address] SpliceOutRequest address + * @property {number|Long|null} [spliceAmountSats] SpliceOutRequest spliceAmountSats + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpliceOutRequest userChannelId. + * @member {string} userChannelId + * @memberof api.SpliceOutRequest + * @instance + */ + SpliceOutRequest.prototype.userChannelId = ""; + + /** + * SpliceOutRequest counterpartyNodeId. + * @member {string} counterpartyNodeId + * @memberof api.SpliceOutRequest + * @instance + */ + SpliceOutRequest.prototype.counterpartyNodeId = ""; + + /** + * SpliceOutRequest address. + * @member {string} address + * @memberof api.SpliceOutRequest + * @instance + */ + SpliceOutRequest.prototype.address = ""; + + /** + * SpliceOutRequest spliceAmountSats. + * @member {number|Long} spliceAmountSats + * @memberof api.SpliceOutRequest + * @instance + */ + SpliceOutRequest.prototype.spliceAmountSats = 0; + + /** + * 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.userChannelId != null && Object.hasOwnProperty.call(message, "userChannelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userChannelId); + if (message.counterpartyNodeId != null && Object.hasOwnProperty.call(message, "counterpartyNodeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterpartyNodeId); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.address); + if (message.spliceAmountSats != null && Object.hasOwnProperty.call(message, "spliceAmountSats")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.spliceAmountSats); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.SpliceOutRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userChannelId = reader.string(); + break; + case 2: + message.counterpartyNodeId = reader.string(); + break; + case 3: + message.address = reader.string(); + break; + case 4: + message.spliceAmountSats = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userChannelId != null && message.hasOwnProperty("userChannelId")) + if (!$util.isString(message.userChannelId)) + return "userChannelId: string expected"; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + if (!$util.isString(message.counterpartyNodeId)) + return "counterpartyNodeId: string expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.spliceAmountSats != null && message.hasOwnProperty("spliceAmountSats")) + if (!$util.isInteger(message.spliceAmountSats) && !(message.spliceAmountSats && $util.isInteger(message.spliceAmountSats.low) && $util.isInteger(message.spliceAmountSats.high))) + return "spliceAmountSats: 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) { + if (object instanceof $root.api.SpliceOutRequest) + return object; + var message = new $root.api.SpliceOutRequest(); + if (object.userChannelId != null) + message.userChannelId = String(object.userChannelId); + if (object.counterpartyNodeId != null) + message.counterpartyNodeId = String(object.counterpartyNodeId); + if (object.address != null) + message.address = String(object.address); + if (object.spliceAmountSats != null) + if ($util.Long) + (message.spliceAmountSats = $util.Long.fromValue(object.spliceAmountSats)).unsigned = true; + else if (typeof object.spliceAmountSats === "string") + message.spliceAmountSats = parseInt(object.spliceAmountSats, 10); + else if (typeof object.spliceAmountSats === "number") + message.spliceAmountSats = object.spliceAmountSats; + else if (typeof object.spliceAmountSats === "object") + message.spliceAmountSats = new $util.LongBits(object.spliceAmountSats.low >>> 0, object.spliceAmountSats.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 = {}; + var object = {}; + if (options.defaults) { + object.userChannelId = ""; + object.counterpartyNodeId = ""; + object.address = ""; + object.spliceAmountSats = 0; + } + if (message.userChannelId != null && message.hasOwnProperty("userChannelId")) + object.userChannelId = message.userChannelId; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + object.counterpartyNodeId = message.counterpartyNodeId; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.spliceAmountSats != null && message.hasOwnProperty("spliceAmountSats")) + if (typeof message.spliceAmountSats === "number") + object.spliceAmountSats = options.longs === String ? String(message.spliceAmountSats) : message.spliceAmountSats; + else + object.spliceAmountSats = options.longs === String ? $util.Long.prototype.toString.call(message.spliceAmountSats) : options.longs === Number ? new $util.LongBits(message.spliceAmountSats.low >>> 0, message.spliceAmountSats.high >>> 0).toNumber(true) : message.spliceAmountSats; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.SpliceOutResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.SpliceOutResponse) + return object; + var 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 = {}; + var 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); + }; + + return SpliceOutResponse; + })(); + + api.UpdateChannelConfigRequest = (function() { + + /** + * Properties of an UpdateChannelConfigRequest. + * @memberof api + * @interface IUpdateChannelConfigRequest + * @property {string|null} [userChannelId] UpdateChannelConfigRequest userChannelId + * @property {string|null} [counterpartyNodeId] UpdateChannelConfigRequest counterpartyNodeId + * @property {types.IChannelConfig|null} [channelConfig] UpdateChannelConfigRequest channelConfig + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateChannelConfigRequest userChannelId. + * @member {string} userChannelId + * @memberof api.UpdateChannelConfigRequest + * @instance + */ + UpdateChannelConfigRequest.prototype.userChannelId = ""; + + /** + * UpdateChannelConfigRequest counterpartyNodeId. + * @member {string} counterpartyNodeId + * @memberof api.UpdateChannelConfigRequest + * @instance + */ + UpdateChannelConfigRequest.prototype.counterpartyNodeId = ""; + + /** + * UpdateChannelConfigRequest channelConfig. + * @member {types.IChannelConfig|null|undefined} channelConfig + * @memberof api.UpdateChannelConfigRequest + * @instance + */ + UpdateChannelConfigRequest.prototype.channelConfig = 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.userChannelId != null && Object.hasOwnProperty.call(message, "userChannelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userChannelId); + if (message.counterpartyNodeId != null && Object.hasOwnProperty.call(message, "counterpartyNodeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterpartyNodeId); + if (message.channelConfig != null && Object.hasOwnProperty.call(message, "channelConfig")) + $root.types.ChannelConfig.encode(message.channelConfig, 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.UpdateChannelConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userChannelId = reader.string(); + break; + case 2: + message.counterpartyNodeId = reader.string(); + break; + case 3: + message.channelConfig = $root.types.ChannelConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userChannelId != null && message.hasOwnProperty("userChannelId")) + if (!$util.isString(message.userChannelId)) + return "userChannelId: string expected"; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + if (!$util.isString(message.counterpartyNodeId)) + return "counterpartyNodeId: string expected"; + if (message.channelConfig != null && message.hasOwnProperty("channelConfig")) { + var error = $root.types.ChannelConfig.verify(message.channelConfig); + if (error) + return "channelConfig." + 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) { + if (object instanceof $root.api.UpdateChannelConfigRequest) + return object; + var message = new $root.api.UpdateChannelConfigRequest(); + if (object.userChannelId != null) + message.userChannelId = String(object.userChannelId); + if (object.counterpartyNodeId != null) + message.counterpartyNodeId = String(object.counterpartyNodeId); + if (object.channelConfig != null) { + if (typeof object.channelConfig !== "object") + throw TypeError(".api.UpdateChannelConfigRequest.channelConfig: object expected"); + message.channelConfig = $root.types.ChannelConfig.fromObject(object.channelConfig); + } + 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 = {}; + var object = {}; + if (options.defaults) { + object.userChannelId = ""; + object.counterpartyNodeId = ""; + object.channelConfig = null; + } + if (message.userChannelId != null && message.hasOwnProperty("userChannelId")) + object.userChannelId = message.userChannelId; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + object.counterpartyNodeId = message.counterpartyNodeId; + if (message.channelConfig != null && message.hasOwnProperty("channelConfig")) + object.channelConfig = $root.types.ChannelConfig.toObject(message.channelConfig, 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.UpdateChannelConfigResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.UpdateChannelConfigResponse) + return object; + 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); + }; + + return UpdateChannelConfigResponse; + })(); + + api.CloseChannelRequest = (function() { + + /** + * Properties of a CloseChannelRequest. + * @memberof api + * @interface ICloseChannelRequest + * @property {string|null} [userChannelId] CloseChannelRequest userChannelId + * @property {string|null} [counterpartyNodeId] CloseChannelRequest counterpartyNodeId + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloseChannelRequest userChannelId. + * @member {string} userChannelId + * @memberof api.CloseChannelRequest + * @instance + */ + CloseChannelRequest.prototype.userChannelId = ""; + + /** + * CloseChannelRequest counterpartyNodeId. + * @member {string} counterpartyNodeId + * @memberof api.CloseChannelRequest + * @instance + */ + CloseChannelRequest.prototype.counterpartyNodeId = ""; + + /** + * 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.userChannelId != null && Object.hasOwnProperty.call(message, "userChannelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userChannelId); + if (message.counterpartyNodeId != null && Object.hasOwnProperty.call(message, "counterpartyNodeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterpartyNodeId); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.CloseChannelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userChannelId = reader.string(); + break; + case 2: + message.counterpartyNodeId = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userChannelId != null && message.hasOwnProperty("userChannelId")) + if (!$util.isString(message.userChannelId)) + return "userChannelId: string expected"; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + if (!$util.isString(message.counterpartyNodeId)) + return "counterpartyNodeId: 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) { + if (object instanceof $root.api.CloseChannelRequest) + return object; + var message = new $root.api.CloseChannelRequest(); + if (object.userChannelId != null) + message.userChannelId = String(object.userChannelId); + if (object.counterpartyNodeId != null) + message.counterpartyNodeId = String(object.counterpartyNodeId); + 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 = {}; + var object = {}; + if (options.defaults) { + object.userChannelId = ""; + object.counterpartyNodeId = ""; + } + if (message.userChannelId != null && message.hasOwnProperty("userChannelId")) + object.userChannelId = message.userChannelId; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + object.counterpartyNodeId = message.counterpartyNodeId; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.CloseChannelResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.CloseChannelResponse) + return object; + 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); + }; + + return CloseChannelResponse; + })(); + + api.ForceCloseChannelRequest = (function() { + + /** + * Properties of a ForceCloseChannelRequest. + * @memberof api + * @interface IForceCloseChannelRequest + * @property {string|null} [userChannelId] ForceCloseChannelRequest userChannelId + * @property {string|null} [counterpartyNodeId] ForceCloseChannelRequest counterpartyNodeId + * @property {string|null} [forceCloseReason] ForceCloseChannelRequest forceCloseReason + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ForceCloseChannelRequest userChannelId. + * @member {string} userChannelId + * @memberof api.ForceCloseChannelRequest + * @instance + */ + ForceCloseChannelRequest.prototype.userChannelId = ""; + + /** + * ForceCloseChannelRequest counterpartyNodeId. + * @member {string} counterpartyNodeId + * @memberof api.ForceCloseChannelRequest + * @instance + */ + ForceCloseChannelRequest.prototype.counterpartyNodeId = ""; + + /** + * ForceCloseChannelRequest forceCloseReason. + * @member {string} forceCloseReason + * @memberof api.ForceCloseChannelRequest + * @instance + */ + ForceCloseChannelRequest.prototype.forceCloseReason = ""; + + /** + * 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.userChannelId != null && Object.hasOwnProperty.call(message, "userChannelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userChannelId); + if (message.counterpartyNodeId != null && Object.hasOwnProperty.call(message, "counterpartyNodeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterpartyNodeId); + if (message.forceCloseReason != null && Object.hasOwnProperty.call(message, "forceCloseReason")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.forceCloseReason); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ForceCloseChannelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userChannelId = reader.string(); + break; + case 2: + message.counterpartyNodeId = reader.string(); + break; + case 3: + message.forceCloseReason = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userChannelId != null && message.hasOwnProperty("userChannelId")) + if (!$util.isString(message.userChannelId)) + return "userChannelId: string expected"; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + if (!$util.isString(message.counterpartyNodeId)) + return "counterpartyNodeId: string expected"; + if (message.forceCloseReason != null && message.hasOwnProperty("forceCloseReason")) + if (!$util.isString(message.forceCloseReason)) + return "forceCloseReason: 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) { + if (object instanceof $root.api.ForceCloseChannelRequest) + return object; + var message = new $root.api.ForceCloseChannelRequest(); + if (object.userChannelId != null) + message.userChannelId = String(object.userChannelId); + if (object.counterpartyNodeId != null) + message.counterpartyNodeId = String(object.counterpartyNodeId); + if (object.forceCloseReason != null) + message.forceCloseReason = String(object.forceCloseReason); + 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 = {}; + var object = {}; + if (options.defaults) { + object.userChannelId = ""; + object.counterpartyNodeId = ""; + object.forceCloseReason = ""; + } + if (message.userChannelId != null && message.hasOwnProperty("userChannelId")) + object.userChannelId = message.userChannelId; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + object.counterpartyNodeId = message.counterpartyNodeId; + if (message.forceCloseReason != null && message.hasOwnProperty("forceCloseReason")) + object.forceCloseReason = message.forceCloseReason; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ForceCloseChannelResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.ForceCloseChannelResponse) + return object; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ListChannelsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.ListChannelsRequest) + return object; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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 (var 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ListChannelsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.channels && message.channels.length)) + message.channels = []; + message.channels.push($root.types.Channel.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channels != null && message.hasOwnProperty("channels")) { + if (!Array.isArray(message.channels)) + return "channels: array expected"; + for (var i = 0; i < message.channels.length; ++i) { + var error = $root.types.Channel.verify(message.channels[i]); + 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) { + if (object instanceof $root.api.ListChannelsResponse) + return object; + var message = new $root.api.ListChannelsResponse(); + if (object.channels) { + if (!Array.isArray(object.channels)) + throw TypeError(".api.ListChannelsResponse.channels: array expected"); + message.channels = []; + for (var 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]); + } + } + 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 = {}; + var object = {}; + if (options.arrays || options.defaults) + object.channels = []; + if (message.channels && message.channels.length) { + object.channels = []; + for (var 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); + }; + + return ListChannelsResponse; + })(); + + api.GetPaymentDetailsRequest = (function() { + + /** + * Properties of a GetPaymentDetailsRequest. + * @memberof api + * @interface IGetPaymentDetailsRequest + * @property {string|null} [paymentId] GetPaymentDetailsRequest paymentId + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPaymentDetailsRequest paymentId. + * @member {string} paymentId + * @memberof api.GetPaymentDetailsRequest + * @instance + */ + GetPaymentDetailsRequest.prototype.paymentId = ""; + + /** + * 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.paymentId != null && Object.hasOwnProperty.call(message, "paymentId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paymentId); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GetPaymentDetailsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paymentId = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paymentId != null && message.hasOwnProperty("paymentId")) + if (!$util.isString(message.paymentId)) + return "paymentId: 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) { + if (object instanceof $root.api.GetPaymentDetailsRequest) + return object; + var message = new $root.api.GetPaymentDetailsRequest(); + if (object.paymentId != null) + message.paymentId = String(object.paymentId); + 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 = {}; + var object = {}; + if (options.defaults) + object.paymentId = ""; + if (message.paymentId != null && message.hasOwnProperty("paymentId")) + object.paymentId = message.paymentId; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GetPaymentDetailsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.payment = $root.types.Payment.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.payment != null && message.hasOwnProperty("payment")) { + var error = $root.types.Payment.verify(message.payment); + 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) { + if (object instanceof $root.api.GetPaymentDetailsResponse) + return object; + var 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); + } + 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 = {}; + var 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); + }; + + return GetPaymentDetailsResponse; + })(); + + api.ListPaymentsRequest = (function() { + + /** + * Properties of a ListPaymentsRequest. + * @memberof api + * @interface IListPaymentsRequest + * @property {types.IPageToken|null} [pageToken] ListPaymentsRequest pageToken + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPaymentsRequest pageToken. + * @member {types.IPageToken|null|undefined} pageToken + * @memberof api.ListPaymentsRequest + * @instance + */ + ListPaymentsRequest.prototype.pageToken = null; + + /** + * 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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + $root.types.PageToken.encode(message.pageToken, 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ListPaymentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pageToken = $root.types.PageToken.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + var error = $root.types.PageToken.verify(message.pageToken); + if (error) + return "pageToken." + 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) { + if (object instanceof $root.api.ListPaymentsRequest) + return object; + var message = new $root.api.ListPaymentsRequest(); + if (object.pageToken != null) { + if (typeof object.pageToken !== "object") + throw TypeError(".api.ListPaymentsRequest.pageToken: object expected"); + message.pageToken = $root.types.PageToken.fromObject(object.pageToken); + } + 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 = {}; + var object = {}; + if (options.defaults) + object.pageToken = null; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = $root.types.PageToken.toObject(message.pageToken, options); + 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); + }; + + return ListPaymentsRequest; + })(); + + api.ListPaymentsResponse = (function() { + + /** + * Properties of a ListPaymentsResponse. + * @memberof api + * @interface IListPaymentsResponse + * @property {Array.|null} [payments] ListPaymentsResponse payments + * @property {types.IPageToken|null} [nextPageToken] ListPaymentsResponse nextPageToken + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPaymentsResponse payments. + * @member {Array.} payments + * @memberof api.ListPaymentsResponse + * @instance + */ + ListPaymentsResponse.prototype.payments = $util.emptyArray; + + /** + * ListPaymentsResponse nextPageToken. + * @member {types.IPageToken|null|undefined} nextPageToken + * @memberof api.ListPaymentsResponse + * @instance + */ + ListPaymentsResponse.prototype.nextPageToken = null; + + /** + * 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 (var 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.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + $root.types.PageToken.encode(message.nextPageToken, 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ListPaymentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.payments && message.payments.length)) + message.payments = []; + message.payments.push($root.types.Payment.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = $root.types.PageToken.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.payments != null && message.hasOwnProperty("payments")) { + if (!Array.isArray(message.payments)) + return "payments: array expected"; + for (var i = 0; i < message.payments.length; ++i) { + var error = $root.types.Payment.verify(message.payments[i]); + if (error) + return "payments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + var error = $root.types.PageToken.verify(message.nextPageToken); + if (error) + return "nextPageToken." + 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) { + if (object instanceof $root.api.ListPaymentsResponse) + return object; + var message = new $root.api.ListPaymentsResponse(); + if (object.payments) { + if (!Array.isArray(object.payments)) + throw TypeError(".api.ListPaymentsResponse.payments: array expected"); + message.payments = []; + for (var 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]); + } + } + if (object.nextPageToken != null) { + if (typeof object.nextPageToken !== "object") + throw TypeError(".api.ListPaymentsResponse.nextPageToken: object expected"); + message.nextPageToken = $root.types.PageToken.fromObject(object.nextPageToken); + } + 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 = {}; + var object = {}; + if (options.arrays || options.defaults) + object.payments = []; + if (options.defaults) + object.nextPageToken = null; + if (message.payments && message.payments.length) { + object.payments = []; + for (var j = 0; j < message.payments.length; ++j) + object.payments[j] = $root.types.Payment.toObject(message.payments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = $root.types.PageToken.toObject(message.nextPageToken, options); + 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); + }; + + return ListPaymentsResponse; + })(); + + api.ListForwardedPaymentsRequest = (function() { + + /** + * Properties of a ListForwardedPaymentsRequest. + * @memberof api + * @interface IListForwardedPaymentsRequest + * @property {types.IPageToken|null} [pageToken] ListForwardedPaymentsRequest pageToken + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListForwardedPaymentsRequest pageToken. + * @member {types.IPageToken|null|undefined} pageToken + * @memberof api.ListForwardedPaymentsRequest + * @instance + */ + ListForwardedPaymentsRequest.prototype.pageToken = null; + + /** + * 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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + $root.types.PageToken.encode(message.pageToken, 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ListForwardedPaymentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pageToken = $root.types.PageToken.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + var error = $root.types.PageToken.verify(message.pageToken); + if (error) + return "pageToken." + 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) { + if (object instanceof $root.api.ListForwardedPaymentsRequest) + return object; + var message = new $root.api.ListForwardedPaymentsRequest(); + if (object.pageToken != null) { + if (typeof object.pageToken !== "object") + throw TypeError(".api.ListForwardedPaymentsRequest.pageToken: object expected"); + message.pageToken = $root.types.PageToken.fromObject(object.pageToken); + } + 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 = {}; + var object = {}; + if (options.defaults) + object.pageToken = null; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = $root.types.PageToken.toObject(message.pageToken, options); + 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); + }; + + return ListForwardedPaymentsRequest; + })(); + + api.ListForwardedPaymentsResponse = (function() { + + /** + * Properties of a ListForwardedPaymentsResponse. + * @memberof api + * @interface IListForwardedPaymentsResponse + * @property {Array.|null} [forwardedPayments] ListForwardedPaymentsResponse forwardedPayments + * @property {types.IPageToken|null} [nextPageToken] ListForwardedPaymentsResponse nextPageToken + */ + + /** + * Constructs a new ListForwardedPaymentsResponse. + * @memberof api + * @classdesc Represents a ListForwardedPaymentsResponse. + * @implements IListForwardedPaymentsResponse + * @constructor + * @param {api.IListForwardedPaymentsResponse=} [properties] Properties to set + */ + function ListForwardedPaymentsResponse(properties) { + this.forwardedPayments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListForwardedPaymentsResponse forwardedPayments. + * @member {Array.} forwardedPayments + * @memberof api.ListForwardedPaymentsResponse + * @instance + */ + ListForwardedPaymentsResponse.prototype.forwardedPayments = $util.emptyArray; + + /** + * ListForwardedPaymentsResponse nextPageToken. + * @member {types.IPageToken|null|undefined} nextPageToken + * @memberof api.ListForwardedPaymentsResponse + * @instance + */ + ListForwardedPaymentsResponse.prototype.nextPageToken = null; + + /** + * 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.forwardedPayments != null && message.forwardedPayments.length) + for (var i = 0; i < message.forwardedPayments.length; ++i) + $root.types.ForwardedPayment.encode(message.forwardedPayments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + $root.types.PageToken.encode(message.nextPageToken, 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ListForwardedPaymentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.forwardedPayments && message.forwardedPayments.length)) + message.forwardedPayments = []; + message.forwardedPayments.push($root.types.ForwardedPayment.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = $root.types.PageToken.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.forwardedPayments != null && message.hasOwnProperty("forwardedPayments")) { + if (!Array.isArray(message.forwardedPayments)) + return "forwardedPayments: array expected"; + for (var i = 0; i < message.forwardedPayments.length; ++i) { + var error = $root.types.ForwardedPayment.verify(message.forwardedPayments[i]); + if (error) + return "forwardedPayments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + var error = $root.types.PageToken.verify(message.nextPageToken); + if (error) + return "nextPageToken." + 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) { + if (object instanceof $root.api.ListForwardedPaymentsResponse) + return object; + var message = new $root.api.ListForwardedPaymentsResponse(); + if (object.forwardedPayments) { + if (!Array.isArray(object.forwardedPayments)) + throw TypeError(".api.ListForwardedPaymentsResponse.forwardedPayments: array expected"); + message.forwardedPayments = []; + for (var i = 0; i < object.forwardedPayments.length; ++i) { + if (typeof object.forwardedPayments[i] !== "object") + throw TypeError(".api.ListForwardedPaymentsResponse.forwardedPayments: object expected"); + message.forwardedPayments[i] = $root.types.ForwardedPayment.fromObject(object.forwardedPayments[i]); + } + } + if (object.nextPageToken != null) { + if (typeof object.nextPageToken !== "object") + throw TypeError(".api.ListForwardedPaymentsResponse.nextPageToken: object expected"); + message.nextPageToken = $root.types.PageToken.fromObject(object.nextPageToken); + } + 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 = {}; + var object = {}; + if (options.arrays || options.defaults) + object.forwardedPayments = []; + if (options.defaults) + object.nextPageToken = null; + if (message.forwardedPayments && message.forwardedPayments.length) { + object.forwardedPayments = []; + for (var j = 0; j < message.forwardedPayments.length; ++j) + object.forwardedPayments[j] = $root.types.ForwardedPayment.toObject(message.forwardedPayments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = $root.types.PageToken.toObject(message.nextPageToken, options); + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.SignMessageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.SignMessageRequest) + return object; + var 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) + 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 = {}; + var 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.SignMessageResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.signature = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.SignMessageResponse) + return object; + var 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 = {}; + var 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); + }; + + 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} [publicKey] VerifySignatureRequest publicKey + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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 publicKey. + * @member {string} publicKey + * @memberof api.VerifySignatureRequest + * @instance + */ + VerifySignatureRequest.prototype.publicKey = ""; + + /** + * 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.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicKey); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.VerifySignatureRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.bytes(); + break; + case 2: + message.signature = reader.string(); + break; + case 3: + message.publicKey = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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.publicKey != null && message.hasOwnProperty("publicKey")) + if (!$util.isString(message.publicKey)) + return "publicKey: 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) { + if (object instanceof $root.api.VerifySignatureRequest) + return object; + var 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) + message.message = object.message; + if (object.signature != null) + message.signature = String(object.signature); + if (object.publicKey != null) + message.publicKey = String(object.publicKey); + 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 = {}; + var 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.publicKey = ""; + } + 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.publicKey != null && message.hasOwnProperty("publicKey")) + object.publicKey = message.publicKey; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.VerifySignatureResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.valid = reader.bool(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.VerifySignatureResponse) + return object; + var 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 = {}; + var 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ExportPathfindingScoresRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.ExportPathfindingScoresRequest) + return object; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ExportPathfindingScoresResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.scores = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.ExportPathfindingScoresResponse) + return object; + var 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) + 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 = {}; + var 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GetBalancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.GetBalancesRequest) + return object; + 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); + }; + + return GetBalancesRequest; + })(); + + api.GetBalancesResponse = (function() { + + /** + * Properties of a GetBalancesResponse. + * @memberof api + * @interface IGetBalancesResponse + * @property {number|Long|null} [totalOnchainBalanceSats] GetBalancesResponse totalOnchainBalanceSats + * @property {number|Long|null} [spendableOnchainBalanceSats] GetBalancesResponse spendableOnchainBalanceSats + * @property {number|Long|null} [totalAnchorChannelsReserveSats] GetBalancesResponse totalAnchorChannelsReserveSats + * @property {number|Long|null} [totalLightningBalanceSats] GetBalancesResponse totalLightningBalanceSats + * @property {Array.|null} [lightningBalances] GetBalancesResponse lightningBalances + * @property {Array.|null} [pendingBalancesFromChannelClosures] GetBalancesResponse pendingBalancesFromChannelClosures + */ + + /** + * Constructs a new GetBalancesResponse. + * @memberof api + * @classdesc Represents a GetBalancesResponse. + * @implements IGetBalancesResponse + * @constructor + * @param {api.IGetBalancesResponse=} [properties] Properties to set + */ + function GetBalancesResponse(properties) { + this.lightningBalances = []; + this.pendingBalancesFromChannelClosures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBalancesResponse totalOnchainBalanceSats. + * @member {number|Long} totalOnchainBalanceSats + * @memberof api.GetBalancesResponse + * @instance + */ + GetBalancesResponse.prototype.totalOnchainBalanceSats = 0; + + /** + * GetBalancesResponse spendableOnchainBalanceSats. + * @member {number|Long} spendableOnchainBalanceSats + * @memberof api.GetBalancesResponse + * @instance + */ + GetBalancesResponse.prototype.spendableOnchainBalanceSats = 0; + + /** + * GetBalancesResponse totalAnchorChannelsReserveSats. + * @member {number|Long} totalAnchorChannelsReserveSats + * @memberof api.GetBalancesResponse + * @instance + */ + GetBalancesResponse.prototype.totalAnchorChannelsReserveSats = 0; + + /** + * GetBalancesResponse totalLightningBalanceSats. + * @member {number|Long} totalLightningBalanceSats + * @memberof api.GetBalancesResponse + * @instance + */ + GetBalancesResponse.prototype.totalLightningBalanceSats = 0; + + /** + * GetBalancesResponse lightningBalances. + * @member {Array.} lightningBalances + * @memberof api.GetBalancesResponse + * @instance + */ + GetBalancesResponse.prototype.lightningBalances = $util.emptyArray; + + /** + * GetBalancesResponse pendingBalancesFromChannelClosures. + * @member {Array.} pendingBalancesFromChannelClosures + * @memberof api.GetBalancesResponse + * @instance + */ + GetBalancesResponse.prototype.pendingBalancesFromChannelClosures = $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.totalOnchainBalanceSats != null && Object.hasOwnProperty.call(message, "totalOnchainBalanceSats")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.totalOnchainBalanceSats); + if (message.spendableOnchainBalanceSats != null && Object.hasOwnProperty.call(message, "spendableOnchainBalanceSats")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.spendableOnchainBalanceSats); + if (message.totalAnchorChannelsReserveSats != null && Object.hasOwnProperty.call(message, "totalAnchorChannelsReserveSats")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.totalAnchorChannelsReserveSats); + if (message.totalLightningBalanceSats != null && Object.hasOwnProperty.call(message, "totalLightningBalanceSats")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.totalLightningBalanceSats); + if (message.lightningBalances != null && message.lightningBalances.length) + for (var i = 0; i < message.lightningBalances.length; ++i) + $root.types.LightningBalance.encode(message.lightningBalances[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pendingBalancesFromChannelClosures != null && message.pendingBalancesFromChannelClosures.length) + for (var i = 0; i < message.pendingBalancesFromChannelClosures.length; ++i) + $root.types.PendingSweepBalance.encode(message.pendingBalancesFromChannelClosures[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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GetBalancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.totalOnchainBalanceSats = reader.uint64(); + break; + case 2: + message.spendableOnchainBalanceSats = reader.uint64(); + break; + case 3: + message.totalAnchorChannelsReserveSats = reader.uint64(); + break; + case 4: + message.totalLightningBalanceSats = reader.uint64(); + break; + case 5: + if (!(message.lightningBalances && message.lightningBalances.length)) + message.lightningBalances = []; + message.lightningBalances.push($root.types.LightningBalance.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.pendingBalancesFromChannelClosures && message.pendingBalancesFromChannelClosures.length)) + message.pendingBalancesFromChannelClosures = []; + message.pendingBalancesFromChannelClosures.push($root.types.PendingSweepBalance.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.totalOnchainBalanceSats != null && message.hasOwnProperty("totalOnchainBalanceSats")) + if (!$util.isInteger(message.totalOnchainBalanceSats) && !(message.totalOnchainBalanceSats && $util.isInteger(message.totalOnchainBalanceSats.low) && $util.isInteger(message.totalOnchainBalanceSats.high))) + return "totalOnchainBalanceSats: integer|Long expected"; + if (message.spendableOnchainBalanceSats != null && message.hasOwnProperty("spendableOnchainBalanceSats")) + if (!$util.isInteger(message.spendableOnchainBalanceSats) && !(message.spendableOnchainBalanceSats && $util.isInteger(message.spendableOnchainBalanceSats.low) && $util.isInteger(message.spendableOnchainBalanceSats.high))) + return "spendableOnchainBalanceSats: integer|Long expected"; + if (message.totalAnchorChannelsReserveSats != null && message.hasOwnProperty("totalAnchorChannelsReserveSats")) + if (!$util.isInteger(message.totalAnchorChannelsReserveSats) && !(message.totalAnchorChannelsReserveSats && $util.isInteger(message.totalAnchorChannelsReserveSats.low) && $util.isInteger(message.totalAnchorChannelsReserveSats.high))) + return "totalAnchorChannelsReserveSats: integer|Long expected"; + if (message.totalLightningBalanceSats != null && message.hasOwnProperty("totalLightningBalanceSats")) + if (!$util.isInteger(message.totalLightningBalanceSats) && !(message.totalLightningBalanceSats && $util.isInteger(message.totalLightningBalanceSats.low) && $util.isInteger(message.totalLightningBalanceSats.high))) + return "totalLightningBalanceSats: integer|Long expected"; + if (message.lightningBalances != null && message.hasOwnProperty("lightningBalances")) { + if (!Array.isArray(message.lightningBalances)) + return "lightningBalances: array expected"; + for (var i = 0; i < message.lightningBalances.length; ++i) { + var error = $root.types.LightningBalance.verify(message.lightningBalances[i]); + if (error) + return "lightningBalances." + error; + } + } + if (message.pendingBalancesFromChannelClosures != null && message.hasOwnProperty("pendingBalancesFromChannelClosures")) { + if (!Array.isArray(message.pendingBalancesFromChannelClosures)) + return "pendingBalancesFromChannelClosures: array expected"; + for (var i = 0; i < message.pendingBalancesFromChannelClosures.length; ++i) { + var error = $root.types.PendingSweepBalance.verify(message.pendingBalancesFromChannelClosures[i]); + if (error) + return "pendingBalancesFromChannelClosures." + 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) { + if (object instanceof $root.api.GetBalancesResponse) + return object; + var message = new $root.api.GetBalancesResponse(); + if (object.totalOnchainBalanceSats != null) + if ($util.Long) + (message.totalOnchainBalanceSats = $util.Long.fromValue(object.totalOnchainBalanceSats)).unsigned = true; + else if (typeof object.totalOnchainBalanceSats === "string") + message.totalOnchainBalanceSats = parseInt(object.totalOnchainBalanceSats, 10); + else if (typeof object.totalOnchainBalanceSats === "number") + message.totalOnchainBalanceSats = object.totalOnchainBalanceSats; + else if (typeof object.totalOnchainBalanceSats === "object") + message.totalOnchainBalanceSats = new $util.LongBits(object.totalOnchainBalanceSats.low >>> 0, object.totalOnchainBalanceSats.high >>> 0).toNumber(true); + if (object.spendableOnchainBalanceSats != null) + if ($util.Long) + (message.spendableOnchainBalanceSats = $util.Long.fromValue(object.spendableOnchainBalanceSats)).unsigned = true; + else if (typeof object.spendableOnchainBalanceSats === "string") + message.spendableOnchainBalanceSats = parseInt(object.spendableOnchainBalanceSats, 10); + else if (typeof object.spendableOnchainBalanceSats === "number") + message.spendableOnchainBalanceSats = object.spendableOnchainBalanceSats; + else if (typeof object.spendableOnchainBalanceSats === "object") + message.spendableOnchainBalanceSats = new $util.LongBits(object.spendableOnchainBalanceSats.low >>> 0, object.spendableOnchainBalanceSats.high >>> 0).toNumber(true); + if (object.totalAnchorChannelsReserveSats != null) + if ($util.Long) + (message.totalAnchorChannelsReserveSats = $util.Long.fromValue(object.totalAnchorChannelsReserveSats)).unsigned = true; + else if (typeof object.totalAnchorChannelsReserveSats === "string") + message.totalAnchorChannelsReserveSats = parseInt(object.totalAnchorChannelsReserveSats, 10); + else if (typeof object.totalAnchorChannelsReserveSats === "number") + message.totalAnchorChannelsReserveSats = object.totalAnchorChannelsReserveSats; + else if (typeof object.totalAnchorChannelsReserveSats === "object") + message.totalAnchorChannelsReserveSats = new $util.LongBits(object.totalAnchorChannelsReserveSats.low >>> 0, object.totalAnchorChannelsReserveSats.high >>> 0).toNumber(true); + if (object.totalLightningBalanceSats != null) + if ($util.Long) + (message.totalLightningBalanceSats = $util.Long.fromValue(object.totalLightningBalanceSats)).unsigned = true; + else if (typeof object.totalLightningBalanceSats === "string") + message.totalLightningBalanceSats = parseInt(object.totalLightningBalanceSats, 10); + else if (typeof object.totalLightningBalanceSats === "number") + message.totalLightningBalanceSats = object.totalLightningBalanceSats; + else if (typeof object.totalLightningBalanceSats === "object") + message.totalLightningBalanceSats = new $util.LongBits(object.totalLightningBalanceSats.low >>> 0, object.totalLightningBalanceSats.high >>> 0).toNumber(true); + if (object.lightningBalances) { + if (!Array.isArray(object.lightningBalances)) + throw TypeError(".api.GetBalancesResponse.lightningBalances: array expected"); + message.lightningBalances = []; + for (var i = 0; i < object.lightningBalances.length; ++i) { + if (typeof object.lightningBalances[i] !== "object") + throw TypeError(".api.GetBalancesResponse.lightningBalances: object expected"); + message.lightningBalances[i] = $root.types.LightningBalance.fromObject(object.lightningBalances[i]); + } + } + if (object.pendingBalancesFromChannelClosures) { + if (!Array.isArray(object.pendingBalancesFromChannelClosures)) + throw TypeError(".api.GetBalancesResponse.pendingBalancesFromChannelClosures: array expected"); + message.pendingBalancesFromChannelClosures = []; + for (var i = 0; i < object.pendingBalancesFromChannelClosures.length; ++i) { + if (typeof object.pendingBalancesFromChannelClosures[i] !== "object") + throw TypeError(".api.GetBalancesResponse.pendingBalancesFromChannelClosures: object expected"); + message.pendingBalancesFromChannelClosures[i] = $root.types.PendingSweepBalance.fromObject(object.pendingBalancesFromChannelClosures[i]); + } + } + 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 = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.lightningBalances = []; + object.pendingBalancesFromChannelClosures = []; + } + if (options.defaults) { + object.totalOnchainBalanceSats = 0; + object.spendableOnchainBalanceSats = 0; + object.totalAnchorChannelsReserveSats = 0; + object.totalLightningBalanceSats = 0; + } + if (message.totalOnchainBalanceSats != null && message.hasOwnProperty("totalOnchainBalanceSats")) + if (typeof message.totalOnchainBalanceSats === "number") + object.totalOnchainBalanceSats = options.longs === String ? String(message.totalOnchainBalanceSats) : message.totalOnchainBalanceSats; + else + object.totalOnchainBalanceSats = options.longs === String ? $util.Long.prototype.toString.call(message.totalOnchainBalanceSats) : options.longs === Number ? new $util.LongBits(message.totalOnchainBalanceSats.low >>> 0, message.totalOnchainBalanceSats.high >>> 0).toNumber(true) : message.totalOnchainBalanceSats; + if (message.spendableOnchainBalanceSats != null && message.hasOwnProperty("spendableOnchainBalanceSats")) + if (typeof message.spendableOnchainBalanceSats === "number") + object.spendableOnchainBalanceSats = options.longs === String ? String(message.spendableOnchainBalanceSats) : message.spendableOnchainBalanceSats; + else + object.spendableOnchainBalanceSats = options.longs === String ? $util.Long.prototype.toString.call(message.spendableOnchainBalanceSats) : options.longs === Number ? new $util.LongBits(message.spendableOnchainBalanceSats.low >>> 0, message.spendableOnchainBalanceSats.high >>> 0).toNumber(true) : message.spendableOnchainBalanceSats; + if (message.totalAnchorChannelsReserveSats != null && message.hasOwnProperty("totalAnchorChannelsReserveSats")) + if (typeof message.totalAnchorChannelsReserveSats === "number") + object.totalAnchorChannelsReserveSats = options.longs === String ? String(message.totalAnchorChannelsReserveSats) : message.totalAnchorChannelsReserveSats; + else + object.totalAnchorChannelsReserveSats = options.longs === String ? $util.Long.prototype.toString.call(message.totalAnchorChannelsReserveSats) : options.longs === Number ? new $util.LongBits(message.totalAnchorChannelsReserveSats.low >>> 0, message.totalAnchorChannelsReserveSats.high >>> 0).toNumber(true) : message.totalAnchorChannelsReserveSats; + if (message.totalLightningBalanceSats != null && message.hasOwnProperty("totalLightningBalanceSats")) + if (typeof message.totalLightningBalanceSats === "number") + object.totalLightningBalanceSats = options.longs === String ? String(message.totalLightningBalanceSats) : message.totalLightningBalanceSats; + else + object.totalLightningBalanceSats = options.longs === String ? $util.Long.prototype.toString.call(message.totalLightningBalanceSats) : options.longs === Number ? new $util.LongBits(message.totalLightningBalanceSats.low >>> 0, message.totalLightningBalanceSats.high >>> 0).toNumber(true) : message.totalLightningBalanceSats; + if (message.lightningBalances && message.lightningBalances.length) { + object.lightningBalances = []; + for (var j = 0; j < message.lightningBalances.length; ++j) + object.lightningBalances[j] = $root.types.LightningBalance.toObject(message.lightningBalances[j], options); + } + if (message.pendingBalancesFromChannelClosures && message.pendingBalancesFromChannelClosures.length) { + object.pendingBalancesFromChannelClosures = []; + for (var j = 0; j < message.pendingBalancesFromChannelClosures.length; ++j) + object.pendingBalancesFromChannelClosures[j] = $root.types.PendingSweepBalance.toObject(message.pendingBalancesFromChannelClosures[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); + }; + + return GetBalancesResponse; + })(); + + api.ConnectPeerRequest = (function() { + + /** + * Properties of a ConnectPeerRequest. + * @memberof api + * @interface IConnectPeerRequest + * @property {string|null} [nodePubkey] ConnectPeerRequest nodePubkey + * @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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectPeerRequest nodePubkey. + * @member {string} nodePubkey + * @memberof api.ConnectPeerRequest + * @instance + */ + ConnectPeerRequest.prototype.nodePubkey = ""; + + /** + * 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.nodePubkey != null && Object.hasOwnProperty.call(message, "nodePubkey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodePubkey); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ConnectPeerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nodePubkey = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + case 3: + message.persist = reader.bool(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodePubkey != null && message.hasOwnProperty("nodePubkey")) + if (!$util.isString(message.nodePubkey)) + return "nodePubkey: 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) { + if (object instanceof $root.api.ConnectPeerRequest) + return object; + var message = new $root.api.ConnectPeerRequest(); + if (object.nodePubkey != null) + message.nodePubkey = String(object.nodePubkey); + 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 = {}; + var object = {}; + if (options.defaults) { + object.nodePubkey = ""; + object.address = ""; + object.persist = false; + } + if (message.nodePubkey != null && message.hasOwnProperty("nodePubkey")) + object.nodePubkey = message.nodePubkey; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ConnectPeerResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.ConnectPeerResponse) + return object; + 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); + }; + + return ConnectPeerResponse; + })(); + + api.DisconnectPeerRequest = (function() { + + /** + * Properties of a DisconnectPeerRequest. + * @memberof api + * @interface IDisconnectPeerRequest + * @property {string|null} [nodePubkey] DisconnectPeerRequest nodePubkey + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisconnectPeerRequest nodePubkey. + * @member {string} nodePubkey + * @memberof api.DisconnectPeerRequest + * @instance + */ + DisconnectPeerRequest.prototype.nodePubkey = ""; + + /** + * 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.nodePubkey != null && Object.hasOwnProperty.call(message, "nodePubkey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodePubkey); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.DisconnectPeerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nodePubkey = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisconnectPeerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodePubkey != null && message.hasOwnProperty("nodePubkey")) + if (!$util.isString(message.nodePubkey)) + return "nodePubkey: 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) { + if (object instanceof $root.api.DisconnectPeerRequest) + return object; + var message = new $root.api.DisconnectPeerRequest(); + if (object.nodePubkey != null) + message.nodePubkey = String(object.nodePubkey); + 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 = {}; + var object = {}; + if (options.defaults) + object.nodePubkey = ""; + if (message.nodePubkey != null && message.hasOwnProperty("nodePubkey")) + object.nodePubkey = message.nodePubkey; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.DisconnectPeerResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DisconnectPeerResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.DisconnectPeerResponse + * @static + * @param {Object.} object Plain object + * @returns {api.DisconnectPeerResponse} DisconnectPeerResponse + */ + DisconnectPeerResponse.fromObject = function fromObject(object) { + if (object instanceof $root.api.DisconnectPeerResponse) + return object; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ListPeersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.ListPeersRequest) + return object; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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 (var 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.ListPeersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.peers && message.peers.length)) + message.peers = []; + message.peers.push($root.types.Peer.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.peers != null && message.hasOwnProperty("peers")) { + if (!Array.isArray(message.peers)) + return "peers: array expected"; + for (var i = 0; i < message.peers.length; ++i) { + var error = $root.types.Peer.verify(message.peers[i]); + 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) { + if (object instanceof $root.api.ListPeersResponse) + return object; + var message = new $root.api.ListPeersResponse(); + if (object.peers) { + if (!Array.isArray(object.peers)) + throw TypeError(".api.ListPeersResponse.peers: array expected"); + message.peers = []; + for (var 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]); + } + } + 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 = {}; + var object = {}; + if (options.arrays || options.defaults) + object.peers = []; + if (message.peers && message.peers.length) { + object.peers = []; + for (var 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GraphListChannelsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.GraphListChannelsRequest) + return object; + 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); + }; + + return GraphListChannelsRequest; + })(); + + api.GraphListChannelsResponse = (function() { + + /** + * Properties of a GraphListChannelsResponse. + * @memberof api + * @interface IGraphListChannelsResponse + * @property {Array.|null} [shortChannelIds] GraphListChannelsResponse shortChannelIds + */ + + /** + * Constructs a new GraphListChannelsResponse. + * @memberof api + * @classdesc Represents a GraphListChannelsResponse. + * @implements IGraphListChannelsResponse + * @constructor + * @param {api.IGraphListChannelsResponse=} [properties] Properties to set + */ + function GraphListChannelsResponse(properties) { + this.shortChannelIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphListChannelsResponse shortChannelIds. + * @member {Array.} shortChannelIds + * @memberof api.GraphListChannelsResponse + * @instance + */ + GraphListChannelsResponse.prototype.shortChannelIds = $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.shortChannelIds != null && message.shortChannelIds.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.shortChannelIds.length; ++i) + writer.uint64(message.shortChannelIds[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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GraphListChannelsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.shortChannelIds && message.shortChannelIds.length)) + message.shortChannelIds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.shortChannelIds.push(reader.uint64()); + } else + message.shortChannelIds.push(reader.uint64()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.shortChannelIds != null && message.hasOwnProperty("shortChannelIds")) { + if (!Array.isArray(message.shortChannelIds)) + return "shortChannelIds: array expected"; + for (var i = 0; i < message.shortChannelIds.length; ++i) + if (!$util.isInteger(message.shortChannelIds[i]) && !(message.shortChannelIds[i] && $util.isInteger(message.shortChannelIds[i].low) && $util.isInteger(message.shortChannelIds[i].high))) + return "shortChannelIds: 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) { + if (object instanceof $root.api.GraphListChannelsResponse) + return object; + var message = new $root.api.GraphListChannelsResponse(); + if (object.shortChannelIds) { + if (!Array.isArray(object.shortChannelIds)) + throw TypeError(".api.GraphListChannelsResponse.shortChannelIds: array expected"); + message.shortChannelIds = []; + for (var i = 0; i < object.shortChannelIds.length; ++i) + if ($util.Long) + (message.shortChannelIds[i] = $util.Long.fromValue(object.shortChannelIds[i])).unsigned = true; + else if (typeof object.shortChannelIds[i] === "string") + message.shortChannelIds[i] = parseInt(object.shortChannelIds[i], 10); + else if (typeof object.shortChannelIds[i] === "number") + message.shortChannelIds[i] = object.shortChannelIds[i]; + else if (typeof object.shortChannelIds[i] === "object") + message.shortChannelIds[i] = new $util.LongBits(object.shortChannelIds[i].low >>> 0, object.shortChannelIds[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 = {}; + var object = {}; + if (options.arrays || options.defaults) + object.shortChannelIds = []; + if (message.shortChannelIds && message.shortChannelIds.length) { + object.shortChannelIds = []; + for (var j = 0; j < message.shortChannelIds.length; ++j) + if (typeof message.shortChannelIds[j] === "number") + object.shortChannelIds[j] = options.longs === String ? String(message.shortChannelIds[j]) : message.shortChannelIds[j]; + else + object.shortChannelIds[j] = options.longs === String ? $util.Long.prototype.toString.call(message.shortChannelIds[j]) : options.longs === Number ? new $util.LongBits(message.shortChannelIds[j].low >>> 0, message.shortChannelIds[j].high >>> 0).toNumber(true) : message.shortChannelIds[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); + }; + + return GraphListChannelsResponse; + })(); + + api.GraphGetChannelRequest = (function() { + + /** + * Properties of a GraphGetChannelRequest. + * @memberof api + * @interface IGraphGetChannelRequest + * @property {number|Long|null} [shortChannelId] GraphGetChannelRequest shortChannelId + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphGetChannelRequest shortChannelId. + * @member {number|Long} shortChannelId + * @memberof api.GraphGetChannelRequest + * @instance + */ + GraphGetChannelRequest.prototype.shortChannelId = 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.shortChannelId != null && Object.hasOwnProperty.call(message, "shortChannelId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.shortChannelId); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GraphGetChannelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.shortChannelId = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.shortChannelId != null && message.hasOwnProperty("shortChannelId")) + if (!$util.isInteger(message.shortChannelId) && !(message.shortChannelId && $util.isInteger(message.shortChannelId.low) && $util.isInteger(message.shortChannelId.high))) + return "shortChannelId: 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) { + if (object instanceof $root.api.GraphGetChannelRequest) + return object; + var message = new $root.api.GraphGetChannelRequest(); + if (object.shortChannelId != null) + if ($util.Long) + (message.shortChannelId = $util.Long.fromValue(object.shortChannelId)).unsigned = true; + else if (typeof object.shortChannelId === "string") + message.shortChannelId = parseInt(object.shortChannelId, 10); + else if (typeof object.shortChannelId === "number") + message.shortChannelId = object.shortChannelId; + else if (typeof object.shortChannelId === "object") + message.shortChannelId = new $util.LongBits(object.shortChannelId.low >>> 0, object.shortChannelId.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 = {}; + var object = {}; + if (options.defaults) + object.shortChannelId = 0; + if (message.shortChannelId != null && message.hasOwnProperty("shortChannelId")) + if (typeof message.shortChannelId === "number") + object.shortChannelId = options.longs === String ? String(message.shortChannelId) : message.shortChannelId; + else + object.shortChannelId = options.longs === String ? $util.Long.prototype.toString.call(message.shortChannelId) : options.longs === Number ? new $util.LongBits(message.shortChannelId.low >>> 0, message.shortChannelId.high >>> 0).toNumber(true) : message.shortChannelId; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GraphGetChannelResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channel = $root.types.GraphChannel.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channel != null && message.hasOwnProperty("channel")) { + var error = $root.types.GraphChannel.verify(message.channel); + 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) { + if (object instanceof $root.api.GraphGetChannelResponse) + return object; + var 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); + } + 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 = {}; + var 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GraphListNodesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.GraphListNodesRequest) + return object; + 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); + }; + + return GraphListNodesRequest; + })(); + + api.GraphListNodesResponse = (function() { + + /** + * Properties of a GraphListNodesResponse. + * @memberof api + * @interface IGraphListNodesResponse + * @property {Array.|null} [nodeIds] GraphListNodesResponse nodeIds + */ + + /** + * Constructs a new GraphListNodesResponse. + * @memberof api + * @classdesc Represents a GraphListNodesResponse. + * @implements IGraphListNodesResponse + * @constructor + * @param {api.IGraphListNodesResponse=} [properties] Properties to set + */ + function GraphListNodesResponse(properties) { + this.nodeIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphListNodesResponse nodeIds. + * @member {Array.} nodeIds + * @memberof api.GraphListNodesResponse + * @instance + */ + GraphListNodesResponse.prototype.nodeIds = $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.nodeIds != null && message.nodeIds.length) + for (var i = 0; i < message.nodeIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeIds[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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GraphListNodesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.nodeIds && message.nodeIds.length)) + message.nodeIds = []; + message.nodeIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeIds != null && message.hasOwnProperty("nodeIds")) { + if (!Array.isArray(message.nodeIds)) + return "nodeIds: array expected"; + for (var i = 0; i < message.nodeIds.length; ++i) + if (!$util.isString(message.nodeIds[i])) + return "nodeIds: 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) { + if (object instanceof $root.api.GraphListNodesResponse) + return object; + var message = new $root.api.GraphListNodesResponse(); + if (object.nodeIds) { + if (!Array.isArray(object.nodeIds)) + throw TypeError(".api.GraphListNodesResponse.nodeIds: array expected"); + message.nodeIds = []; + for (var i = 0; i < object.nodeIds.length; ++i) + message.nodeIds[i] = String(object.nodeIds[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 = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeIds = []; + if (message.nodeIds && message.nodeIds.length) { + object.nodeIds = []; + for (var j = 0; j < message.nodeIds.length; ++j) + object.nodeIds[j] = message.nodeIds[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); + }; + + return GraphListNodesResponse; + })(); + + api.UnifiedSendRequest = (function() { + + /** + * Properties of an UnifiedSendRequest. + * @memberof api + * @interface IUnifiedSendRequest + * @property {string|null} [uri] UnifiedSendRequest uri + * @property {number|Long|null} [amountMsat] UnifiedSendRequest amountMsat + * @property {types.IRouteParametersConfig|null} [routeParameters] UnifiedSendRequest routeParameters + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnifiedSendRequest uri. + * @member {string} uri + * @memberof api.UnifiedSendRequest + * @instance + */ + UnifiedSendRequest.prototype.uri = ""; + + /** + * UnifiedSendRequest amountMsat. + * @member {number|Long} amountMsat + * @memberof api.UnifiedSendRequest + * @instance + */ + UnifiedSendRequest.prototype.amountMsat = 0; + + /** + * UnifiedSendRequest routeParameters. + * @member {types.IRouteParametersConfig|null|undefined} routeParameters + * @memberof api.UnifiedSendRequest + * @instance + */ + UnifiedSendRequest.prototype.routeParameters = null; + + /** + * 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.amountMsat != null && Object.hasOwnProperty.call(message, "amountMsat")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amountMsat); + if (message.routeParameters != null && Object.hasOwnProperty.call(message, "routeParameters")) + $root.types.RouteParametersConfig.encode(message.routeParameters, 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.UnifiedSendRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + case 2: + message.amountMsat = reader.uint64(); + break; + case 3: + message.routeParameters = $root.types.RouteParametersConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (!$util.isInteger(message.amountMsat) && !(message.amountMsat && $util.isInteger(message.amountMsat.low) && $util.isInteger(message.amountMsat.high))) + return "amountMsat: integer|Long expected"; + if (message.routeParameters != null && message.hasOwnProperty("routeParameters")) { + var error = $root.types.RouteParametersConfig.verify(message.routeParameters); + if (error) + return "routeParameters." + 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) { + if (object instanceof $root.api.UnifiedSendRequest) + return object; + var message = new $root.api.UnifiedSendRequest(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.amountMsat != null) + if ($util.Long) + (message.amountMsat = $util.Long.fromValue(object.amountMsat)).unsigned = true; + else if (typeof object.amountMsat === "string") + message.amountMsat = parseInt(object.amountMsat, 10); + else if (typeof object.amountMsat === "number") + message.amountMsat = object.amountMsat; + else if (typeof object.amountMsat === "object") + message.amountMsat = new $util.LongBits(object.amountMsat.low >>> 0, object.amountMsat.high >>> 0).toNumber(true); + if (object.routeParameters != null) { + if (typeof object.routeParameters !== "object") + throw TypeError(".api.UnifiedSendRequest.routeParameters: object expected"); + message.routeParameters = $root.types.RouteParametersConfig.fromObject(object.routeParameters); + } + 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 = {}; + var object = {}; + if (options.defaults) { + object.uri = ""; + object.amountMsat = 0; + object.routeParameters = null; + } + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (typeof message.amountMsat === "number") + object.amountMsat = options.longs === String ? String(message.amountMsat) : message.amountMsat; + else + object.amountMsat = options.longs === String ? $util.Long.prototype.toString.call(message.amountMsat) : options.longs === Number ? new $util.LongBits(message.amountMsat.low >>> 0, message.amountMsat.high >>> 0).toNumber(true) : message.amountMsat; + if (message.routeParameters != null && message.hasOwnProperty("routeParameters")) + object.routeParameters = $root.types.RouteParametersConfig.toObject(message.routeParameters, options); + 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); + }; + + return UnifiedSendRequest; + })(); + + api.UnifiedSendResponse = (function() { + + /** + * Properties of an UnifiedSendResponse. + * @memberof api + * @interface IUnifiedSendResponse + * @property {string|null} [txid] UnifiedSendResponse txid + * @property {string|null} [bolt11PaymentId] UnifiedSendResponse bolt11PaymentId + * @property {string|null} [bolt12PaymentId] UnifiedSendResponse bolt12PaymentId + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnifiedSendResponse txid. + * @member {string} txid + * @memberof api.UnifiedSendResponse + * @instance + */ + UnifiedSendResponse.prototype.txid = ""; + + /** + * UnifiedSendResponse bolt11PaymentId. + * @member {string} bolt11PaymentId + * @memberof api.UnifiedSendResponse + * @instance + */ + UnifiedSendResponse.prototype.bolt11PaymentId = ""; + + /** + * UnifiedSendResponse bolt12PaymentId. + * @member {string} bolt12PaymentId + * @memberof api.UnifiedSendResponse + * @instance + */ + UnifiedSendResponse.prototype.bolt12PaymentId = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UnifiedSendResponse paymentResult. + * @member {"txid"|"bolt11PaymentId"|"bolt12PaymentId"|undefined} paymentResult + * @memberof api.UnifiedSendResponse + * @instance + */ + Object.defineProperty(UnifiedSendResponse.prototype, "paymentResult", { + get: $util.oneOfGetter($oneOfFields = ["txid", "bolt11PaymentId", "bolt12PaymentId"]), + 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.bolt11PaymentId != null && Object.hasOwnProperty.call(message, "bolt11PaymentId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.bolt11PaymentId); + if (message.bolt12PaymentId != null && Object.hasOwnProperty.call(message, "bolt12PaymentId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.bolt12PaymentId); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.UnifiedSendResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txid = reader.string(); + break; + case 2: + message.bolt11PaymentId = reader.string(); + break; + case 3: + message.bolt12PaymentId = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.txid != null && message.hasOwnProperty("txid")) { + properties.paymentResult = 1; + if (!$util.isString(message.txid)) + return "txid: string expected"; + } + if (message.bolt11PaymentId != null && message.hasOwnProperty("bolt11PaymentId")) { + if (properties.paymentResult === 1) + return "paymentResult: multiple values"; + properties.paymentResult = 1; + if (!$util.isString(message.bolt11PaymentId)) + return "bolt11PaymentId: string expected"; + } + if (message.bolt12PaymentId != null && message.hasOwnProperty("bolt12PaymentId")) { + if (properties.paymentResult === 1) + return "paymentResult: multiple values"; + properties.paymentResult = 1; + if (!$util.isString(message.bolt12PaymentId)) + return "bolt12PaymentId: 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) { + if (object instanceof $root.api.UnifiedSendResponse) + return object; + var message = new $root.api.UnifiedSendResponse(); + if (object.txid != null) + message.txid = String(object.txid); + if (object.bolt11PaymentId != null) + message.bolt11PaymentId = String(object.bolt11PaymentId); + if (object.bolt12PaymentId != null) + message.bolt12PaymentId = String(object.bolt12PaymentId); + 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 = {}; + var object = {}; + if (message.txid != null && message.hasOwnProperty("txid")) { + object.txid = message.txid; + if (options.oneofs) + object.paymentResult = "txid"; + } + if (message.bolt11PaymentId != null && message.hasOwnProperty("bolt11PaymentId")) { + object.bolt11PaymentId = message.bolt11PaymentId; + if (options.oneofs) + object.paymentResult = "bolt11PaymentId"; + } + if (message.bolt12PaymentId != null && message.hasOwnProperty("bolt12PaymentId")) { + object.bolt12PaymentId = message.bolt12PaymentId; + if (options.oneofs) + object.paymentResult = "bolt12PaymentId"; + } + 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); + }; + + return UnifiedSendResponse; + })(); + + api.GraphGetNodeRequest = (function() { + + /** + * Properties of a GraphGetNodeRequest. + * @memberof api + * @interface IGraphGetNodeRequest + * @property {string|null} [nodeId] GraphGetNodeRequest nodeId + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphGetNodeRequest nodeId. + * @member {string} nodeId + * @memberof api.GraphGetNodeRequest + * @instance + */ + GraphGetNodeRequest.prototype.nodeId = ""; + + /** + * 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.nodeId != null && Object.hasOwnProperty.call(message, "nodeId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeId); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GraphGetNodeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nodeId = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + if (!$util.isString(message.nodeId)) + return "nodeId: 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) { + if (object instanceof $root.api.GraphGetNodeRequest) + return object; + var message = new $root.api.GraphGetNodeRequest(); + if (object.nodeId != null) + message.nodeId = String(object.nodeId); + 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 = {}; + var object = {}; + if (options.defaults) + object.nodeId = ""; + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + object.nodeId = message.nodeId; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.GraphGetNodeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.node = $root.types.GraphNode.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.node != null && message.hasOwnProperty("node")) { + var error = $root.types.GraphNode.verify(message.node); + 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) { + if (object instanceof $root.api.GraphGetNodeResponse) + return object; + var 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); + } + 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 = {}; + var 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.DecodeInvoiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.invoice = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.DecodeInvoiceRequest) + return object; + var 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 = {}; + var 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); + }; + + return DecodeInvoiceRequest; + })(); + + api.DecodeInvoiceResponse = (function() { + + /** + * Properties of a DecodeInvoiceResponse. + * @memberof api + * @interface IDecodeInvoiceResponse + * @property {string|null} [destination] DecodeInvoiceResponse destination + * @property {string|null} [paymentHash] DecodeInvoiceResponse paymentHash + * @property {number|Long|null} [amountMsat] DecodeInvoiceResponse amountMsat + * @property {number|Long|null} [timestamp] DecodeInvoiceResponse timestamp + * @property {number|Long|null} [expiry] DecodeInvoiceResponse expiry + * @property {string|null} [description] DecodeInvoiceResponse description + * @property {string|null} [descriptionHash] DecodeInvoiceResponse descriptionHash + * @property {string|null} [fallbackAddress] DecodeInvoiceResponse fallbackAddress + * @property {number|Long|null} [minFinalCltvExpiryDelta] DecodeInvoiceResponse minFinalCltvExpiryDelta + * @property {string|null} [paymentSecret] DecodeInvoiceResponse paymentSecret + * @property {Array.|null} [routeHints] DecodeInvoiceResponse routeHints + * @property {Object.|null} [features] DecodeInvoiceResponse features + * @property {string|null} [currency] DecodeInvoiceResponse currency + * @property {string|null} [paymentMetadata] DecodeInvoiceResponse paymentMetadata + * @property {boolean|null} [isExpired] DecodeInvoiceResponse isExpired + */ + + /** + * Constructs a new DecodeInvoiceResponse. + * @memberof api + * @classdesc Represents a DecodeInvoiceResponse. + * @implements IDecodeInvoiceResponse + * @constructor + * @param {api.IDecodeInvoiceResponse=} [properties] Properties to set + */ + function DecodeInvoiceResponse(properties) { + this.routeHints = []; + this.features = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DecodeInvoiceResponse destination. + * @member {string} destination + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.destination = ""; + + /** + * DecodeInvoiceResponse paymentHash. + * @member {string} paymentHash + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.paymentHash = ""; + + /** + * DecodeInvoiceResponse amountMsat. + * @member {number|Long} amountMsat + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.amountMsat = 0; + + /** + * DecodeInvoiceResponse timestamp. + * @member {number|Long} timestamp + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.timestamp = 0; + + /** + * DecodeInvoiceResponse expiry. + * @member {number|Long} expiry + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.expiry = 0; + + /** + * DecodeInvoiceResponse description. + * @member {string} description + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.description = ""; + + /** + * DecodeInvoiceResponse descriptionHash. + * @member {string} descriptionHash + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.descriptionHash = ""; + + /** + * DecodeInvoiceResponse fallbackAddress. + * @member {string} fallbackAddress + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.fallbackAddress = ""; + + /** + * DecodeInvoiceResponse minFinalCltvExpiryDelta. + * @member {number|Long} minFinalCltvExpiryDelta + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.minFinalCltvExpiryDelta = 0; + + /** + * DecodeInvoiceResponse paymentSecret. + * @member {string} paymentSecret + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.paymentSecret = ""; + + /** + * DecodeInvoiceResponse routeHints. + * @member {Array.} routeHints + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.routeHints = $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 paymentMetadata. + * @member {string} paymentMetadata + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.paymentMetadata = ""; + + /** + * DecodeInvoiceResponse isExpired. + * @member {boolean} isExpired + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.isExpired = false; + + /** + * 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.paymentHash != null && Object.hasOwnProperty.call(message, "paymentHash")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.paymentHash); + if (message.amountMsat != null && Object.hasOwnProperty.call(message, "amountMsat")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.amountMsat); + 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.fallbackAddress != null && Object.hasOwnProperty.call(message, "fallbackAddress")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.fallbackAddress); + if (message.minFinalCltvExpiryDelta != null && Object.hasOwnProperty.call(message, "minFinalCltvExpiryDelta")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.minFinalCltvExpiryDelta); + if (message.paymentSecret != null && Object.hasOwnProperty.call(message, "paymentSecret")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.paymentSecret); + if (message.routeHints != null && message.routeHints.length) + for (var i = 0; i < message.routeHints.length; ++i) + $root.types.Bolt11RouteHint.encode(message.routeHints[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + for (var 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.paymentMetadata != null && Object.hasOwnProperty.call(message, "paymentMetadata")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.paymentMetadata); + if (message.descriptionHash != null && Object.hasOwnProperty.call(message, "descriptionHash")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.descriptionHash); + if (message.isExpired != null && Object.hasOwnProperty.call(message, "isExpired")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.isExpired); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.DecodeInvoiceResponse(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.destination = reader.string(); + break; + case 2: + message.paymentHash = reader.string(); + break; + case 3: + message.amountMsat = 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.descriptionHash = reader.string(); + break; + case 7: + message.fallbackAddress = reader.string(); + break; + case 8: + message.minFinalCltvExpiryDelta = reader.uint64(); + break; + case 9: + message.paymentSecret = reader.string(); + break; + case 10: + if (!(message.routeHints && message.routeHints.length)) + message.routeHints = []; + message.routeHints.push($root.types.Bolt11RouteHint.decode(reader, reader.uint32())); + break; + case 11: + reader.skip().pos++; + if (message.features === $util.emptyObject) + message.features = {}; + key = reader.uint32(); + reader.pos++; + message.features[key] = $root.types.Bolt11Feature.decode(reader, reader.uint32()); + break; + case 12: + message.currency = reader.string(); + break; + case 13: + message.paymentMetadata = reader.string(); + break; + case 15: + message.isExpired = reader.bool(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.destination != null && message.hasOwnProperty("destination")) + if (!$util.isString(message.destination)) + return "destination: string expected"; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) + if (!$util.isString(message.paymentHash)) + return "paymentHash: string expected"; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (!$util.isInteger(message.amountMsat) && !(message.amountMsat && $util.isInteger(message.amountMsat.low) && $util.isInteger(message.amountMsat.high))) + return "amountMsat: 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")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.descriptionHash != null && message.hasOwnProperty("descriptionHash")) + if (!$util.isString(message.descriptionHash)) + return "descriptionHash: string expected"; + if (message.fallbackAddress != null && message.hasOwnProperty("fallbackAddress")) + if (!$util.isString(message.fallbackAddress)) + return "fallbackAddress: string expected"; + if (message.minFinalCltvExpiryDelta != null && message.hasOwnProperty("minFinalCltvExpiryDelta")) + if (!$util.isInteger(message.minFinalCltvExpiryDelta) && !(message.minFinalCltvExpiryDelta && $util.isInteger(message.minFinalCltvExpiryDelta.low) && $util.isInteger(message.minFinalCltvExpiryDelta.high))) + return "minFinalCltvExpiryDelta: integer|Long expected"; + if (message.paymentSecret != null && message.hasOwnProperty("paymentSecret")) + if (!$util.isString(message.paymentSecret)) + return "paymentSecret: string expected"; + if (message.routeHints != null && message.hasOwnProperty("routeHints")) { + if (!Array.isArray(message.routeHints)) + return "routeHints: array expected"; + for (var i = 0; i < message.routeHints.length; ++i) { + var error = $root.types.Bolt11RouteHint.verify(message.routeHints[i]); + if (error) + return "routeHints." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + if (!$util.isObject(message.features)) + return "features: object expected"; + var key = Object.keys(message.features); + for (var i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "features: integer key{k:uint32} expected"; + { + var error = $root.types.Bolt11Feature.verify(message.features[key[i]]); + if (error) + return "features." + error; + } + } + } + if (message.currency != null && message.hasOwnProperty("currency")) + if (!$util.isString(message.currency)) + return "currency: string expected"; + if (message.paymentMetadata != null && message.hasOwnProperty("paymentMetadata")) + if (!$util.isString(message.paymentMetadata)) + return "paymentMetadata: string expected"; + if (message.isExpired != null && message.hasOwnProperty("isExpired")) + if (typeof message.isExpired !== "boolean") + return "isExpired: 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) { + if (object instanceof $root.api.DecodeInvoiceResponse) + return object; + var message = new $root.api.DecodeInvoiceResponse(); + if (object.destination != null) + message.destination = String(object.destination); + if (object.paymentHash != null) + message.paymentHash = String(object.paymentHash); + if (object.amountMsat != null) + if ($util.Long) + (message.amountMsat = $util.Long.fromValue(object.amountMsat)).unsigned = true; + else if (typeof object.amountMsat === "string") + message.amountMsat = parseInt(object.amountMsat, 10); + else if (typeof object.amountMsat === "number") + message.amountMsat = object.amountMsat; + else if (typeof object.amountMsat === "object") + message.amountMsat = new $util.LongBits(object.amountMsat.low >>> 0, object.amountMsat.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.descriptionHash != null) + message.descriptionHash = String(object.descriptionHash); + if (object.fallbackAddress != null) + message.fallbackAddress = String(object.fallbackAddress); + if (object.minFinalCltvExpiryDelta != null) + if ($util.Long) + (message.minFinalCltvExpiryDelta = $util.Long.fromValue(object.minFinalCltvExpiryDelta)).unsigned = true; + else if (typeof object.minFinalCltvExpiryDelta === "string") + message.minFinalCltvExpiryDelta = parseInt(object.minFinalCltvExpiryDelta, 10); + else if (typeof object.minFinalCltvExpiryDelta === "number") + message.minFinalCltvExpiryDelta = object.minFinalCltvExpiryDelta; + else if (typeof object.minFinalCltvExpiryDelta === "object") + message.minFinalCltvExpiryDelta = new $util.LongBits(object.minFinalCltvExpiryDelta.low >>> 0, object.minFinalCltvExpiryDelta.high >>> 0).toNumber(true); + if (object.paymentSecret != null) + message.paymentSecret = String(object.paymentSecret); + if (object.routeHints) { + if (!Array.isArray(object.routeHints)) + throw TypeError(".api.DecodeInvoiceResponse.routeHints: array expected"); + message.routeHints = []; + for (var i = 0; i < object.routeHints.length; ++i) { + if (typeof object.routeHints[i] !== "object") + throw TypeError(".api.DecodeInvoiceResponse.routeHints: object expected"); + message.routeHints[i] = $root.types.Bolt11RouteHint.fromObject(object.routeHints[i]); + } + } + if (object.features) { + if (typeof object.features !== "object") + throw TypeError(".api.DecodeInvoiceResponse.features: object expected"); + message.features = {}; + for (var keys = Object.keys(object.features), i = 0; i < keys.length; ++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]]); + } + } + if (object.currency != null) + message.currency = String(object.currency); + if (object.paymentMetadata != null) + message.paymentMetadata = String(object.paymentMetadata); + if (object.isExpired != null) + message.isExpired = Boolean(object.isExpired); + 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 = {}; + var object = {}; + if (options.arrays || options.defaults) + object.routeHints = []; + if (options.objects || options.defaults) + object.features = {}; + if (options.defaults) { + object.destination = ""; + object.paymentHash = ""; + object.amountMsat = 0; + object.timestamp = 0; + object.expiry = 0; + object.description = ""; + object.fallbackAddress = ""; + object.minFinalCltvExpiryDelta = 0; + object.paymentSecret = ""; + object.currency = ""; + object.paymentMetadata = ""; + object.descriptionHash = ""; + object.isExpired = false; + } + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = message.destination; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) + object.paymentHash = message.paymentHash; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (typeof message.amountMsat === "number") + object.amountMsat = options.longs === String ? String(message.amountMsat) : message.amountMsat; + else + object.amountMsat = options.longs === String ? $util.Long.prototype.toString.call(message.amountMsat) : options.longs === Number ? new $util.LongBits(message.amountMsat.low >>> 0, message.amountMsat.high >>> 0).toNumber(true) : message.amountMsat; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + 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 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 (message.fallbackAddress != null && message.hasOwnProperty("fallbackAddress")) + object.fallbackAddress = message.fallbackAddress; + if (message.minFinalCltvExpiryDelta != null && message.hasOwnProperty("minFinalCltvExpiryDelta")) + if (typeof message.minFinalCltvExpiryDelta === "number") + object.minFinalCltvExpiryDelta = options.longs === String ? String(message.minFinalCltvExpiryDelta) : message.minFinalCltvExpiryDelta; + else + object.minFinalCltvExpiryDelta = options.longs === String ? $util.Long.prototype.toString.call(message.minFinalCltvExpiryDelta) : options.longs === Number ? new $util.LongBits(message.minFinalCltvExpiryDelta.low >>> 0, message.minFinalCltvExpiryDelta.high >>> 0).toNumber(true) : message.minFinalCltvExpiryDelta; + if (message.paymentSecret != null && message.hasOwnProperty("paymentSecret")) + object.paymentSecret = message.paymentSecret; + if (message.routeHints && message.routeHints.length) { + object.routeHints = []; + for (var j = 0; j < message.routeHints.length; ++j) + object.routeHints[j] = $root.types.Bolt11RouteHint.toObject(message.routeHints[j], options); + } + var keys2; + if (message.features && (keys2 = Object.keys(message.features)).length) { + object.features = {}; + for (var j = 0; j < keys2.length; ++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.paymentMetadata != null && message.hasOwnProperty("paymentMetadata")) + object.paymentMetadata = message.paymentMetadata; + if (message.descriptionHash != null && message.hasOwnProperty("descriptionHash")) + object.descriptionHash = message.descriptionHash; + if (message.isExpired != null && message.hasOwnProperty("isExpired")) + object.isExpired = message.isExpired; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.DecodeOfferRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.offer = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.DecodeOfferRequest) + return object; + var 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 = {}; + var 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); + }; + + return DecodeOfferRequest; + })(); + + api.DecodeOfferResponse = (function() { + + /** + * Properties of a DecodeOfferResponse. + * @memberof api + * @interface IDecodeOfferResponse + * @property {string|null} [offerId] DecodeOfferResponse offerId + * @property {string|null} [description] DecodeOfferResponse description + * @property {string|null} [issuer] DecodeOfferResponse issuer + * @property {types.IOfferAmount|null} [amount] DecodeOfferResponse amount + * @property {string|null} [issuerSigningPubkey] DecodeOfferResponse issuerSigningPubkey + * @property {number|Long|null} [absoluteExpiry] DecodeOfferResponse absoluteExpiry + * @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} [isExpired] DecodeOfferResponse isExpired + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DecodeOfferResponse offerId. + * @member {string} offerId + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.offerId = ""; + + /** + * DecodeOfferResponse description. + * @member {string} description + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.description = ""; + + /** + * DecodeOfferResponse issuer. + * @member {string} issuer + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.issuer = ""; + + /** + * DecodeOfferResponse amount. + * @member {types.IOfferAmount|null|undefined} amount + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.amount = null; + + /** + * DecodeOfferResponse issuerSigningPubkey. + * @member {string} issuerSigningPubkey + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.issuerSigningPubkey = ""; + + /** + * DecodeOfferResponse absoluteExpiry. + * @member {number|Long} absoluteExpiry + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.absoluteExpiry = 0; + + /** + * 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} metadata + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.metadata = ""; + + /** + * DecodeOfferResponse isExpired. + * @member {boolean} isExpired + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.isExpired = false; + + /** + * 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.offerId != null && Object.hasOwnProperty.call(message, "offerId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.offerId); + 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.issuerSigningPubkey != null && Object.hasOwnProperty.call(message, "issuerSigningPubkey")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.issuerSigningPubkey); + if (message.absoluteExpiry != null && Object.hasOwnProperty.call(message, "absoluteExpiry")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.absoluteExpiry); + 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 (var 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 (var 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 (var 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.isExpired != null && Object.hasOwnProperty.call(message, "isExpired")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.isExpired); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.DecodeOfferResponse(), key; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.offerId = 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()); + break; + case 5: + message.issuerSigningPubkey = reader.string(); + break; + case 6: + message.absoluteExpiry = reader.uint64(); + break; + case 7: + message.quantity = $root.types.OfferQuantity.decode(reader, reader.uint32()); + break; + case 8: + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push($root.types.BlindedPath.decode(reader, reader.uint32())); + break; + case 9: + reader.skip().pos++; + if (message.features === $util.emptyObject) + message.features = {}; + key = reader.uint32(); + reader.pos++; + message.features[key] = $root.types.Bolt11Feature.decode(reader, reader.uint32()); + 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.isExpired = reader.bool(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.offerId != null && message.hasOwnProperty("offerId")) + if (!$util.isString(message.offerId)) + return "offerId: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.issuer != null && message.hasOwnProperty("issuer")) + if (!$util.isString(message.issuer)) + return "issuer: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + var error = $root.types.OfferAmount.verify(message.amount); + if (error) + return "amount." + error; + } + if (message.issuerSigningPubkey != null && message.hasOwnProperty("issuerSigningPubkey")) + if (!$util.isString(message.issuerSigningPubkey)) + return "issuerSigningPubkey: string expected"; + if (message.absoluteExpiry != null && message.hasOwnProperty("absoluteExpiry")) + if (!$util.isInteger(message.absoluteExpiry) && !(message.absoluteExpiry && $util.isInteger(message.absoluteExpiry.low) && $util.isInteger(message.absoluteExpiry.high))) + return "absoluteExpiry: integer|Long expected"; + if (message.quantity != null && message.hasOwnProperty("quantity")) { + var error = $root.types.OfferQuantity.verify(message.quantity); + if (error) + return "quantity." + error; + } + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) { + var error = $root.types.BlindedPath.verify(message.paths[i]); + if (error) + return "paths." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + if (!$util.isObject(message.features)) + return "features: object expected"; + var key = Object.keys(message.features); + for (var i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "features: integer key{k:uint32} expected"; + { + var error = $root.types.Bolt11Feature.verify(message.features[key[i]]); + if (error) + return "features." + error; + } + } + } + if (message.chains != null && message.hasOwnProperty("chains")) { + if (!Array.isArray(message.chains)) + return "chains: array expected"; + for (var i = 0; i < message.chains.length; ++i) + if (!$util.isString(message.chains[i])) + return "chains: string[] expected"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + if (!$util.isString(message.metadata)) + return "metadata: string expected"; + if (message.isExpired != null && message.hasOwnProperty("isExpired")) + if (typeof message.isExpired !== "boolean") + return "isExpired: 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) { + if (object instanceof $root.api.DecodeOfferResponse) + return object; + var message = new $root.api.DecodeOfferResponse(); + if (object.offerId != null) + message.offerId = String(object.offerId); + 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); + } + if (object.issuerSigningPubkey != null) + message.issuerSigningPubkey = String(object.issuerSigningPubkey); + if (object.absoluteExpiry != null) + if ($util.Long) + (message.absoluteExpiry = $util.Long.fromValue(object.absoluteExpiry)).unsigned = true; + else if (typeof object.absoluteExpiry === "string") + message.absoluteExpiry = parseInt(object.absoluteExpiry, 10); + else if (typeof object.absoluteExpiry === "number") + message.absoluteExpiry = object.absoluteExpiry; + else if (typeof object.absoluteExpiry === "object") + message.absoluteExpiry = new $util.LongBits(object.absoluteExpiry.low >>> 0, object.absoluteExpiry.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); + } + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".api.DecodeOfferResponse.paths: array expected"); + message.paths = []; + for (var 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]); + } + } + if (object.features) { + if (typeof object.features !== "object") + throw TypeError(".api.DecodeOfferResponse.features: object expected"); + message.features = {}; + for (var keys = Object.keys(object.features), i = 0; i < keys.length; ++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]]); + } + } + if (object.chains) { + if (!Array.isArray(object.chains)) + throw TypeError(".api.DecodeOfferResponse.chains: array expected"); + message.chains = []; + for (var 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.isExpired != null) + message.isExpired = Boolean(object.isExpired); + 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 = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.paths = []; + object.chains = []; + } + if (options.objects || options.defaults) + object.features = {}; + if (options.defaults) { + object.offerId = ""; + object.description = ""; + object.issuer = ""; + object.amount = null; + object.issuerSigningPubkey = ""; + object.absoluteExpiry = 0; + object.quantity = null; + object.metadata = ""; + object.isExpired = false; + } + if (message.offerId != null && message.hasOwnProperty("offerId")) + object.offerId = message.offerId; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.issuer != null && message.hasOwnProperty("issuer")) + object.issuer = message.issuer; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = $root.types.OfferAmount.toObject(message.amount, options); + if (message.issuerSigningPubkey != null && message.hasOwnProperty("issuerSigningPubkey")) + object.issuerSigningPubkey = message.issuerSigningPubkey; + if (message.absoluteExpiry != null && message.hasOwnProperty("absoluteExpiry")) + if (typeof message.absoluteExpiry === "number") + object.absoluteExpiry = options.longs === String ? String(message.absoluteExpiry) : message.absoluteExpiry; + else + object.absoluteExpiry = options.longs === String ? $util.Long.prototype.toString.call(message.absoluteExpiry) : options.longs === Number ? new $util.LongBits(message.absoluteExpiry.low >>> 0, message.absoluteExpiry.high >>> 0).toNumber(true) : message.absoluteExpiry; + 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 (var j = 0; j < message.paths.length; ++j) + object.paths[j] = $root.types.BlindedPath.toObject(message.paths[j], options); + } + var keys2; + if (message.features && (keys2 = Object.keys(message.features)).length) { + object.features = {}; + for (var j = 0; j < keys2.length; ++j) + object.features[keys2[j]] = $root.types.Bolt11Feature.toObject(message.features[keys2[j]], options); + } + if (message.chains && message.chains.length) { + object.chains = []; + for (var 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 (message.isExpired != null && message.hasOwnProperty("isExpired")) + object.isExpired = message.isExpired; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.SubscribeEventsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.api.SubscribeEventsRequest) + return object; + 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); + }; + + 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; +})(); + +$root.types = (function() { + + /** + * Namespace types. + * @exports types + * @namespace + */ + var 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 {number|Long|null} [amountMsat] Payment amountMsat + * @property {number|Long|null} [feePaidMsat] Payment feePaidMsat + * @property {types.PaymentDirection|null} [direction] Payment direction + * @property {types.PaymentStatus|null} [status] Payment status + * @property {number|Long|null} [latestUpdateTimestamp] Payment latestUpdateTimestamp + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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 amountMsat. + * @member {number|Long} amountMsat + * @memberof types.Payment + * @instance + */ + Payment.prototype.amountMsat = 0; + + /** + * Payment feePaidMsat. + * @member {number|Long} feePaidMsat + * @memberof types.Payment + * @instance + */ + Payment.prototype.feePaidMsat = 0; + + /** + * 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 latestUpdateTimestamp. + * @member {number|Long} latestUpdateTimestamp + * @memberof types.Payment + * @instance + */ + Payment.prototype.latestUpdateTimestamp = 0; + + /** + * 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.amountMsat != null && Object.hasOwnProperty.call(message, "amountMsat")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.amountMsat); + 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.latestUpdateTimestamp != null && Object.hasOwnProperty.call(message, "latestUpdateTimestamp")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.latestUpdateTimestamp); + if (message.feePaidMsat != null && Object.hasOwnProperty.call(message, "feePaidMsat")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.feePaidMsat); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Payment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.kind = $root.types.PaymentKind.decode(reader, reader.uint32()); + break; + case 3: + message.amountMsat = reader.uint64(); + break; + case 7: + message.feePaidMsat = reader.uint64(); + break; + case 4: + message.direction = reader.int32(); + break; + case 5: + message.status = reader.int32(); + break; + case 6: + message.latestUpdateTimestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.kind != null && message.hasOwnProperty("kind")) { + var error = $root.types.PaymentKind.verify(message.kind); + if (error) + return "kind." + error; + } + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (!$util.isInteger(message.amountMsat) && !(message.amountMsat && $util.isInteger(message.amountMsat.low) && $util.isInteger(message.amountMsat.high))) + return "amountMsat: integer|Long expected"; + if (message.feePaidMsat != null && message.hasOwnProperty("feePaidMsat")) + if (!$util.isInteger(message.feePaidMsat) && !(message.feePaidMsat && $util.isInteger(message.feePaidMsat.low) && $util.isInteger(message.feePaidMsat.high))) + return "feePaidMsat: 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.latestUpdateTimestamp != null && message.hasOwnProperty("latestUpdateTimestamp")) + if (!$util.isInteger(message.latestUpdateTimestamp) && !(message.latestUpdateTimestamp && $util.isInteger(message.latestUpdateTimestamp.low) && $util.isInteger(message.latestUpdateTimestamp.high))) + return "latestUpdateTimestamp: 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) { + if (object instanceof $root.types.Payment) + return object; + var 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); + } + if (object.amountMsat != null) + if ($util.Long) + (message.amountMsat = $util.Long.fromValue(object.amountMsat)).unsigned = true; + else if (typeof object.amountMsat === "string") + message.amountMsat = parseInt(object.amountMsat, 10); + else if (typeof object.amountMsat === "number") + message.amountMsat = object.amountMsat; + else if (typeof object.amountMsat === "object") + message.amountMsat = new $util.LongBits(object.amountMsat.low >>> 0, object.amountMsat.high >>> 0).toNumber(true); + if (object.feePaidMsat != null) + if ($util.Long) + (message.feePaidMsat = $util.Long.fromValue(object.feePaidMsat)).unsigned = true; + else if (typeof object.feePaidMsat === "string") + message.feePaidMsat = parseInt(object.feePaidMsat, 10); + else if (typeof object.feePaidMsat === "number") + message.feePaidMsat = object.feePaidMsat; + else if (typeof object.feePaidMsat === "object") + message.feePaidMsat = new $util.LongBits(object.feePaidMsat.low >>> 0, object.feePaidMsat.high >>> 0).toNumber(true); + switch (object.direction) { + case "INBOUND": + case 0: + message.direction = 0; + break; + case "OUTBOUND": + case 1: + message.direction = 1; + break; + } + switch (object.status) { + 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.latestUpdateTimestamp != null) + if ($util.Long) + (message.latestUpdateTimestamp = $util.Long.fromValue(object.latestUpdateTimestamp)).unsigned = true; + else if (typeof object.latestUpdateTimestamp === "string") + message.latestUpdateTimestamp = parseInt(object.latestUpdateTimestamp, 10); + else if (typeof object.latestUpdateTimestamp === "number") + message.latestUpdateTimestamp = object.latestUpdateTimestamp; + else if (typeof object.latestUpdateTimestamp === "object") + message.latestUpdateTimestamp = new $util.LongBits(object.latestUpdateTimestamp.low >>> 0, object.latestUpdateTimestamp.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 = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.kind = null; + object.amountMsat = 0; + object.direction = options.enums === String ? "INBOUND" : 0; + object.status = options.enums === String ? "PENDING" : 0; + object.latestUpdateTimestamp = 0; + object.feePaidMsat = 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.amountMsat != null && message.hasOwnProperty("amountMsat")) + if (typeof message.amountMsat === "number") + object.amountMsat = options.longs === String ? String(message.amountMsat) : message.amountMsat; + else + object.amountMsat = options.longs === String ? $util.Long.prototype.toString.call(message.amountMsat) : options.longs === Number ? new $util.LongBits(message.amountMsat.low >>> 0, message.amountMsat.high >>> 0).toNumber(true) : message.amountMsat; + if (message.direction != null && message.hasOwnProperty("direction")) + object.direction = options.enums === String ? $root.types.PaymentDirection[message.direction] : message.direction; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.types.PaymentStatus[message.status] : message.status; + if (message.latestUpdateTimestamp != null && message.hasOwnProperty("latestUpdateTimestamp")) + if (typeof message.latestUpdateTimestamp === "number") + object.latestUpdateTimestamp = options.longs === String ? String(message.latestUpdateTimestamp) : message.latestUpdateTimestamp; + else + object.latestUpdateTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.latestUpdateTimestamp) : options.longs === Number ? new $util.LongBits(message.latestUpdateTimestamp.low >>> 0, message.latestUpdateTimestamp.high >>> 0).toNumber(true) : message.latestUpdateTimestamp; + if (message.feePaidMsat != null && message.hasOwnProperty("feePaidMsat")) + if (typeof message.feePaidMsat === "number") + object.feePaidMsat = options.longs === String ? String(message.feePaidMsat) : message.feePaidMsat; + else + object.feePaidMsat = options.longs === String ? $util.Long.prototype.toString.call(message.feePaidMsat) : options.longs === Number ? new $util.LongBits(message.feePaidMsat.low >>> 0, message.feePaidMsat.high >>> 0).toNumber(true) : message.feePaidMsat; + 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); + }; + + 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} [bolt11Jit] PaymentKind bolt11Jit + * @property {types.IBolt12Offer|null} [bolt12Offer] PaymentKind bolt12Offer + * @property {types.IBolt12Refund|null} [bolt12Refund] PaymentKind bolt12Refund + * @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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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 bolt11Jit. + * @member {types.IBolt11Jit|null|undefined} bolt11Jit + * @memberof types.PaymentKind + * @instance + */ + PaymentKind.prototype.bolt11Jit = null; + + /** + * PaymentKind bolt12Offer. + * @member {types.IBolt12Offer|null|undefined} bolt12Offer + * @memberof types.PaymentKind + * @instance + */ + PaymentKind.prototype.bolt12Offer = null; + + /** + * PaymentKind bolt12Refund. + * @member {types.IBolt12Refund|null|undefined} bolt12Refund + * @memberof types.PaymentKind + * @instance + */ + PaymentKind.prototype.bolt12Refund = 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 + var $oneOfFields; + + /** + * PaymentKind kind. + * @member {"onchain"|"bolt11"|"bolt11Jit"|"bolt12Offer"|"bolt12Refund"|"spontaneous"|undefined} kind + * @memberof types.PaymentKind + * @instance + */ + Object.defineProperty(PaymentKind.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["onchain", "bolt11", "bolt11Jit", "bolt12Offer", "bolt12Refund", "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.bolt11Jit != null && Object.hasOwnProperty.call(message, "bolt11Jit")) + $root.types.Bolt11Jit.encode(message.bolt11Jit, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.bolt12Offer != null && Object.hasOwnProperty.call(message, "bolt12Offer")) + $root.types.Bolt12Offer.encode(message.bolt12Offer, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.bolt12Refund != null && Object.hasOwnProperty.call(message, "bolt12Refund")) + $root.types.Bolt12Refund.encode(message.bolt12Refund, 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.PaymentKind(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.onchain = $root.types.Onchain.decode(reader, reader.uint32()); + break; + case 2: + message.bolt11 = $root.types.Bolt11.decode(reader, reader.uint32()); + break; + case 3: + message.bolt11Jit = $root.types.Bolt11Jit.decode(reader, reader.uint32()); + break; + case 4: + message.bolt12Offer = $root.types.Bolt12Offer.decode(reader, reader.uint32()); + break; + case 5: + message.bolt12Refund = $root.types.Bolt12Refund.decode(reader, reader.uint32()); + break; + case 6: + message.spontaneous = $root.types.Spontaneous.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.onchain != null && message.hasOwnProperty("onchain")) { + properties.kind = 1; + { + var error = $root.types.Onchain.verify(message.onchain); + if (error) + return "onchain." + error; + } + } + if (message.bolt11 != null && message.hasOwnProperty("bolt11")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.types.Bolt11.verify(message.bolt11); + if (error) + return "bolt11." + error; + } + } + if (message.bolt11Jit != null && message.hasOwnProperty("bolt11Jit")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.types.Bolt11Jit.verify(message.bolt11Jit); + if (error) + return "bolt11Jit." + error; + } + } + if (message.bolt12Offer != null && message.hasOwnProperty("bolt12Offer")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.types.Bolt12Offer.verify(message.bolt12Offer); + if (error) + return "bolt12Offer." + error; + } + } + if (message.bolt12Refund != null && message.hasOwnProperty("bolt12Refund")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.types.Bolt12Refund.verify(message.bolt12Refund); + if (error) + return "bolt12Refund." + error; + } + } + if (message.spontaneous != null && message.hasOwnProperty("spontaneous")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.types.Spontaneous.verify(message.spontaneous); + 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) { + if (object instanceof $root.types.PaymentKind) + return object; + var 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); + } + if (object.bolt11 != null) { + if (typeof object.bolt11 !== "object") + throw TypeError(".types.PaymentKind.bolt11: object expected"); + message.bolt11 = $root.types.Bolt11.fromObject(object.bolt11); + } + if (object.bolt11Jit != null) { + if (typeof object.bolt11Jit !== "object") + throw TypeError(".types.PaymentKind.bolt11Jit: object expected"); + message.bolt11Jit = $root.types.Bolt11Jit.fromObject(object.bolt11Jit); + } + if (object.bolt12Offer != null) { + if (typeof object.bolt12Offer !== "object") + throw TypeError(".types.PaymentKind.bolt12Offer: object expected"); + message.bolt12Offer = $root.types.Bolt12Offer.fromObject(object.bolt12Offer); + } + if (object.bolt12Refund != null) { + if (typeof object.bolt12Refund !== "object") + throw TypeError(".types.PaymentKind.bolt12Refund: object expected"); + message.bolt12Refund = $root.types.Bolt12Refund.fromObject(object.bolt12Refund); + } + if (object.spontaneous != null) { + if (typeof object.spontaneous !== "object") + throw TypeError(".types.PaymentKind.spontaneous: object expected"); + message.spontaneous = $root.types.Spontaneous.fromObject(object.spontaneous); + } + 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 = {}; + var 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.bolt11Jit != null && message.hasOwnProperty("bolt11Jit")) { + object.bolt11Jit = $root.types.Bolt11Jit.toObject(message.bolt11Jit, options); + if (options.oneofs) + object.kind = "bolt11Jit"; + } + if (message.bolt12Offer != null && message.hasOwnProperty("bolt12Offer")) { + object.bolt12Offer = $root.types.Bolt12Offer.toObject(message.bolt12Offer, options); + if (options.oneofs) + object.kind = "bolt12Offer"; + } + if (message.bolt12Refund != null && message.hasOwnProperty("bolt12Refund")) { + object.bolt12Refund = $root.types.Bolt12Refund.toObject(message.bolt12Refund, options); + if (options.oneofs) + object.kind = "bolt12Refund"; + } + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Onchain(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txid = reader.string(); + break; + case 2: + message.status = $root.types.ConfirmationStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.txid != null && message.hasOwnProperty("txid")) + if (!$util.isString(message.txid)) + return "txid: string expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.types.ConfirmationStatus.verify(message.status); + 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) { + if (object instanceof $root.types.Onchain) + return object; + var 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); + } + 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 = {}; + var 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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 + var $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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.ConfirmationStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.confirmed = $root.types.Confirmed.decode(reader, reader.uint32()); + break; + case 2: + message.unconfirmed = $root.types.Unconfirmed.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.confirmed != null && message.hasOwnProperty("confirmed")) { + properties.status = 1; + { + var error = $root.types.Confirmed.verify(message.confirmed); + if (error) + return "confirmed." + error; + } + } + if (message.unconfirmed != null && message.hasOwnProperty("unconfirmed")) { + if (properties.status === 1) + return "status: multiple values"; + properties.status = 1; + { + var error = $root.types.Unconfirmed.verify(message.unconfirmed); + 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) { + if (object instanceof $root.types.ConfirmationStatus) + return object; + var 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); + } + if (object.unconfirmed != null) { + if (typeof object.unconfirmed !== "object") + throw TypeError(".types.ConfirmationStatus.unconfirmed: object expected"); + message.unconfirmed = $root.types.Unconfirmed.fromObject(object.unconfirmed); + } + 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 = {}; + var 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); + }; + + return ConfirmationStatus; + })(); + + types.Confirmed = (function() { + + /** + * Properties of a Confirmed. + * @memberof types + * @interface IConfirmed + * @property {string|null} [blockHash] Confirmed blockHash + * @property {number|null} [height] Confirmed height + * @property {number|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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Confirmed blockHash. + * @member {string} blockHash + * @memberof types.Confirmed + * @instance + */ + Confirmed.prototype.blockHash = ""; + + /** + * Confirmed height. + * @member {number} height + * @memberof types.Confirmed + * @instance + */ + Confirmed.prototype.height = 0; + + /** + * Confirmed timestamp. + * @member {number|Long} timestamp + * @memberof types.Confirmed + * @instance + */ + Confirmed.prototype.timestamp = 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.blockHash != null && Object.hasOwnProperty.call(message, "blockHash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.blockHash); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Confirmed(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHash = reader.string(); + break; + case 2: + message.height = reader.uint32(); + break; + case 3: + message.timestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockHash != null && message.hasOwnProperty("blockHash")) + if (!$util.isString(message.blockHash)) + return "blockHash: 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) { + if (object instanceof $root.types.Confirmed) + return object; + var message = new $root.types.Confirmed(); + if (object.blockHash != null) + message.blockHash = String(object.blockHash); + 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 = {}; + var object = {}; + if (options.defaults) { + object.blockHash = ""; + object.height = 0; + object.timestamp = 0; + } + if (message.blockHash != null && message.hasOwnProperty("blockHash")) + object.blockHash = message.blockHash; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Unconfirmed(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.types.Unconfirmed) + return object; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11 hash. + * @member {string} hash + * @memberof types.Bolt11 + * @instance + */ + Bolt11.prototype.hash = ""; + + /** + * Bolt11 preimage. + * @member {string} preimage + * @memberof types.Bolt11 + * @instance + */ + Bolt11.prototype.preimage = ""; + + /** + * Bolt11 secret. + * @member {Uint8Array} secret + * @memberof types.Bolt11 + * @instance + */ + Bolt11.prototype.secret = $util.newBuffer([]); + + /** + * 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Bolt11(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + if (message.preimage != null && message.hasOwnProperty("preimage")) + if (!$util.isString(message.preimage)) + return "preimage: string expected"; + if (message.secret != null && message.hasOwnProperty("secret")) + 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) { + if (object instanceof $root.types.Bolt11) + return object; + var 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) + 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 = {}; + var object = {}; + if (options.defaults) { + object.hash = ""; + object.preimage = ""; + if (options.bytes === String) + object.secret = ""; + else { + object.secret = []; + if (options.bytes !== Array) + object.secret = $util.newBuffer(object.secret); + } + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + if (message.preimage != null && message.hasOwnProperty("preimage")) + object.preimage = message.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; + 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); + }; + + 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} [lspFeeLimits] Bolt11Jit lspFeeLimits + * @property {number|Long|null} [counterpartySkimmedFeeMsat] Bolt11Jit counterpartySkimmedFeeMsat + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11Jit hash. + * @member {string} hash + * @memberof types.Bolt11Jit + * @instance + */ + Bolt11Jit.prototype.hash = ""; + + /** + * Bolt11Jit preimage. + * @member {string} preimage + * @memberof types.Bolt11Jit + * @instance + */ + Bolt11Jit.prototype.preimage = ""; + + /** + * Bolt11Jit secret. + * @member {Uint8Array} secret + * @memberof types.Bolt11Jit + * @instance + */ + Bolt11Jit.prototype.secret = $util.newBuffer([]); + + /** + * Bolt11Jit lspFeeLimits. + * @member {types.ILSPFeeLimits|null|undefined} lspFeeLimits + * @memberof types.Bolt11Jit + * @instance + */ + Bolt11Jit.prototype.lspFeeLimits = null; + + /** + * Bolt11Jit counterpartySkimmedFeeMsat. + * @member {number|Long} counterpartySkimmedFeeMsat + * @memberof types.Bolt11Jit + * @instance + */ + Bolt11Jit.prototype.counterpartySkimmedFeeMsat = 0; + + /** + * 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.lspFeeLimits != null && Object.hasOwnProperty.call(message, "lspFeeLimits")) + $root.types.LSPFeeLimits.encode(message.lspFeeLimits, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.counterpartySkimmedFeeMsat != null && Object.hasOwnProperty.call(message, "counterpartySkimmedFeeMsat")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.counterpartySkimmedFeeMsat); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Bolt11Jit(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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.lspFeeLimits = $root.types.LSPFeeLimits.decode(reader, reader.uint32()); + break; + case 5: + message.counterpartySkimmedFeeMsat = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + if (message.preimage != null && message.hasOwnProperty("preimage")) + if (!$util.isString(message.preimage)) + return "preimage: string expected"; + if (message.secret != null && message.hasOwnProperty("secret")) + if (!(message.secret && typeof message.secret.length === "number" || $util.isString(message.secret))) + return "secret: buffer expected"; + if (message.lspFeeLimits != null && message.hasOwnProperty("lspFeeLimits")) { + var error = $root.types.LSPFeeLimits.verify(message.lspFeeLimits); + if (error) + return "lspFeeLimits." + error; + } + if (message.counterpartySkimmedFeeMsat != null && message.hasOwnProperty("counterpartySkimmedFeeMsat")) + if (!$util.isInteger(message.counterpartySkimmedFeeMsat) && !(message.counterpartySkimmedFeeMsat && $util.isInteger(message.counterpartySkimmedFeeMsat.low) && $util.isInteger(message.counterpartySkimmedFeeMsat.high))) + return "counterpartySkimmedFeeMsat: 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) { + if (object instanceof $root.types.Bolt11Jit) + return object; + var 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) + message.secret = object.secret; + if (object.lspFeeLimits != null) { + if (typeof object.lspFeeLimits !== "object") + throw TypeError(".types.Bolt11Jit.lspFeeLimits: object expected"); + message.lspFeeLimits = $root.types.LSPFeeLimits.fromObject(object.lspFeeLimits); + } + if (object.counterpartySkimmedFeeMsat != null) + if ($util.Long) + (message.counterpartySkimmedFeeMsat = $util.Long.fromValue(object.counterpartySkimmedFeeMsat)).unsigned = true; + else if (typeof object.counterpartySkimmedFeeMsat === "string") + message.counterpartySkimmedFeeMsat = parseInt(object.counterpartySkimmedFeeMsat, 10); + else if (typeof object.counterpartySkimmedFeeMsat === "number") + message.counterpartySkimmedFeeMsat = object.counterpartySkimmedFeeMsat; + else if (typeof object.counterpartySkimmedFeeMsat === "object") + message.counterpartySkimmedFeeMsat = new $util.LongBits(object.counterpartySkimmedFeeMsat.low >>> 0, object.counterpartySkimmedFeeMsat.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 = {}; + var object = {}; + if (options.defaults) { + object.hash = ""; + object.preimage = ""; + if (options.bytes === String) + object.secret = ""; + else { + object.secret = []; + if (options.bytes !== Array) + object.secret = $util.newBuffer(object.secret); + } + object.lspFeeLimits = null; + object.counterpartySkimmedFeeMsat = 0; + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + if (message.preimage != null && message.hasOwnProperty("preimage")) + object.preimage = message.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 (message.lspFeeLimits != null && message.hasOwnProperty("lspFeeLimits")) + object.lspFeeLimits = $root.types.LSPFeeLimits.toObject(message.lspFeeLimits, options); + if (message.counterpartySkimmedFeeMsat != null && message.hasOwnProperty("counterpartySkimmedFeeMsat")) + if (typeof message.counterpartySkimmedFeeMsat === "number") + object.counterpartySkimmedFeeMsat = options.longs === String ? String(message.counterpartySkimmedFeeMsat) : message.counterpartySkimmedFeeMsat; + else + object.counterpartySkimmedFeeMsat = options.longs === String ? $util.Long.prototype.toString.call(message.counterpartySkimmedFeeMsat) : options.longs === Number ? new $util.LongBits(message.counterpartySkimmedFeeMsat.low >>> 0, message.counterpartySkimmedFeeMsat.high >>> 0).toNumber(true) : message.counterpartySkimmedFeeMsat; + 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); + }; + + 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} [offerId] Bolt12Offer offerId + * @property {string|null} [payerNote] Bolt12Offer payerNote + * @property {number|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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt12Offer hash. + * @member {string} hash + * @memberof types.Bolt12Offer + * @instance + */ + Bolt12Offer.prototype.hash = ""; + + /** + * Bolt12Offer preimage. + * @member {string} preimage + * @memberof types.Bolt12Offer + * @instance + */ + Bolt12Offer.prototype.preimage = ""; + + /** + * Bolt12Offer secret. + * @member {Uint8Array} secret + * @memberof types.Bolt12Offer + * @instance + */ + Bolt12Offer.prototype.secret = $util.newBuffer([]); + + /** + * Bolt12Offer offerId. + * @member {string} offerId + * @memberof types.Bolt12Offer + * @instance + */ + Bolt12Offer.prototype.offerId = ""; + + /** + * Bolt12Offer payerNote. + * @member {string} payerNote + * @memberof types.Bolt12Offer + * @instance + */ + Bolt12Offer.prototype.payerNote = ""; + + /** + * Bolt12Offer quantity. + * @member {number|Long} quantity + * @memberof types.Bolt12Offer + * @instance + */ + Bolt12Offer.prototype.quantity = 0; + + /** + * 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.offerId != null && Object.hasOwnProperty.call(message, "offerId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.offerId); + if (message.payerNote != null && Object.hasOwnProperty.call(message, "payerNote")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.payerNote); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Bolt12Offer(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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.offerId = reader.string(); + break; + case 5: + message.payerNote = reader.string(); + break; + case 6: + message.quantity = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + if (message.preimage != null && message.hasOwnProperty("preimage")) + if (!$util.isString(message.preimage)) + return "preimage: string expected"; + if (message.secret != null && message.hasOwnProperty("secret")) + if (!(message.secret && typeof message.secret.length === "number" || $util.isString(message.secret))) + return "secret: buffer expected"; + if (message.offerId != null && message.hasOwnProperty("offerId")) + if (!$util.isString(message.offerId)) + return "offerId: string expected"; + if (message.payerNote != null && message.hasOwnProperty("payerNote")) + if (!$util.isString(message.payerNote)) + return "payerNote: string expected"; + if (message.quantity != null && message.hasOwnProperty("quantity")) + 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) { + if (object instanceof $root.types.Bolt12Offer) + return object; + var 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) + message.secret = object.secret; + if (object.offerId != null) + message.offerId = String(object.offerId); + if (object.payerNote != null) + message.payerNote = String(object.payerNote); + 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 = {}; + var object = {}; + if (options.defaults) { + object.hash = ""; + object.preimage = ""; + if (options.bytes === String) + object.secret = ""; + else { + object.secret = []; + if (options.bytes !== Array) + object.secret = $util.newBuffer(object.secret); + } + object.offerId = ""; + object.payerNote = ""; + object.quantity = 0; + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + if (message.preimage != null && message.hasOwnProperty("preimage")) + object.preimage = message.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 (message.offerId != null && message.hasOwnProperty("offerId")) + object.offerId = message.offerId; + if (message.payerNote != null && message.hasOwnProperty("payerNote")) + object.payerNote = message.payerNote; + if (message.quantity != null && message.hasOwnProperty("quantity")) + 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; + 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); + }; + + 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} [payerNote] Bolt12Refund payerNote + * @property {number|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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt12Refund hash. + * @member {string} hash + * @memberof types.Bolt12Refund + * @instance + */ + Bolt12Refund.prototype.hash = ""; + + /** + * Bolt12Refund preimage. + * @member {string} preimage + * @memberof types.Bolt12Refund + * @instance + */ + Bolt12Refund.prototype.preimage = ""; + + /** + * Bolt12Refund secret. + * @member {Uint8Array} secret + * @memberof types.Bolt12Refund + * @instance + */ + Bolt12Refund.prototype.secret = $util.newBuffer([]); + + /** + * Bolt12Refund payerNote. + * @member {string} payerNote + * @memberof types.Bolt12Refund + * @instance + */ + Bolt12Refund.prototype.payerNote = ""; + + /** + * Bolt12Refund quantity. + * @member {number|Long} quantity + * @memberof types.Bolt12Refund + * @instance + */ + Bolt12Refund.prototype.quantity = 0; + + /** + * 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.payerNote != null && Object.hasOwnProperty.call(message, "payerNote")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.payerNote); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Bolt12Refund(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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.payerNote = reader.string(); + break; + case 6: + message.quantity = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + if (message.preimage != null && message.hasOwnProperty("preimage")) + if (!$util.isString(message.preimage)) + return "preimage: string expected"; + if (message.secret != null && message.hasOwnProperty("secret")) + if (!(message.secret && typeof message.secret.length === "number" || $util.isString(message.secret))) + return "secret: buffer expected"; + if (message.payerNote != null && message.hasOwnProperty("payerNote")) + if (!$util.isString(message.payerNote)) + return "payerNote: string expected"; + if (message.quantity != null && message.hasOwnProperty("quantity")) + 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) { + if (object instanceof $root.types.Bolt12Refund) + return object; + var 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) + message.secret = object.secret; + if (object.payerNote != null) + message.payerNote = String(object.payerNote); + 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 = {}; + var object = {}; + if (options.defaults) { + object.hash = ""; + object.preimage = ""; + if (options.bytes === String) + object.secret = ""; + else { + object.secret = []; + if (options.bytes !== Array) + object.secret = $util.newBuffer(object.secret); + } + object.payerNote = ""; + object.quantity = 0; + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + if (message.preimage != null && message.hasOwnProperty("preimage")) + object.preimage = message.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 (message.payerNote != null && message.hasOwnProperty("payerNote")) + object.payerNote = message.payerNote; + if (message.quantity != null && message.hasOwnProperty("quantity")) + 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; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Spontaneous hash. + * @member {string} hash + * @memberof types.Spontaneous + * @instance + */ + Spontaneous.prototype.hash = ""; + + /** + * Spontaneous preimage. + * @member {string} preimage + * @memberof types.Spontaneous + * @instance + */ + Spontaneous.prototype.preimage = ""; + + /** + * 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Spontaneous(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hash = reader.string(); + break; + case 2: + message.preimage = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + if (message.preimage != null && message.hasOwnProperty("preimage")) + 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) { + if (object instanceof $root.types.Spontaneous) + return object; + var 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 = {}; + var object = {}; + if (options.defaults) { + object.hash = ""; + object.preimage = ""; + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + if (message.preimage != null && message.hasOwnProperty("preimage")) + object.preimage = message.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); + }; + + return Spontaneous; + })(); + + types.LSPFeeLimits = (function() { + + /** + * Properties of a LSPFeeLimits. + * @memberof types + * @interface ILSPFeeLimits + * @property {number|Long|null} [maxTotalOpeningFeeMsat] LSPFeeLimits maxTotalOpeningFeeMsat + * @property {number|Long|null} [maxProportionalOpeningFeePpmMsat] LSPFeeLimits maxProportionalOpeningFeePpmMsat + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LSPFeeLimits maxTotalOpeningFeeMsat. + * @member {number|Long} maxTotalOpeningFeeMsat + * @memberof types.LSPFeeLimits + * @instance + */ + LSPFeeLimits.prototype.maxTotalOpeningFeeMsat = 0; + + /** + * LSPFeeLimits maxProportionalOpeningFeePpmMsat. + * @member {number|Long} maxProportionalOpeningFeePpmMsat + * @memberof types.LSPFeeLimits + * @instance + */ + LSPFeeLimits.prototype.maxProportionalOpeningFeePpmMsat = 0; + + /** + * 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.maxTotalOpeningFeeMsat != null && Object.hasOwnProperty.call(message, "maxTotalOpeningFeeMsat")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.maxTotalOpeningFeeMsat); + if (message.maxProportionalOpeningFeePpmMsat != null && Object.hasOwnProperty.call(message, "maxProportionalOpeningFeePpmMsat")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.maxProportionalOpeningFeePpmMsat); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.LSPFeeLimits(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxTotalOpeningFeeMsat = reader.uint64(); + break; + case 2: + message.maxProportionalOpeningFeePpmMsat = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxTotalOpeningFeeMsat != null && message.hasOwnProperty("maxTotalOpeningFeeMsat")) + if (!$util.isInteger(message.maxTotalOpeningFeeMsat) && !(message.maxTotalOpeningFeeMsat && $util.isInteger(message.maxTotalOpeningFeeMsat.low) && $util.isInteger(message.maxTotalOpeningFeeMsat.high))) + return "maxTotalOpeningFeeMsat: integer|Long expected"; + if (message.maxProportionalOpeningFeePpmMsat != null && message.hasOwnProperty("maxProportionalOpeningFeePpmMsat")) + if (!$util.isInteger(message.maxProportionalOpeningFeePpmMsat) && !(message.maxProportionalOpeningFeePpmMsat && $util.isInteger(message.maxProportionalOpeningFeePpmMsat.low) && $util.isInteger(message.maxProportionalOpeningFeePpmMsat.high))) + return "maxProportionalOpeningFeePpmMsat: 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) { + if (object instanceof $root.types.LSPFeeLimits) + return object; + var message = new $root.types.LSPFeeLimits(); + if (object.maxTotalOpeningFeeMsat != null) + if ($util.Long) + (message.maxTotalOpeningFeeMsat = $util.Long.fromValue(object.maxTotalOpeningFeeMsat)).unsigned = true; + else if (typeof object.maxTotalOpeningFeeMsat === "string") + message.maxTotalOpeningFeeMsat = parseInt(object.maxTotalOpeningFeeMsat, 10); + else if (typeof object.maxTotalOpeningFeeMsat === "number") + message.maxTotalOpeningFeeMsat = object.maxTotalOpeningFeeMsat; + else if (typeof object.maxTotalOpeningFeeMsat === "object") + message.maxTotalOpeningFeeMsat = new $util.LongBits(object.maxTotalOpeningFeeMsat.low >>> 0, object.maxTotalOpeningFeeMsat.high >>> 0).toNumber(true); + if (object.maxProportionalOpeningFeePpmMsat != null) + if ($util.Long) + (message.maxProportionalOpeningFeePpmMsat = $util.Long.fromValue(object.maxProportionalOpeningFeePpmMsat)).unsigned = true; + else if (typeof object.maxProportionalOpeningFeePpmMsat === "string") + message.maxProportionalOpeningFeePpmMsat = parseInt(object.maxProportionalOpeningFeePpmMsat, 10); + else if (typeof object.maxProportionalOpeningFeePpmMsat === "number") + message.maxProportionalOpeningFeePpmMsat = object.maxProportionalOpeningFeePpmMsat; + else if (typeof object.maxProportionalOpeningFeePpmMsat === "object") + message.maxProportionalOpeningFeePpmMsat = new $util.LongBits(object.maxProportionalOpeningFeePpmMsat.low >>> 0, object.maxProportionalOpeningFeePpmMsat.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 = {}; + var object = {}; + if (options.defaults) { + object.maxTotalOpeningFeeMsat = 0; + object.maxProportionalOpeningFeePpmMsat = 0; + } + if (message.maxTotalOpeningFeeMsat != null && message.hasOwnProperty("maxTotalOpeningFeeMsat")) + if (typeof message.maxTotalOpeningFeeMsat === "number") + object.maxTotalOpeningFeeMsat = options.longs === String ? String(message.maxTotalOpeningFeeMsat) : message.maxTotalOpeningFeeMsat; + else + object.maxTotalOpeningFeeMsat = options.longs === String ? $util.Long.prototype.toString.call(message.maxTotalOpeningFeeMsat) : options.longs === Number ? new $util.LongBits(message.maxTotalOpeningFeeMsat.low >>> 0, message.maxTotalOpeningFeeMsat.high >>> 0).toNumber(true) : message.maxTotalOpeningFeeMsat; + if (message.maxProportionalOpeningFeePpmMsat != null && message.hasOwnProperty("maxProportionalOpeningFeePpmMsat")) + if (typeof message.maxProportionalOpeningFeePpmMsat === "number") + object.maxProportionalOpeningFeePpmMsat = options.longs === String ? String(message.maxProportionalOpeningFeePpmMsat) : message.maxProportionalOpeningFeePpmMsat; + else + object.maxProportionalOpeningFeePpmMsat = options.longs === String ? $util.Long.prototype.toString.call(message.maxProportionalOpeningFeePpmMsat) : options.longs === Number ? new $util.LongBits(message.maxProportionalOpeningFeePpmMsat.low >>> 0, message.maxProportionalOpeningFeePpmMsat.high >>> 0).toNumber(true) : message.maxProportionalOpeningFeePpmMsat; + 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); + }; + + return LSPFeeLimits; + })(); + + /** + * PaymentDirection enum. + * @name types.PaymentDirection + * @enum {string} + * @property {number} INBOUND=0 INBOUND value + * @property {number} OUTBOUND=1 OUTBOUND value + */ + types.PaymentDirection = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INBOUND"] = 0; + values[valuesById[1] = "OUTBOUND"] = 1; + return values; + })(); + + /** + * PaymentStatus enum. + * @name types.PaymentStatus + * @enum {string} + * @property {number} PENDING=0 PENDING value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED=2 FAILED value + */ + types.PaymentStatus = (function() { + var 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 {string} + * @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() { + var 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} [prevChannelId] ForwardedPayment prevChannelId + * @property {string|null} [nextChannelId] ForwardedPayment nextChannelId + * @property {string|null} [prevUserChannelId] ForwardedPayment prevUserChannelId + * @property {string|null} [prevNodeId] ForwardedPayment prevNodeId + * @property {string|null} [nextNodeId] ForwardedPayment nextNodeId + * @property {string|null} [nextUserChannelId] ForwardedPayment nextUserChannelId + * @property {number|Long|null} [totalFeeEarnedMsat] ForwardedPayment totalFeeEarnedMsat + * @property {number|Long|null} [skimmedFeeMsat] ForwardedPayment skimmedFeeMsat + * @property {boolean|null} [claimFromOnchainTx] ForwardedPayment claimFromOnchainTx + * @property {number|Long|null} [outboundAmountForwardedMsat] ForwardedPayment outboundAmountForwardedMsat + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ForwardedPayment prevChannelId. + * @member {string} prevChannelId + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.prevChannelId = ""; + + /** + * ForwardedPayment nextChannelId. + * @member {string} nextChannelId + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.nextChannelId = ""; + + /** + * ForwardedPayment prevUserChannelId. + * @member {string} prevUserChannelId + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.prevUserChannelId = ""; + + /** + * ForwardedPayment prevNodeId. + * @member {string} prevNodeId + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.prevNodeId = ""; + + /** + * ForwardedPayment nextNodeId. + * @member {string} nextNodeId + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.nextNodeId = ""; + + /** + * ForwardedPayment nextUserChannelId. + * @member {string} nextUserChannelId + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.nextUserChannelId = ""; + + /** + * ForwardedPayment totalFeeEarnedMsat. + * @member {number|Long} totalFeeEarnedMsat + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.totalFeeEarnedMsat = 0; + + /** + * ForwardedPayment skimmedFeeMsat. + * @member {number|Long} skimmedFeeMsat + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.skimmedFeeMsat = 0; + + /** + * ForwardedPayment claimFromOnchainTx. + * @member {boolean} claimFromOnchainTx + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.claimFromOnchainTx = false; + + /** + * ForwardedPayment outboundAmountForwardedMsat. + * @member {number|Long} outboundAmountForwardedMsat + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.outboundAmountForwardedMsat = 0; + + /** + * 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.prevChannelId != null && Object.hasOwnProperty.call(message, "prevChannelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.prevChannelId); + if (message.nextChannelId != null && Object.hasOwnProperty.call(message, "nextChannelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextChannelId); + if (message.prevUserChannelId != null && Object.hasOwnProperty.call(message, "prevUserChannelId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.prevUserChannelId); + if (message.nextUserChannelId != null && Object.hasOwnProperty.call(message, "nextUserChannelId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.nextUserChannelId); + if (message.totalFeeEarnedMsat != null && Object.hasOwnProperty.call(message, "totalFeeEarnedMsat")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.totalFeeEarnedMsat); + if (message.skimmedFeeMsat != null && Object.hasOwnProperty.call(message, "skimmedFeeMsat")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.skimmedFeeMsat); + if (message.claimFromOnchainTx != null && Object.hasOwnProperty.call(message, "claimFromOnchainTx")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.claimFromOnchainTx); + if (message.outboundAmountForwardedMsat != null && Object.hasOwnProperty.call(message, "outboundAmountForwardedMsat")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.outboundAmountForwardedMsat); + if (message.prevNodeId != null && Object.hasOwnProperty.call(message, "prevNodeId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.prevNodeId); + if (message.nextNodeId != null && Object.hasOwnProperty.call(message, "nextNodeId")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.nextNodeId); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.ForwardedPayment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prevChannelId = reader.string(); + break; + case 2: + message.nextChannelId = reader.string(); + break; + case 3: + message.prevUserChannelId = reader.string(); + break; + case 9: + message.prevNodeId = reader.string(); + break; + case 10: + message.nextNodeId = reader.string(); + break; + case 4: + message.nextUserChannelId = reader.string(); + break; + case 5: + message.totalFeeEarnedMsat = reader.uint64(); + break; + case 6: + message.skimmedFeeMsat = reader.uint64(); + break; + case 7: + message.claimFromOnchainTx = reader.bool(); + break; + case 8: + message.outboundAmountForwardedMsat = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.prevChannelId != null && message.hasOwnProperty("prevChannelId")) + if (!$util.isString(message.prevChannelId)) + return "prevChannelId: string expected"; + if (message.nextChannelId != null && message.hasOwnProperty("nextChannelId")) + if (!$util.isString(message.nextChannelId)) + return "nextChannelId: string expected"; + if (message.prevUserChannelId != null && message.hasOwnProperty("prevUserChannelId")) + if (!$util.isString(message.prevUserChannelId)) + return "prevUserChannelId: string expected"; + if (message.prevNodeId != null && message.hasOwnProperty("prevNodeId")) + if (!$util.isString(message.prevNodeId)) + return "prevNodeId: string expected"; + if (message.nextNodeId != null && message.hasOwnProperty("nextNodeId")) + if (!$util.isString(message.nextNodeId)) + return "nextNodeId: string expected"; + if (message.nextUserChannelId != null && message.hasOwnProperty("nextUserChannelId")) + if (!$util.isString(message.nextUserChannelId)) + return "nextUserChannelId: string expected"; + if (message.totalFeeEarnedMsat != null && message.hasOwnProperty("totalFeeEarnedMsat")) + if (!$util.isInteger(message.totalFeeEarnedMsat) && !(message.totalFeeEarnedMsat && $util.isInteger(message.totalFeeEarnedMsat.low) && $util.isInteger(message.totalFeeEarnedMsat.high))) + return "totalFeeEarnedMsat: integer|Long expected"; + if (message.skimmedFeeMsat != null && message.hasOwnProperty("skimmedFeeMsat")) + if (!$util.isInteger(message.skimmedFeeMsat) && !(message.skimmedFeeMsat && $util.isInteger(message.skimmedFeeMsat.low) && $util.isInteger(message.skimmedFeeMsat.high))) + return "skimmedFeeMsat: integer|Long expected"; + if (message.claimFromOnchainTx != null && message.hasOwnProperty("claimFromOnchainTx")) + if (typeof message.claimFromOnchainTx !== "boolean") + return "claimFromOnchainTx: boolean expected"; + if (message.outboundAmountForwardedMsat != null && message.hasOwnProperty("outboundAmountForwardedMsat")) + if (!$util.isInteger(message.outboundAmountForwardedMsat) && !(message.outboundAmountForwardedMsat && $util.isInteger(message.outboundAmountForwardedMsat.low) && $util.isInteger(message.outboundAmountForwardedMsat.high))) + return "outboundAmountForwardedMsat: 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) { + if (object instanceof $root.types.ForwardedPayment) + return object; + var message = new $root.types.ForwardedPayment(); + if (object.prevChannelId != null) + message.prevChannelId = String(object.prevChannelId); + if (object.nextChannelId != null) + message.nextChannelId = String(object.nextChannelId); + if (object.prevUserChannelId != null) + message.prevUserChannelId = String(object.prevUserChannelId); + if (object.prevNodeId != null) + message.prevNodeId = String(object.prevNodeId); + if (object.nextNodeId != null) + message.nextNodeId = String(object.nextNodeId); + if (object.nextUserChannelId != null) + message.nextUserChannelId = String(object.nextUserChannelId); + if (object.totalFeeEarnedMsat != null) + if ($util.Long) + (message.totalFeeEarnedMsat = $util.Long.fromValue(object.totalFeeEarnedMsat)).unsigned = true; + else if (typeof object.totalFeeEarnedMsat === "string") + message.totalFeeEarnedMsat = parseInt(object.totalFeeEarnedMsat, 10); + else if (typeof object.totalFeeEarnedMsat === "number") + message.totalFeeEarnedMsat = object.totalFeeEarnedMsat; + else if (typeof object.totalFeeEarnedMsat === "object") + message.totalFeeEarnedMsat = new $util.LongBits(object.totalFeeEarnedMsat.low >>> 0, object.totalFeeEarnedMsat.high >>> 0).toNumber(true); + if (object.skimmedFeeMsat != null) + if ($util.Long) + (message.skimmedFeeMsat = $util.Long.fromValue(object.skimmedFeeMsat)).unsigned = true; + else if (typeof object.skimmedFeeMsat === "string") + message.skimmedFeeMsat = parseInt(object.skimmedFeeMsat, 10); + else if (typeof object.skimmedFeeMsat === "number") + message.skimmedFeeMsat = object.skimmedFeeMsat; + else if (typeof object.skimmedFeeMsat === "object") + message.skimmedFeeMsat = new $util.LongBits(object.skimmedFeeMsat.low >>> 0, object.skimmedFeeMsat.high >>> 0).toNumber(true); + if (object.claimFromOnchainTx != null) + message.claimFromOnchainTx = Boolean(object.claimFromOnchainTx); + if (object.outboundAmountForwardedMsat != null) + if ($util.Long) + (message.outboundAmountForwardedMsat = $util.Long.fromValue(object.outboundAmountForwardedMsat)).unsigned = true; + else if (typeof object.outboundAmountForwardedMsat === "string") + message.outboundAmountForwardedMsat = parseInt(object.outboundAmountForwardedMsat, 10); + else if (typeof object.outboundAmountForwardedMsat === "number") + message.outboundAmountForwardedMsat = object.outboundAmountForwardedMsat; + else if (typeof object.outboundAmountForwardedMsat === "object") + message.outboundAmountForwardedMsat = new $util.LongBits(object.outboundAmountForwardedMsat.low >>> 0, object.outboundAmountForwardedMsat.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 = {}; + var object = {}; + if (options.defaults) { + object.prevChannelId = ""; + object.nextChannelId = ""; + object.prevUserChannelId = ""; + object.nextUserChannelId = ""; + object.totalFeeEarnedMsat = 0; + object.skimmedFeeMsat = 0; + object.claimFromOnchainTx = false; + object.outboundAmountForwardedMsat = 0; + object.prevNodeId = ""; + object.nextNodeId = ""; + } + if (message.prevChannelId != null && message.hasOwnProperty("prevChannelId")) + object.prevChannelId = message.prevChannelId; + if (message.nextChannelId != null && message.hasOwnProperty("nextChannelId")) + object.nextChannelId = message.nextChannelId; + if (message.prevUserChannelId != null && message.hasOwnProperty("prevUserChannelId")) + object.prevUserChannelId = message.prevUserChannelId; + if (message.nextUserChannelId != null && message.hasOwnProperty("nextUserChannelId")) + object.nextUserChannelId = message.nextUserChannelId; + if (message.totalFeeEarnedMsat != null && message.hasOwnProperty("totalFeeEarnedMsat")) + if (typeof message.totalFeeEarnedMsat === "number") + object.totalFeeEarnedMsat = options.longs === String ? String(message.totalFeeEarnedMsat) : message.totalFeeEarnedMsat; + else + object.totalFeeEarnedMsat = options.longs === String ? $util.Long.prototype.toString.call(message.totalFeeEarnedMsat) : options.longs === Number ? new $util.LongBits(message.totalFeeEarnedMsat.low >>> 0, message.totalFeeEarnedMsat.high >>> 0).toNumber(true) : message.totalFeeEarnedMsat; + if (message.skimmedFeeMsat != null && message.hasOwnProperty("skimmedFeeMsat")) + if (typeof message.skimmedFeeMsat === "number") + object.skimmedFeeMsat = options.longs === String ? String(message.skimmedFeeMsat) : message.skimmedFeeMsat; + else + object.skimmedFeeMsat = options.longs === String ? $util.Long.prototype.toString.call(message.skimmedFeeMsat) : options.longs === Number ? new $util.LongBits(message.skimmedFeeMsat.low >>> 0, message.skimmedFeeMsat.high >>> 0).toNumber(true) : message.skimmedFeeMsat; + if (message.claimFromOnchainTx != null && message.hasOwnProperty("claimFromOnchainTx")) + object.claimFromOnchainTx = message.claimFromOnchainTx; + if (message.outboundAmountForwardedMsat != null && message.hasOwnProperty("outboundAmountForwardedMsat")) + if (typeof message.outboundAmountForwardedMsat === "number") + object.outboundAmountForwardedMsat = options.longs === String ? String(message.outboundAmountForwardedMsat) : message.outboundAmountForwardedMsat; + else + object.outboundAmountForwardedMsat = options.longs === String ? $util.Long.prototype.toString.call(message.outboundAmountForwardedMsat) : options.longs === Number ? new $util.LongBits(message.outboundAmountForwardedMsat.low >>> 0, message.outboundAmountForwardedMsat.high >>> 0).toNumber(true) : message.outboundAmountForwardedMsat; + if (message.prevNodeId != null && message.hasOwnProperty("prevNodeId")) + object.prevNodeId = message.prevNodeId; + if (message.nextNodeId != null && message.hasOwnProperty("nextNodeId")) + object.nextNodeId = message.nextNodeId; + 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); + }; + + return ForwardedPayment; + })(); + + types.Channel = (function() { + + /** + * Properties of a Channel. + * @memberof types + * @interface IChannel + * @property {string|null} [channelId] Channel channelId + * @property {string|null} [counterpartyNodeId] Channel counterpartyNodeId + * @property {types.IOutPoint|null} [fundingTxo] Channel fundingTxo + * @property {string|null} [userChannelId] Channel userChannelId + * @property {number|Long|null} [unspendablePunishmentReserve] Channel unspendablePunishmentReserve + * @property {number|Long|null} [channelValueSats] Channel channelValueSats + * @property {number|null} [feerateSatPer_1000Weight] Channel feerateSatPer_1000Weight + * @property {number|Long|null} [outboundCapacityMsat] Channel outboundCapacityMsat + * @property {number|Long|null} [inboundCapacityMsat] Channel inboundCapacityMsat + * @property {number|null} [confirmationsRequired] Channel confirmationsRequired + * @property {number|null} [confirmations] Channel confirmations + * @property {boolean|null} [isOutbound] Channel isOutbound + * @property {boolean|null} [isChannelReady] Channel isChannelReady + * @property {boolean|null} [isUsable] Channel isUsable + * @property {boolean|null} [isAnnounced] Channel isAnnounced + * @property {types.IChannelConfig|null} [channelConfig] Channel channelConfig + * @property {number|Long|null} [nextOutboundHtlcLimitMsat] Channel nextOutboundHtlcLimitMsat + * @property {number|Long|null} [nextOutboundHtlcMinimumMsat] Channel nextOutboundHtlcMinimumMsat + * @property {number|null} [forceCloseSpendDelay] Channel forceCloseSpendDelay + * @property {number|Long|null} [counterpartyOutboundHtlcMinimumMsat] Channel counterpartyOutboundHtlcMinimumMsat + * @property {number|Long|null} [counterpartyOutboundHtlcMaximumMsat] Channel counterpartyOutboundHtlcMaximumMsat + * @property {number|Long|null} [counterpartyUnspendablePunishmentReserve] Channel counterpartyUnspendablePunishmentReserve + * @property {number|null} [counterpartyForwardingInfoFeeBaseMsat] Channel counterpartyForwardingInfoFeeBaseMsat + * @property {number|null} [counterpartyForwardingInfoFeeProportionalMillionths] Channel counterpartyForwardingInfoFeeProportionalMillionths + * @property {number|null} [counterpartyForwardingInfoCltvExpiryDelta] Channel counterpartyForwardingInfoCltvExpiryDelta + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Channel channelId. + * @member {string} channelId + * @memberof types.Channel + * @instance + */ + Channel.prototype.channelId = ""; + + /** + * Channel counterpartyNodeId. + * @member {string} counterpartyNodeId + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterpartyNodeId = ""; + + /** + * Channel fundingTxo. + * @member {types.IOutPoint|null|undefined} fundingTxo + * @memberof types.Channel + * @instance + */ + Channel.prototype.fundingTxo = null; + + /** + * Channel userChannelId. + * @member {string} userChannelId + * @memberof types.Channel + * @instance + */ + Channel.prototype.userChannelId = ""; + + /** + * Channel unspendablePunishmentReserve. + * @member {number|Long} unspendablePunishmentReserve + * @memberof types.Channel + * @instance + */ + Channel.prototype.unspendablePunishmentReserve = 0; + + /** + * Channel channelValueSats. + * @member {number|Long} channelValueSats + * @memberof types.Channel + * @instance + */ + Channel.prototype.channelValueSats = 0; + + /** + * Channel feerateSatPer_1000Weight. + * @member {number} feerateSatPer_1000Weight + * @memberof types.Channel + * @instance + */ + Channel.prototype.feerateSatPer_1000Weight = 0; + + /** + * Channel outboundCapacityMsat. + * @member {number|Long} outboundCapacityMsat + * @memberof types.Channel + * @instance + */ + Channel.prototype.outboundCapacityMsat = 0; + + /** + * Channel inboundCapacityMsat. + * @member {number|Long} inboundCapacityMsat + * @memberof types.Channel + * @instance + */ + Channel.prototype.inboundCapacityMsat = 0; + + /** + * Channel confirmationsRequired. + * @member {number} confirmationsRequired + * @memberof types.Channel + * @instance + */ + Channel.prototype.confirmationsRequired = 0; + + /** + * Channel confirmations. + * @member {number} confirmations + * @memberof types.Channel + * @instance + */ + Channel.prototype.confirmations = 0; + + /** + * Channel isOutbound. + * @member {boolean} isOutbound + * @memberof types.Channel + * @instance + */ + Channel.prototype.isOutbound = false; + + /** + * Channel isChannelReady. + * @member {boolean} isChannelReady + * @memberof types.Channel + * @instance + */ + Channel.prototype.isChannelReady = false; + + /** + * Channel isUsable. + * @member {boolean} isUsable + * @memberof types.Channel + * @instance + */ + Channel.prototype.isUsable = false; + + /** + * Channel isAnnounced. + * @member {boolean} isAnnounced + * @memberof types.Channel + * @instance + */ + Channel.prototype.isAnnounced = false; + + /** + * Channel channelConfig. + * @member {types.IChannelConfig|null|undefined} channelConfig + * @memberof types.Channel + * @instance + */ + Channel.prototype.channelConfig = null; + + /** + * Channel nextOutboundHtlcLimitMsat. + * @member {number|Long} nextOutboundHtlcLimitMsat + * @memberof types.Channel + * @instance + */ + Channel.prototype.nextOutboundHtlcLimitMsat = 0; + + /** + * Channel nextOutboundHtlcMinimumMsat. + * @member {number|Long} nextOutboundHtlcMinimumMsat + * @memberof types.Channel + * @instance + */ + Channel.prototype.nextOutboundHtlcMinimumMsat = 0; + + /** + * Channel forceCloseSpendDelay. + * @member {number} forceCloseSpendDelay + * @memberof types.Channel + * @instance + */ + Channel.prototype.forceCloseSpendDelay = 0; + + /** + * Channel counterpartyOutboundHtlcMinimumMsat. + * @member {number|Long} counterpartyOutboundHtlcMinimumMsat + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterpartyOutboundHtlcMinimumMsat = 0; + + /** + * Channel counterpartyOutboundHtlcMaximumMsat. + * @member {number|Long} counterpartyOutboundHtlcMaximumMsat + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterpartyOutboundHtlcMaximumMsat = 0; + + /** + * Channel counterpartyUnspendablePunishmentReserve. + * @member {number|Long} counterpartyUnspendablePunishmentReserve + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterpartyUnspendablePunishmentReserve = 0; + + /** + * Channel counterpartyForwardingInfoFeeBaseMsat. + * @member {number} counterpartyForwardingInfoFeeBaseMsat + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterpartyForwardingInfoFeeBaseMsat = 0; + + /** + * Channel counterpartyForwardingInfoFeeProportionalMillionths. + * @member {number} counterpartyForwardingInfoFeeProportionalMillionths + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterpartyForwardingInfoFeeProportionalMillionths = 0; + + /** + * Channel counterpartyForwardingInfoCltvExpiryDelta. + * @member {number} counterpartyForwardingInfoCltvExpiryDelta + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterpartyForwardingInfoCltvExpiryDelta = 0; + + /** + * 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.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channelId); + if (message.counterpartyNodeId != null && Object.hasOwnProperty.call(message, "counterpartyNodeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterpartyNodeId); + if (message.fundingTxo != null && Object.hasOwnProperty.call(message, "fundingTxo")) + $root.types.OutPoint.encode(message.fundingTxo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.userChannelId != null && Object.hasOwnProperty.call(message, "userChannelId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.userChannelId); + if (message.unspendablePunishmentReserve != null && Object.hasOwnProperty.call(message, "unspendablePunishmentReserve")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.unspendablePunishmentReserve); + if (message.channelValueSats != null && Object.hasOwnProperty.call(message, "channelValueSats")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.channelValueSats); + if (message.feerateSatPer_1000Weight != null && Object.hasOwnProperty.call(message, "feerateSatPer_1000Weight")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.feerateSatPer_1000Weight); + if (message.outboundCapacityMsat != null && Object.hasOwnProperty.call(message, "outboundCapacityMsat")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.outboundCapacityMsat); + if (message.inboundCapacityMsat != null && Object.hasOwnProperty.call(message, "inboundCapacityMsat")) + writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.inboundCapacityMsat); + if (message.confirmationsRequired != null && Object.hasOwnProperty.call(message, "confirmationsRequired")) + writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.confirmationsRequired); + if (message.confirmations != null && Object.hasOwnProperty.call(message, "confirmations")) + writer.uint32(/* id 11, wireType 0 =*/88).uint32(message.confirmations); + if (message.isOutbound != null && Object.hasOwnProperty.call(message, "isOutbound")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.isOutbound); + if (message.isChannelReady != null && Object.hasOwnProperty.call(message, "isChannelReady")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.isChannelReady); + if (message.isUsable != null && Object.hasOwnProperty.call(message, "isUsable")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.isUsable); + if (message.isAnnounced != null && Object.hasOwnProperty.call(message, "isAnnounced")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.isAnnounced); + if (message.channelConfig != null && Object.hasOwnProperty.call(message, "channelConfig")) + $root.types.ChannelConfig.encode(message.channelConfig, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.nextOutboundHtlcLimitMsat != null && Object.hasOwnProperty.call(message, "nextOutboundHtlcLimitMsat")) + writer.uint32(/* id 17, wireType 0 =*/136).uint64(message.nextOutboundHtlcLimitMsat); + if (message.nextOutboundHtlcMinimumMsat != null && Object.hasOwnProperty.call(message, "nextOutboundHtlcMinimumMsat")) + writer.uint32(/* id 18, wireType 0 =*/144).uint64(message.nextOutboundHtlcMinimumMsat); + if (message.forceCloseSpendDelay != null && Object.hasOwnProperty.call(message, "forceCloseSpendDelay")) + writer.uint32(/* id 19, wireType 0 =*/152).uint32(message.forceCloseSpendDelay); + if (message.counterpartyOutboundHtlcMinimumMsat != null && Object.hasOwnProperty.call(message, "counterpartyOutboundHtlcMinimumMsat")) + writer.uint32(/* id 20, wireType 0 =*/160).uint64(message.counterpartyOutboundHtlcMinimumMsat); + if (message.counterpartyOutboundHtlcMaximumMsat != null && Object.hasOwnProperty.call(message, "counterpartyOutboundHtlcMaximumMsat")) + writer.uint32(/* id 21, wireType 0 =*/168).uint64(message.counterpartyOutboundHtlcMaximumMsat); + if (message.counterpartyUnspendablePunishmentReserve != null && Object.hasOwnProperty.call(message, "counterpartyUnspendablePunishmentReserve")) + writer.uint32(/* id 22, wireType 0 =*/176).uint64(message.counterpartyUnspendablePunishmentReserve); + if (message.counterpartyForwardingInfoFeeBaseMsat != null && Object.hasOwnProperty.call(message, "counterpartyForwardingInfoFeeBaseMsat")) + writer.uint32(/* id 23, wireType 0 =*/184).uint32(message.counterpartyForwardingInfoFeeBaseMsat); + if (message.counterpartyForwardingInfoFeeProportionalMillionths != null && Object.hasOwnProperty.call(message, "counterpartyForwardingInfoFeeProportionalMillionths")) + writer.uint32(/* id 24, wireType 0 =*/192).uint32(message.counterpartyForwardingInfoFeeProportionalMillionths); + if (message.counterpartyForwardingInfoCltvExpiryDelta != null && Object.hasOwnProperty.call(message, "counterpartyForwardingInfoCltvExpiryDelta")) + writer.uint32(/* id 25, wireType 0 =*/200).uint32(message.counterpartyForwardingInfoCltvExpiryDelta); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Channel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.counterpartyNodeId = reader.string(); + break; + case 3: + message.fundingTxo = $root.types.OutPoint.decode(reader, reader.uint32()); + break; + case 4: + message.userChannelId = reader.string(); + break; + case 5: + message.unspendablePunishmentReserve = reader.uint64(); + break; + case 6: + message.channelValueSats = reader.uint64(); + break; + case 7: + message.feerateSatPer_1000Weight = reader.uint32(); + break; + case 8: + message.outboundCapacityMsat = reader.uint64(); + break; + case 9: + message.inboundCapacityMsat = reader.uint64(); + break; + case 10: + message.confirmationsRequired = reader.uint32(); + break; + case 11: + message.confirmations = reader.uint32(); + break; + case 12: + message.isOutbound = reader.bool(); + break; + case 13: + message.isChannelReady = reader.bool(); + break; + case 14: + message.isUsable = reader.bool(); + break; + case 15: + message.isAnnounced = reader.bool(); + break; + case 16: + message.channelConfig = $root.types.ChannelConfig.decode(reader, reader.uint32()); + break; + case 17: + message.nextOutboundHtlcLimitMsat = reader.uint64(); + break; + case 18: + message.nextOutboundHtlcMinimumMsat = reader.uint64(); + break; + case 19: + message.forceCloseSpendDelay = reader.uint32(); + break; + case 20: + message.counterpartyOutboundHtlcMinimumMsat = reader.uint64(); + break; + case 21: + message.counterpartyOutboundHtlcMaximumMsat = reader.uint64(); + break; + case 22: + message.counterpartyUnspendablePunishmentReserve = reader.uint64(); + break; + case 23: + message.counterpartyForwardingInfoFeeBaseMsat = reader.uint32(); + break; + case 24: + message.counterpartyForwardingInfoFeeProportionalMillionths = reader.uint32(); + break; + case 25: + message.counterpartyForwardingInfoCltvExpiryDelta = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + if (!$util.isString(message.counterpartyNodeId)) + return "counterpartyNodeId: string expected"; + if (message.fundingTxo != null && message.hasOwnProperty("fundingTxo")) { + var error = $root.types.OutPoint.verify(message.fundingTxo); + if (error) + return "fundingTxo." + error; + } + if (message.userChannelId != null && message.hasOwnProperty("userChannelId")) + if (!$util.isString(message.userChannelId)) + return "userChannelId: string expected"; + if (message.unspendablePunishmentReserve != null && message.hasOwnProperty("unspendablePunishmentReserve")) + if (!$util.isInteger(message.unspendablePunishmentReserve) && !(message.unspendablePunishmentReserve && $util.isInteger(message.unspendablePunishmentReserve.low) && $util.isInteger(message.unspendablePunishmentReserve.high))) + return "unspendablePunishmentReserve: integer|Long expected"; + if (message.channelValueSats != null && message.hasOwnProperty("channelValueSats")) + if (!$util.isInteger(message.channelValueSats) && !(message.channelValueSats && $util.isInteger(message.channelValueSats.low) && $util.isInteger(message.channelValueSats.high))) + return "channelValueSats: integer|Long expected"; + if (message.feerateSatPer_1000Weight != null && message.hasOwnProperty("feerateSatPer_1000Weight")) + if (!$util.isInteger(message.feerateSatPer_1000Weight)) + return "feerateSatPer_1000Weight: integer expected"; + if (message.outboundCapacityMsat != null && message.hasOwnProperty("outboundCapacityMsat")) + if (!$util.isInteger(message.outboundCapacityMsat) && !(message.outboundCapacityMsat && $util.isInteger(message.outboundCapacityMsat.low) && $util.isInteger(message.outboundCapacityMsat.high))) + return "outboundCapacityMsat: integer|Long expected"; + if (message.inboundCapacityMsat != null && message.hasOwnProperty("inboundCapacityMsat")) + if (!$util.isInteger(message.inboundCapacityMsat) && !(message.inboundCapacityMsat && $util.isInteger(message.inboundCapacityMsat.low) && $util.isInteger(message.inboundCapacityMsat.high))) + return "inboundCapacityMsat: integer|Long expected"; + if (message.confirmationsRequired != null && message.hasOwnProperty("confirmationsRequired")) + if (!$util.isInteger(message.confirmationsRequired)) + return "confirmationsRequired: integer expected"; + if (message.confirmations != null && message.hasOwnProperty("confirmations")) + if (!$util.isInteger(message.confirmations)) + return "confirmations: integer expected"; + if (message.isOutbound != null && message.hasOwnProperty("isOutbound")) + if (typeof message.isOutbound !== "boolean") + return "isOutbound: boolean expected"; + if (message.isChannelReady != null && message.hasOwnProperty("isChannelReady")) + if (typeof message.isChannelReady !== "boolean") + return "isChannelReady: boolean expected"; + if (message.isUsable != null && message.hasOwnProperty("isUsable")) + if (typeof message.isUsable !== "boolean") + return "isUsable: boolean expected"; + if (message.isAnnounced != null && message.hasOwnProperty("isAnnounced")) + if (typeof message.isAnnounced !== "boolean") + return "isAnnounced: boolean expected"; + if (message.channelConfig != null && message.hasOwnProperty("channelConfig")) { + var error = $root.types.ChannelConfig.verify(message.channelConfig); + if (error) + return "channelConfig." + error; + } + if (message.nextOutboundHtlcLimitMsat != null && message.hasOwnProperty("nextOutboundHtlcLimitMsat")) + if (!$util.isInteger(message.nextOutboundHtlcLimitMsat) && !(message.nextOutboundHtlcLimitMsat && $util.isInteger(message.nextOutboundHtlcLimitMsat.low) && $util.isInteger(message.nextOutboundHtlcLimitMsat.high))) + return "nextOutboundHtlcLimitMsat: integer|Long expected"; + if (message.nextOutboundHtlcMinimumMsat != null && message.hasOwnProperty("nextOutboundHtlcMinimumMsat")) + if (!$util.isInteger(message.nextOutboundHtlcMinimumMsat) && !(message.nextOutboundHtlcMinimumMsat && $util.isInteger(message.nextOutboundHtlcMinimumMsat.low) && $util.isInteger(message.nextOutboundHtlcMinimumMsat.high))) + return "nextOutboundHtlcMinimumMsat: integer|Long expected"; + if (message.forceCloseSpendDelay != null && message.hasOwnProperty("forceCloseSpendDelay")) + if (!$util.isInteger(message.forceCloseSpendDelay)) + return "forceCloseSpendDelay: integer expected"; + if (message.counterpartyOutboundHtlcMinimumMsat != null && message.hasOwnProperty("counterpartyOutboundHtlcMinimumMsat")) + if (!$util.isInteger(message.counterpartyOutboundHtlcMinimumMsat) && !(message.counterpartyOutboundHtlcMinimumMsat && $util.isInteger(message.counterpartyOutboundHtlcMinimumMsat.low) && $util.isInteger(message.counterpartyOutboundHtlcMinimumMsat.high))) + return "counterpartyOutboundHtlcMinimumMsat: integer|Long expected"; + if (message.counterpartyOutboundHtlcMaximumMsat != null && message.hasOwnProperty("counterpartyOutboundHtlcMaximumMsat")) + if (!$util.isInteger(message.counterpartyOutboundHtlcMaximumMsat) && !(message.counterpartyOutboundHtlcMaximumMsat && $util.isInteger(message.counterpartyOutboundHtlcMaximumMsat.low) && $util.isInteger(message.counterpartyOutboundHtlcMaximumMsat.high))) + return "counterpartyOutboundHtlcMaximumMsat: integer|Long expected"; + if (message.counterpartyUnspendablePunishmentReserve != null && message.hasOwnProperty("counterpartyUnspendablePunishmentReserve")) + if (!$util.isInteger(message.counterpartyUnspendablePunishmentReserve) && !(message.counterpartyUnspendablePunishmentReserve && $util.isInteger(message.counterpartyUnspendablePunishmentReserve.low) && $util.isInteger(message.counterpartyUnspendablePunishmentReserve.high))) + return "counterpartyUnspendablePunishmentReserve: integer|Long expected"; + if (message.counterpartyForwardingInfoFeeBaseMsat != null && message.hasOwnProperty("counterpartyForwardingInfoFeeBaseMsat")) + if (!$util.isInteger(message.counterpartyForwardingInfoFeeBaseMsat)) + return "counterpartyForwardingInfoFeeBaseMsat: integer expected"; + if (message.counterpartyForwardingInfoFeeProportionalMillionths != null && message.hasOwnProperty("counterpartyForwardingInfoFeeProportionalMillionths")) + if (!$util.isInteger(message.counterpartyForwardingInfoFeeProportionalMillionths)) + return "counterpartyForwardingInfoFeeProportionalMillionths: integer expected"; + if (message.counterpartyForwardingInfoCltvExpiryDelta != null && message.hasOwnProperty("counterpartyForwardingInfoCltvExpiryDelta")) + if (!$util.isInteger(message.counterpartyForwardingInfoCltvExpiryDelta)) + return "counterpartyForwardingInfoCltvExpiryDelta: 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) { + if (object instanceof $root.types.Channel) + return object; + var message = new $root.types.Channel(); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.counterpartyNodeId != null) + message.counterpartyNodeId = String(object.counterpartyNodeId); + if (object.fundingTxo != null) { + if (typeof object.fundingTxo !== "object") + throw TypeError(".types.Channel.fundingTxo: object expected"); + message.fundingTxo = $root.types.OutPoint.fromObject(object.fundingTxo); + } + if (object.userChannelId != null) + message.userChannelId = String(object.userChannelId); + if (object.unspendablePunishmentReserve != null) + if ($util.Long) + (message.unspendablePunishmentReserve = $util.Long.fromValue(object.unspendablePunishmentReserve)).unsigned = true; + else if (typeof object.unspendablePunishmentReserve === "string") + message.unspendablePunishmentReserve = parseInt(object.unspendablePunishmentReserve, 10); + else if (typeof object.unspendablePunishmentReserve === "number") + message.unspendablePunishmentReserve = object.unspendablePunishmentReserve; + else if (typeof object.unspendablePunishmentReserve === "object") + message.unspendablePunishmentReserve = new $util.LongBits(object.unspendablePunishmentReserve.low >>> 0, object.unspendablePunishmentReserve.high >>> 0).toNumber(true); + if (object.channelValueSats != null) + if ($util.Long) + (message.channelValueSats = $util.Long.fromValue(object.channelValueSats)).unsigned = true; + else if (typeof object.channelValueSats === "string") + message.channelValueSats = parseInt(object.channelValueSats, 10); + else if (typeof object.channelValueSats === "number") + message.channelValueSats = object.channelValueSats; + else if (typeof object.channelValueSats === "object") + message.channelValueSats = new $util.LongBits(object.channelValueSats.low >>> 0, object.channelValueSats.high >>> 0).toNumber(true); + if (object.feerateSatPer_1000Weight != null) + message.feerateSatPer_1000Weight = object.feerateSatPer_1000Weight >>> 0; + if (object.outboundCapacityMsat != null) + if ($util.Long) + (message.outboundCapacityMsat = $util.Long.fromValue(object.outboundCapacityMsat)).unsigned = true; + else if (typeof object.outboundCapacityMsat === "string") + message.outboundCapacityMsat = parseInt(object.outboundCapacityMsat, 10); + else if (typeof object.outboundCapacityMsat === "number") + message.outboundCapacityMsat = object.outboundCapacityMsat; + else if (typeof object.outboundCapacityMsat === "object") + message.outboundCapacityMsat = new $util.LongBits(object.outboundCapacityMsat.low >>> 0, object.outboundCapacityMsat.high >>> 0).toNumber(true); + if (object.inboundCapacityMsat != null) + if ($util.Long) + (message.inboundCapacityMsat = $util.Long.fromValue(object.inboundCapacityMsat)).unsigned = true; + else if (typeof object.inboundCapacityMsat === "string") + message.inboundCapacityMsat = parseInt(object.inboundCapacityMsat, 10); + else if (typeof object.inboundCapacityMsat === "number") + message.inboundCapacityMsat = object.inboundCapacityMsat; + else if (typeof object.inboundCapacityMsat === "object") + message.inboundCapacityMsat = new $util.LongBits(object.inboundCapacityMsat.low >>> 0, object.inboundCapacityMsat.high >>> 0).toNumber(true); + if (object.confirmationsRequired != null) + message.confirmationsRequired = object.confirmationsRequired >>> 0; + if (object.confirmations != null) + message.confirmations = object.confirmations >>> 0; + if (object.isOutbound != null) + message.isOutbound = Boolean(object.isOutbound); + if (object.isChannelReady != null) + message.isChannelReady = Boolean(object.isChannelReady); + if (object.isUsable != null) + message.isUsable = Boolean(object.isUsable); + if (object.isAnnounced != null) + message.isAnnounced = Boolean(object.isAnnounced); + if (object.channelConfig != null) { + if (typeof object.channelConfig !== "object") + throw TypeError(".types.Channel.channelConfig: object expected"); + message.channelConfig = $root.types.ChannelConfig.fromObject(object.channelConfig); + } + if (object.nextOutboundHtlcLimitMsat != null) + if ($util.Long) + (message.nextOutboundHtlcLimitMsat = $util.Long.fromValue(object.nextOutboundHtlcLimitMsat)).unsigned = true; + else if (typeof object.nextOutboundHtlcLimitMsat === "string") + message.nextOutboundHtlcLimitMsat = parseInt(object.nextOutboundHtlcLimitMsat, 10); + else if (typeof object.nextOutboundHtlcLimitMsat === "number") + message.nextOutboundHtlcLimitMsat = object.nextOutboundHtlcLimitMsat; + else if (typeof object.nextOutboundHtlcLimitMsat === "object") + message.nextOutboundHtlcLimitMsat = new $util.LongBits(object.nextOutboundHtlcLimitMsat.low >>> 0, object.nextOutboundHtlcLimitMsat.high >>> 0).toNumber(true); + if (object.nextOutboundHtlcMinimumMsat != null) + if ($util.Long) + (message.nextOutboundHtlcMinimumMsat = $util.Long.fromValue(object.nextOutboundHtlcMinimumMsat)).unsigned = true; + else if (typeof object.nextOutboundHtlcMinimumMsat === "string") + message.nextOutboundHtlcMinimumMsat = parseInt(object.nextOutboundHtlcMinimumMsat, 10); + else if (typeof object.nextOutboundHtlcMinimumMsat === "number") + message.nextOutboundHtlcMinimumMsat = object.nextOutboundHtlcMinimumMsat; + else if (typeof object.nextOutboundHtlcMinimumMsat === "object") + message.nextOutboundHtlcMinimumMsat = new $util.LongBits(object.nextOutboundHtlcMinimumMsat.low >>> 0, object.nextOutboundHtlcMinimumMsat.high >>> 0).toNumber(true); + if (object.forceCloseSpendDelay != null) + message.forceCloseSpendDelay = object.forceCloseSpendDelay >>> 0; + if (object.counterpartyOutboundHtlcMinimumMsat != null) + if ($util.Long) + (message.counterpartyOutboundHtlcMinimumMsat = $util.Long.fromValue(object.counterpartyOutboundHtlcMinimumMsat)).unsigned = true; + else if (typeof object.counterpartyOutboundHtlcMinimumMsat === "string") + message.counterpartyOutboundHtlcMinimumMsat = parseInt(object.counterpartyOutboundHtlcMinimumMsat, 10); + else if (typeof object.counterpartyOutboundHtlcMinimumMsat === "number") + message.counterpartyOutboundHtlcMinimumMsat = object.counterpartyOutboundHtlcMinimumMsat; + else if (typeof object.counterpartyOutboundHtlcMinimumMsat === "object") + message.counterpartyOutboundHtlcMinimumMsat = new $util.LongBits(object.counterpartyOutboundHtlcMinimumMsat.low >>> 0, object.counterpartyOutboundHtlcMinimumMsat.high >>> 0).toNumber(true); + if (object.counterpartyOutboundHtlcMaximumMsat != null) + if ($util.Long) + (message.counterpartyOutboundHtlcMaximumMsat = $util.Long.fromValue(object.counterpartyOutboundHtlcMaximumMsat)).unsigned = true; + else if (typeof object.counterpartyOutboundHtlcMaximumMsat === "string") + message.counterpartyOutboundHtlcMaximumMsat = parseInt(object.counterpartyOutboundHtlcMaximumMsat, 10); + else if (typeof object.counterpartyOutboundHtlcMaximumMsat === "number") + message.counterpartyOutboundHtlcMaximumMsat = object.counterpartyOutboundHtlcMaximumMsat; + else if (typeof object.counterpartyOutboundHtlcMaximumMsat === "object") + message.counterpartyOutboundHtlcMaximumMsat = new $util.LongBits(object.counterpartyOutboundHtlcMaximumMsat.low >>> 0, object.counterpartyOutboundHtlcMaximumMsat.high >>> 0).toNumber(true); + if (object.counterpartyUnspendablePunishmentReserve != null) + if ($util.Long) + (message.counterpartyUnspendablePunishmentReserve = $util.Long.fromValue(object.counterpartyUnspendablePunishmentReserve)).unsigned = true; + else if (typeof object.counterpartyUnspendablePunishmentReserve === "string") + message.counterpartyUnspendablePunishmentReserve = parseInt(object.counterpartyUnspendablePunishmentReserve, 10); + else if (typeof object.counterpartyUnspendablePunishmentReserve === "number") + message.counterpartyUnspendablePunishmentReserve = object.counterpartyUnspendablePunishmentReserve; + else if (typeof object.counterpartyUnspendablePunishmentReserve === "object") + message.counterpartyUnspendablePunishmentReserve = new $util.LongBits(object.counterpartyUnspendablePunishmentReserve.low >>> 0, object.counterpartyUnspendablePunishmentReserve.high >>> 0).toNumber(true); + if (object.counterpartyForwardingInfoFeeBaseMsat != null) + message.counterpartyForwardingInfoFeeBaseMsat = object.counterpartyForwardingInfoFeeBaseMsat >>> 0; + if (object.counterpartyForwardingInfoFeeProportionalMillionths != null) + message.counterpartyForwardingInfoFeeProportionalMillionths = object.counterpartyForwardingInfoFeeProportionalMillionths >>> 0; + if (object.counterpartyForwardingInfoCltvExpiryDelta != null) + message.counterpartyForwardingInfoCltvExpiryDelta = object.counterpartyForwardingInfoCltvExpiryDelta >>> 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 = {}; + var object = {}; + if (options.defaults) { + object.channelId = ""; + object.counterpartyNodeId = ""; + object.fundingTxo = null; + object.userChannelId = ""; + object.unspendablePunishmentReserve = 0; + object.channelValueSats = 0; + object.feerateSatPer_1000Weight = 0; + object.outboundCapacityMsat = 0; + object.inboundCapacityMsat = 0; + object.confirmationsRequired = 0; + object.confirmations = 0; + object.isOutbound = false; + object.isChannelReady = false; + object.isUsable = false; + object.isAnnounced = false; + object.channelConfig = null; + object.nextOutboundHtlcLimitMsat = 0; + object.nextOutboundHtlcMinimumMsat = 0; + object.forceCloseSpendDelay = 0; + object.counterpartyOutboundHtlcMinimumMsat = 0; + object.counterpartyOutboundHtlcMaximumMsat = 0; + object.counterpartyUnspendablePunishmentReserve = 0; + object.counterpartyForwardingInfoFeeBaseMsat = 0; + object.counterpartyForwardingInfoFeeProportionalMillionths = 0; + object.counterpartyForwardingInfoCltvExpiryDelta = 0; + } + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + object.counterpartyNodeId = message.counterpartyNodeId; + if (message.fundingTxo != null && message.hasOwnProperty("fundingTxo")) + object.fundingTxo = $root.types.OutPoint.toObject(message.fundingTxo, options); + if (message.userChannelId != null && message.hasOwnProperty("userChannelId")) + object.userChannelId = message.userChannelId; + if (message.unspendablePunishmentReserve != null && message.hasOwnProperty("unspendablePunishmentReserve")) + if (typeof message.unspendablePunishmentReserve === "number") + object.unspendablePunishmentReserve = options.longs === String ? String(message.unspendablePunishmentReserve) : message.unspendablePunishmentReserve; + else + object.unspendablePunishmentReserve = options.longs === String ? $util.Long.prototype.toString.call(message.unspendablePunishmentReserve) : options.longs === Number ? new $util.LongBits(message.unspendablePunishmentReserve.low >>> 0, message.unspendablePunishmentReserve.high >>> 0).toNumber(true) : message.unspendablePunishmentReserve; + if (message.channelValueSats != null && message.hasOwnProperty("channelValueSats")) + if (typeof message.channelValueSats === "number") + object.channelValueSats = options.longs === String ? String(message.channelValueSats) : message.channelValueSats; + else + object.channelValueSats = options.longs === String ? $util.Long.prototype.toString.call(message.channelValueSats) : options.longs === Number ? new $util.LongBits(message.channelValueSats.low >>> 0, message.channelValueSats.high >>> 0).toNumber(true) : message.channelValueSats; + if (message.feerateSatPer_1000Weight != null && message.hasOwnProperty("feerateSatPer_1000Weight")) + object.feerateSatPer_1000Weight = message.feerateSatPer_1000Weight; + if (message.outboundCapacityMsat != null && message.hasOwnProperty("outboundCapacityMsat")) + if (typeof message.outboundCapacityMsat === "number") + object.outboundCapacityMsat = options.longs === String ? String(message.outboundCapacityMsat) : message.outboundCapacityMsat; + else + object.outboundCapacityMsat = options.longs === String ? $util.Long.prototype.toString.call(message.outboundCapacityMsat) : options.longs === Number ? new $util.LongBits(message.outboundCapacityMsat.low >>> 0, message.outboundCapacityMsat.high >>> 0).toNumber(true) : message.outboundCapacityMsat; + if (message.inboundCapacityMsat != null && message.hasOwnProperty("inboundCapacityMsat")) + if (typeof message.inboundCapacityMsat === "number") + object.inboundCapacityMsat = options.longs === String ? String(message.inboundCapacityMsat) : message.inboundCapacityMsat; + else + object.inboundCapacityMsat = options.longs === String ? $util.Long.prototype.toString.call(message.inboundCapacityMsat) : options.longs === Number ? new $util.LongBits(message.inboundCapacityMsat.low >>> 0, message.inboundCapacityMsat.high >>> 0).toNumber(true) : message.inboundCapacityMsat; + if (message.confirmationsRequired != null && message.hasOwnProperty("confirmationsRequired")) + object.confirmationsRequired = message.confirmationsRequired; + if (message.confirmations != null && message.hasOwnProperty("confirmations")) + object.confirmations = message.confirmations; + if (message.isOutbound != null && message.hasOwnProperty("isOutbound")) + object.isOutbound = message.isOutbound; + if (message.isChannelReady != null && message.hasOwnProperty("isChannelReady")) + object.isChannelReady = message.isChannelReady; + if (message.isUsable != null && message.hasOwnProperty("isUsable")) + object.isUsable = message.isUsable; + if (message.isAnnounced != null && message.hasOwnProperty("isAnnounced")) + object.isAnnounced = message.isAnnounced; + if (message.channelConfig != null && message.hasOwnProperty("channelConfig")) + object.channelConfig = $root.types.ChannelConfig.toObject(message.channelConfig, options); + if (message.nextOutboundHtlcLimitMsat != null && message.hasOwnProperty("nextOutboundHtlcLimitMsat")) + if (typeof message.nextOutboundHtlcLimitMsat === "number") + object.nextOutboundHtlcLimitMsat = options.longs === String ? String(message.nextOutboundHtlcLimitMsat) : message.nextOutboundHtlcLimitMsat; + else + object.nextOutboundHtlcLimitMsat = options.longs === String ? $util.Long.prototype.toString.call(message.nextOutboundHtlcLimitMsat) : options.longs === Number ? new $util.LongBits(message.nextOutboundHtlcLimitMsat.low >>> 0, message.nextOutboundHtlcLimitMsat.high >>> 0).toNumber(true) : message.nextOutboundHtlcLimitMsat; + if (message.nextOutboundHtlcMinimumMsat != null && message.hasOwnProperty("nextOutboundHtlcMinimumMsat")) + if (typeof message.nextOutboundHtlcMinimumMsat === "number") + object.nextOutboundHtlcMinimumMsat = options.longs === String ? String(message.nextOutboundHtlcMinimumMsat) : message.nextOutboundHtlcMinimumMsat; + else + object.nextOutboundHtlcMinimumMsat = options.longs === String ? $util.Long.prototype.toString.call(message.nextOutboundHtlcMinimumMsat) : options.longs === Number ? new $util.LongBits(message.nextOutboundHtlcMinimumMsat.low >>> 0, message.nextOutboundHtlcMinimumMsat.high >>> 0).toNumber(true) : message.nextOutboundHtlcMinimumMsat; + if (message.forceCloseSpendDelay != null && message.hasOwnProperty("forceCloseSpendDelay")) + object.forceCloseSpendDelay = message.forceCloseSpendDelay; + if (message.counterpartyOutboundHtlcMinimumMsat != null && message.hasOwnProperty("counterpartyOutboundHtlcMinimumMsat")) + if (typeof message.counterpartyOutboundHtlcMinimumMsat === "number") + object.counterpartyOutboundHtlcMinimumMsat = options.longs === String ? String(message.counterpartyOutboundHtlcMinimumMsat) : message.counterpartyOutboundHtlcMinimumMsat; + else + object.counterpartyOutboundHtlcMinimumMsat = options.longs === String ? $util.Long.prototype.toString.call(message.counterpartyOutboundHtlcMinimumMsat) : options.longs === Number ? new $util.LongBits(message.counterpartyOutboundHtlcMinimumMsat.low >>> 0, message.counterpartyOutboundHtlcMinimumMsat.high >>> 0).toNumber(true) : message.counterpartyOutboundHtlcMinimumMsat; + if (message.counterpartyOutboundHtlcMaximumMsat != null && message.hasOwnProperty("counterpartyOutboundHtlcMaximumMsat")) + if (typeof message.counterpartyOutboundHtlcMaximumMsat === "number") + object.counterpartyOutboundHtlcMaximumMsat = options.longs === String ? String(message.counterpartyOutboundHtlcMaximumMsat) : message.counterpartyOutboundHtlcMaximumMsat; + else + object.counterpartyOutboundHtlcMaximumMsat = options.longs === String ? $util.Long.prototype.toString.call(message.counterpartyOutboundHtlcMaximumMsat) : options.longs === Number ? new $util.LongBits(message.counterpartyOutboundHtlcMaximumMsat.low >>> 0, message.counterpartyOutboundHtlcMaximumMsat.high >>> 0).toNumber(true) : message.counterpartyOutboundHtlcMaximumMsat; + if (message.counterpartyUnspendablePunishmentReserve != null && message.hasOwnProperty("counterpartyUnspendablePunishmentReserve")) + if (typeof message.counterpartyUnspendablePunishmentReserve === "number") + object.counterpartyUnspendablePunishmentReserve = options.longs === String ? String(message.counterpartyUnspendablePunishmentReserve) : message.counterpartyUnspendablePunishmentReserve; + else + object.counterpartyUnspendablePunishmentReserve = options.longs === String ? $util.Long.prototype.toString.call(message.counterpartyUnspendablePunishmentReserve) : options.longs === Number ? new $util.LongBits(message.counterpartyUnspendablePunishmentReserve.low >>> 0, message.counterpartyUnspendablePunishmentReserve.high >>> 0).toNumber(true) : message.counterpartyUnspendablePunishmentReserve; + if (message.counterpartyForwardingInfoFeeBaseMsat != null && message.hasOwnProperty("counterpartyForwardingInfoFeeBaseMsat")) + object.counterpartyForwardingInfoFeeBaseMsat = message.counterpartyForwardingInfoFeeBaseMsat; + if (message.counterpartyForwardingInfoFeeProportionalMillionths != null && message.hasOwnProperty("counterpartyForwardingInfoFeeProportionalMillionths")) + object.counterpartyForwardingInfoFeeProportionalMillionths = message.counterpartyForwardingInfoFeeProportionalMillionths; + if (message.counterpartyForwardingInfoCltvExpiryDelta != null && message.hasOwnProperty("counterpartyForwardingInfoCltvExpiryDelta")) + object.counterpartyForwardingInfoCltvExpiryDelta = message.counterpartyForwardingInfoCltvExpiryDelta; + 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); + }; + + return Channel; + })(); + + types.ChannelConfig = (function() { + + /** + * Properties of a ChannelConfig. + * @memberof types + * @interface IChannelConfig + * @property {number|null} [forwardingFeeProportionalMillionths] ChannelConfig forwardingFeeProportionalMillionths + * @property {number|null} [forwardingFeeBaseMsat] ChannelConfig forwardingFeeBaseMsat + * @property {number|null} [cltvExpiryDelta] ChannelConfig cltvExpiryDelta + * @property {number|Long|null} [forceCloseAvoidanceMaxFeeSatoshis] ChannelConfig forceCloseAvoidanceMaxFeeSatoshis + * @property {boolean|null} [acceptUnderpayingHtlcs] ChannelConfig acceptUnderpayingHtlcs + * @property {number|Long|null} [fixedLimitMsat] ChannelConfig fixedLimitMsat + * @property {number|Long|null} [feeRateMultiplier] ChannelConfig feeRateMultiplier + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChannelConfig forwardingFeeProportionalMillionths. + * @member {number} forwardingFeeProportionalMillionths + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.forwardingFeeProportionalMillionths = 0; + + /** + * ChannelConfig forwardingFeeBaseMsat. + * @member {number} forwardingFeeBaseMsat + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.forwardingFeeBaseMsat = 0; + + /** + * ChannelConfig cltvExpiryDelta. + * @member {number} cltvExpiryDelta + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.cltvExpiryDelta = 0; + + /** + * ChannelConfig forceCloseAvoidanceMaxFeeSatoshis. + * @member {number|Long} forceCloseAvoidanceMaxFeeSatoshis + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.forceCloseAvoidanceMaxFeeSatoshis = 0; + + /** + * ChannelConfig acceptUnderpayingHtlcs. + * @member {boolean} acceptUnderpayingHtlcs + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.acceptUnderpayingHtlcs = false; + + /** + * ChannelConfig fixedLimitMsat. + * @member {number|Long} fixedLimitMsat + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.fixedLimitMsat = 0; + + /** + * ChannelConfig feeRateMultiplier. + * @member {number|Long} feeRateMultiplier + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.feeRateMultiplier = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ChannelConfig maxDustHtlcExposure. + * @member {"fixedLimitMsat"|"feeRateMultiplier"|undefined} maxDustHtlcExposure + * @memberof types.ChannelConfig + * @instance + */ + Object.defineProperty(ChannelConfig.prototype, "maxDustHtlcExposure", { + get: $util.oneOfGetter($oneOfFields = ["fixedLimitMsat", "feeRateMultiplier"]), + 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.forwardingFeeProportionalMillionths != null && Object.hasOwnProperty.call(message, "forwardingFeeProportionalMillionths")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.forwardingFeeProportionalMillionths); + if (message.forwardingFeeBaseMsat != null && Object.hasOwnProperty.call(message, "forwardingFeeBaseMsat")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.forwardingFeeBaseMsat); + if (message.cltvExpiryDelta != null && Object.hasOwnProperty.call(message, "cltvExpiryDelta")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.cltvExpiryDelta); + if (message.forceCloseAvoidanceMaxFeeSatoshis != null && Object.hasOwnProperty.call(message, "forceCloseAvoidanceMaxFeeSatoshis")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.forceCloseAvoidanceMaxFeeSatoshis); + if (message.acceptUnderpayingHtlcs != null && Object.hasOwnProperty.call(message, "acceptUnderpayingHtlcs")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.acceptUnderpayingHtlcs); + if (message.fixedLimitMsat != null && Object.hasOwnProperty.call(message, "fixedLimitMsat")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.fixedLimitMsat); + if (message.feeRateMultiplier != null && Object.hasOwnProperty.call(message, "feeRateMultiplier")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.feeRateMultiplier); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.ChannelConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.forwardingFeeProportionalMillionths = reader.uint32(); + break; + case 2: + message.forwardingFeeBaseMsat = reader.uint32(); + break; + case 3: + message.cltvExpiryDelta = reader.uint32(); + break; + case 4: + message.forceCloseAvoidanceMaxFeeSatoshis = reader.uint64(); + break; + case 5: + message.acceptUnderpayingHtlcs = reader.bool(); + break; + case 6: + message.fixedLimitMsat = reader.uint64(); + break; + case 7: + message.feeRateMultiplier = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.forwardingFeeProportionalMillionths != null && message.hasOwnProperty("forwardingFeeProportionalMillionths")) + if (!$util.isInteger(message.forwardingFeeProportionalMillionths)) + return "forwardingFeeProportionalMillionths: integer expected"; + if (message.forwardingFeeBaseMsat != null && message.hasOwnProperty("forwardingFeeBaseMsat")) + if (!$util.isInteger(message.forwardingFeeBaseMsat)) + return "forwardingFeeBaseMsat: integer expected"; + if (message.cltvExpiryDelta != null && message.hasOwnProperty("cltvExpiryDelta")) + if (!$util.isInteger(message.cltvExpiryDelta)) + return "cltvExpiryDelta: integer expected"; + if (message.forceCloseAvoidanceMaxFeeSatoshis != null && message.hasOwnProperty("forceCloseAvoidanceMaxFeeSatoshis")) + if (!$util.isInteger(message.forceCloseAvoidanceMaxFeeSatoshis) && !(message.forceCloseAvoidanceMaxFeeSatoshis && $util.isInteger(message.forceCloseAvoidanceMaxFeeSatoshis.low) && $util.isInteger(message.forceCloseAvoidanceMaxFeeSatoshis.high))) + return "forceCloseAvoidanceMaxFeeSatoshis: integer|Long expected"; + if (message.acceptUnderpayingHtlcs != null && message.hasOwnProperty("acceptUnderpayingHtlcs")) + if (typeof message.acceptUnderpayingHtlcs !== "boolean") + return "acceptUnderpayingHtlcs: boolean expected"; + if (message.fixedLimitMsat != null && message.hasOwnProperty("fixedLimitMsat")) { + properties.maxDustHtlcExposure = 1; + if (!$util.isInteger(message.fixedLimitMsat) && !(message.fixedLimitMsat && $util.isInteger(message.fixedLimitMsat.low) && $util.isInteger(message.fixedLimitMsat.high))) + return "fixedLimitMsat: integer|Long expected"; + } + if (message.feeRateMultiplier != null && message.hasOwnProperty("feeRateMultiplier")) { + if (properties.maxDustHtlcExposure === 1) + return "maxDustHtlcExposure: multiple values"; + properties.maxDustHtlcExposure = 1; + if (!$util.isInteger(message.feeRateMultiplier) && !(message.feeRateMultiplier && $util.isInteger(message.feeRateMultiplier.low) && $util.isInteger(message.feeRateMultiplier.high))) + return "feeRateMultiplier: 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) { + if (object instanceof $root.types.ChannelConfig) + return object; + var message = new $root.types.ChannelConfig(); + if (object.forwardingFeeProportionalMillionths != null) + message.forwardingFeeProportionalMillionths = object.forwardingFeeProportionalMillionths >>> 0; + if (object.forwardingFeeBaseMsat != null) + message.forwardingFeeBaseMsat = object.forwardingFeeBaseMsat >>> 0; + if (object.cltvExpiryDelta != null) + message.cltvExpiryDelta = object.cltvExpiryDelta >>> 0; + if (object.forceCloseAvoidanceMaxFeeSatoshis != null) + if ($util.Long) + (message.forceCloseAvoidanceMaxFeeSatoshis = $util.Long.fromValue(object.forceCloseAvoidanceMaxFeeSatoshis)).unsigned = true; + else if (typeof object.forceCloseAvoidanceMaxFeeSatoshis === "string") + message.forceCloseAvoidanceMaxFeeSatoshis = parseInt(object.forceCloseAvoidanceMaxFeeSatoshis, 10); + else if (typeof object.forceCloseAvoidanceMaxFeeSatoshis === "number") + message.forceCloseAvoidanceMaxFeeSatoshis = object.forceCloseAvoidanceMaxFeeSatoshis; + else if (typeof object.forceCloseAvoidanceMaxFeeSatoshis === "object") + message.forceCloseAvoidanceMaxFeeSatoshis = new $util.LongBits(object.forceCloseAvoidanceMaxFeeSatoshis.low >>> 0, object.forceCloseAvoidanceMaxFeeSatoshis.high >>> 0).toNumber(true); + if (object.acceptUnderpayingHtlcs != null) + message.acceptUnderpayingHtlcs = Boolean(object.acceptUnderpayingHtlcs); + if (object.fixedLimitMsat != null) + if ($util.Long) + (message.fixedLimitMsat = $util.Long.fromValue(object.fixedLimitMsat)).unsigned = true; + else if (typeof object.fixedLimitMsat === "string") + message.fixedLimitMsat = parseInt(object.fixedLimitMsat, 10); + else if (typeof object.fixedLimitMsat === "number") + message.fixedLimitMsat = object.fixedLimitMsat; + else if (typeof object.fixedLimitMsat === "object") + message.fixedLimitMsat = new $util.LongBits(object.fixedLimitMsat.low >>> 0, object.fixedLimitMsat.high >>> 0).toNumber(true); + if (object.feeRateMultiplier != null) + if ($util.Long) + (message.feeRateMultiplier = $util.Long.fromValue(object.feeRateMultiplier)).unsigned = true; + else if (typeof object.feeRateMultiplier === "string") + message.feeRateMultiplier = parseInt(object.feeRateMultiplier, 10); + else if (typeof object.feeRateMultiplier === "number") + message.feeRateMultiplier = object.feeRateMultiplier; + else if (typeof object.feeRateMultiplier === "object") + message.feeRateMultiplier = new $util.LongBits(object.feeRateMultiplier.low >>> 0, object.feeRateMultiplier.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 = {}; + var object = {}; + if (options.defaults) { + object.forwardingFeeProportionalMillionths = 0; + object.forwardingFeeBaseMsat = 0; + object.cltvExpiryDelta = 0; + object.forceCloseAvoidanceMaxFeeSatoshis = 0; + object.acceptUnderpayingHtlcs = false; + } + if (message.forwardingFeeProportionalMillionths != null && message.hasOwnProperty("forwardingFeeProportionalMillionths")) + object.forwardingFeeProportionalMillionths = message.forwardingFeeProportionalMillionths; + if (message.forwardingFeeBaseMsat != null && message.hasOwnProperty("forwardingFeeBaseMsat")) + object.forwardingFeeBaseMsat = message.forwardingFeeBaseMsat; + if (message.cltvExpiryDelta != null && message.hasOwnProperty("cltvExpiryDelta")) + object.cltvExpiryDelta = message.cltvExpiryDelta; + if (message.forceCloseAvoidanceMaxFeeSatoshis != null && message.hasOwnProperty("forceCloseAvoidanceMaxFeeSatoshis")) + if (typeof message.forceCloseAvoidanceMaxFeeSatoshis === "number") + object.forceCloseAvoidanceMaxFeeSatoshis = options.longs === String ? String(message.forceCloseAvoidanceMaxFeeSatoshis) : message.forceCloseAvoidanceMaxFeeSatoshis; + else + object.forceCloseAvoidanceMaxFeeSatoshis = options.longs === String ? $util.Long.prototype.toString.call(message.forceCloseAvoidanceMaxFeeSatoshis) : options.longs === Number ? new $util.LongBits(message.forceCloseAvoidanceMaxFeeSatoshis.low >>> 0, message.forceCloseAvoidanceMaxFeeSatoshis.high >>> 0).toNumber(true) : message.forceCloseAvoidanceMaxFeeSatoshis; + if (message.acceptUnderpayingHtlcs != null && message.hasOwnProperty("acceptUnderpayingHtlcs")) + object.acceptUnderpayingHtlcs = message.acceptUnderpayingHtlcs; + if (message.fixedLimitMsat != null && message.hasOwnProperty("fixedLimitMsat")) { + if (typeof message.fixedLimitMsat === "number") + object.fixedLimitMsat = options.longs === String ? String(message.fixedLimitMsat) : message.fixedLimitMsat; + else + object.fixedLimitMsat = options.longs === String ? $util.Long.prototype.toString.call(message.fixedLimitMsat) : options.longs === Number ? new $util.LongBits(message.fixedLimitMsat.low >>> 0, message.fixedLimitMsat.high >>> 0).toNumber(true) : message.fixedLimitMsat; + if (options.oneofs) + object.maxDustHtlcExposure = "fixedLimitMsat"; + } + if (message.feeRateMultiplier != null && message.hasOwnProperty("feeRateMultiplier")) { + if (typeof message.feeRateMultiplier === "number") + object.feeRateMultiplier = options.longs === String ? String(message.feeRateMultiplier) : message.feeRateMultiplier; + else + object.feeRateMultiplier = options.longs === String ? $util.Long.prototype.toString.call(message.feeRateMultiplier) : options.longs === Number ? new $util.LongBits(message.feeRateMultiplier.low >>> 0, message.feeRateMultiplier.high >>> 0).toNumber(true) : message.feeRateMultiplier; + if (options.oneofs) + object.maxDustHtlcExposure = "feeRateMultiplier"; + } + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.OutPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.txid = reader.string(); + break; + case 2: + message.vout = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.types.OutPoint) + return object; + var 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 = {}; + var 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); + }; + + return OutPoint; + })(); + + types.BestBlock = (function() { + + /** + * Properties of a BestBlock. + * @memberof types + * @interface IBestBlock + * @property {string|null} [blockHash] BestBlock blockHash + * @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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BestBlock blockHash. + * @member {string} blockHash + * @memberof types.BestBlock + * @instance + */ + BestBlock.prototype.blockHash = ""; + + /** + * 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.blockHash != null && Object.hasOwnProperty.call(message, "blockHash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.blockHash); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.BestBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.blockHash = reader.string(); + break; + case 2: + message.height = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockHash != null && message.hasOwnProperty("blockHash")) + if (!$util.isString(message.blockHash)) + return "blockHash: 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) { + if (object instanceof $root.types.BestBlock) + return object; + var message = new $root.types.BestBlock(); + if (object.blockHash != null) + message.blockHash = String(object.blockHash); + 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 = {}; + var object = {}; + if (options.defaults) { + object.blockHash = ""; + object.height = 0; + } + if (message.blockHash != null && message.hasOwnProperty("blockHash")) + object.blockHash = message.blockHash; + 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); + }; + + return BestBlock; + })(); + + types.LightningBalance = (function() { + + /** + * Properties of a LightningBalance. + * @memberof types + * @interface ILightningBalance + * @property {types.IClaimableOnChannelClose|null} [claimableOnChannelClose] LightningBalance claimableOnChannelClose + * @property {types.IClaimableAwaitingConfirmations|null} [claimableAwaitingConfirmations] LightningBalance claimableAwaitingConfirmations + * @property {types.IContentiousClaimable|null} [contentiousClaimable] LightningBalance contentiousClaimable + * @property {types.IMaybeTimeoutClaimableHTLC|null} [maybeTimeoutClaimableHtlc] LightningBalance maybeTimeoutClaimableHtlc + * @property {types.IMaybePreimageClaimableHTLC|null} [maybePreimageClaimableHtlc] LightningBalance maybePreimageClaimableHtlc + * @property {types.ICounterpartyRevokedOutputClaimable|null} [counterpartyRevokedOutputClaimable] LightningBalance counterpartyRevokedOutputClaimable + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LightningBalance claimableOnChannelClose. + * @member {types.IClaimableOnChannelClose|null|undefined} claimableOnChannelClose + * @memberof types.LightningBalance + * @instance + */ + LightningBalance.prototype.claimableOnChannelClose = null; + + /** + * LightningBalance claimableAwaitingConfirmations. + * @member {types.IClaimableAwaitingConfirmations|null|undefined} claimableAwaitingConfirmations + * @memberof types.LightningBalance + * @instance + */ + LightningBalance.prototype.claimableAwaitingConfirmations = null; + + /** + * LightningBalance contentiousClaimable. + * @member {types.IContentiousClaimable|null|undefined} contentiousClaimable + * @memberof types.LightningBalance + * @instance + */ + LightningBalance.prototype.contentiousClaimable = null; + + /** + * LightningBalance maybeTimeoutClaimableHtlc. + * @member {types.IMaybeTimeoutClaimableHTLC|null|undefined} maybeTimeoutClaimableHtlc + * @memberof types.LightningBalance + * @instance + */ + LightningBalance.prototype.maybeTimeoutClaimableHtlc = null; + + /** + * LightningBalance maybePreimageClaimableHtlc. + * @member {types.IMaybePreimageClaimableHTLC|null|undefined} maybePreimageClaimableHtlc + * @memberof types.LightningBalance + * @instance + */ + LightningBalance.prototype.maybePreimageClaimableHtlc = null; + + /** + * LightningBalance counterpartyRevokedOutputClaimable. + * @member {types.ICounterpartyRevokedOutputClaimable|null|undefined} counterpartyRevokedOutputClaimable + * @memberof types.LightningBalance + * @instance + */ + LightningBalance.prototype.counterpartyRevokedOutputClaimable = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LightningBalance balanceType. + * @member {"claimableOnChannelClose"|"claimableAwaitingConfirmations"|"contentiousClaimable"|"maybeTimeoutClaimableHtlc"|"maybePreimageClaimableHtlc"|"counterpartyRevokedOutputClaimable"|undefined} balanceType + * @memberof types.LightningBalance + * @instance + */ + Object.defineProperty(LightningBalance.prototype, "balanceType", { + get: $util.oneOfGetter($oneOfFields = ["claimableOnChannelClose", "claimableAwaitingConfirmations", "contentiousClaimable", "maybeTimeoutClaimableHtlc", "maybePreimageClaimableHtlc", "counterpartyRevokedOutputClaimable"]), + 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.claimableOnChannelClose != null && Object.hasOwnProperty.call(message, "claimableOnChannelClose")) + $root.types.ClaimableOnChannelClose.encode(message.claimableOnChannelClose, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.claimableAwaitingConfirmations != null && Object.hasOwnProperty.call(message, "claimableAwaitingConfirmations")) + $root.types.ClaimableAwaitingConfirmations.encode(message.claimableAwaitingConfirmations, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.contentiousClaimable != null && Object.hasOwnProperty.call(message, "contentiousClaimable")) + $root.types.ContentiousClaimable.encode(message.contentiousClaimable, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.maybeTimeoutClaimableHtlc != null && Object.hasOwnProperty.call(message, "maybeTimeoutClaimableHtlc")) + $root.types.MaybeTimeoutClaimableHTLC.encode(message.maybeTimeoutClaimableHtlc, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.maybePreimageClaimableHtlc != null && Object.hasOwnProperty.call(message, "maybePreimageClaimableHtlc")) + $root.types.MaybePreimageClaimableHTLC.encode(message.maybePreimageClaimableHtlc, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.counterpartyRevokedOutputClaimable != null && Object.hasOwnProperty.call(message, "counterpartyRevokedOutputClaimable")) + $root.types.CounterpartyRevokedOutputClaimable.encode(message.counterpartyRevokedOutputClaimable, 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.LightningBalance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.claimableOnChannelClose = $root.types.ClaimableOnChannelClose.decode(reader, reader.uint32()); + break; + case 2: + message.claimableAwaitingConfirmations = $root.types.ClaimableAwaitingConfirmations.decode(reader, reader.uint32()); + break; + case 3: + message.contentiousClaimable = $root.types.ContentiousClaimable.decode(reader, reader.uint32()); + break; + case 4: + message.maybeTimeoutClaimableHtlc = $root.types.MaybeTimeoutClaimableHTLC.decode(reader, reader.uint32()); + break; + case 5: + message.maybePreimageClaimableHtlc = $root.types.MaybePreimageClaimableHTLC.decode(reader, reader.uint32()); + break; + case 6: + message.counterpartyRevokedOutputClaimable = $root.types.CounterpartyRevokedOutputClaimable.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.claimableOnChannelClose != null && message.hasOwnProperty("claimableOnChannelClose")) { + properties.balanceType = 1; + { + var error = $root.types.ClaimableOnChannelClose.verify(message.claimableOnChannelClose); + if (error) + return "claimableOnChannelClose." + error; + } + } + if (message.claimableAwaitingConfirmations != null && message.hasOwnProperty("claimableAwaitingConfirmations")) { + if (properties.balanceType === 1) + return "balanceType: multiple values"; + properties.balanceType = 1; + { + var error = $root.types.ClaimableAwaitingConfirmations.verify(message.claimableAwaitingConfirmations); + if (error) + return "claimableAwaitingConfirmations." + error; + } + } + if (message.contentiousClaimable != null && message.hasOwnProperty("contentiousClaimable")) { + if (properties.balanceType === 1) + return "balanceType: multiple values"; + properties.balanceType = 1; + { + var error = $root.types.ContentiousClaimable.verify(message.contentiousClaimable); + if (error) + return "contentiousClaimable." + error; + } + } + if (message.maybeTimeoutClaimableHtlc != null && message.hasOwnProperty("maybeTimeoutClaimableHtlc")) { + if (properties.balanceType === 1) + return "balanceType: multiple values"; + properties.balanceType = 1; + { + var error = $root.types.MaybeTimeoutClaimableHTLC.verify(message.maybeTimeoutClaimableHtlc); + if (error) + return "maybeTimeoutClaimableHtlc." + error; + } + } + if (message.maybePreimageClaimableHtlc != null && message.hasOwnProperty("maybePreimageClaimableHtlc")) { + if (properties.balanceType === 1) + return "balanceType: multiple values"; + properties.balanceType = 1; + { + var error = $root.types.MaybePreimageClaimableHTLC.verify(message.maybePreimageClaimableHtlc); + if (error) + return "maybePreimageClaimableHtlc." + error; + } + } + if (message.counterpartyRevokedOutputClaimable != null && message.hasOwnProperty("counterpartyRevokedOutputClaimable")) { + if (properties.balanceType === 1) + return "balanceType: multiple values"; + properties.balanceType = 1; + { + var error = $root.types.CounterpartyRevokedOutputClaimable.verify(message.counterpartyRevokedOutputClaimable); + if (error) + return "counterpartyRevokedOutputClaimable." + 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) { + if (object instanceof $root.types.LightningBalance) + return object; + var message = new $root.types.LightningBalance(); + if (object.claimableOnChannelClose != null) { + if (typeof object.claimableOnChannelClose !== "object") + throw TypeError(".types.LightningBalance.claimableOnChannelClose: object expected"); + message.claimableOnChannelClose = $root.types.ClaimableOnChannelClose.fromObject(object.claimableOnChannelClose); + } + if (object.claimableAwaitingConfirmations != null) { + if (typeof object.claimableAwaitingConfirmations !== "object") + throw TypeError(".types.LightningBalance.claimableAwaitingConfirmations: object expected"); + message.claimableAwaitingConfirmations = $root.types.ClaimableAwaitingConfirmations.fromObject(object.claimableAwaitingConfirmations); + } + if (object.contentiousClaimable != null) { + if (typeof object.contentiousClaimable !== "object") + throw TypeError(".types.LightningBalance.contentiousClaimable: object expected"); + message.contentiousClaimable = $root.types.ContentiousClaimable.fromObject(object.contentiousClaimable); + } + if (object.maybeTimeoutClaimableHtlc != null) { + if (typeof object.maybeTimeoutClaimableHtlc !== "object") + throw TypeError(".types.LightningBalance.maybeTimeoutClaimableHtlc: object expected"); + message.maybeTimeoutClaimableHtlc = $root.types.MaybeTimeoutClaimableHTLC.fromObject(object.maybeTimeoutClaimableHtlc); + } + if (object.maybePreimageClaimableHtlc != null) { + if (typeof object.maybePreimageClaimableHtlc !== "object") + throw TypeError(".types.LightningBalance.maybePreimageClaimableHtlc: object expected"); + message.maybePreimageClaimableHtlc = $root.types.MaybePreimageClaimableHTLC.fromObject(object.maybePreimageClaimableHtlc); + } + if (object.counterpartyRevokedOutputClaimable != null) { + if (typeof object.counterpartyRevokedOutputClaimable !== "object") + throw TypeError(".types.LightningBalance.counterpartyRevokedOutputClaimable: object expected"); + message.counterpartyRevokedOutputClaimable = $root.types.CounterpartyRevokedOutputClaimable.fromObject(object.counterpartyRevokedOutputClaimable); + } + 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 = {}; + var object = {}; + if (message.claimableOnChannelClose != null && message.hasOwnProperty("claimableOnChannelClose")) { + object.claimableOnChannelClose = $root.types.ClaimableOnChannelClose.toObject(message.claimableOnChannelClose, options); + if (options.oneofs) + object.balanceType = "claimableOnChannelClose"; + } + if (message.claimableAwaitingConfirmations != null && message.hasOwnProperty("claimableAwaitingConfirmations")) { + object.claimableAwaitingConfirmations = $root.types.ClaimableAwaitingConfirmations.toObject(message.claimableAwaitingConfirmations, options); + if (options.oneofs) + object.balanceType = "claimableAwaitingConfirmations"; + } + if (message.contentiousClaimable != null && message.hasOwnProperty("contentiousClaimable")) { + object.contentiousClaimable = $root.types.ContentiousClaimable.toObject(message.contentiousClaimable, options); + if (options.oneofs) + object.balanceType = "contentiousClaimable"; + } + if (message.maybeTimeoutClaimableHtlc != null && message.hasOwnProperty("maybeTimeoutClaimableHtlc")) { + object.maybeTimeoutClaimableHtlc = $root.types.MaybeTimeoutClaimableHTLC.toObject(message.maybeTimeoutClaimableHtlc, options); + if (options.oneofs) + object.balanceType = "maybeTimeoutClaimableHtlc"; + } + if (message.maybePreimageClaimableHtlc != null && message.hasOwnProperty("maybePreimageClaimableHtlc")) { + object.maybePreimageClaimableHtlc = $root.types.MaybePreimageClaimableHTLC.toObject(message.maybePreimageClaimableHtlc, options); + if (options.oneofs) + object.balanceType = "maybePreimageClaimableHtlc"; + } + if (message.counterpartyRevokedOutputClaimable != null && message.hasOwnProperty("counterpartyRevokedOutputClaimable")) { + object.counterpartyRevokedOutputClaimable = $root.types.CounterpartyRevokedOutputClaimable.toObject(message.counterpartyRevokedOutputClaimable, options); + if (options.oneofs) + object.balanceType = "counterpartyRevokedOutputClaimable"; + } + 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); + }; + + return LightningBalance; + })(); + + types.ClaimableOnChannelClose = (function() { + + /** + * Properties of a ClaimableOnChannelClose. + * @memberof types + * @interface IClaimableOnChannelClose + * @property {string|null} [channelId] ClaimableOnChannelClose channelId + * @property {string|null} [counterpartyNodeId] ClaimableOnChannelClose counterpartyNodeId + * @property {number|Long|null} [amountSatoshis] ClaimableOnChannelClose amountSatoshis + * @property {number|Long|null} [transactionFeeSatoshis] ClaimableOnChannelClose transactionFeeSatoshis + * @property {number|Long|null} [outboundPaymentHtlcRoundedMsat] ClaimableOnChannelClose outboundPaymentHtlcRoundedMsat + * @property {number|Long|null} [outboundForwardedHtlcRoundedMsat] ClaimableOnChannelClose outboundForwardedHtlcRoundedMsat + * @property {number|Long|null} [inboundClaimingHtlcRoundedMsat] ClaimableOnChannelClose inboundClaimingHtlcRoundedMsat + * @property {number|Long|null} [inboundHtlcRoundedMsat] ClaimableOnChannelClose inboundHtlcRoundedMsat + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClaimableOnChannelClose channelId. + * @member {string} channelId + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.channelId = ""; + + /** + * ClaimableOnChannelClose counterpartyNodeId. + * @member {string} counterpartyNodeId + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.counterpartyNodeId = ""; + + /** + * ClaimableOnChannelClose amountSatoshis. + * @member {number|Long} amountSatoshis + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.amountSatoshis = 0; + + /** + * ClaimableOnChannelClose transactionFeeSatoshis. + * @member {number|Long} transactionFeeSatoshis + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.transactionFeeSatoshis = 0; + + /** + * ClaimableOnChannelClose outboundPaymentHtlcRoundedMsat. + * @member {number|Long} outboundPaymentHtlcRoundedMsat + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.outboundPaymentHtlcRoundedMsat = 0; + + /** + * ClaimableOnChannelClose outboundForwardedHtlcRoundedMsat. + * @member {number|Long} outboundForwardedHtlcRoundedMsat + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.outboundForwardedHtlcRoundedMsat = 0; + + /** + * ClaimableOnChannelClose inboundClaimingHtlcRoundedMsat. + * @member {number|Long} inboundClaimingHtlcRoundedMsat + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.inboundClaimingHtlcRoundedMsat = 0; + + /** + * ClaimableOnChannelClose inboundHtlcRoundedMsat. + * @member {number|Long} inboundHtlcRoundedMsat + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.inboundHtlcRoundedMsat = 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.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channelId); + if (message.counterpartyNodeId != null && Object.hasOwnProperty.call(message, "counterpartyNodeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterpartyNodeId); + if (message.amountSatoshis != null && Object.hasOwnProperty.call(message, "amountSatoshis")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.amountSatoshis); + if (message.transactionFeeSatoshis != null && Object.hasOwnProperty.call(message, "transactionFeeSatoshis")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.transactionFeeSatoshis); + if (message.outboundPaymentHtlcRoundedMsat != null && Object.hasOwnProperty.call(message, "outboundPaymentHtlcRoundedMsat")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.outboundPaymentHtlcRoundedMsat); + if (message.outboundForwardedHtlcRoundedMsat != null && Object.hasOwnProperty.call(message, "outboundForwardedHtlcRoundedMsat")) + writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.outboundForwardedHtlcRoundedMsat); + if (message.inboundClaimingHtlcRoundedMsat != null && Object.hasOwnProperty.call(message, "inboundClaimingHtlcRoundedMsat")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.inboundClaimingHtlcRoundedMsat); + if (message.inboundHtlcRoundedMsat != null && Object.hasOwnProperty.call(message, "inboundHtlcRoundedMsat")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.inboundHtlcRoundedMsat); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.ClaimableOnChannelClose(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.counterpartyNodeId = reader.string(); + break; + case 3: + message.amountSatoshis = reader.uint64(); + break; + case 4: + message.transactionFeeSatoshis = reader.uint64(); + break; + case 5: + message.outboundPaymentHtlcRoundedMsat = reader.uint64(); + break; + case 6: + message.outboundForwardedHtlcRoundedMsat = reader.uint64(); + break; + case 7: + message.inboundClaimingHtlcRoundedMsat = reader.uint64(); + break; + case 8: + message.inboundHtlcRoundedMsat = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + if (!$util.isString(message.counterpartyNodeId)) + return "counterpartyNodeId: string expected"; + if (message.amountSatoshis != null && message.hasOwnProperty("amountSatoshis")) + if (!$util.isInteger(message.amountSatoshis) && !(message.amountSatoshis && $util.isInteger(message.amountSatoshis.low) && $util.isInteger(message.amountSatoshis.high))) + return "amountSatoshis: integer|Long expected"; + if (message.transactionFeeSatoshis != null && message.hasOwnProperty("transactionFeeSatoshis")) + if (!$util.isInteger(message.transactionFeeSatoshis) && !(message.transactionFeeSatoshis && $util.isInteger(message.transactionFeeSatoshis.low) && $util.isInteger(message.transactionFeeSatoshis.high))) + return "transactionFeeSatoshis: integer|Long expected"; + if (message.outboundPaymentHtlcRoundedMsat != null && message.hasOwnProperty("outboundPaymentHtlcRoundedMsat")) + if (!$util.isInteger(message.outboundPaymentHtlcRoundedMsat) && !(message.outboundPaymentHtlcRoundedMsat && $util.isInteger(message.outboundPaymentHtlcRoundedMsat.low) && $util.isInteger(message.outboundPaymentHtlcRoundedMsat.high))) + return "outboundPaymentHtlcRoundedMsat: integer|Long expected"; + if (message.outboundForwardedHtlcRoundedMsat != null && message.hasOwnProperty("outboundForwardedHtlcRoundedMsat")) + if (!$util.isInteger(message.outboundForwardedHtlcRoundedMsat) && !(message.outboundForwardedHtlcRoundedMsat && $util.isInteger(message.outboundForwardedHtlcRoundedMsat.low) && $util.isInteger(message.outboundForwardedHtlcRoundedMsat.high))) + return "outboundForwardedHtlcRoundedMsat: integer|Long expected"; + if (message.inboundClaimingHtlcRoundedMsat != null && message.hasOwnProperty("inboundClaimingHtlcRoundedMsat")) + if (!$util.isInteger(message.inboundClaimingHtlcRoundedMsat) && !(message.inboundClaimingHtlcRoundedMsat && $util.isInteger(message.inboundClaimingHtlcRoundedMsat.low) && $util.isInteger(message.inboundClaimingHtlcRoundedMsat.high))) + return "inboundClaimingHtlcRoundedMsat: integer|Long expected"; + if (message.inboundHtlcRoundedMsat != null && message.hasOwnProperty("inboundHtlcRoundedMsat")) + if (!$util.isInteger(message.inboundHtlcRoundedMsat) && !(message.inboundHtlcRoundedMsat && $util.isInteger(message.inboundHtlcRoundedMsat.low) && $util.isInteger(message.inboundHtlcRoundedMsat.high))) + return "inboundHtlcRoundedMsat: 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) { + if (object instanceof $root.types.ClaimableOnChannelClose) + return object; + var message = new $root.types.ClaimableOnChannelClose(); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.counterpartyNodeId != null) + message.counterpartyNodeId = String(object.counterpartyNodeId); + if (object.amountSatoshis != null) + if ($util.Long) + (message.amountSatoshis = $util.Long.fromValue(object.amountSatoshis)).unsigned = true; + else if (typeof object.amountSatoshis === "string") + message.amountSatoshis = parseInt(object.amountSatoshis, 10); + else if (typeof object.amountSatoshis === "number") + message.amountSatoshis = object.amountSatoshis; + else if (typeof object.amountSatoshis === "object") + message.amountSatoshis = new $util.LongBits(object.amountSatoshis.low >>> 0, object.amountSatoshis.high >>> 0).toNumber(true); + if (object.transactionFeeSatoshis != null) + if ($util.Long) + (message.transactionFeeSatoshis = $util.Long.fromValue(object.transactionFeeSatoshis)).unsigned = true; + else if (typeof object.transactionFeeSatoshis === "string") + message.transactionFeeSatoshis = parseInt(object.transactionFeeSatoshis, 10); + else if (typeof object.transactionFeeSatoshis === "number") + message.transactionFeeSatoshis = object.transactionFeeSatoshis; + else if (typeof object.transactionFeeSatoshis === "object") + message.transactionFeeSatoshis = new $util.LongBits(object.transactionFeeSatoshis.low >>> 0, object.transactionFeeSatoshis.high >>> 0).toNumber(true); + if (object.outboundPaymentHtlcRoundedMsat != null) + if ($util.Long) + (message.outboundPaymentHtlcRoundedMsat = $util.Long.fromValue(object.outboundPaymentHtlcRoundedMsat)).unsigned = true; + else if (typeof object.outboundPaymentHtlcRoundedMsat === "string") + message.outboundPaymentHtlcRoundedMsat = parseInt(object.outboundPaymentHtlcRoundedMsat, 10); + else if (typeof object.outboundPaymentHtlcRoundedMsat === "number") + message.outboundPaymentHtlcRoundedMsat = object.outboundPaymentHtlcRoundedMsat; + else if (typeof object.outboundPaymentHtlcRoundedMsat === "object") + message.outboundPaymentHtlcRoundedMsat = new $util.LongBits(object.outboundPaymentHtlcRoundedMsat.low >>> 0, object.outboundPaymentHtlcRoundedMsat.high >>> 0).toNumber(true); + if (object.outboundForwardedHtlcRoundedMsat != null) + if ($util.Long) + (message.outboundForwardedHtlcRoundedMsat = $util.Long.fromValue(object.outboundForwardedHtlcRoundedMsat)).unsigned = true; + else if (typeof object.outboundForwardedHtlcRoundedMsat === "string") + message.outboundForwardedHtlcRoundedMsat = parseInt(object.outboundForwardedHtlcRoundedMsat, 10); + else if (typeof object.outboundForwardedHtlcRoundedMsat === "number") + message.outboundForwardedHtlcRoundedMsat = object.outboundForwardedHtlcRoundedMsat; + else if (typeof object.outboundForwardedHtlcRoundedMsat === "object") + message.outboundForwardedHtlcRoundedMsat = new $util.LongBits(object.outboundForwardedHtlcRoundedMsat.low >>> 0, object.outboundForwardedHtlcRoundedMsat.high >>> 0).toNumber(true); + if (object.inboundClaimingHtlcRoundedMsat != null) + if ($util.Long) + (message.inboundClaimingHtlcRoundedMsat = $util.Long.fromValue(object.inboundClaimingHtlcRoundedMsat)).unsigned = true; + else if (typeof object.inboundClaimingHtlcRoundedMsat === "string") + message.inboundClaimingHtlcRoundedMsat = parseInt(object.inboundClaimingHtlcRoundedMsat, 10); + else if (typeof object.inboundClaimingHtlcRoundedMsat === "number") + message.inboundClaimingHtlcRoundedMsat = object.inboundClaimingHtlcRoundedMsat; + else if (typeof object.inboundClaimingHtlcRoundedMsat === "object") + message.inboundClaimingHtlcRoundedMsat = new $util.LongBits(object.inboundClaimingHtlcRoundedMsat.low >>> 0, object.inboundClaimingHtlcRoundedMsat.high >>> 0).toNumber(true); + if (object.inboundHtlcRoundedMsat != null) + if ($util.Long) + (message.inboundHtlcRoundedMsat = $util.Long.fromValue(object.inboundHtlcRoundedMsat)).unsigned = true; + else if (typeof object.inboundHtlcRoundedMsat === "string") + message.inboundHtlcRoundedMsat = parseInt(object.inboundHtlcRoundedMsat, 10); + else if (typeof object.inboundHtlcRoundedMsat === "number") + message.inboundHtlcRoundedMsat = object.inboundHtlcRoundedMsat; + else if (typeof object.inboundHtlcRoundedMsat === "object") + message.inboundHtlcRoundedMsat = new $util.LongBits(object.inboundHtlcRoundedMsat.low >>> 0, object.inboundHtlcRoundedMsat.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 = {}; + var object = {}; + if (options.defaults) { + object.channelId = ""; + object.counterpartyNodeId = ""; + object.amountSatoshis = 0; + object.transactionFeeSatoshis = 0; + object.outboundPaymentHtlcRoundedMsat = 0; + object.outboundForwardedHtlcRoundedMsat = 0; + object.inboundClaimingHtlcRoundedMsat = 0; + object.inboundHtlcRoundedMsat = 0; + } + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + object.counterpartyNodeId = message.counterpartyNodeId; + if (message.amountSatoshis != null && message.hasOwnProperty("amountSatoshis")) + if (typeof message.amountSatoshis === "number") + object.amountSatoshis = options.longs === String ? String(message.amountSatoshis) : message.amountSatoshis; + else + object.amountSatoshis = options.longs === String ? $util.Long.prototype.toString.call(message.amountSatoshis) : options.longs === Number ? new $util.LongBits(message.amountSatoshis.low >>> 0, message.amountSatoshis.high >>> 0).toNumber(true) : message.amountSatoshis; + if (message.transactionFeeSatoshis != null && message.hasOwnProperty("transactionFeeSatoshis")) + if (typeof message.transactionFeeSatoshis === "number") + object.transactionFeeSatoshis = options.longs === String ? String(message.transactionFeeSatoshis) : message.transactionFeeSatoshis; + else + object.transactionFeeSatoshis = options.longs === String ? $util.Long.prototype.toString.call(message.transactionFeeSatoshis) : options.longs === Number ? new $util.LongBits(message.transactionFeeSatoshis.low >>> 0, message.transactionFeeSatoshis.high >>> 0).toNumber(true) : message.transactionFeeSatoshis; + if (message.outboundPaymentHtlcRoundedMsat != null && message.hasOwnProperty("outboundPaymentHtlcRoundedMsat")) + if (typeof message.outboundPaymentHtlcRoundedMsat === "number") + object.outboundPaymentHtlcRoundedMsat = options.longs === String ? String(message.outboundPaymentHtlcRoundedMsat) : message.outboundPaymentHtlcRoundedMsat; + else + object.outboundPaymentHtlcRoundedMsat = options.longs === String ? $util.Long.prototype.toString.call(message.outboundPaymentHtlcRoundedMsat) : options.longs === Number ? new $util.LongBits(message.outboundPaymentHtlcRoundedMsat.low >>> 0, message.outboundPaymentHtlcRoundedMsat.high >>> 0).toNumber(true) : message.outboundPaymentHtlcRoundedMsat; + if (message.outboundForwardedHtlcRoundedMsat != null && message.hasOwnProperty("outboundForwardedHtlcRoundedMsat")) + if (typeof message.outboundForwardedHtlcRoundedMsat === "number") + object.outboundForwardedHtlcRoundedMsat = options.longs === String ? String(message.outboundForwardedHtlcRoundedMsat) : message.outboundForwardedHtlcRoundedMsat; + else + object.outboundForwardedHtlcRoundedMsat = options.longs === String ? $util.Long.prototype.toString.call(message.outboundForwardedHtlcRoundedMsat) : options.longs === Number ? new $util.LongBits(message.outboundForwardedHtlcRoundedMsat.low >>> 0, message.outboundForwardedHtlcRoundedMsat.high >>> 0).toNumber(true) : message.outboundForwardedHtlcRoundedMsat; + if (message.inboundClaimingHtlcRoundedMsat != null && message.hasOwnProperty("inboundClaimingHtlcRoundedMsat")) + if (typeof message.inboundClaimingHtlcRoundedMsat === "number") + object.inboundClaimingHtlcRoundedMsat = options.longs === String ? String(message.inboundClaimingHtlcRoundedMsat) : message.inboundClaimingHtlcRoundedMsat; + else + object.inboundClaimingHtlcRoundedMsat = options.longs === String ? $util.Long.prototype.toString.call(message.inboundClaimingHtlcRoundedMsat) : options.longs === Number ? new $util.LongBits(message.inboundClaimingHtlcRoundedMsat.low >>> 0, message.inboundClaimingHtlcRoundedMsat.high >>> 0).toNumber(true) : message.inboundClaimingHtlcRoundedMsat; + if (message.inboundHtlcRoundedMsat != null && message.hasOwnProperty("inboundHtlcRoundedMsat")) + if (typeof message.inboundHtlcRoundedMsat === "number") + object.inboundHtlcRoundedMsat = options.longs === String ? String(message.inboundHtlcRoundedMsat) : message.inboundHtlcRoundedMsat; + else + object.inboundHtlcRoundedMsat = options.longs === String ? $util.Long.prototype.toString.call(message.inboundHtlcRoundedMsat) : options.longs === Number ? new $util.LongBits(message.inboundHtlcRoundedMsat.low >>> 0, message.inboundHtlcRoundedMsat.high >>> 0).toNumber(true) : message.inboundHtlcRoundedMsat; + 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); + }; + + return ClaimableOnChannelClose; + })(); + + types.ClaimableAwaitingConfirmations = (function() { + + /** + * Properties of a ClaimableAwaitingConfirmations. + * @memberof types + * @interface IClaimableAwaitingConfirmations + * @property {string|null} [channelId] ClaimableAwaitingConfirmations channelId + * @property {string|null} [counterpartyNodeId] ClaimableAwaitingConfirmations counterpartyNodeId + * @property {number|Long|null} [amountSatoshis] ClaimableAwaitingConfirmations amountSatoshis + * @property {number|null} [confirmationHeight] ClaimableAwaitingConfirmations confirmationHeight + * @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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClaimableAwaitingConfirmations channelId. + * @member {string} channelId + * @memberof types.ClaimableAwaitingConfirmations + * @instance + */ + ClaimableAwaitingConfirmations.prototype.channelId = ""; + + /** + * ClaimableAwaitingConfirmations counterpartyNodeId. + * @member {string} counterpartyNodeId + * @memberof types.ClaimableAwaitingConfirmations + * @instance + */ + ClaimableAwaitingConfirmations.prototype.counterpartyNodeId = ""; + + /** + * ClaimableAwaitingConfirmations amountSatoshis. + * @member {number|Long} amountSatoshis + * @memberof types.ClaimableAwaitingConfirmations + * @instance + */ + ClaimableAwaitingConfirmations.prototype.amountSatoshis = 0; + + /** + * ClaimableAwaitingConfirmations confirmationHeight. + * @member {number} confirmationHeight + * @memberof types.ClaimableAwaitingConfirmations + * @instance + */ + ClaimableAwaitingConfirmations.prototype.confirmationHeight = 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.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channelId); + if (message.counterpartyNodeId != null && Object.hasOwnProperty.call(message, "counterpartyNodeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterpartyNodeId); + if (message.amountSatoshis != null && Object.hasOwnProperty.call(message, "amountSatoshis")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.amountSatoshis); + if (message.confirmationHeight != null && Object.hasOwnProperty.call(message, "confirmationHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.confirmationHeight); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.ClaimableAwaitingConfirmations(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.counterpartyNodeId = reader.string(); + break; + case 3: + message.amountSatoshis = reader.uint64(); + break; + case 4: + message.confirmationHeight = reader.uint32(); + break; + case 5: + message.source = reader.int32(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + if (!$util.isString(message.counterpartyNodeId)) + return "counterpartyNodeId: string expected"; + if (message.amountSatoshis != null && message.hasOwnProperty("amountSatoshis")) + if (!$util.isInteger(message.amountSatoshis) && !(message.amountSatoshis && $util.isInteger(message.amountSatoshis.low) && $util.isInteger(message.amountSatoshis.high))) + return "amountSatoshis: integer|Long expected"; + if (message.confirmationHeight != null && message.hasOwnProperty("confirmationHeight")) + if (!$util.isInteger(message.confirmationHeight)) + return "confirmationHeight: 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) { + if (object instanceof $root.types.ClaimableAwaitingConfirmations) + return object; + var message = new $root.types.ClaimableAwaitingConfirmations(); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.counterpartyNodeId != null) + message.counterpartyNodeId = String(object.counterpartyNodeId); + if (object.amountSatoshis != null) + if ($util.Long) + (message.amountSatoshis = $util.Long.fromValue(object.amountSatoshis)).unsigned = true; + else if (typeof object.amountSatoshis === "string") + message.amountSatoshis = parseInt(object.amountSatoshis, 10); + else if (typeof object.amountSatoshis === "number") + message.amountSatoshis = object.amountSatoshis; + else if (typeof object.amountSatoshis === "object") + message.amountSatoshis = new $util.LongBits(object.amountSatoshis.low >>> 0, object.amountSatoshis.high >>> 0).toNumber(true); + if (object.confirmationHeight != null) + message.confirmationHeight = object.confirmationHeight >>> 0; + switch (object.source) { + 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 = {}; + var object = {}; + if (options.defaults) { + object.channelId = ""; + object.counterpartyNodeId = ""; + object.amountSatoshis = 0; + object.confirmationHeight = 0; + object.source = options.enums === String ? "HOLDER_FORCE_CLOSED" : 0; + } + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + object.counterpartyNodeId = message.counterpartyNodeId; + if (message.amountSatoshis != null && message.hasOwnProperty("amountSatoshis")) + if (typeof message.amountSatoshis === "number") + object.amountSatoshis = options.longs === String ? String(message.amountSatoshis) : message.amountSatoshis; + else + object.amountSatoshis = options.longs === String ? $util.Long.prototype.toString.call(message.amountSatoshis) : options.longs === Number ? new $util.LongBits(message.amountSatoshis.low >>> 0, message.amountSatoshis.high >>> 0).toNumber(true) : message.amountSatoshis; + if (message.confirmationHeight != null && message.hasOwnProperty("confirmationHeight")) + object.confirmationHeight = message.confirmationHeight; + if (message.source != null && message.hasOwnProperty("source")) + object.source = options.enums === String ? $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); + }; + + return ClaimableAwaitingConfirmations; + })(); + + /** + * BalanceSource enum. + * @name types.BalanceSource + * @enum {string} + * @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() { + var 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} [channelId] ContentiousClaimable channelId + * @property {string|null} [counterpartyNodeId] ContentiousClaimable counterpartyNodeId + * @property {number|Long|null} [amountSatoshis] ContentiousClaimable amountSatoshis + * @property {number|null} [timeoutHeight] ContentiousClaimable timeoutHeight + * @property {string|null} [paymentHash] ContentiousClaimable paymentHash + * @property {string|null} [paymentPreimage] ContentiousClaimable paymentPreimage + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContentiousClaimable channelId. + * @member {string} channelId + * @memberof types.ContentiousClaimable + * @instance + */ + ContentiousClaimable.prototype.channelId = ""; + + /** + * ContentiousClaimable counterpartyNodeId. + * @member {string} counterpartyNodeId + * @memberof types.ContentiousClaimable + * @instance + */ + ContentiousClaimable.prototype.counterpartyNodeId = ""; + + /** + * ContentiousClaimable amountSatoshis. + * @member {number|Long} amountSatoshis + * @memberof types.ContentiousClaimable + * @instance + */ + ContentiousClaimable.prototype.amountSatoshis = 0; + + /** + * ContentiousClaimable timeoutHeight. + * @member {number} timeoutHeight + * @memberof types.ContentiousClaimable + * @instance + */ + ContentiousClaimable.prototype.timeoutHeight = 0; + + /** + * ContentiousClaimable paymentHash. + * @member {string} paymentHash + * @memberof types.ContentiousClaimable + * @instance + */ + ContentiousClaimable.prototype.paymentHash = ""; + + /** + * ContentiousClaimable paymentPreimage. + * @member {string} paymentPreimage + * @memberof types.ContentiousClaimable + * @instance + */ + ContentiousClaimable.prototype.paymentPreimage = ""; + + /** + * 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.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channelId); + if (message.counterpartyNodeId != null && Object.hasOwnProperty.call(message, "counterpartyNodeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterpartyNodeId); + if (message.amountSatoshis != null && Object.hasOwnProperty.call(message, "amountSatoshis")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.amountSatoshis); + if (message.timeoutHeight != null && Object.hasOwnProperty.call(message, "timeoutHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.timeoutHeight); + if (message.paymentHash != null && Object.hasOwnProperty.call(message, "paymentHash")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.paymentHash); + if (message.paymentPreimage != null && Object.hasOwnProperty.call(message, "paymentPreimage")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.paymentPreimage); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.ContentiousClaimable(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.counterpartyNodeId = reader.string(); + break; + case 3: + message.amountSatoshis = reader.uint64(); + break; + case 4: + message.timeoutHeight = reader.uint32(); + break; + case 5: + message.paymentHash = reader.string(); + break; + case 6: + message.paymentPreimage = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + if (!$util.isString(message.counterpartyNodeId)) + return "counterpartyNodeId: string expected"; + if (message.amountSatoshis != null && message.hasOwnProperty("amountSatoshis")) + if (!$util.isInteger(message.amountSatoshis) && !(message.amountSatoshis && $util.isInteger(message.amountSatoshis.low) && $util.isInteger(message.amountSatoshis.high))) + return "amountSatoshis: integer|Long expected"; + if (message.timeoutHeight != null && message.hasOwnProperty("timeoutHeight")) + if (!$util.isInteger(message.timeoutHeight)) + return "timeoutHeight: integer expected"; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) + if (!$util.isString(message.paymentHash)) + return "paymentHash: string expected"; + if (message.paymentPreimage != null && message.hasOwnProperty("paymentPreimage")) + if (!$util.isString(message.paymentPreimage)) + return "paymentPreimage: 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) { + if (object instanceof $root.types.ContentiousClaimable) + return object; + var message = new $root.types.ContentiousClaimable(); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.counterpartyNodeId != null) + message.counterpartyNodeId = String(object.counterpartyNodeId); + if (object.amountSatoshis != null) + if ($util.Long) + (message.amountSatoshis = $util.Long.fromValue(object.amountSatoshis)).unsigned = true; + else if (typeof object.amountSatoshis === "string") + message.amountSatoshis = parseInt(object.amountSatoshis, 10); + else if (typeof object.amountSatoshis === "number") + message.amountSatoshis = object.amountSatoshis; + else if (typeof object.amountSatoshis === "object") + message.amountSatoshis = new $util.LongBits(object.amountSatoshis.low >>> 0, object.amountSatoshis.high >>> 0).toNumber(true); + if (object.timeoutHeight != null) + message.timeoutHeight = object.timeoutHeight >>> 0; + if (object.paymentHash != null) + message.paymentHash = String(object.paymentHash); + if (object.paymentPreimage != null) + message.paymentPreimage = String(object.paymentPreimage); + 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 = {}; + var object = {}; + if (options.defaults) { + object.channelId = ""; + object.counterpartyNodeId = ""; + object.amountSatoshis = 0; + object.timeoutHeight = 0; + object.paymentHash = ""; + object.paymentPreimage = ""; + } + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + object.counterpartyNodeId = message.counterpartyNodeId; + if (message.amountSatoshis != null && message.hasOwnProperty("amountSatoshis")) + if (typeof message.amountSatoshis === "number") + object.amountSatoshis = options.longs === String ? String(message.amountSatoshis) : message.amountSatoshis; + else + object.amountSatoshis = options.longs === String ? $util.Long.prototype.toString.call(message.amountSatoshis) : options.longs === Number ? new $util.LongBits(message.amountSatoshis.low >>> 0, message.amountSatoshis.high >>> 0).toNumber(true) : message.amountSatoshis; + if (message.timeoutHeight != null && message.hasOwnProperty("timeoutHeight")) + object.timeoutHeight = message.timeoutHeight; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) + object.paymentHash = message.paymentHash; + if (message.paymentPreimage != null && message.hasOwnProperty("paymentPreimage")) + object.paymentPreimage = message.paymentPreimage; + 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); + }; + + return ContentiousClaimable; + })(); + + types.MaybeTimeoutClaimableHTLC = (function() { + + /** + * Properties of a MaybeTimeoutClaimableHTLC. + * @memberof types + * @interface IMaybeTimeoutClaimableHTLC + * @property {string|null} [channelId] MaybeTimeoutClaimableHTLC channelId + * @property {string|null} [counterpartyNodeId] MaybeTimeoutClaimableHTLC counterpartyNodeId + * @property {number|Long|null} [amountSatoshis] MaybeTimeoutClaimableHTLC amountSatoshis + * @property {number|null} [claimableHeight] MaybeTimeoutClaimableHTLC claimableHeight + * @property {string|null} [paymentHash] MaybeTimeoutClaimableHTLC paymentHash + * @property {boolean|null} [outboundPayment] MaybeTimeoutClaimableHTLC outboundPayment + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaybeTimeoutClaimableHTLC channelId. + * @member {string} channelId + * @memberof types.MaybeTimeoutClaimableHTLC + * @instance + */ + MaybeTimeoutClaimableHTLC.prototype.channelId = ""; + + /** + * MaybeTimeoutClaimableHTLC counterpartyNodeId. + * @member {string} counterpartyNodeId + * @memberof types.MaybeTimeoutClaimableHTLC + * @instance + */ + MaybeTimeoutClaimableHTLC.prototype.counterpartyNodeId = ""; + + /** + * MaybeTimeoutClaimableHTLC amountSatoshis. + * @member {number|Long} amountSatoshis + * @memberof types.MaybeTimeoutClaimableHTLC + * @instance + */ + MaybeTimeoutClaimableHTLC.prototype.amountSatoshis = 0; + + /** + * MaybeTimeoutClaimableHTLC claimableHeight. + * @member {number} claimableHeight + * @memberof types.MaybeTimeoutClaimableHTLC + * @instance + */ + MaybeTimeoutClaimableHTLC.prototype.claimableHeight = 0; + + /** + * MaybeTimeoutClaimableHTLC paymentHash. + * @member {string} paymentHash + * @memberof types.MaybeTimeoutClaimableHTLC + * @instance + */ + MaybeTimeoutClaimableHTLC.prototype.paymentHash = ""; + + /** + * MaybeTimeoutClaimableHTLC outboundPayment. + * @member {boolean} outboundPayment + * @memberof types.MaybeTimeoutClaimableHTLC + * @instance + */ + MaybeTimeoutClaimableHTLC.prototype.outboundPayment = 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.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channelId); + if (message.counterpartyNodeId != null && Object.hasOwnProperty.call(message, "counterpartyNodeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterpartyNodeId); + if (message.amountSatoshis != null && Object.hasOwnProperty.call(message, "amountSatoshis")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.amountSatoshis); + if (message.claimableHeight != null && Object.hasOwnProperty.call(message, "claimableHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.claimableHeight); + if (message.paymentHash != null && Object.hasOwnProperty.call(message, "paymentHash")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.paymentHash); + if (message.outboundPayment != null && Object.hasOwnProperty.call(message, "outboundPayment")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.outboundPayment); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.MaybeTimeoutClaimableHTLC(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.counterpartyNodeId = reader.string(); + break; + case 3: + message.amountSatoshis = reader.uint64(); + break; + case 4: + message.claimableHeight = reader.uint32(); + break; + case 5: + message.paymentHash = reader.string(); + break; + case 6: + message.outboundPayment = reader.bool(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + if (!$util.isString(message.counterpartyNodeId)) + return "counterpartyNodeId: string expected"; + if (message.amountSatoshis != null && message.hasOwnProperty("amountSatoshis")) + if (!$util.isInteger(message.amountSatoshis) && !(message.amountSatoshis && $util.isInteger(message.amountSatoshis.low) && $util.isInteger(message.amountSatoshis.high))) + return "amountSatoshis: integer|Long expected"; + if (message.claimableHeight != null && message.hasOwnProperty("claimableHeight")) + if (!$util.isInteger(message.claimableHeight)) + return "claimableHeight: integer expected"; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) + if (!$util.isString(message.paymentHash)) + return "paymentHash: string expected"; + if (message.outboundPayment != null && message.hasOwnProperty("outboundPayment")) + if (typeof message.outboundPayment !== "boolean") + return "outboundPayment: 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) { + if (object instanceof $root.types.MaybeTimeoutClaimableHTLC) + return object; + var message = new $root.types.MaybeTimeoutClaimableHTLC(); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.counterpartyNodeId != null) + message.counterpartyNodeId = String(object.counterpartyNodeId); + if (object.amountSatoshis != null) + if ($util.Long) + (message.amountSatoshis = $util.Long.fromValue(object.amountSatoshis)).unsigned = true; + else if (typeof object.amountSatoshis === "string") + message.amountSatoshis = parseInt(object.amountSatoshis, 10); + else if (typeof object.amountSatoshis === "number") + message.amountSatoshis = object.amountSatoshis; + else if (typeof object.amountSatoshis === "object") + message.amountSatoshis = new $util.LongBits(object.amountSatoshis.low >>> 0, object.amountSatoshis.high >>> 0).toNumber(true); + if (object.claimableHeight != null) + message.claimableHeight = object.claimableHeight >>> 0; + if (object.paymentHash != null) + message.paymentHash = String(object.paymentHash); + if (object.outboundPayment != null) + message.outboundPayment = Boolean(object.outboundPayment); + 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 = {}; + var object = {}; + if (options.defaults) { + object.channelId = ""; + object.counterpartyNodeId = ""; + object.amountSatoshis = 0; + object.claimableHeight = 0; + object.paymentHash = ""; + object.outboundPayment = false; + } + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + object.counterpartyNodeId = message.counterpartyNodeId; + if (message.amountSatoshis != null && message.hasOwnProperty("amountSatoshis")) + if (typeof message.amountSatoshis === "number") + object.amountSatoshis = options.longs === String ? String(message.amountSatoshis) : message.amountSatoshis; + else + object.amountSatoshis = options.longs === String ? $util.Long.prototype.toString.call(message.amountSatoshis) : options.longs === Number ? new $util.LongBits(message.amountSatoshis.low >>> 0, message.amountSatoshis.high >>> 0).toNumber(true) : message.amountSatoshis; + if (message.claimableHeight != null && message.hasOwnProperty("claimableHeight")) + object.claimableHeight = message.claimableHeight; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) + object.paymentHash = message.paymentHash; + if (message.outboundPayment != null && message.hasOwnProperty("outboundPayment")) + object.outboundPayment = message.outboundPayment; + 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); + }; + + return MaybeTimeoutClaimableHTLC; + })(); + + types.MaybePreimageClaimableHTLC = (function() { + + /** + * Properties of a MaybePreimageClaimableHTLC. + * @memberof types + * @interface IMaybePreimageClaimableHTLC + * @property {string|null} [channelId] MaybePreimageClaimableHTLC channelId + * @property {string|null} [counterpartyNodeId] MaybePreimageClaimableHTLC counterpartyNodeId + * @property {number|Long|null} [amountSatoshis] MaybePreimageClaimableHTLC amountSatoshis + * @property {number|null} [expiryHeight] MaybePreimageClaimableHTLC expiryHeight + * @property {string|null} [paymentHash] MaybePreimageClaimableHTLC paymentHash + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MaybePreimageClaimableHTLC channelId. + * @member {string} channelId + * @memberof types.MaybePreimageClaimableHTLC + * @instance + */ + MaybePreimageClaimableHTLC.prototype.channelId = ""; + + /** + * MaybePreimageClaimableHTLC counterpartyNodeId. + * @member {string} counterpartyNodeId + * @memberof types.MaybePreimageClaimableHTLC + * @instance + */ + MaybePreimageClaimableHTLC.prototype.counterpartyNodeId = ""; + + /** + * MaybePreimageClaimableHTLC amountSatoshis. + * @member {number|Long} amountSatoshis + * @memberof types.MaybePreimageClaimableHTLC + * @instance + */ + MaybePreimageClaimableHTLC.prototype.amountSatoshis = 0; + + /** + * MaybePreimageClaimableHTLC expiryHeight. + * @member {number} expiryHeight + * @memberof types.MaybePreimageClaimableHTLC + * @instance + */ + MaybePreimageClaimableHTLC.prototype.expiryHeight = 0; + + /** + * MaybePreimageClaimableHTLC paymentHash. + * @member {string} paymentHash + * @memberof types.MaybePreimageClaimableHTLC + * @instance + */ + MaybePreimageClaimableHTLC.prototype.paymentHash = ""; + + /** + * 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.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channelId); + if (message.counterpartyNodeId != null && Object.hasOwnProperty.call(message, "counterpartyNodeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterpartyNodeId); + if (message.amountSatoshis != null && Object.hasOwnProperty.call(message, "amountSatoshis")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.amountSatoshis); + if (message.expiryHeight != null && Object.hasOwnProperty.call(message, "expiryHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.expiryHeight); + if (message.paymentHash != null && Object.hasOwnProperty.call(message, "paymentHash")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.paymentHash); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.MaybePreimageClaimableHTLC(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.counterpartyNodeId = reader.string(); + break; + case 3: + message.amountSatoshis = reader.uint64(); + break; + case 4: + message.expiryHeight = reader.uint32(); + break; + case 5: + message.paymentHash = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + if (!$util.isString(message.counterpartyNodeId)) + return "counterpartyNodeId: string expected"; + if (message.amountSatoshis != null && message.hasOwnProperty("amountSatoshis")) + if (!$util.isInteger(message.amountSatoshis) && !(message.amountSatoshis && $util.isInteger(message.amountSatoshis.low) && $util.isInteger(message.amountSatoshis.high))) + return "amountSatoshis: integer|Long expected"; + if (message.expiryHeight != null && message.hasOwnProperty("expiryHeight")) + if (!$util.isInteger(message.expiryHeight)) + return "expiryHeight: integer expected"; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) + if (!$util.isString(message.paymentHash)) + return "paymentHash: 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) { + if (object instanceof $root.types.MaybePreimageClaimableHTLC) + return object; + var message = new $root.types.MaybePreimageClaimableHTLC(); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.counterpartyNodeId != null) + message.counterpartyNodeId = String(object.counterpartyNodeId); + if (object.amountSatoshis != null) + if ($util.Long) + (message.amountSatoshis = $util.Long.fromValue(object.amountSatoshis)).unsigned = true; + else if (typeof object.amountSatoshis === "string") + message.amountSatoshis = parseInt(object.amountSatoshis, 10); + else if (typeof object.amountSatoshis === "number") + message.amountSatoshis = object.amountSatoshis; + else if (typeof object.amountSatoshis === "object") + message.amountSatoshis = new $util.LongBits(object.amountSatoshis.low >>> 0, object.amountSatoshis.high >>> 0).toNumber(true); + if (object.expiryHeight != null) + message.expiryHeight = object.expiryHeight >>> 0; + if (object.paymentHash != null) + message.paymentHash = String(object.paymentHash); + 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 = {}; + var object = {}; + if (options.defaults) { + object.channelId = ""; + object.counterpartyNodeId = ""; + object.amountSatoshis = 0; + object.expiryHeight = 0; + object.paymentHash = ""; + } + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + object.counterpartyNodeId = message.counterpartyNodeId; + if (message.amountSatoshis != null && message.hasOwnProperty("amountSatoshis")) + if (typeof message.amountSatoshis === "number") + object.amountSatoshis = options.longs === String ? String(message.amountSatoshis) : message.amountSatoshis; + else + object.amountSatoshis = options.longs === String ? $util.Long.prototype.toString.call(message.amountSatoshis) : options.longs === Number ? new $util.LongBits(message.amountSatoshis.low >>> 0, message.amountSatoshis.high >>> 0).toNumber(true) : message.amountSatoshis; + if (message.expiryHeight != null && message.hasOwnProperty("expiryHeight")) + object.expiryHeight = message.expiryHeight; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) + object.paymentHash = message.paymentHash; + 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); + }; + + return MaybePreimageClaimableHTLC; + })(); + + types.CounterpartyRevokedOutputClaimable = (function() { + + /** + * Properties of a CounterpartyRevokedOutputClaimable. + * @memberof types + * @interface ICounterpartyRevokedOutputClaimable + * @property {string|null} [channelId] CounterpartyRevokedOutputClaimable channelId + * @property {string|null} [counterpartyNodeId] CounterpartyRevokedOutputClaimable counterpartyNodeId + * @property {number|Long|null} [amountSatoshis] CounterpartyRevokedOutputClaimable amountSatoshis + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CounterpartyRevokedOutputClaimable channelId. + * @member {string} channelId + * @memberof types.CounterpartyRevokedOutputClaimable + * @instance + */ + CounterpartyRevokedOutputClaimable.prototype.channelId = ""; + + /** + * CounterpartyRevokedOutputClaimable counterpartyNodeId. + * @member {string} counterpartyNodeId + * @memberof types.CounterpartyRevokedOutputClaimable + * @instance + */ + CounterpartyRevokedOutputClaimable.prototype.counterpartyNodeId = ""; + + /** + * CounterpartyRevokedOutputClaimable amountSatoshis. + * @member {number|Long} amountSatoshis + * @memberof types.CounterpartyRevokedOutputClaimable + * @instance + */ + CounterpartyRevokedOutputClaimable.prototype.amountSatoshis = 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.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channelId); + if (message.counterpartyNodeId != null && Object.hasOwnProperty.call(message, "counterpartyNodeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.counterpartyNodeId); + if (message.amountSatoshis != null && Object.hasOwnProperty.call(message, "amountSatoshis")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.amountSatoshis); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.CounterpartyRevokedOutputClaimable(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.counterpartyNodeId = reader.string(); + break; + case 3: + message.amountSatoshis = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + if (!$util.isString(message.counterpartyNodeId)) + return "counterpartyNodeId: string expected"; + if (message.amountSatoshis != null && message.hasOwnProperty("amountSatoshis")) + if (!$util.isInteger(message.amountSatoshis) && !(message.amountSatoshis && $util.isInteger(message.amountSatoshis.low) && $util.isInteger(message.amountSatoshis.high))) + return "amountSatoshis: 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) { + if (object instanceof $root.types.CounterpartyRevokedOutputClaimable) + return object; + var message = new $root.types.CounterpartyRevokedOutputClaimable(); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.counterpartyNodeId != null) + message.counterpartyNodeId = String(object.counterpartyNodeId); + if (object.amountSatoshis != null) + if ($util.Long) + (message.amountSatoshis = $util.Long.fromValue(object.amountSatoshis)).unsigned = true; + else if (typeof object.amountSatoshis === "string") + message.amountSatoshis = parseInt(object.amountSatoshis, 10); + else if (typeof object.amountSatoshis === "number") + message.amountSatoshis = object.amountSatoshis; + else if (typeof object.amountSatoshis === "object") + message.amountSatoshis = new $util.LongBits(object.amountSatoshis.low >>> 0, object.amountSatoshis.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 = {}; + var object = {}; + if (options.defaults) { + object.channelId = ""; + object.counterpartyNodeId = ""; + object.amountSatoshis = 0; + } + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + object.counterpartyNodeId = message.counterpartyNodeId; + if (message.amountSatoshis != null && message.hasOwnProperty("amountSatoshis")) + if (typeof message.amountSatoshis === "number") + object.amountSatoshis = options.longs === String ? String(message.amountSatoshis) : message.amountSatoshis; + else + object.amountSatoshis = options.longs === String ? $util.Long.prototype.toString.call(message.amountSatoshis) : options.longs === Number ? new $util.LongBits(message.amountSatoshis.low >>> 0, message.amountSatoshis.high >>> 0).toNumber(true) : message.amountSatoshis; + 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); + }; + + return CounterpartyRevokedOutputClaimable; + })(); + + types.PendingSweepBalance = (function() { + + /** + * Properties of a PendingSweepBalance. + * @memberof types + * @interface IPendingSweepBalance + * @property {types.IPendingBroadcast|null} [pendingBroadcast] PendingSweepBalance pendingBroadcast + * @property {types.IBroadcastAwaitingConfirmation|null} [broadcastAwaitingConfirmation] PendingSweepBalance broadcastAwaitingConfirmation + * @property {types.IAwaitingThresholdConfirmations|null} [awaitingThresholdConfirmations] PendingSweepBalance awaitingThresholdConfirmations + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PendingSweepBalance pendingBroadcast. + * @member {types.IPendingBroadcast|null|undefined} pendingBroadcast + * @memberof types.PendingSweepBalance + * @instance + */ + PendingSweepBalance.prototype.pendingBroadcast = null; + + /** + * PendingSweepBalance broadcastAwaitingConfirmation. + * @member {types.IBroadcastAwaitingConfirmation|null|undefined} broadcastAwaitingConfirmation + * @memberof types.PendingSweepBalance + * @instance + */ + PendingSweepBalance.prototype.broadcastAwaitingConfirmation = null; + + /** + * PendingSweepBalance awaitingThresholdConfirmations. + * @member {types.IAwaitingThresholdConfirmations|null|undefined} awaitingThresholdConfirmations + * @memberof types.PendingSweepBalance + * @instance + */ + PendingSweepBalance.prototype.awaitingThresholdConfirmations = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PendingSweepBalance balanceType. + * @member {"pendingBroadcast"|"broadcastAwaitingConfirmation"|"awaitingThresholdConfirmations"|undefined} balanceType + * @memberof types.PendingSweepBalance + * @instance + */ + Object.defineProperty(PendingSweepBalance.prototype, "balanceType", { + get: $util.oneOfGetter($oneOfFields = ["pendingBroadcast", "broadcastAwaitingConfirmation", "awaitingThresholdConfirmations"]), + 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.pendingBroadcast != null && Object.hasOwnProperty.call(message, "pendingBroadcast")) + $root.types.PendingBroadcast.encode(message.pendingBroadcast, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.broadcastAwaitingConfirmation != null && Object.hasOwnProperty.call(message, "broadcastAwaitingConfirmation")) + $root.types.BroadcastAwaitingConfirmation.encode(message.broadcastAwaitingConfirmation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.awaitingThresholdConfirmations != null && Object.hasOwnProperty.call(message, "awaitingThresholdConfirmations")) + $root.types.AwaitingThresholdConfirmations.encode(message.awaitingThresholdConfirmations, 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.PendingSweepBalance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pendingBroadcast = $root.types.PendingBroadcast.decode(reader, reader.uint32()); + break; + case 2: + message.broadcastAwaitingConfirmation = $root.types.BroadcastAwaitingConfirmation.decode(reader, reader.uint32()); + break; + case 3: + message.awaitingThresholdConfirmations = $root.types.AwaitingThresholdConfirmations.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.pendingBroadcast != null && message.hasOwnProperty("pendingBroadcast")) { + properties.balanceType = 1; + { + var error = $root.types.PendingBroadcast.verify(message.pendingBroadcast); + if (error) + return "pendingBroadcast." + error; + } + } + if (message.broadcastAwaitingConfirmation != null && message.hasOwnProperty("broadcastAwaitingConfirmation")) { + if (properties.balanceType === 1) + return "balanceType: multiple values"; + properties.balanceType = 1; + { + var error = $root.types.BroadcastAwaitingConfirmation.verify(message.broadcastAwaitingConfirmation); + if (error) + return "broadcastAwaitingConfirmation." + error; + } + } + if (message.awaitingThresholdConfirmations != null && message.hasOwnProperty("awaitingThresholdConfirmations")) { + if (properties.balanceType === 1) + return "balanceType: multiple values"; + properties.balanceType = 1; + { + var error = $root.types.AwaitingThresholdConfirmations.verify(message.awaitingThresholdConfirmations); + if (error) + return "awaitingThresholdConfirmations." + 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) { + if (object instanceof $root.types.PendingSweepBalance) + return object; + var message = new $root.types.PendingSweepBalance(); + if (object.pendingBroadcast != null) { + if (typeof object.pendingBroadcast !== "object") + throw TypeError(".types.PendingSweepBalance.pendingBroadcast: object expected"); + message.pendingBroadcast = $root.types.PendingBroadcast.fromObject(object.pendingBroadcast); + } + if (object.broadcastAwaitingConfirmation != null) { + if (typeof object.broadcastAwaitingConfirmation !== "object") + throw TypeError(".types.PendingSweepBalance.broadcastAwaitingConfirmation: object expected"); + message.broadcastAwaitingConfirmation = $root.types.BroadcastAwaitingConfirmation.fromObject(object.broadcastAwaitingConfirmation); + } + if (object.awaitingThresholdConfirmations != null) { + if (typeof object.awaitingThresholdConfirmations !== "object") + throw TypeError(".types.PendingSweepBalance.awaitingThresholdConfirmations: object expected"); + message.awaitingThresholdConfirmations = $root.types.AwaitingThresholdConfirmations.fromObject(object.awaitingThresholdConfirmations); + } + 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 = {}; + var object = {}; + if (message.pendingBroadcast != null && message.hasOwnProperty("pendingBroadcast")) { + object.pendingBroadcast = $root.types.PendingBroadcast.toObject(message.pendingBroadcast, options); + if (options.oneofs) + object.balanceType = "pendingBroadcast"; + } + if (message.broadcastAwaitingConfirmation != null && message.hasOwnProperty("broadcastAwaitingConfirmation")) { + object.broadcastAwaitingConfirmation = $root.types.BroadcastAwaitingConfirmation.toObject(message.broadcastAwaitingConfirmation, options); + if (options.oneofs) + object.balanceType = "broadcastAwaitingConfirmation"; + } + if (message.awaitingThresholdConfirmations != null && message.hasOwnProperty("awaitingThresholdConfirmations")) { + object.awaitingThresholdConfirmations = $root.types.AwaitingThresholdConfirmations.toObject(message.awaitingThresholdConfirmations, options); + if (options.oneofs) + object.balanceType = "awaitingThresholdConfirmations"; + } + 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); + }; + + return PendingSweepBalance; + })(); + + types.PendingBroadcast = (function() { + + /** + * Properties of a PendingBroadcast. + * @memberof types + * @interface IPendingBroadcast + * @property {string|null} [channelId] PendingBroadcast channelId + * @property {number|Long|null} [amountSatoshis] PendingBroadcast amountSatoshis + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PendingBroadcast channelId. + * @member {string} channelId + * @memberof types.PendingBroadcast + * @instance + */ + PendingBroadcast.prototype.channelId = ""; + + /** + * PendingBroadcast amountSatoshis. + * @member {number|Long} amountSatoshis + * @memberof types.PendingBroadcast + * @instance + */ + PendingBroadcast.prototype.amountSatoshis = 0; + + /** + * 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.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channelId); + if (message.amountSatoshis != null && Object.hasOwnProperty.call(message, "amountSatoshis")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amountSatoshis); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.PendingBroadcast(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.amountSatoshis = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.amountSatoshis != null && message.hasOwnProperty("amountSatoshis")) + if (!$util.isInteger(message.amountSatoshis) && !(message.amountSatoshis && $util.isInteger(message.amountSatoshis.low) && $util.isInteger(message.amountSatoshis.high))) + return "amountSatoshis: 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) { + if (object instanceof $root.types.PendingBroadcast) + return object; + var message = new $root.types.PendingBroadcast(); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.amountSatoshis != null) + if ($util.Long) + (message.amountSatoshis = $util.Long.fromValue(object.amountSatoshis)).unsigned = true; + else if (typeof object.amountSatoshis === "string") + message.amountSatoshis = parseInt(object.amountSatoshis, 10); + else if (typeof object.amountSatoshis === "number") + message.amountSatoshis = object.amountSatoshis; + else if (typeof object.amountSatoshis === "object") + message.amountSatoshis = new $util.LongBits(object.amountSatoshis.low >>> 0, object.amountSatoshis.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 = {}; + var object = {}; + if (options.defaults) { + object.channelId = ""; + object.amountSatoshis = 0; + } + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.amountSatoshis != null && message.hasOwnProperty("amountSatoshis")) + if (typeof message.amountSatoshis === "number") + object.amountSatoshis = options.longs === String ? String(message.amountSatoshis) : message.amountSatoshis; + else + object.amountSatoshis = options.longs === String ? $util.Long.prototype.toString.call(message.amountSatoshis) : options.longs === Number ? new $util.LongBits(message.amountSatoshis.low >>> 0, message.amountSatoshis.high >>> 0).toNumber(true) : message.amountSatoshis; + 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); + }; + + return PendingBroadcast; + })(); + + types.BroadcastAwaitingConfirmation = (function() { + + /** + * Properties of a BroadcastAwaitingConfirmation. + * @memberof types + * @interface IBroadcastAwaitingConfirmation + * @property {string|null} [channelId] BroadcastAwaitingConfirmation channelId + * @property {number|null} [latestBroadcastHeight] BroadcastAwaitingConfirmation latestBroadcastHeight + * @property {string|null} [latestSpendingTxid] BroadcastAwaitingConfirmation latestSpendingTxid + * @property {number|Long|null} [amountSatoshis] BroadcastAwaitingConfirmation amountSatoshis + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BroadcastAwaitingConfirmation channelId. + * @member {string} channelId + * @memberof types.BroadcastAwaitingConfirmation + * @instance + */ + BroadcastAwaitingConfirmation.prototype.channelId = ""; + + /** + * BroadcastAwaitingConfirmation latestBroadcastHeight. + * @member {number} latestBroadcastHeight + * @memberof types.BroadcastAwaitingConfirmation + * @instance + */ + BroadcastAwaitingConfirmation.prototype.latestBroadcastHeight = 0; + + /** + * BroadcastAwaitingConfirmation latestSpendingTxid. + * @member {string} latestSpendingTxid + * @memberof types.BroadcastAwaitingConfirmation + * @instance + */ + BroadcastAwaitingConfirmation.prototype.latestSpendingTxid = ""; + + /** + * BroadcastAwaitingConfirmation amountSatoshis. + * @member {number|Long} amountSatoshis + * @memberof types.BroadcastAwaitingConfirmation + * @instance + */ + BroadcastAwaitingConfirmation.prototype.amountSatoshis = 0; + + /** + * 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.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channelId); + if (message.latestBroadcastHeight != null && Object.hasOwnProperty.call(message, "latestBroadcastHeight")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.latestBroadcastHeight); + if (message.latestSpendingTxid != null && Object.hasOwnProperty.call(message, "latestSpendingTxid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.latestSpendingTxid); + if (message.amountSatoshis != null && Object.hasOwnProperty.call(message, "amountSatoshis")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.amountSatoshis); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.BroadcastAwaitingConfirmation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.latestBroadcastHeight = reader.uint32(); + break; + case 3: + message.latestSpendingTxid = reader.string(); + break; + case 4: + message.amountSatoshis = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.latestBroadcastHeight != null && message.hasOwnProperty("latestBroadcastHeight")) + if (!$util.isInteger(message.latestBroadcastHeight)) + return "latestBroadcastHeight: integer expected"; + if (message.latestSpendingTxid != null && message.hasOwnProperty("latestSpendingTxid")) + if (!$util.isString(message.latestSpendingTxid)) + return "latestSpendingTxid: string expected"; + if (message.amountSatoshis != null && message.hasOwnProperty("amountSatoshis")) + if (!$util.isInteger(message.amountSatoshis) && !(message.amountSatoshis && $util.isInteger(message.amountSatoshis.low) && $util.isInteger(message.amountSatoshis.high))) + return "amountSatoshis: 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) { + if (object instanceof $root.types.BroadcastAwaitingConfirmation) + return object; + var message = new $root.types.BroadcastAwaitingConfirmation(); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.latestBroadcastHeight != null) + message.latestBroadcastHeight = object.latestBroadcastHeight >>> 0; + if (object.latestSpendingTxid != null) + message.latestSpendingTxid = String(object.latestSpendingTxid); + if (object.amountSatoshis != null) + if ($util.Long) + (message.amountSatoshis = $util.Long.fromValue(object.amountSatoshis)).unsigned = true; + else if (typeof object.amountSatoshis === "string") + message.amountSatoshis = parseInt(object.amountSatoshis, 10); + else if (typeof object.amountSatoshis === "number") + message.amountSatoshis = object.amountSatoshis; + else if (typeof object.amountSatoshis === "object") + message.amountSatoshis = new $util.LongBits(object.amountSatoshis.low >>> 0, object.amountSatoshis.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 = {}; + var object = {}; + if (options.defaults) { + object.channelId = ""; + object.latestBroadcastHeight = 0; + object.latestSpendingTxid = ""; + object.amountSatoshis = 0; + } + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.latestBroadcastHeight != null && message.hasOwnProperty("latestBroadcastHeight")) + object.latestBroadcastHeight = message.latestBroadcastHeight; + if (message.latestSpendingTxid != null && message.hasOwnProperty("latestSpendingTxid")) + object.latestSpendingTxid = message.latestSpendingTxid; + if (message.amountSatoshis != null && message.hasOwnProperty("amountSatoshis")) + if (typeof message.amountSatoshis === "number") + object.amountSatoshis = options.longs === String ? String(message.amountSatoshis) : message.amountSatoshis; + else + object.amountSatoshis = options.longs === String ? $util.Long.prototype.toString.call(message.amountSatoshis) : options.longs === Number ? new $util.LongBits(message.amountSatoshis.low >>> 0, message.amountSatoshis.high >>> 0).toNumber(true) : message.amountSatoshis; + 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); + }; + + return BroadcastAwaitingConfirmation; + })(); + + types.AwaitingThresholdConfirmations = (function() { + + /** + * Properties of an AwaitingThresholdConfirmations. + * @memberof types + * @interface IAwaitingThresholdConfirmations + * @property {string|null} [channelId] AwaitingThresholdConfirmations channelId + * @property {string|null} [latestSpendingTxid] AwaitingThresholdConfirmations latestSpendingTxid + * @property {string|null} [confirmationHash] AwaitingThresholdConfirmations confirmationHash + * @property {number|null} [confirmationHeight] AwaitingThresholdConfirmations confirmationHeight + * @property {number|Long|null} [amountSatoshis] AwaitingThresholdConfirmations amountSatoshis + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AwaitingThresholdConfirmations channelId. + * @member {string} channelId + * @memberof types.AwaitingThresholdConfirmations + * @instance + */ + AwaitingThresholdConfirmations.prototype.channelId = ""; + + /** + * AwaitingThresholdConfirmations latestSpendingTxid. + * @member {string} latestSpendingTxid + * @memberof types.AwaitingThresholdConfirmations + * @instance + */ + AwaitingThresholdConfirmations.prototype.latestSpendingTxid = ""; + + /** + * AwaitingThresholdConfirmations confirmationHash. + * @member {string} confirmationHash + * @memberof types.AwaitingThresholdConfirmations + * @instance + */ + AwaitingThresholdConfirmations.prototype.confirmationHash = ""; + + /** + * AwaitingThresholdConfirmations confirmationHeight. + * @member {number} confirmationHeight + * @memberof types.AwaitingThresholdConfirmations + * @instance + */ + AwaitingThresholdConfirmations.prototype.confirmationHeight = 0; + + /** + * AwaitingThresholdConfirmations amountSatoshis. + * @member {number|Long} amountSatoshis + * @memberof types.AwaitingThresholdConfirmations + * @instance + */ + AwaitingThresholdConfirmations.prototype.amountSatoshis = 0; + + /** + * 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.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channelId); + if (message.latestSpendingTxid != null && Object.hasOwnProperty.call(message, "latestSpendingTxid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.latestSpendingTxid); + if (message.confirmationHash != null && Object.hasOwnProperty.call(message, "confirmationHash")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.confirmationHash); + if (message.confirmationHeight != null && Object.hasOwnProperty.call(message, "confirmationHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.confirmationHeight); + if (message.amountSatoshis != null && Object.hasOwnProperty.call(message, "amountSatoshis")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.amountSatoshis); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.AwaitingThresholdConfirmations(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.latestSpendingTxid = reader.string(); + break; + case 3: + message.confirmationHash = reader.string(); + break; + case 4: + message.confirmationHeight = reader.uint32(); + break; + case 5: + message.amountSatoshis = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.latestSpendingTxid != null && message.hasOwnProperty("latestSpendingTxid")) + if (!$util.isString(message.latestSpendingTxid)) + return "latestSpendingTxid: string expected"; + if (message.confirmationHash != null && message.hasOwnProperty("confirmationHash")) + if (!$util.isString(message.confirmationHash)) + return "confirmationHash: string expected"; + if (message.confirmationHeight != null && message.hasOwnProperty("confirmationHeight")) + if (!$util.isInteger(message.confirmationHeight)) + return "confirmationHeight: integer expected"; + if (message.amountSatoshis != null && message.hasOwnProperty("amountSatoshis")) + if (!$util.isInteger(message.amountSatoshis) && !(message.amountSatoshis && $util.isInteger(message.amountSatoshis.low) && $util.isInteger(message.amountSatoshis.high))) + return "amountSatoshis: 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) { + if (object instanceof $root.types.AwaitingThresholdConfirmations) + return object; + var message = new $root.types.AwaitingThresholdConfirmations(); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.latestSpendingTxid != null) + message.latestSpendingTxid = String(object.latestSpendingTxid); + if (object.confirmationHash != null) + message.confirmationHash = String(object.confirmationHash); + if (object.confirmationHeight != null) + message.confirmationHeight = object.confirmationHeight >>> 0; + if (object.amountSatoshis != null) + if ($util.Long) + (message.amountSatoshis = $util.Long.fromValue(object.amountSatoshis)).unsigned = true; + else if (typeof object.amountSatoshis === "string") + message.amountSatoshis = parseInt(object.amountSatoshis, 10); + else if (typeof object.amountSatoshis === "number") + message.amountSatoshis = object.amountSatoshis; + else if (typeof object.amountSatoshis === "object") + message.amountSatoshis = new $util.LongBits(object.amountSatoshis.low >>> 0, object.amountSatoshis.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 = {}; + var object = {}; + if (options.defaults) { + object.channelId = ""; + object.latestSpendingTxid = ""; + object.confirmationHash = ""; + object.confirmationHeight = 0; + object.amountSatoshis = 0; + } + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.latestSpendingTxid != null && message.hasOwnProperty("latestSpendingTxid")) + object.latestSpendingTxid = message.latestSpendingTxid; + if (message.confirmationHash != null && message.hasOwnProperty("confirmationHash")) + object.confirmationHash = message.confirmationHash; + if (message.confirmationHeight != null && message.hasOwnProperty("confirmationHeight")) + object.confirmationHeight = message.confirmationHeight; + if (message.amountSatoshis != null && message.hasOwnProperty("amountSatoshis")) + if (typeof message.amountSatoshis === "number") + object.amountSatoshis = options.longs === String ? String(message.amountSatoshis) : message.amountSatoshis; + else + object.amountSatoshis = options.longs === String ? $util.Long.prototype.toString.call(message.amountSatoshis) : options.longs === Number ? new $util.LongBits(message.amountSatoshis.low >>> 0, message.amountSatoshis.high >>> 0).toNumber(true) : message.amountSatoshis; + 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); + }; + + return AwaitingThresholdConfirmations; + })(); + + types.PageToken = (function() { + + /** + * Properties of a PageToken. + * @memberof types + * @interface IPageToken + * @property {string|null} [token] PageToken token + * @property {number|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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PageToken token. + * @member {string} token + * @memberof types.PageToken + * @instance + */ + PageToken.prototype.token = ""; + + /** + * PageToken index. + * @member {number|Long} index + * @memberof types.PageToken + * @instance + */ + PageToken.prototype.index = 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.PageToken(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.token = reader.string(); + break; + case 2: + message.index = reader.int64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.types.PageToken) + return object; + var 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 = {}; + var object = {}; + if (options.defaults) { + object.token = ""; + object.index = 0; + } + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + if (message.index != null && message.hasOwnProperty("index")) + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11InvoiceDescription direct. + * @member {string} direct + * @memberof types.Bolt11InvoiceDescription + * @instance + */ + Bolt11InvoiceDescription.prototype.direct = ""; + + /** + * Bolt11InvoiceDescription hash. + * @member {string} hash + * @memberof types.Bolt11InvoiceDescription + * @instance + */ + Bolt11InvoiceDescription.prototype.hash = ""; + + // OneOf field names bound to virtual getters and setters + var $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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Bolt11InvoiceDescription(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.direct = reader.string(); + break; + case 2: + message.hash = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + var 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) { + if (object instanceof $root.types.Bolt11InvoiceDescription) + return object; + var 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 = {}; + var 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); + }; + + return Bolt11InvoiceDescription; + })(); + + types.RouteParametersConfig = (function() { + + /** + * Properties of a RouteParametersConfig. + * @memberof types + * @interface IRouteParametersConfig + * @property {number|Long|null} [maxTotalRoutingFeeMsat] RouteParametersConfig maxTotalRoutingFeeMsat + * @property {number|null} [maxTotalCltvExpiryDelta] RouteParametersConfig maxTotalCltvExpiryDelta + * @property {number|null} [maxPathCount] RouteParametersConfig maxPathCount + * @property {number|null} [maxChannelSaturationPowerOfHalf] RouteParametersConfig maxChannelSaturationPowerOfHalf + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteParametersConfig maxTotalRoutingFeeMsat. + * @member {number|Long} maxTotalRoutingFeeMsat + * @memberof types.RouteParametersConfig + * @instance + */ + RouteParametersConfig.prototype.maxTotalRoutingFeeMsat = 0; + + /** + * RouteParametersConfig maxTotalCltvExpiryDelta. + * @member {number} maxTotalCltvExpiryDelta + * @memberof types.RouteParametersConfig + * @instance + */ + RouteParametersConfig.prototype.maxTotalCltvExpiryDelta = 0; + + /** + * RouteParametersConfig maxPathCount. + * @member {number} maxPathCount + * @memberof types.RouteParametersConfig + * @instance + */ + RouteParametersConfig.prototype.maxPathCount = 0; + + /** + * RouteParametersConfig maxChannelSaturationPowerOfHalf. + * @member {number} maxChannelSaturationPowerOfHalf + * @memberof types.RouteParametersConfig + * @instance + */ + RouteParametersConfig.prototype.maxChannelSaturationPowerOfHalf = 0; + + /** + * 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.maxTotalRoutingFeeMsat != null && Object.hasOwnProperty.call(message, "maxTotalRoutingFeeMsat")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.maxTotalRoutingFeeMsat); + if (message.maxTotalCltvExpiryDelta != null && Object.hasOwnProperty.call(message, "maxTotalCltvExpiryDelta")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.maxTotalCltvExpiryDelta); + if (message.maxPathCount != null && Object.hasOwnProperty.call(message, "maxPathCount")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.maxPathCount); + if (message.maxChannelSaturationPowerOfHalf != null && Object.hasOwnProperty.call(message, "maxChannelSaturationPowerOfHalf")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.maxChannelSaturationPowerOfHalf); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.RouteParametersConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxTotalRoutingFeeMsat = reader.uint64(); + break; + case 2: + message.maxTotalCltvExpiryDelta = reader.uint32(); + break; + case 3: + message.maxPathCount = reader.uint32(); + break; + case 4: + message.maxChannelSaturationPowerOfHalf = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxTotalRoutingFeeMsat != null && message.hasOwnProperty("maxTotalRoutingFeeMsat")) + if (!$util.isInteger(message.maxTotalRoutingFeeMsat) && !(message.maxTotalRoutingFeeMsat && $util.isInteger(message.maxTotalRoutingFeeMsat.low) && $util.isInteger(message.maxTotalRoutingFeeMsat.high))) + return "maxTotalRoutingFeeMsat: integer|Long expected"; + if (message.maxTotalCltvExpiryDelta != null && message.hasOwnProperty("maxTotalCltvExpiryDelta")) + if (!$util.isInteger(message.maxTotalCltvExpiryDelta)) + return "maxTotalCltvExpiryDelta: integer expected"; + if (message.maxPathCount != null && message.hasOwnProperty("maxPathCount")) + if (!$util.isInteger(message.maxPathCount)) + return "maxPathCount: integer expected"; + if (message.maxChannelSaturationPowerOfHalf != null && message.hasOwnProperty("maxChannelSaturationPowerOfHalf")) + if (!$util.isInteger(message.maxChannelSaturationPowerOfHalf)) + return "maxChannelSaturationPowerOfHalf: 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) { + if (object instanceof $root.types.RouteParametersConfig) + return object; + var message = new $root.types.RouteParametersConfig(); + if (object.maxTotalRoutingFeeMsat != null) + if ($util.Long) + (message.maxTotalRoutingFeeMsat = $util.Long.fromValue(object.maxTotalRoutingFeeMsat)).unsigned = true; + else if (typeof object.maxTotalRoutingFeeMsat === "string") + message.maxTotalRoutingFeeMsat = parseInt(object.maxTotalRoutingFeeMsat, 10); + else if (typeof object.maxTotalRoutingFeeMsat === "number") + message.maxTotalRoutingFeeMsat = object.maxTotalRoutingFeeMsat; + else if (typeof object.maxTotalRoutingFeeMsat === "object") + message.maxTotalRoutingFeeMsat = new $util.LongBits(object.maxTotalRoutingFeeMsat.low >>> 0, object.maxTotalRoutingFeeMsat.high >>> 0).toNumber(true); + if (object.maxTotalCltvExpiryDelta != null) + message.maxTotalCltvExpiryDelta = object.maxTotalCltvExpiryDelta >>> 0; + if (object.maxPathCount != null) + message.maxPathCount = object.maxPathCount >>> 0; + if (object.maxChannelSaturationPowerOfHalf != null) + message.maxChannelSaturationPowerOfHalf = object.maxChannelSaturationPowerOfHalf >>> 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 = {}; + var object = {}; + if (options.defaults) { + object.maxTotalRoutingFeeMsat = 0; + object.maxTotalCltvExpiryDelta = 0; + object.maxPathCount = 0; + object.maxChannelSaturationPowerOfHalf = 0; + } + if (message.maxTotalRoutingFeeMsat != null && message.hasOwnProperty("maxTotalRoutingFeeMsat")) + if (typeof message.maxTotalRoutingFeeMsat === "number") + object.maxTotalRoutingFeeMsat = options.longs === String ? String(message.maxTotalRoutingFeeMsat) : message.maxTotalRoutingFeeMsat; + else + object.maxTotalRoutingFeeMsat = options.longs === String ? $util.Long.prototype.toString.call(message.maxTotalRoutingFeeMsat) : options.longs === Number ? new $util.LongBits(message.maxTotalRoutingFeeMsat.low >>> 0, message.maxTotalRoutingFeeMsat.high >>> 0).toNumber(true) : message.maxTotalRoutingFeeMsat; + if (message.maxTotalCltvExpiryDelta != null && message.hasOwnProperty("maxTotalCltvExpiryDelta")) + object.maxTotalCltvExpiryDelta = message.maxTotalCltvExpiryDelta; + if (message.maxPathCount != null && message.hasOwnProperty("maxPathCount")) + object.maxPathCount = message.maxPathCount; + if (message.maxChannelSaturationPowerOfHalf != null && message.hasOwnProperty("maxChannelSaturationPowerOfHalf")) + object.maxChannelSaturationPowerOfHalf = message.maxChannelSaturationPowerOfHalf; + 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); + }; + + return RouteParametersConfig; + })(); + + types.GraphRoutingFees = (function() { + + /** + * Properties of a GraphRoutingFees. + * @memberof types + * @interface IGraphRoutingFees + * @property {number|null} [baseMsat] GraphRoutingFees baseMsat + * @property {number|null} [proportionalMillionths] GraphRoutingFees proportionalMillionths + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphRoutingFees baseMsat. + * @member {number} baseMsat + * @memberof types.GraphRoutingFees + * @instance + */ + GraphRoutingFees.prototype.baseMsat = 0; + + /** + * GraphRoutingFees proportionalMillionths. + * @member {number} proportionalMillionths + * @memberof types.GraphRoutingFees + * @instance + */ + GraphRoutingFees.prototype.proportionalMillionths = 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.baseMsat != null && Object.hasOwnProperty.call(message, "baseMsat")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.baseMsat); + if (message.proportionalMillionths != null && Object.hasOwnProperty.call(message, "proportionalMillionths")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.proportionalMillionths); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.GraphRoutingFees(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseMsat = reader.uint32(); + break; + case 2: + message.proportionalMillionths = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseMsat != null && message.hasOwnProperty("baseMsat")) + if (!$util.isInteger(message.baseMsat)) + return "baseMsat: integer expected"; + if (message.proportionalMillionths != null && message.hasOwnProperty("proportionalMillionths")) + if (!$util.isInteger(message.proportionalMillionths)) + return "proportionalMillionths: 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) { + if (object instanceof $root.types.GraphRoutingFees) + return object; + var message = new $root.types.GraphRoutingFees(); + if (object.baseMsat != null) + message.baseMsat = object.baseMsat >>> 0; + if (object.proportionalMillionths != null) + message.proportionalMillionths = object.proportionalMillionths >>> 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 = {}; + var object = {}; + if (options.defaults) { + object.baseMsat = 0; + object.proportionalMillionths = 0; + } + if (message.baseMsat != null && message.hasOwnProperty("baseMsat")) + object.baseMsat = message.baseMsat; + if (message.proportionalMillionths != null && message.hasOwnProperty("proportionalMillionths")) + object.proportionalMillionths = message.proportionalMillionths; + 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); + }; + + return GraphRoutingFees; + })(); + + types.GraphChannelUpdate = (function() { + + /** + * Properties of a GraphChannelUpdate. + * @memberof types + * @interface IGraphChannelUpdate + * @property {number|null} [lastUpdate] GraphChannelUpdate lastUpdate + * @property {boolean|null} [enabled] GraphChannelUpdate enabled + * @property {number|null} [cltvExpiryDelta] GraphChannelUpdate cltvExpiryDelta + * @property {number|Long|null} [htlcMinimumMsat] GraphChannelUpdate htlcMinimumMsat + * @property {number|Long|null} [htlcMaximumMsat] GraphChannelUpdate htlcMaximumMsat + * @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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphChannelUpdate lastUpdate. + * @member {number} lastUpdate + * @memberof types.GraphChannelUpdate + * @instance + */ + GraphChannelUpdate.prototype.lastUpdate = 0; + + /** + * GraphChannelUpdate enabled. + * @member {boolean} enabled + * @memberof types.GraphChannelUpdate + * @instance + */ + GraphChannelUpdate.prototype.enabled = false; + + /** + * GraphChannelUpdate cltvExpiryDelta. + * @member {number} cltvExpiryDelta + * @memberof types.GraphChannelUpdate + * @instance + */ + GraphChannelUpdate.prototype.cltvExpiryDelta = 0; + + /** + * GraphChannelUpdate htlcMinimumMsat. + * @member {number|Long} htlcMinimumMsat + * @memberof types.GraphChannelUpdate + * @instance + */ + GraphChannelUpdate.prototype.htlcMinimumMsat = 0; + + /** + * GraphChannelUpdate htlcMaximumMsat. + * @member {number|Long} htlcMaximumMsat + * @memberof types.GraphChannelUpdate + * @instance + */ + GraphChannelUpdate.prototype.htlcMaximumMsat = 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.lastUpdate != null && Object.hasOwnProperty.call(message, "lastUpdate")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.lastUpdate); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enabled); + if (message.cltvExpiryDelta != null && Object.hasOwnProperty.call(message, "cltvExpiryDelta")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.cltvExpiryDelta); + if (message.htlcMinimumMsat != null && Object.hasOwnProperty.call(message, "htlcMinimumMsat")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.htlcMinimumMsat); + if (message.htlcMaximumMsat != null && Object.hasOwnProperty.call(message, "htlcMaximumMsat")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.htlcMaximumMsat); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.GraphChannelUpdate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lastUpdate = reader.uint32(); + break; + case 2: + message.enabled = reader.bool(); + break; + case 3: + message.cltvExpiryDelta = reader.uint32(); + break; + case 4: + message.htlcMinimumMsat = reader.uint64(); + break; + case 5: + message.htlcMaximumMsat = reader.uint64(); + break; + case 6: + message.fees = $root.types.GraphRoutingFees.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lastUpdate != null && message.hasOwnProperty("lastUpdate")) + if (!$util.isInteger(message.lastUpdate)) + return "lastUpdate: integer expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.cltvExpiryDelta != null && message.hasOwnProperty("cltvExpiryDelta")) + if (!$util.isInteger(message.cltvExpiryDelta)) + return "cltvExpiryDelta: integer expected"; + if (message.htlcMinimumMsat != null && message.hasOwnProperty("htlcMinimumMsat")) + if (!$util.isInteger(message.htlcMinimumMsat) && !(message.htlcMinimumMsat && $util.isInteger(message.htlcMinimumMsat.low) && $util.isInteger(message.htlcMinimumMsat.high))) + return "htlcMinimumMsat: integer|Long expected"; + if (message.htlcMaximumMsat != null && message.hasOwnProperty("htlcMaximumMsat")) + if (!$util.isInteger(message.htlcMaximumMsat) && !(message.htlcMaximumMsat && $util.isInteger(message.htlcMaximumMsat.low) && $util.isInteger(message.htlcMaximumMsat.high))) + return "htlcMaximumMsat: integer|Long expected"; + if (message.fees != null && message.hasOwnProperty("fees")) { + var error = $root.types.GraphRoutingFees.verify(message.fees); + 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) { + if (object instanceof $root.types.GraphChannelUpdate) + return object; + var message = new $root.types.GraphChannelUpdate(); + if (object.lastUpdate != null) + message.lastUpdate = object.lastUpdate >>> 0; + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.cltvExpiryDelta != null) + message.cltvExpiryDelta = object.cltvExpiryDelta >>> 0; + if (object.htlcMinimumMsat != null) + if ($util.Long) + (message.htlcMinimumMsat = $util.Long.fromValue(object.htlcMinimumMsat)).unsigned = true; + else if (typeof object.htlcMinimumMsat === "string") + message.htlcMinimumMsat = parseInt(object.htlcMinimumMsat, 10); + else if (typeof object.htlcMinimumMsat === "number") + message.htlcMinimumMsat = object.htlcMinimumMsat; + else if (typeof object.htlcMinimumMsat === "object") + message.htlcMinimumMsat = new $util.LongBits(object.htlcMinimumMsat.low >>> 0, object.htlcMinimumMsat.high >>> 0).toNumber(true); + if (object.htlcMaximumMsat != null) + if ($util.Long) + (message.htlcMaximumMsat = $util.Long.fromValue(object.htlcMaximumMsat)).unsigned = true; + else if (typeof object.htlcMaximumMsat === "string") + message.htlcMaximumMsat = parseInt(object.htlcMaximumMsat, 10); + else if (typeof object.htlcMaximumMsat === "number") + message.htlcMaximumMsat = object.htlcMaximumMsat; + else if (typeof object.htlcMaximumMsat === "object") + message.htlcMaximumMsat = new $util.LongBits(object.htlcMaximumMsat.low >>> 0, object.htlcMaximumMsat.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); + } + 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 = {}; + var object = {}; + if (options.defaults) { + object.lastUpdate = 0; + object.enabled = false; + object.cltvExpiryDelta = 0; + object.htlcMinimumMsat = 0; + object.htlcMaximumMsat = 0; + object.fees = null; + } + if (message.lastUpdate != null && message.hasOwnProperty("lastUpdate")) + object.lastUpdate = message.lastUpdate; + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.cltvExpiryDelta != null && message.hasOwnProperty("cltvExpiryDelta")) + object.cltvExpiryDelta = message.cltvExpiryDelta; + if (message.htlcMinimumMsat != null && message.hasOwnProperty("htlcMinimumMsat")) + if (typeof message.htlcMinimumMsat === "number") + object.htlcMinimumMsat = options.longs === String ? String(message.htlcMinimumMsat) : message.htlcMinimumMsat; + else + object.htlcMinimumMsat = options.longs === String ? $util.Long.prototype.toString.call(message.htlcMinimumMsat) : options.longs === Number ? new $util.LongBits(message.htlcMinimumMsat.low >>> 0, message.htlcMinimumMsat.high >>> 0).toNumber(true) : message.htlcMinimumMsat; + if (message.htlcMaximumMsat != null && message.hasOwnProperty("htlcMaximumMsat")) + if (typeof message.htlcMaximumMsat === "number") + object.htlcMaximumMsat = options.longs === String ? String(message.htlcMaximumMsat) : message.htlcMaximumMsat; + else + object.htlcMaximumMsat = options.longs === String ? $util.Long.prototype.toString.call(message.htlcMaximumMsat) : options.longs === Number ? new $util.LongBits(message.htlcMaximumMsat.low >>> 0, message.htlcMaximumMsat.high >>> 0).toNumber(true) : message.htlcMaximumMsat; + 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); + }; + + return GraphChannelUpdate; + })(); + + types.GraphChannel = (function() { + + /** + * Properties of a GraphChannel. + * @memberof types + * @interface IGraphChannel + * @property {string|null} [nodeOne] GraphChannel nodeOne + * @property {string|null} [nodeTwo] GraphChannel nodeTwo + * @property {number|Long|null} [capacitySats] GraphChannel capacitySats + * @property {types.IGraphChannelUpdate|null} [oneToTwo] GraphChannel oneToTwo + * @property {types.IGraphChannelUpdate|null} [twoToOne] GraphChannel twoToOne + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphChannel nodeOne. + * @member {string} nodeOne + * @memberof types.GraphChannel + * @instance + */ + GraphChannel.prototype.nodeOne = ""; + + /** + * GraphChannel nodeTwo. + * @member {string} nodeTwo + * @memberof types.GraphChannel + * @instance + */ + GraphChannel.prototype.nodeTwo = ""; + + /** + * GraphChannel capacitySats. + * @member {number|Long} capacitySats + * @memberof types.GraphChannel + * @instance + */ + GraphChannel.prototype.capacitySats = 0; + + /** + * GraphChannel oneToTwo. + * @member {types.IGraphChannelUpdate|null|undefined} oneToTwo + * @memberof types.GraphChannel + * @instance + */ + GraphChannel.prototype.oneToTwo = null; + + /** + * GraphChannel twoToOne. + * @member {types.IGraphChannelUpdate|null|undefined} twoToOne + * @memberof types.GraphChannel + * @instance + */ + GraphChannel.prototype.twoToOne = null; + + /** + * 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.nodeOne != null && Object.hasOwnProperty.call(message, "nodeOne")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeOne); + if (message.nodeTwo != null && Object.hasOwnProperty.call(message, "nodeTwo")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeTwo); + if (message.capacitySats != null && Object.hasOwnProperty.call(message, "capacitySats")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.capacitySats); + if (message.oneToTwo != null && Object.hasOwnProperty.call(message, "oneToTwo")) + $root.types.GraphChannelUpdate.encode(message.oneToTwo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.twoToOne != null && Object.hasOwnProperty.call(message, "twoToOne")) + $root.types.GraphChannelUpdate.encode(message.twoToOne, 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.GraphChannel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nodeOne = reader.string(); + break; + case 2: + message.nodeTwo = reader.string(); + break; + case 3: + message.capacitySats = reader.uint64(); + break; + case 4: + message.oneToTwo = $root.types.GraphChannelUpdate.decode(reader, reader.uint32()); + break; + case 5: + message.twoToOne = $root.types.GraphChannelUpdate.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeOne != null && message.hasOwnProperty("nodeOne")) + if (!$util.isString(message.nodeOne)) + return "nodeOne: string expected"; + if (message.nodeTwo != null && message.hasOwnProperty("nodeTwo")) + if (!$util.isString(message.nodeTwo)) + return "nodeTwo: string expected"; + if (message.capacitySats != null && message.hasOwnProperty("capacitySats")) + if (!$util.isInteger(message.capacitySats) && !(message.capacitySats && $util.isInteger(message.capacitySats.low) && $util.isInteger(message.capacitySats.high))) + return "capacitySats: integer|Long expected"; + if (message.oneToTwo != null && message.hasOwnProperty("oneToTwo")) { + var error = $root.types.GraphChannelUpdate.verify(message.oneToTwo); + if (error) + return "oneToTwo." + error; + } + if (message.twoToOne != null && message.hasOwnProperty("twoToOne")) { + var error = $root.types.GraphChannelUpdate.verify(message.twoToOne); + if (error) + return "twoToOne." + 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) { + if (object instanceof $root.types.GraphChannel) + return object; + var message = new $root.types.GraphChannel(); + if (object.nodeOne != null) + message.nodeOne = String(object.nodeOne); + if (object.nodeTwo != null) + message.nodeTwo = String(object.nodeTwo); + if (object.capacitySats != null) + if ($util.Long) + (message.capacitySats = $util.Long.fromValue(object.capacitySats)).unsigned = true; + else if (typeof object.capacitySats === "string") + message.capacitySats = parseInt(object.capacitySats, 10); + else if (typeof object.capacitySats === "number") + message.capacitySats = object.capacitySats; + else if (typeof object.capacitySats === "object") + message.capacitySats = new $util.LongBits(object.capacitySats.low >>> 0, object.capacitySats.high >>> 0).toNumber(true); + if (object.oneToTwo != null) { + if (typeof object.oneToTwo !== "object") + throw TypeError(".types.GraphChannel.oneToTwo: object expected"); + message.oneToTwo = $root.types.GraphChannelUpdate.fromObject(object.oneToTwo); + } + if (object.twoToOne != null) { + if (typeof object.twoToOne !== "object") + throw TypeError(".types.GraphChannel.twoToOne: object expected"); + message.twoToOne = $root.types.GraphChannelUpdate.fromObject(object.twoToOne); + } + 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 = {}; + var object = {}; + if (options.defaults) { + object.nodeOne = ""; + object.nodeTwo = ""; + object.capacitySats = 0; + object.oneToTwo = null; + object.twoToOne = null; + } + if (message.nodeOne != null && message.hasOwnProperty("nodeOne")) + object.nodeOne = message.nodeOne; + if (message.nodeTwo != null && message.hasOwnProperty("nodeTwo")) + object.nodeTwo = message.nodeTwo; + if (message.capacitySats != null && message.hasOwnProperty("capacitySats")) + if (typeof message.capacitySats === "number") + object.capacitySats = options.longs === String ? String(message.capacitySats) : message.capacitySats; + else + object.capacitySats = options.longs === String ? $util.Long.prototype.toString.call(message.capacitySats) : options.longs === Number ? new $util.LongBits(message.capacitySats.low >>> 0, message.capacitySats.high >>> 0).toNumber(true) : message.capacitySats; + if (message.oneToTwo != null && message.hasOwnProperty("oneToTwo")) + object.oneToTwo = $root.types.GraphChannelUpdate.toObject(message.oneToTwo, options); + if (message.twoToOne != null && message.hasOwnProperty("twoToOne")) + object.twoToOne = $root.types.GraphChannelUpdate.toObject(message.twoToOne, 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); + }; + + return GraphChannel; + })(); + + types.GraphNodeAnnouncement = (function() { + + /** + * Properties of a GraphNodeAnnouncement. + * @memberof types + * @interface IGraphNodeAnnouncement + * @property {number|null} [lastUpdate] GraphNodeAnnouncement lastUpdate + * @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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphNodeAnnouncement lastUpdate. + * @member {number} lastUpdate + * @memberof types.GraphNodeAnnouncement + * @instance + */ + GraphNodeAnnouncement.prototype.lastUpdate = 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.lastUpdate != null && Object.hasOwnProperty.call(message, "lastUpdate")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.lastUpdate); + 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 (var 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.GraphNodeAnnouncement(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.lastUpdate = 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); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lastUpdate != null && message.hasOwnProperty("lastUpdate")) + if (!$util.isInteger(message.lastUpdate)) + return "lastUpdate: 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 (var 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) { + if (object instanceof $root.types.GraphNodeAnnouncement) + return object; + var message = new $root.types.GraphNodeAnnouncement(); + if (object.lastUpdate != null) + message.lastUpdate = object.lastUpdate >>> 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 (var 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 = {}; + var object = {}; + if (options.arrays || options.defaults) + object.addresses = []; + if (options.defaults) { + object.lastUpdate = 0; + object.alias = ""; + object.rgb = ""; + } + if (message.lastUpdate != null && message.hasOwnProperty("lastUpdate")) + object.lastUpdate = message.lastUpdate; + 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 (var 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); + }; + + return GraphNodeAnnouncement; + })(); + + types.Peer = (function() { + + /** + * Properties of a Peer. + * @memberof types + * @interface IPeer + * @property {string|null} [nodeId] Peer nodeId + * @property {string|null} [address] Peer address + * @property {boolean|null} [isPersisted] Peer isPersisted + * @property {boolean|null} [isConnected] Peer isConnected + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Peer nodeId. + * @member {string} nodeId + * @memberof types.Peer + * @instance + */ + Peer.prototype.nodeId = ""; + + /** + * Peer address. + * @member {string} address + * @memberof types.Peer + * @instance + */ + Peer.prototype.address = ""; + + /** + * Peer isPersisted. + * @member {boolean} isPersisted + * @memberof types.Peer + * @instance + */ + Peer.prototype.isPersisted = false; + + /** + * Peer isConnected. + * @member {boolean} isConnected + * @memberof types.Peer + * @instance + */ + Peer.prototype.isConnected = 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.nodeId != null && Object.hasOwnProperty.call(message, "nodeId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeId); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.address); + if (message.isPersisted != null && Object.hasOwnProperty.call(message, "isPersisted")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isPersisted); + if (message.isConnected != null && Object.hasOwnProperty.call(message, "isConnected")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isConnected); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Peer(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nodeId = reader.string(); + break; + case 2: + message.address = reader.string(); + break; + case 3: + message.isPersisted = reader.bool(); + break; + case 4: + message.isConnected = reader.bool(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + if (!$util.isString(message.nodeId)) + return "nodeId: string expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.isPersisted != null && message.hasOwnProperty("isPersisted")) + if (typeof message.isPersisted !== "boolean") + return "isPersisted: boolean expected"; + if (message.isConnected != null && message.hasOwnProperty("isConnected")) + if (typeof message.isConnected !== "boolean") + return "isConnected: 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) { + if (object instanceof $root.types.Peer) + return object; + var message = new $root.types.Peer(); + if (object.nodeId != null) + message.nodeId = String(object.nodeId); + if (object.address != null) + message.address = String(object.address); + if (object.isPersisted != null) + message.isPersisted = Boolean(object.isPersisted); + if (object.isConnected != null) + message.isConnected = Boolean(object.isConnected); + 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 = {}; + var object = {}; + if (options.defaults) { + object.nodeId = ""; + object.address = ""; + object.isPersisted = false; + object.isConnected = false; + } + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + object.nodeId = message.nodeId; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.isPersisted != null && message.hasOwnProperty("isPersisted")) + object.isPersisted = message.isPersisted; + if (message.isConnected != null && message.hasOwnProperty("isConnected")) + object.isConnected = message.isConnected; + 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); + }; + + return Peer; + })(); + + types.GraphNode = (function() { + + /** + * Properties of a GraphNode. + * @memberof types + * @interface IGraphNode + * @property {Array.|null} [channels] GraphNode channels + * @property {types.IGraphNodeAnnouncement|null} [announcementInfo] GraphNode announcementInfo + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GraphNode channels. + * @member {Array.} channels + * @memberof types.GraphNode + * @instance + */ + GraphNode.prototype.channels = $util.emptyArray; + + /** + * GraphNode announcementInfo. + * @member {types.IGraphNodeAnnouncement|null|undefined} announcementInfo + * @memberof types.GraphNode + * @instance + */ + GraphNode.prototype.announcementInfo = 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 (var i = 0; i < message.channels.length; ++i) + writer.uint64(message.channels[i]); + writer.ldelim(); + } + if (message.announcementInfo != null && Object.hasOwnProperty.call(message, "announcementInfo")) + $root.types.GraphNodeAnnouncement.encode(message.announcementInfo, 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.GraphNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.channels && message.channels.length)) + message.channels = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.channels.push(reader.uint64()); + } else + message.channels.push(reader.uint64()); + break; + case 2: + message.announcementInfo = $root.types.GraphNodeAnnouncement.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channels != null && message.hasOwnProperty("channels")) { + if (!Array.isArray(message.channels)) + return "channels: array expected"; + for (var 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.announcementInfo != null && message.hasOwnProperty("announcementInfo")) { + var error = $root.types.GraphNodeAnnouncement.verify(message.announcementInfo); + if (error) + return "announcementInfo." + 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) { + if (object instanceof $root.types.GraphNode) + return object; + var message = new $root.types.GraphNode(); + if (object.channels) { + if (!Array.isArray(object.channels)) + throw TypeError(".types.GraphNode.channels: array expected"); + message.channels = []; + for (var 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.announcementInfo != null) { + if (typeof object.announcementInfo !== "object") + throw TypeError(".types.GraphNode.announcementInfo: object expected"); + message.announcementInfo = $root.types.GraphNodeAnnouncement.fromObject(object.announcementInfo); + } + 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 = {}; + var object = {}; + if (options.arrays || options.defaults) + object.channels = []; + if (options.defaults) + object.announcementInfo = null; + if (message.channels && message.channels.length) { + object.channels = []; + for (var j = 0; j < message.channels.length; ++j) + 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.announcementInfo != null && message.hasOwnProperty("announcementInfo")) + object.announcementInfo = $root.types.GraphNodeAnnouncement.toObject(message.announcementInfo, 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); + }; + + return GraphNode; + })(); + + types.Bolt11RouteHint = (function() { + + /** + * Properties of a Bolt11RouteHint. + * @memberof types + * @interface IBolt11RouteHint + * @property {Array.|null} [hopHints] Bolt11RouteHint hopHints + */ + + /** + * Constructs a new Bolt11RouteHint. + * @memberof types + * @classdesc Represents a Bolt11RouteHint. + * @implements IBolt11RouteHint + * @constructor + * @param {types.IBolt11RouteHint=} [properties] Properties to set + */ + function Bolt11RouteHint(properties) { + this.hopHints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11RouteHint hopHints. + * @member {Array.} hopHints + * @memberof types.Bolt11RouteHint + * @instance + */ + Bolt11RouteHint.prototype.hopHints = $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.hopHints != null && message.hopHints.length) + for (var i = 0; i < message.hopHints.length; ++i) + $root.types.Bolt11HopHint.encode(message.hopHints[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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Bolt11RouteHint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.hopHints && message.hopHints.length)) + message.hopHints = []; + message.hopHints.push($root.types.Bolt11HopHint.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hopHints != null && message.hasOwnProperty("hopHints")) { + if (!Array.isArray(message.hopHints)) + return "hopHints: array expected"; + for (var i = 0; i < message.hopHints.length; ++i) { + var error = $root.types.Bolt11HopHint.verify(message.hopHints[i]); + if (error) + return "hopHints." + 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) { + if (object instanceof $root.types.Bolt11RouteHint) + return object; + var message = new $root.types.Bolt11RouteHint(); + if (object.hopHints) { + if (!Array.isArray(object.hopHints)) + throw TypeError(".types.Bolt11RouteHint.hopHints: array expected"); + message.hopHints = []; + for (var i = 0; i < object.hopHints.length; ++i) { + if (typeof object.hopHints[i] !== "object") + throw TypeError(".types.Bolt11RouteHint.hopHints: object expected"); + message.hopHints[i] = $root.types.Bolt11HopHint.fromObject(object.hopHints[i]); + } + } + 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 = {}; + var object = {}; + if (options.arrays || options.defaults) + object.hopHints = []; + if (message.hopHints && message.hopHints.length) { + object.hopHints = []; + for (var j = 0; j < message.hopHints.length; ++j) + object.hopHints[j] = $root.types.Bolt11HopHint.toObject(message.hopHints[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); + }; + + return Bolt11RouteHint; + })(); + + types.Bolt11HopHint = (function() { + + /** + * Properties of a Bolt11HopHint. + * @memberof types + * @interface IBolt11HopHint + * @property {string|null} [nodeId] Bolt11HopHint nodeId + * @property {number|Long|null} [shortChannelId] Bolt11HopHint shortChannelId + * @property {number|null} [feeBaseMsat] Bolt11HopHint feeBaseMsat + * @property {number|null} [feeProportionalMillionths] Bolt11HopHint feeProportionalMillionths + * @property {number|null} [cltvExpiryDelta] Bolt11HopHint cltvExpiryDelta + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11HopHint nodeId. + * @member {string} nodeId + * @memberof types.Bolt11HopHint + * @instance + */ + Bolt11HopHint.prototype.nodeId = ""; + + /** + * Bolt11HopHint shortChannelId. + * @member {number|Long} shortChannelId + * @memberof types.Bolt11HopHint + * @instance + */ + Bolt11HopHint.prototype.shortChannelId = 0; + + /** + * Bolt11HopHint feeBaseMsat. + * @member {number} feeBaseMsat + * @memberof types.Bolt11HopHint + * @instance + */ + Bolt11HopHint.prototype.feeBaseMsat = 0; + + /** + * Bolt11HopHint feeProportionalMillionths. + * @member {number} feeProportionalMillionths + * @memberof types.Bolt11HopHint + * @instance + */ + Bolt11HopHint.prototype.feeProportionalMillionths = 0; + + /** + * Bolt11HopHint cltvExpiryDelta. + * @member {number} cltvExpiryDelta + * @memberof types.Bolt11HopHint + * @instance + */ + Bolt11HopHint.prototype.cltvExpiryDelta = 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.nodeId != null && Object.hasOwnProperty.call(message, "nodeId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeId); + if (message.shortChannelId != null && Object.hasOwnProperty.call(message, "shortChannelId")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.shortChannelId); + if (message.feeBaseMsat != null && Object.hasOwnProperty.call(message, "feeBaseMsat")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.feeBaseMsat); + if (message.feeProportionalMillionths != null && Object.hasOwnProperty.call(message, "feeProportionalMillionths")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.feeProportionalMillionths); + if (message.cltvExpiryDelta != null && Object.hasOwnProperty.call(message, "cltvExpiryDelta")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.cltvExpiryDelta); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Bolt11HopHint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nodeId = reader.string(); + break; + case 2: + message.shortChannelId = reader.uint64(); + break; + case 3: + message.feeBaseMsat = reader.uint32(); + break; + case 4: + message.feeProportionalMillionths = reader.uint32(); + break; + case 5: + message.cltvExpiryDelta = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + if (!$util.isString(message.nodeId)) + return "nodeId: string expected"; + if (message.shortChannelId != null && message.hasOwnProperty("shortChannelId")) + if (!$util.isInteger(message.shortChannelId) && !(message.shortChannelId && $util.isInteger(message.shortChannelId.low) && $util.isInteger(message.shortChannelId.high))) + return "shortChannelId: integer|Long expected"; + if (message.feeBaseMsat != null && message.hasOwnProperty("feeBaseMsat")) + if (!$util.isInteger(message.feeBaseMsat)) + return "feeBaseMsat: integer expected"; + if (message.feeProportionalMillionths != null && message.hasOwnProperty("feeProportionalMillionths")) + if (!$util.isInteger(message.feeProportionalMillionths)) + return "feeProportionalMillionths: integer expected"; + if (message.cltvExpiryDelta != null && message.hasOwnProperty("cltvExpiryDelta")) + if (!$util.isInteger(message.cltvExpiryDelta)) + return "cltvExpiryDelta: 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) { + if (object instanceof $root.types.Bolt11HopHint) + return object; + var message = new $root.types.Bolt11HopHint(); + if (object.nodeId != null) + message.nodeId = String(object.nodeId); + if (object.shortChannelId != null) + if ($util.Long) + (message.shortChannelId = $util.Long.fromValue(object.shortChannelId)).unsigned = true; + else if (typeof object.shortChannelId === "string") + message.shortChannelId = parseInt(object.shortChannelId, 10); + else if (typeof object.shortChannelId === "number") + message.shortChannelId = object.shortChannelId; + else if (typeof object.shortChannelId === "object") + message.shortChannelId = new $util.LongBits(object.shortChannelId.low >>> 0, object.shortChannelId.high >>> 0).toNumber(true); + if (object.feeBaseMsat != null) + message.feeBaseMsat = object.feeBaseMsat >>> 0; + if (object.feeProportionalMillionths != null) + message.feeProportionalMillionths = object.feeProportionalMillionths >>> 0; + if (object.cltvExpiryDelta != null) + message.cltvExpiryDelta = object.cltvExpiryDelta >>> 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 = {}; + var object = {}; + if (options.defaults) { + object.nodeId = ""; + object.shortChannelId = 0; + object.feeBaseMsat = 0; + object.feeProportionalMillionths = 0; + object.cltvExpiryDelta = 0; + } + if (message.nodeId != null && message.hasOwnProperty("nodeId")) + object.nodeId = message.nodeId; + if (message.shortChannelId != null && message.hasOwnProperty("shortChannelId")) + if (typeof message.shortChannelId === "number") + object.shortChannelId = options.longs === String ? String(message.shortChannelId) : message.shortChannelId; + else + object.shortChannelId = options.longs === String ? $util.Long.prototype.toString.call(message.shortChannelId) : options.longs === Number ? new $util.LongBits(message.shortChannelId.low >>> 0, message.shortChannelId.high >>> 0).toNumber(true) : message.shortChannelId; + if (message.feeBaseMsat != null && message.hasOwnProperty("feeBaseMsat")) + object.feeBaseMsat = message.feeBaseMsat; + if (message.feeProportionalMillionths != null && message.hasOwnProperty("feeProportionalMillionths")) + object.feeProportionalMillionths = message.feeProportionalMillionths; + if (message.cltvExpiryDelta != null && message.hasOwnProperty("cltvExpiryDelta")) + object.cltvExpiryDelta = message.cltvExpiryDelta; + 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); + }; + + return Bolt11HopHint; + })(); + + types.OfferAmount = (function() { + + /** + * Properties of an OfferAmount. + * @memberof types + * @interface IOfferAmount + * @property {number|Long|null} [bitcoinAmountMsats] OfferAmount bitcoinAmountMsats + * @property {types.ICurrencyAmount|null} [currencyAmount] OfferAmount currencyAmount + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OfferAmount bitcoinAmountMsats. + * @member {number|Long} bitcoinAmountMsats + * @memberof types.OfferAmount + * @instance + */ + OfferAmount.prototype.bitcoinAmountMsats = 0; + + /** + * OfferAmount currencyAmount. + * @member {types.ICurrencyAmount|null|undefined} currencyAmount + * @memberof types.OfferAmount + * @instance + */ + OfferAmount.prototype.currencyAmount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OfferAmount amount. + * @member {"bitcoinAmountMsats"|"currencyAmount"|undefined} amount + * @memberof types.OfferAmount + * @instance + */ + Object.defineProperty(OfferAmount.prototype, "amount", { + get: $util.oneOfGetter($oneOfFields = ["bitcoinAmountMsats", "currencyAmount"]), + 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.bitcoinAmountMsats != null && Object.hasOwnProperty.call(message, "bitcoinAmountMsats")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.bitcoinAmountMsats); + if (message.currencyAmount != null && Object.hasOwnProperty.call(message, "currencyAmount")) + $root.types.CurrencyAmount.encode(message.currencyAmount, 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.OfferAmount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.bitcoinAmountMsats = reader.uint64(); + break; + case 2: + message.currencyAmount = $root.types.CurrencyAmount.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bitcoinAmountMsats != null && message.hasOwnProperty("bitcoinAmountMsats")) { + properties.amount = 1; + if (!$util.isInteger(message.bitcoinAmountMsats) && !(message.bitcoinAmountMsats && $util.isInteger(message.bitcoinAmountMsats.low) && $util.isInteger(message.bitcoinAmountMsats.high))) + return "bitcoinAmountMsats: integer|Long expected"; + } + if (message.currencyAmount != null && message.hasOwnProperty("currencyAmount")) { + if (properties.amount === 1) + return "amount: multiple values"; + properties.amount = 1; + { + var error = $root.types.CurrencyAmount.verify(message.currencyAmount); + if (error) + return "currencyAmount." + 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) { + if (object instanceof $root.types.OfferAmount) + return object; + var message = new $root.types.OfferAmount(); + if (object.bitcoinAmountMsats != null) + if ($util.Long) + (message.bitcoinAmountMsats = $util.Long.fromValue(object.bitcoinAmountMsats)).unsigned = true; + else if (typeof object.bitcoinAmountMsats === "string") + message.bitcoinAmountMsats = parseInt(object.bitcoinAmountMsats, 10); + else if (typeof object.bitcoinAmountMsats === "number") + message.bitcoinAmountMsats = object.bitcoinAmountMsats; + else if (typeof object.bitcoinAmountMsats === "object") + message.bitcoinAmountMsats = new $util.LongBits(object.bitcoinAmountMsats.low >>> 0, object.bitcoinAmountMsats.high >>> 0).toNumber(true); + if (object.currencyAmount != null) { + if (typeof object.currencyAmount !== "object") + throw TypeError(".types.OfferAmount.currencyAmount: object expected"); + message.currencyAmount = $root.types.CurrencyAmount.fromObject(object.currencyAmount); + } + 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 = {}; + var object = {}; + if (message.bitcoinAmountMsats != null && message.hasOwnProperty("bitcoinAmountMsats")) { + if (typeof message.bitcoinAmountMsats === "number") + object.bitcoinAmountMsats = options.longs === String ? String(message.bitcoinAmountMsats) : message.bitcoinAmountMsats; + else + object.bitcoinAmountMsats = options.longs === String ? $util.Long.prototype.toString.call(message.bitcoinAmountMsats) : options.longs === Number ? new $util.LongBits(message.bitcoinAmountMsats.low >>> 0, message.bitcoinAmountMsats.high >>> 0).toNumber(true) : message.bitcoinAmountMsats; + if (options.oneofs) + object.amount = "bitcoinAmountMsats"; + } + if (message.currencyAmount != null && message.hasOwnProperty("currencyAmount")) { + object.currencyAmount = $root.types.CurrencyAmount.toObject(message.currencyAmount, options); + if (options.oneofs) + object.amount = "currencyAmount"; + } + 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); + }; + + return OfferAmount; + })(); + + types.CurrencyAmount = (function() { + + /** + * Properties of a CurrencyAmount. + * @memberof types + * @interface ICurrencyAmount + * @property {string|null} [iso4217Code] CurrencyAmount iso4217Code + * @property {number|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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CurrencyAmount iso4217Code. + * @member {string} iso4217Code + * @memberof types.CurrencyAmount + * @instance + */ + CurrencyAmount.prototype.iso4217Code = ""; + + /** + * CurrencyAmount amount. + * @member {number|Long} amount + * @memberof types.CurrencyAmount + * @instance + */ + CurrencyAmount.prototype.amount = 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.iso4217Code != null && Object.hasOwnProperty.call(message, "iso4217Code")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.iso4217Code); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.CurrencyAmount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.iso4217Code = reader.string(); + break; + case 2: + message.amount = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.iso4217Code != null && message.hasOwnProperty("iso4217Code")) + if (!$util.isString(message.iso4217Code)) + return "iso4217Code: 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) { + if (object instanceof $root.types.CurrencyAmount) + return object; + var message = new $root.types.CurrencyAmount(); + if (object.iso4217Code != null) + message.iso4217Code = String(object.iso4217Code); + 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 = {}; + var object = {}; + if (options.defaults) { + object.iso4217Code = ""; + object.amount = 0; + } + if (message.iso4217Code != null && message.hasOwnProperty("iso4217Code")) + object.iso4217Code = message.iso4217Code; + if (message.amount != null && message.hasOwnProperty("amount")) + 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); + }; + + return CurrencyAmount; + })(); + + types.OfferQuantity = (function() { + + /** + * Properties of an OfferQuantity. + * @memberof types + * @interface IOfferQuantity + * @property {boolean|null} [one] OfferQuantity one + * @property {number|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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OfferQuantity one. + * @member {boolean} one + * @memberof types.OfferQuantity + * @instance + */ + OfferQuantity.prototype.one = false; + + /** + * OfferQuantity bounded. + * @member {number|Long} bounded + * @memberof types.OfferQuantity + * @instance + */ + OfferQuantity.prototype.bounded = 0; + + /** + * OfferQuantity unbounded. + * @member {boolean} unbounded + * @memberof types.OfferQuantity + * @instance + */ + OfferQuantity.prototype.unbounded = false; + + // OneOf field names bound to virtual getters and setters + var $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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.OfferQuantity(); + while (reader.pos < end) { + var tag = reader.uint32(); + 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); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + var 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) { + if (object instanceof $root.types.OfferQuantity) + return object; + var 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 = {}; + var 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 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); + }; + + return OfferQuantity; + })(); + + types.BlindedPath = (function() { + + /** + * Properties of a BlindedPath. + * @memberof types + * @interface IBlindedPath + * @property {string|null} [nodeId] BlindedPath nodeId + * @property {types.IDirectedShortChannelId|null} [directedScid] BlindedPath directedScid + * @property {string|null} [blindingPoint] BlindedPath blindingPoint + * @property {number|null} [numHops] BlindedPath numHops + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BlindedPath nodeId. + * @member {string} nodeId + * @memberof types.BlindedPath + * @instance + */ + BlindedPath.prototype.nodeId = ""; + + /** + * BlindedPath directedScid. + * @member {types.IDirectedShortChannelId|null|undefined} directedScid + * @memberof types.BlindedPath + * @instance + */ + BlindedPath.prototype.directedScid = null; + + /** + * BlindedPath blindingPoint. + * @member {string} blindingPoint + * @memberof types.BlindedPath + * @instance + */ + BlindedPath.prototype.blindingPoint = ""; + + /** + * BlindedPath numHops. + * @member {number} numHops + * @memberof types.BlindedPath + * @instance + */ + BlindedPath.prototype.numHops = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BlindedPath introductionNode. + * @member {"nodeId"|"directedScid"|undefined} introductionNode + * @memberof types.BlindedPath + * @instance + */ + Object.defineProperty(BlindedPath.prototype, "introductionNode", { + get: $util.oneOfGetter($oneOfFields = ["nodeId", "directedScid"]), + 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.nodeId != null && Object.hasOwnProperty.call(message, "nodeId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeId); + if (message.directedScid != null && Object.hasOwnProperty.call(message, "directedScid")) + $root.types.DirectedShortChannelId.encode(message.directedScid, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.blindingPoint != null && Object.hasOwnProperty.call(message, "blindingPoint")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.blindingPoint); + if (message.numHops != null && Object.hasOwnProperty.call(message, "numHops")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.numHops); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.BlindedPath(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nodeId = reader.string(); + break; + case 2: + message.directedScid = $root.types.DirectedShortChannelId.decode(reader, reader.uint32()); + break; + case 3: + message.blindingPoint = reader.string(); + break; + case 4: + message.numHops = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nodeId != null && message.hasOwnProperty("nodeId")) { + properties.introductionNode = 1; + if (!$util.isString(message.nodeId)) + return "nodeId: string expected"; + } + if (message.directedScid != null && message.hasOwnProperty("directedScid")) { + if (properties.introductionNode === 1) + return "introductionNode: multiple values"; + properties.introductionNode = 1; + { + var error = $root.types.DirectedShortChannelId.verify(message.directedScid); + if (error) + return "directedScid." + error; + } + } + if (message.blindingPoint != null && message.hasOwnProperty("blindingPoint")) + if (!$util.isString(message.blindingPoint)) + return "blindingPoint: string expected"; + if (message.numHops != null && message.hasOwnProperty("numHops")) + if (!$util.isInteger(message.numHops)) + return "numHops: 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) { + if (object instanceof $root.types.BlindedPath) + return object; + var message = new $root.types.BlindedPath(); + if (object.nodeId != null) + message.nodeId = String(object.nodeId); + if (object.directedScid != null) { + if (typeof object.directedScid !== "object") + throw TypeError(".types.BlindedPath.directedScid: object expected"); + message.directedScid = $root.types.DirectedShortChannelId.fromObject(object.directedScid); + } + if (object.blindingPoint != null) + message.blindingPoint = String(object.blindingPoint); + if (object.numHops != null) + message.numHops = object.numHops >>> 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 = {}; + var object = {}; + if (options.defaults) { + object.blindingPoint = ""; + object.numHops = 0; + } + if (message.nodeId != null && message.hasOwnProperty("nodeId")) { + object.nodeId = message.nodeId; + if (options.oneofs) + object.introductionNode = "nodeId"; + } + if (message.directedScid != null && message.hasOwnProperty("directedScid")) { + object.directedScid = $root.types.DirectedShortChannelId.toObject(message.directedScid, options); + if (options.oneofs) + object.introductionNode = "directedScid"; + } + if (message.blindingPoint != null && message.hasOwnProperty("blindingPoint")) + object.blindingPoint = message.blindingPoint; + if (message.numHops != null && message.hasOwnProperty("numHops")) + object.numHops = message.numHops; + 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); + }; + + return BlindedPath; + })(); + + types.DirectedShortChannelId = (function() { + + /** + * Properties of a DirectedShortChannelId. + * @memberof types + * @interface IDirectedShortChannelId + * @property {number|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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DirectedShortChannelId scid. + * @member {number|Long} scid + * @memberof types.DirectedShortChannelId + * @instance + */ + DirectedShortChannelId.prototype.scid = 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.DirectedShortChannelId(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.scid = reader.uint64(); + break; + case 2: + message.direction = reader.int32(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.types.DirectedShortChannelId) + return object; + var 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) { + 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 = {}; + var object = {}; + if (options.defaults) { + object.scid = 0; + object.direction = options.enums === String ? "NODE_ONE" : 0; + } + if (message.scid != null && message.hasOwnProperty("scid")) + 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] : 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); + }; + + return DirectedShortChannelId; + })(); + + /** + * ChannelDirection enum. + * @name types.ChannelDirection + * @enum {string} + * @property {number} NODE_ONE=0 NODE_ONE value + * @property {number} NODE_TWO=1 NODE_TWO value + */ + types.ChannelDirection = (function() { + var 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} [isRequired] Bolt11Feature isRequired + * @property {boolean|null} [isKnown] Bolt11Feature isKnown + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Bolt11Feature name. + * @member {string} name + * @memberof types.Bolt11Feature + * @instance + */ + Bolt11Feature.prototype.name = ""; + + /** + * Bolt11Feature isRequired. + * @member {boolean} isRequired + * @memberof types.Bolt11Feature + * @instance + */ + Bolt11Feature.prototype.isRequired = false; + + /** + * Bolt11Feature isKnown. + * @member {boolean} isKnown + * @memberof types.Bolt11Feature + * @instance + */ + Bolt11Feature.prototype.isKnown = 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.isRequired != null && Object.hasOwnProperty.call(message, "isRequired")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isRequired); + if (message.isKnown != null && Object.hasOwnProperty.call(message, "isKnown")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isKnown); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.Bolt11Feature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.isRequired = reader.bool(); + break; + case 3: + message.isKnown = reader.bool(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.isRequired != null && message.hasOwnProperty("isRequired")) + if (typeof message.isRequired !== "boolean") + return "isRequired: boolean expected"; + if (message.isKnown != null && message.hasOwnProperty("isKnown")) + if (typeof message.isKnown !== "boolean") + return "isKnown: 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) { + if (object instanceof $root.types.Bolt11Feature) + return object; + var message = new $root.types.Bolt11Feature(); + if (object.name != null) + message.name = String(object.name); + if (object.isRequired != null) + message.isRequired = Boolean(object.isRequired); + if (object.isKnown != null) + message.isKnown = Boolean(object.isKnown); + 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 = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.isRequired = false; + object.isKnown = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.isRequired != null && message.hasOwnProperty("isRequired")) + object.isRequired = message.isRequired; + if (message.isKnown != null && message.hasOwnProperty("isKnown")) + object.isKnown = message.isKnown; + 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); + }; + + return Bolt11Feature; + })(); + + return types; +})(); + +$root.events = (function() { + + /** + * Namespace events. + * @exports events + * @namespace + */ + var events = {}; + + events.EventEnvelope = (function() { + + /** + * Properties of an EventEnvelope. + * @memberof events + * @interface IEventEnvelope + * @property {events.IPaymentReceived|null} [paymentReceived] EventEnvelope paymentReceived + * @property {events.IPaymentSuccessful|null} [paymentSuccessful] EventEnvelope paymentSuccessful + * @property {events.IPaymentFailed|null} [paymentFailed] EventEnvelope paymentFailed + * @property {events.IPaymentForwarded|null} [paymentForwarded] EventEnvelope paymentForwarded + * @property {events.IPaymentClaimable|null} [paymentClaimable] EventEnvelope paymentClaimable + * @property {events.IChannelStateChanged|null} [channelStateChanged] EventEnvelope channelStateChanged + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EventEnvelope paymentReceived. + * @member {events.IPaymentReceived|null|undefined} paymentReceived + * @memberof events.EventEnvelope + * @instance + */ + EventEnvelope.prototype.paymentReceived = null; + + /** + * EventEnvelope paymentSuccessful. + * @member {events.IPaymentSuccessful|null|undefined} paymentSuccessful + * @memberof events.EventEnvelope + * @instance + */ + EventEnvelope.prototype.paymentSuccessful = null; + + /** + * EventEnvelope paymentFailed. + * @member {events.IPaymentFailed|null|undefined} paymentFailed + * @memberof events.EventEnvelope + * @instance + */ + EventEnvelope.prototype.paymentFailed = null; + + /** + * EventEnvelope paymentForwarded. + * @member {events.IPaymentForwarded|null|undefined} paymentForwarded + * @memberof events.EventEnvelope + * @instance + */ + EventEnvelope.prototype.paymentForwarded = null; + + /** + * EventEnvelope paymentClaimable. + * @member {events.IPaymentClaimable|null|undefined} paymentClaimable + * @memberof events.EventEnvelope + * @instance + */ + EventEnvelope.prototype.paymentClaimable = null; + + /** + * EventEnvelope channelStateChanged. + * @member {events.IChannelStateChanged|null|undefined} channelStateChanged + * @memberof events.EventEnvelope + * @instance + */ + EventEnvelope.prototype.channelStateChanged = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EventEnvelope event. + * @member {"paymentReceived"|"paymentSuccessful"|"paymentFailed"|"paymentForwarded"|"paymentClaimable"|"channelStateChanged"|undefined} event + * @memberof events.EventEnvelope + * @instance + */ + Object.defineProperty(EventEnvelope.prototype, "event", { + get: $util.oneOfGetter($oneOfFields = ["paymentReceived", "paymentSuccessful", "paymentFailed", "paymentForwarded", "paymentClaimable", "channelStateChanged"]), + 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.paymentReceived != null && Object.hasOwnProperty.call(message, "paymentReceived")) + $root.events.PaymentReceived.encode(message.paymentReceived, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.paymentSuccessful != null && Object.hasOwnProperty.call(message, "paymentSuccessful")) + $root.events.PaymentSuccessful.encode(message.paymentSuccessful, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.paymentFailed != null && Object.hasOwnProperty.call(message, "paymentFailed")) + $root.events.PaymentFailed.encode(message.paymentFailed, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.paymentForwarded != null && Object.hasOwnProperty.call(message, "paymentForwarded")) + $root.events.PaymentForwarded.encode(message.paymentForwarded, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.paymentClaimable != null && Object.hasOwnProperty.call(message, "paymentClaimable")) + $root.events.PaymentClaimable.encode(message.paymentClaimable, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.channelStateChanged != null && Object.hasOwnProperty.call(message, "channelStateChanged")) + $root.events.ChannelStateChanged.encode(message.channelStateChanged, 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.EventEnvelope(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.paymentReceived = $root.events.PaymentReceived.decode(reader, reader.uint32()); + break; + case 3: + message.paymentSuccessful = $root.events.PaymentSuccessful.decode(reader, reader.uint32()); + break; + case 4: + message.paymentFailed = $root.events.PaymentFailed.decode(reader, reader.uint32()); + break; + case 6: + message.paymentForwarded = $root.events.PaymentForwarded.decode(reader, reader.uint32()); + break; + case 7: + message.paymentClaimable = $root.events.PaymentClaimable.decode(reader, reader.uint32()); + break; + case 8: + message.channelStateChanged = $root.events.ChannelStateChanged.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.paymentReceived != null && message.hasOwnProperty("paymentReceived")) { + properties.event = 1; + { + var error = $root.events.PaymentReceived.verify(message.paymentReceived); + if (error) + return "paymentReceived." + error; + } + } + if (message.paymentSuccessful != null && message.hasOwnProperty("paymentSuccessful")) { + if (properties.event === 1) + return "event: multiple values"; + properties.event = 1; + { + var error = $root.events.PaymentSuccessful.verify(message.paymentSuccessful); + if (error) + return "paymentSuccessful." + error; + } + } + if (message.paymentFailed != null && message.hasOwnProperty("paymentFailed")) { + if (properties.event === 1) + return "event: multiple values"; + properties.event = 1; + { + var error = $root.events.PaymentFailed.verify(message.paymentFailed); + if (error) + return "paymentFailed." + error; + } + } + if (message.paymentForwarded != null && message.hasOwnProperty("paymentForwarded")) { + if (properties.event === 1) + return "event: multiple values"; + properties.event = 1; + { + var error = $root.events.PaymentForwarded.verify(message.paymentForwarded); + if (error) + return "paymentForwarded." + error; + } + } + if (message.paymentClaimable != null && message.hasOwnProperty("paymentClaimable")) { + if (properties.event === 1) + return "event: multiple values"; + properties.event = 1; + { + var error = $root.events.PaymentClaimable.verify(message.paymentClaimable); + if (error) + return "paymentClaimable." + error; + } + } + if (message.channelStateChanged != null && message.hasOwnProperty("channelStateChanged")) { + if (properties.event === 1) + return "event: multiple values"; + properties.event = 1; + { + var error = $root.events.ChannelStateChanged.verify(message.channelStateChanged); + if (error) + return "channelStateChanged." + 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) { + if (object instanceof $root.events.EventEnvelope) + return object; + var message = new $root.events.EventEnvelope(); + if (object.paymentReceived != null) { + if (typeof object.paymentReceived !== "object") + throw TypeError(".events.EventEnvelope.paymentReceived: object expected"); + message.paymentReceived = $root.events.PaymentReceived.fromObject(object.paymentReceived); + } + if (object.paymentSuccessful != null) { + if (typeof object.paymentSuccessful !== "object") + throw TypeError(".events.EventEnvelope.paymentSuccessful: object expected"); + message.paymentSuccessful = $root.events.PaymentSuccessful.fromObject(object.paymentSuccessful); + } + if (object.paymentFailed != null) { + if (typeof object.paymentFailed !== "object") + throw TypeError(".events.EventEnvelope.paymentFailed: object expected"); + message.paymentFailed = $root.events.PaymentFailed.fromObject(object.paymentFailed); + } + if (object.paymentForwarded != null) { + if (typeof object.paymentForwarded !== "object") + throw TypeError(".events.EventEnvelope.paymentForwarded: object expected"); + message.paymentForwarded = $root.events.PaymentForwarded.fromObject(object.paymentForwarded); + } + if (object.paymentClaimable != null) { + if (typeof object.paymentClaimable !== "object") + throw TypeError(".events.EventEnvelope.paymentClaimable: object expected"); + message.paymentClaimable = $root.events.PaymentClaimable.fromObject(object.paymentClaimable); + } + if (object.channelStateChanged != null) { + if (typeof object.channelStateChanged !== "object") + throw TypeError(".events.EventEnvelope.channelStateChanged: object expected"); + message.channelStateChanged = $root.events.ChannelStateChanged.fromObject(object.channelStateChanged); + } + 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 = {}; + var object = {}; + if (message.paymentReceived != null && message.hasOwnProperty("paymentReceived")) { + object.paymentReceived = $root.events.PaymentReceived.toObject(message.paymentReceived, options); + if (options.oneofs) + object.event = "paymentReceived"; + } + if (message.paymentSuccessful != null && message.hasOwnProperty("paymentSuccessful")) { + object.paymentSuccessful = $root.events.PaymentSuccessful.toObject(message.paymentSuccessful, options); + if (options.oneofs) + object.event = "paymentSuccessful"; + } + if (message.paymentFailed != null && message.hasOwnProperty("paymentFailed")) { + object.paymentFailed = $root.events.PaymentFailed.toObject(message.paymentFailed, options); + if (options.oneofs) + object.event = "paymentFailed"; + } + if (message.paymentForwarded != null && message.hasOwnProperty("paymentForwarded")) { + object.paymentForwarded = $root.events.PaymentForwarded.toObject(message.paymentForwarded, options); + if (options.oneofs) + object.event = "paymentForwarded"; + } + if (message.paymentClaimable != null && message.hasOwnProperty("paymentClaimable")) { + object.paymentClaimable = $root.events.PaymentClaimable.toObject(message.paymentClaimable, options); + if (options.oneofs) + object.event = "paymentClaimable"; + } + if (message.channelStateChanged != null && message.hasOwnProperty("channelStateChanged")) { + object.channelStateChanged = $root.events.ChannelStateChanged.toObject(message.channelStateChanged, options); + if (options.oneofs) + object.event = "channelStateChanged"; + } + 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); + }; + + return EventEnvelope; + })(); + + /** + * ChannelState enum. + * @name events.ChannelState + * @enum {string} + * @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() { + var 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 {string} + * @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() { + var 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 {string} + * @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() { + var 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} [peerMsg] CounterpartyForceClosedDetails peerMsg + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CounterpartyForceClosedDetails peerMsg. + * @member {string} peerMsg + * @memberof events.CounterpartyForceClosedDetails + * @instance + */ + CounterpartyForceClosedDetails.prototype.peerMsg = ""; + + /** + * 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.peerMsg != null && Object.hasOwnProperty.call(message, "peerMsg")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.peerMsg); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.CounterpartyForceClosedDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.peerMsg = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.peerMsg != null && message.hasOwnProperty("peerMsg")) + if (!$util.isString(message.peerMsg)) + return "peerMsg: 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) { + if (object instanceof $root.events.CounterpartyForceClosedDetails) + return object; + var message = new $root.events.CounterpartyForceClosedDetails(); + if (object.peerMsg != null) + message.peerMsg = String(object.peerMsg); + 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 = {}; + var object = {}; + if (options.defaults) + object.peerMsg = ""; + if (message.peerMsg != null && message.hasOwnProperty("peerMsg")) + object.peerMsg = message.peerMsg; + 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); + }; + + return CounterpartyForceClosedDetails; + })(); + + events.HolderForceClosedDetails = (function() { + + /** + * Properties of a HolderForceClosedDetails. + * @memberof events + * @interface IHolderForceClosedDetails + * @property {boolean|null} [broadcastedLatestTxn] HolderForceClosedDetails broadcastedLatestTxn + * @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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HolderForceClosedDetails broadcastedLatestTxn. + * @member {boolean} broadcastedLatestTxn + * @memberof events.HolderForceClosedDetails + * @instance + */ + HolderForceClosedDetails.prototype.broadcastedLatestTxn = false; + + /** + * HolderForceClosedDetails message. + * @member {string} message + * @memberof events.HolderForceClosedDetails + * @instance + */ + HolderForceClosedDetails.prototype.message = ""; + + /** + * 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.broadcastedLatestTxn != null && Object.hasOwnProperty.call(message, "broadcastedLatestTxn")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.broadcastedLatestTxn); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.HolderForceClosedDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.broadcastedLatestTxn = reader.bool(); + break; + case 2: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.broadcastedLatestTxn != null && message.hasOwnProperty("broadcastedLatestTxn")) + if (typeof message.broadcastedLatestTxn !== "boolean") + return "broadcastedLatestTxn: 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) { + if (object instanceof $root.events.HolderForceClosedDetails) + return object; + var message = new $root.events.HolderForceClosedDetails(); + if (object.broadcastedLatestTxn != null) + message.broadcastedLatestTxn = Boolean(object.broadcastedLatestTxn); + 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 = {}; + var object = {}; + if (options.defaults) { + object.broadcastedLatestTxn = false; + object.message = ""; + } + if (message.broadcastedLatestTxn != null && message.hasOwnProperty("broadcastedLatestTxn")) + object.broadcastedLatestTxn = message.broadcastedLatestTxn; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.ProcessingErrorDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.err = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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) { + if (object instanceof $root.events.ProcessingErrorDetails) + return object; + var 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 = {}; + var 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); + }; + + return ProcessingErrorDetails; + })(); + + events.HtlcsTimedOutDetails = (function() { + + /** + * Properties of a HtlcsTimedOutDetails. + * @memberof events + * @interface IHtlcsTimedOutDetails + * @property {string|null} [paymentHash] HtlcsTimedOutDetails paymentHash + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HtlcsTimedOutDetails paymentHash. + * @member {string} paymentHash + * @memberof events.HtlcsTimedOutDetails + * @instance + */ + HtlcsTimedOutDetails.prototype.paymentHash = ""; + + /** + * 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.paymentHash != null && Object.hasOwnProperty.call(message, "paymentHash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paymentHash); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.HtlcsTimedOutDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.paymentHash = reader.string(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) + if (!$util.isString(message.paymentHash)) + return "paymentHash: 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) { + if (object instanceof $root.events.HtlcsTimedOutDetails) + return object; + var message = new $root.events.HtlcsTimedOutDetails(); + if (object.paymentHash != null) + message.paymentHash = String(object.paymentHash); + 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 = {}; + var object = {}; + if (options.defaults) + object.paymentHash = ""; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) + object.paymentHash = message.paymentHash; + 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); + }; + + return HtlcsTimedOutDetails; + })(); + + events.PeerFeerateTooLowDetails = (function() { + + /** + * Properties of a PeerFeerateTooLowDetails. + * @memberof events + * @interface IPeerFeerateTooLowDetails + * @property {number|null} [peerFeerateSatPerKw] PeerFeerateTooLowDetails peerFeerateSatPerKw + * @property {number|null} [requiredFeerateSatPerKw] PeerFeerateTooLowDetails requiredFeerateSatPerKw + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PeerFeerateTooLowDetails peerFeerateSatPerKw. + * @member {number} peerFeerateSatPerKw + * @memberof events.PeerFeerateTooLowDetails + * @instance + */ + PeerFeerateTooLowDetails.prototype.peerFeerateSatPerKw = 0; + + /** + * PeerFeerateTooLowDetails requiredFeerateSatPerKw. + * @member {number} requiredFeerateSatPerKw + * @memberof events.PeerFeerateTooLowDetails + * @instance + */ + PeerFeerateTooLowDetails.prototype.requiredFeerateSatPerKw = 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.peerFeerateSatPerKw != null && Object.hasOwnProperty.call(message, "peerFeerateSatPerKw")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.peerFeerateSatPerKw); + if (message.requiredFeerateSatPerKw != null && Object.hasOwnProperty.call(message, "requiredFeerateSatPerKw")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.requiredFeerateSatPerKw); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.PeerFeerateTooLowDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.peerFeerateSatPerKw = reader.uint32(); + break; + case 2: + message.requiredFeerateSatPerKw = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.peerFeerateSatPerKw != null && message.hasOwnProperty("peerFeerateSatPerKw")) + if (!$util.isInteger(message.peerFeerateSatPerKw)) + return "peerFeerateSatPerKw: integer expected"; + if (message.requiredFeerateSatPerKw != null && message.hasOwnProperty("requiredFeerateSatPerKw")) + if (!$util.isInteger(message.requiredFeerateSatPerKw)) + return "requiredFeerateSatPerKw: 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) { + if (object instanceof $root.events.PeerFeerateTooLowDetails) + return object; + var message = new $root.events.PeerFeerateTooLowDetails(); + if (object.peerFeerateSatPerKw != null) + message.peerFeerateSatPerKw = object.peerFeerateSatPerKw >>> 0; + if (object.requiredFeerateSatPerKw != null) + message.requiredFeerateSatPerKw = object.requiredFeerateSatPerKw >>> 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 = {}; + var object = {}; + if (options.defaults) { + object.peerFeerateSatPerKw = 0; + object.requiredFeerateSatPerKw = 0; + } + if (message.peerFeerateSatPerKw != null && message.hasOwnProperty("peerFeerateSatPerKw")) + object.peerFeerateSatPerKw = message.peerFeerateSatPerKw; + if (message.requiredFeerateSatPerKw != null && message.hasOwnProperty("requiredFeerateSatPerKw")) + object.requiredFeerateSatPerKw = message.requiredFeerateSatPerKw; + 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); + }; + + 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} [counterpartyForceClosed] ChannelStateChangeReason counterpartyForceClosed + * @property {events.IHolderForceClosedDetails|null} [holderForceClosed] ChannelStateChangeReason holderForceClosed + * @property {events.IProcessingErrorDetails|null} [processingError] ChannelStateChangeReason processingError + * @property {events.IHtlcsTimedOutDetails|null} [htlcsTimedOut] ChannelStateChangeReason htlcsTimedOut + * @property {events.IPeerFeerateTooLowDetails|null} [peerFeerateTooLow] ChannelStateChangeReason peerFeerateTooLow + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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 counterpartyForceClosed. + * @member {events.ICounterpartyForceClosedDetails|null|undefined} counterpartyForceClosed + * @memberof events.ChannelStateChangeReason + * @instance + */ + ChannelStateChangeReason.prototype.counterpartyForceClosed = null; + + /** + * ChannelStateChangeReason holderForceClosed. + * @member {events.IHolderForceClosedDetails|null|undefined} holderForceClosed + * @memberof events.ChannelStateChangeReason + * @instance + */ + ChannelStateChangeReason.prototype.holderForceClosed = null; + + /** + * ChannelStateChangeReason processingError. + * @member {events.IProcessingErrorDetails|null|undefined} processingError + * @memberof events.ChannelStateChangeReason + * @instance + */ + ChannelStateChangeReason.prototype.processingError = null; + + /** + * ChannelStateChangeReason htlcsTimedOut. + * @member {events.IHtlcsTimedOutDetails|null|undefined} htlcsTimedOut + * @memberof events.ChannelStateChangeReason + * @instance + */ + ChannelStateChangeReason.prototype.htlcsTimedOut = null; + + /** + * ChannelStateChangeReason peerFeerateTooLow. + * @member {events.IPeerFeerateTooLowDetails|null|undefined} peerFeerateTooLow + * @memberof events.ChannelStateChangeReason + * @instance + */ + ChannelStateChangeReason.prototype.peerFeerateTooLow = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ChannelStateChangeReason details. + * @member {"counterpartyForceClosed"|"holderForceClosed"|"processingError"|"htlcsTimedOut"|"peerFeerateTooLow"|undefined} details + * @memberof events.ChannelStateChangeReason + * @instance + */ + Object.defineProperty(ChannelStateChangeReason.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["counterpartyForceClosed", "holderForceClosed", "processingError", "htlcsTimedOut", "peerFeerateTooLow"]), + 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.counterpartyForceClosed != null && Object.hasOwnProperty.call(message, "counterpartyForceClosed")) + $root.events.CounterpartyForceClosedDetails.encode(message.counterpartyForceClosed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.holderForceClosed != null && Object.hasOwnProperty.call(message, "holderForceClosed")) + $root.events.HolderForceClosedDetails.encode(message.holderForceClosed, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.processingError != null && Object.hasOwnProperty.call(message, "processingError")) + $root.events.ProcessingErrorDetails.encode(message.processingError, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.htlcsTimedOut != null && Object.hasOwnProperty.call(message, "htlcsTimedOut")) + $root.events.HtlcsTimedOutDetails.encode(message.htlcsTimedOut, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.peerFeerateTooLow != null && Object.hasOwnProperty.call(message, "peerFeerateTooLow")) + $root.events.PeerFeerateTooLowDetails.encode(message.peerFeerateTooLow, 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.ChannelStateChangeReason(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.int32(); + break; + case 2: + message.message = reader.string(); + break; + case 3: + message.counterpartyForceClosed = $root.events.CounterpartyForceClosedDetails.decode(reader, reader.uint32()); + break; + case 4: + message.holderForceClosed = $root.events.HolderForceClosedDetails.decode(reader, reader.uint32()); + break; + case 5: + message.processingError = $root.events.ProcessingErrorDetails.decode(reader, reader.uint32()); + break; + case 6: + message.htlcsTimedOut = $root.events.HtlcsTimedOutDetails.decode(reader, reader.uint32()); + break; + case 7: + message.peerFeerateTooLow = $root.events.PeerFeerateTooLowDetails.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + var 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.counterpartyForceClosed != null && message.hasOwnProperty("counterpartyForceClosed")) { + properties.details = 1; + { + var error = $root.events.CounterpartyForceClosedDetails.verify(message.counterpartyForceClosed); + if (error) + return "counterpartyForceClosed." + error; + } + } + if (message.holderForceClosed != null && message.hasOwnProperty("holderForceClosed")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.events.HolderForceClosedDetails.verify(message.holderForceClosed); + if (error) + return "holderForceClosed." + error; + } + } + if (message.processingError != null && message.hasOwnProperty("processingError")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.events.ProcessingErrorDetails.verify(message.processingError); + if (error) + return "processingError." + error; + } + } + if (message.htlcsTimedOut != null && message.hasOwnProperty("htlcsTimedOut")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.events.HtlcsTimedOutDetails.verify(message.htlcsTimedOut); + if (error) + return "htlcsTimedOut." + error; + } + } + if (message.peerFeerateTooLow != null && message.hasOwnProperty("peerFeerateTooLow")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.events.PeerFeerateTooLowDetails.verify(message.peerFeerateTooLow); + if (error) + return "peerFeerateTooLow." + 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) { + if (object instanceof $root.events.ChannelStateChangeReason) + return object; + var message = new $root.events.ChannelStateChangeReason(); + switch (object.kind) { + 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.counterpartyForceClosed != null) { + if (typeof object.counterpartyForceClosed !== "object") + throw TypeError(".events.ChannelStateChangeReason.counterpartyForceClosed: object expected"); + message.counterpartyForceClosed = $root.events.CounterpartyForceClosedDetails.fromObject(object.counterpartyForceClosed); + } + if (object.holderForceClosed != null) { + if (typeof object.holderForceClosed !== "object") + throw TypeError(".events.ChannelStateChangeReason.holderForceClosed: object expected"); + message.holderForceClosed = $root.events.HolderForceClosedDetails.fromObject(object.holderForceClosed); + } + if (object.processingError != null) { + if (typeof object.processingError !== "object") + throw TypeError(".events.ChannelStateChangeReason.processingError: object expected"); + message.processingError = $root.events.ProcessingErrorDetails.fromObject(object.processingError); + } + if (object.htlcsTimedOut != null) { + if (typeof object.htlcsTimedOut !== "object") + throw TypeError(".events.ChannelStateChangeReason.htlcsTimedOut: object expected"); + message.htlcsTimedOut = $root.events.HtlcsTimedOutDetails.fromObject(object.htlcsTimedOut); + } + if (object.peerFeerateTooLow != null) { + if (typeof object.peerFeerateTooLow !== "object") + throw TypeError(".events.ChannelStateChangeReason.peerFeerateTooLow: object expected"); + message.peerFeerateTooLow = $root.events.PeerFeerateTooLowDetails.fromObject(object.peerFeerateTooLow); + } + 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 = {}; + var 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] : message.kind; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.counterpartyForceClosed != null && message.hasOwnProperty("counterpartyForceClosed")) { + object.counterpartyForceClosed = $root.events.CounterpartyForceClosedDetails.toObject(message.counterpartyForceClosed, options); + if (options.oneofs) + object.details = "counterpartyForceClosed"; + } + if (message.holderForceClosed != null && message.hasOwnProperty("holderForceClosed")) { + object.holderForceClosed = $root.events.HolderForceClosedDetails.toObject(message.holderForceClosed, options); + if (options.oneofs) + object.details = "holderForceClosed"; + } + if (message.processingError != null && message.hasOwnProperty("processingError")) { + object.processingError = $root.events.ProcessingErrorDetails.toObject(message.processingError, options); + if (options.oneofs) + object.details = "processingError"; + } + if (message.htlcsTimedOut != null && message.hasOwnProperty("htlcsTimedOut")) { + object.htlcsTimedOut = $root.events.HtlcsTimedOutDetails.toObject(message.htlcsTimedOut, options); + if (options.oneofs) + object.details = "htlcsTimedOut"; + } + if (message.peerFeerateTooLow != null && message.hasOwnProperty("peerFeerateTooLow")) { + object.peerFeerateTooLow = $root.events.PeerFeerateTooLowDetails.toObject(message.peerFeerateTooLow, options); + if (options.oneofs) + object.details = "peerFeerateTooLow"; + } + 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); + }; + + return ChannelStateChangeReason; + })(); + + events.ChannelStateChanged = (function() { + + /** + * Properties of a ChannelStateChanged. + * @memberof events + * @interface IChannelStateChanged + * @property {string|null} [channelId] ChannelStateChanged channelId + * @property {string|null} [userChannelId] ChannelStateChanged userChannelId + * @property {string|null} [counterpartyNodeId] ChannelStateChanged counterpartyNodeId + * @property {events.ChannelState|null} [state] ChannelStateChanged state + * @property {string|null} [fundingTxo] ChannelStateChanged fundingTxo + * @property {events.IChannelStateChangeReason|null} [reason] ChannelStateChanged reason + * @property {events.ChannelClosureInitiator|null} [closureInitiator] ChannelStateChanged closureInitiator + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChannelStateChanged channelId. + * @member {string} channelId + * @memberof events.ChannelStateChanged + * @instance + */ + ChannelStateChanged.prototype.channelId = ""; + + /** + * ChannelStateChanged userChannelId. + * @member {string} userChannelId + * @memberof events.ChannelStateChanged + * @instance + */ + ChannelStateChanged.prototype.userChannelId = ""; + + /** + * ChannelStateChanged counterpartyNodeId. + * @member {string} counterpartyNodeId + * @memberof events.ChannelStateChanged + * @instance + */ + ChannelStateChanged.prototype.counterpartyNodeId = ""; + + /** + * ChannelStateChanged state. + * @member {events.ChannelState} state + * @memberof events.ChannelStateChanged + * @instance + */ + ChannelStateChanged.prototype.state = 0; + + /** + * ChannelStateChanged fundingTxo. + * @member {string} fundingTxo + * @memberof events.ChannelStateChanged + * @instance + */ + ChannelStateChanged.prototype.fundingTxo = ""; + + /** + * ChannelStateChanged reason. + * @member {events.IChannelStateChangeReason|null|undefined} reason + * @memberof events.ChannelStateChanged + * @instance + */ + ChannelStateChanged.prototype.reason = null; + + /** + * ChannelStateChanged closureInitiator. + * @member {events.ChannelClosureInitiator} closureInitiator + * @memberof events.ChannelStateChanged + * @instance + */ + ChannelStateChanged.prototype.closureInitiator = 0; + + /** + * 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.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channelId); + if (message.userChannelId != null && Object.hasOwnProperty.call(message, "userChannelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.userChannelId); + if (message.counterpartyNodeId != null && Object.hasOwnProperty.call(message, "counterpartyNodeId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.counterpartyNodeId); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.fundingTxo != null && Object.hasOwnProperty.call(message, "fundingTxo")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.fundingTxo); + 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.closureInitiator != null && Object.hasOwnProperty.call(message, "closureInitiator")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.closureInitiator); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.ChannelStateChanged(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.channelId = reader.string(); + break; + case 2: + message.userChannelId = reader.string(); + break; + case 3: + message.counterpartyNodeId = reader.string(); + break; + case 4: + message.state = reader.int32(); + break; + case 5: + message.fundingTxo = reader.string(); + break; + case 6: + message.reason = $root.events.ChannelStateChangeReason.decode(reader, reader.uint32()); + break; + case 7: + message.closureInitiator = reader.int32(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: string expected"; + if (message.userChannelId != null && message.hasOwnProperty("userChannelId")) + if (!$util.isString(message.userChannelId)) + return "userChannelId: string expected"; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + if (!$util.isString(message.counterpartyNodeId)) + return "counterpartyNodeId: 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.fundingTxo != null && message.hasOwnProperty("fundingTxo")) + if (!$util.isString(message.fundingTxo)) + return "fundingTxo: string expected"; + if (message.reason != null && message.hasOwnProperty("reason")) { + var error = $root.events.ChannelStateChangeReason.verify(message.reason); + if (error) + return "reason." + error; + } + if (message.closureInitiator != null && message.hasOwnProperty("closureInitiator")) + switch (message.closureInitiator) { + default: + return "closureInitiator: 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) { + if (object instanceof $root.events.ChannelStateChanged) + return object; + var message = new $root.events.ChannelStateChanged(); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.userChannelId != null) + message.userChannelId = String(object.userChannelId); + if (object.counterpartyNodeId != null) + message.counterpartyNodeId = String(object.counterpartyNodeId); + switch (object.state) { + 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.fundingTxo != null) + message.fundingTxo = String(object.fundingTxo); + if (object.reason != null) { + if (typeof object.reason !== "object") + throw TypeError(".events.ChannelStateChanged.reason: object expected"); + message.reason = $root.events.ChannelStateChangeReason.fromObject(object.reason); + } + switch (object.closureInitiator) { + case "CHANNEL_CLOSURE_INITIATOR_UNSPECIFIED": + case 0: + message.closureInitiator = 0; + break; + case "CHANNEL_CLOSURE_INITIATOR_LOCAL": + case 1: + message.closureInitiator = 1; + break; + case "CHANNEL_CLOSURE_INITIATOR_REMOTE": + case 2: + message.closureInitiator = 2; + break; + case "CHANNEL_CLOSURE_INITIATOR_UNKNOWN": + case 3: + message.closureInitiator = 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 = {}; + var object = {}; + if (options.defaults) { + object.channelId = ""; + object.userChannelId = ""; + object.counterpartyNodeId = ""; + object.state = options.enums === String ? "CHANNEL_STATE_UNSPECIFIED" : 0; + object.fundingTxo = ""; + object.reason = null; + object.closureInitiator = options.enums === String ? "CHANNEL_CLOSURE_INITIATOR_UNSPECIFIED" : 0; + } + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + if (message.userChannelId != null && message.hasOwnProperty("userChannelId")) + object.userChannelId = message.userChannelId; + if (message.counterpartyNodeId != null && message.hasOwnProperty("counterpartyNodeId")) + object.counterpartyNodeId = message.counterpartyNodeId; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.events.ChannelState[message.state] : message.state; + if (message.fundingTxo != null && message.hasOwnProperty("fundingTxo")) + object.fundingTxo = message.fundingTxo; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = $root.events.ChannelStateChangeReason.toObject(message.reason, options); + if (message.closureInitiator != null && message.hasOwnProperty("closureInitiator")) + object.closureInitiator = options.enums === String ? $root.events.ChannelClosureInitiator[message.closureInitiator] : message.closureInitiator; + 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.PaymentReceived(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.payment = $root.types.Payment.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.payment != null && message.hasOwnProperty("payment")) { + var error = $root.types.Payment.verify(message.payment); + 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) { + if (object instanceof $root.events.PaymentReceived) + return object; + var 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); + } + 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 = {}; + var 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.PaymentSuccessful(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.payment = $root.types.Payment.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.payment != null && message.hasOwnProperty("payment")) { + var error = $root.types.Payment.verify(message.payment); + 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) { + if (object instanceof $root.events.PaymentSuccessful) + return object; + var 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); + } + 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 = {}; + var 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.PaymentFailed(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.payment = $root.types.Payment.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.payment != null && message.hasOwnProperty("payment")) { + var error = $root.types.Payment.verify(message.payment); + 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) { + if (object instanceof $root.events.PaymentFailed) + return object; + var 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); + } + 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 = {}; + var 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); + }; + + 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.PaymentClaimable(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.payment = $root.types.Payment.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.payment != null && message.hasOwnProperty("payment")) { + var error = $root.types.Payment.verify(message.payment); + 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) { + if (object instanceof $root.events.PaymentClaimable) + return object; + var 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); + } + 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 = {}; + var 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); + }; + + return PaymentClaimable; + })(); + + events.PaymentForwarded = (function() { + + /** + * Properties of a PaymentForwarded. + * @memberof events + * @interface IPaymentForwarded + * @property {types.IForwardedPayment|null} [forwardedPayment] PaymentForwarded forwardedPayment + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PaymentForwarded forwardedPayment. + * @member {types.IForwardedPayment|null|undefined} forwardedPayment + * @memberof events.PaymentForwarded + * @instance + */ + PaymentForwarded.prototype.forwardedPayment = 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.forwardedPayment != null && Object.hasOwnProperty.call(message, "forwardedPayment")) + $root.types.ForwardedPayment.encode(message.forwardedPayment, 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.events.PaymentForwarded(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.forwardedPayment = $root.types.ForwardedPayment.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.forwardedPayment != null && message.hasOwnProperty("forwardedPayment")) { + var error = $root.types.ForwardedPayment.verify(message.forwardedPayment); + if (error) + return "forwardedPayment." + 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) { + if (object instanceof $root.events.PaymentForwarded) + return object; + var message = new $root.events.PaymentForwarded(); + if (object.forwardedPayment != null) { + if (typeof object.forwardedPayment !== "object") + throw TypeError(".events.PaymentForwarded.forwardedPayment: object expected"); + message.forwardedPayment = $root.types.ForwardedPayment.fromObject(object.forwardedPayment); + } + 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 = {}; + var object = {}; + if (options.defaults) + object.forwardedPayment = null; + if (message.forwardedPayment != null && message.hasOwnProperty("forwardedPayment")) + object.forwardedPayment = $root.types.ForwardedPayment.toObject(message.forwardedPayment, 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); + }; + + return PaymentForwarded; + })(); + + return events; +})(); + +$root.error = (function() { + + /** + * Namespace error. + * @exports error + * @namespace + */ + var error = {}; + + error.ErrorResponse = (function() { + + /** + * Properties of an ErrorResponse. + * @memberof error + * @interface IErrorResponse + * @property {string|null} [message] ErrorResponse message + * @property {error.ErrorCode|null} [errorCode] ErrorResponse errorCode + */ + + /** + * 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 (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ErrorResponse message. + * @member {string} message + * @memberof error.ErrorResponse + * @instance + */ + ErrorResponse.prototype.message = ""; + + /** + * ErrorResponse errorCode. + * @member {error.ErrorCode} errorCode + * @memberof error.ErrorResponse + * @instance + */ + ErrorResponse.prototype.errorCode = 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.errorCode != null && Object.hasOwnProperty.call(message, "errorCode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.errorCode); + 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.error.ErrorResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.message = reader.string(); + break; + case 2: + message.errorCode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + 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) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + switch (message.errorCode) { + default: + return "errorCode: 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) { + if (object instanceof $root.error.ErrorResponse) + return object; + var message = new $root.error.ErrorResponse(); + if (object.message != null) + message.message = String(object.message); + switch (object.errorCode) { + case "UNKNOWN_ERROR": + case 0: + message.errorCode = 0; + break; + case "INVALID_REQUEST_ERROR": + case 1: + message.errorCode = 1; + break; + case "AUTH_ERROR": + case 2: + message.errorCode = 2; + break; + case "LIGHTNING_ERROR": + case 3: + message.errorCode = 3; + break; + case "INTERNAL_SERVER_ERROR": + case 4: + message.errorCode = 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 = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.errorCode = options.enums === String ? "UNKNOWN_ERROR" : 0; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + object.errorCode = options.enums === String ? $root.error.ErrorCode[message.errorCode] : message.errorCode; + 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); + }; + + return ErrorResponse; + })(); + + /** + * ErrorCode enum. + * @name error.ErrorCode + * @enum {string} + * @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() { + var 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; +})(); + +module.exports = $root; diff --git a/src/server/modules/node/ldk-server/proto/types.proto b/src/server/modules/node/ldk-server/proto/types.proto new file mode 100644 index 000000000..83be8be89 --- /dev/null +++ b/src/server/modules/node/ldk-server/proto/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/src/server/modules/node/lightning.types.ts b/src/server/modules/node/lightning.types.ts index b28d40893..b65f81372 100644 --- a/src/server/modules/node/lightning.types.ts +++ b/src/server/modules/node/lightning.types.ts @@ -6,6 +6,7 @@ import { Routes } from 'lightning'; export const NodeType = { LND: 'lnd', LITD: 'litd', + LDK_SERVER: 'ldk-server', } as const; export type NodeType = (typeof NodeType)[keyof typeof NodeType]; @@ -367,6 +368,7 @@ export interface LightningProvider { cert?: string; macaroon?: string; authToken?: string; + tlsCertPath?: string; }): any; /** Verify the connection is valid and the node matches this provider type */ diff --git a/src/server/modules/node/provider-registry.module.ts b/src/server/modules/node/provider-registry.module.ts index 11bd44f1d..ec0c476a7 100644 --- a/src/server/modules/node/provider-registry.module.ts +++ b/src/server/modules/node/provider-registry.module.ts @@ -1,10 +1,11 @@ import { Module } from '@nestjs/common'; import { LndModule } from './lnd/lnd.module'; import { LitdModule } from './litd/litd.module'; +import { LdkServerModule } from './ldk-server/ldk-server.module'; import { ProviderRegistryService } from './provider-registry.service'; @Module({ - imports: [LndModule, LitdModule], + imports: [LndModule, LitdModule, LdkServerModule], providers: [ProviderRegistryService], exports: [ProviderRegistryService], }) diff --git a/src/server/modules/node/provider-registry.service.ts b/src/server/modules/node/provider-registry.service.ts index ab73ae867..978ae33a6 100644 --- a/src/server/modules/node/provider-registry.service.ts +++ b/src/server/modules/node/provider-registry.service.ts @@ -2,14 +2,20 @@ import { Injectable } from '@nestjs/common'; import { LightningProvider, NodeType } from './lightning.types'; import { LndService } from './lnd/lnd.service'; import { LitdService } from './litd/litd.service'; +import { LdkServerService } from './ldk-server/ldk-server.service'; @Injectable() export class ProviderRegistryService { private providers = new Map(); - constructor(lndService: LndService, litdService: LitdService) { + constructor( + lndService: LndService, + litdService: LitdService, + ldkServerService: LdkServerService + ) { this.providers.set(NodeType.LND, lndService); this.providers.set(NodeType.LITD, litdService); + this.providers.set(NodeType.LDK_SERVER, ldkServerService); } register(type: string, provider: LightningProvider): void { diff --git a/src/server/modules/sub/sub.service.ts b/src/server/modules/sub/sub.service.ts index 68dba924b..0e657c2ef 100644 --- a/src/server/modules/sub/sub.service.ts +++ b/src/server/modules/sub/sub.service.ts @@ -17,6 +17,9 @@ import { UserConfigService } from '../api/userConfig/userConfig.service'; import { getAmbossSpaceUrl, getNetwork } from 'src/server/utils/network'; import { AmbossService } from '../api/amboss/amboss.service'; import { ProviderRegistryService } from '../node/provider-registry.service'; +import { NodeType } from '../node/lightning.types'; +import { mapLdkServerEvent } from '../node/ldk-server/ldk-server.events'; +import { LdkServerService } from '../node/ldk-server/ldk-server.service'; const restartSubscriptionTimeMs = 1000 * 30; @@ -30,6 +33,8 @@ type SubscriptionNode = { @Injectable() export class SubService implements OnApplicationBootstrap { subscriptions = []; + ldkSubscriptions: Array<{ stop?: () => void; removeAllListeners(): void }> = + []; retryCount = 0; constructor( @@ -51,6 +56,49 @@ export class SubService implements OnApplicationBootstrap { } this.startSubscription(); + this.startLdkServerSubscriptions(); + } + + async startLdkServerSubscriptions() { + const accounts = this.accountsService.getAllAccounts(); + + for (const key in accounts) { + if (!Object.prototype.hasOwnProperty.call(accounts, key)) continue; + + const account = accounts[key]; + if (account.type !== NodeType.LDK_SERVER || account.encrypted) continue; + + try { + const info = await this.nodeService.getWalletInfo(account.hash); + const sliced = info.public_key.slice(0, 10); + const name = `${info.alias || 'ldk-server'}(${sliced})`; + const provider = this.providerRegistry.getProvider( + account.type + ) as unknown as LdkServerService; + const sub = provider.subscribeEvents(account.connection); + + this.logger.info(`Starting gRPC event stream for ldk-server: ${name}`); + + sub.on('data', envelope => { + const event = mapLdkServerEvent(envelope); + if (!event) return; + this.logger.info(`ldk-server event: ${event.name}`, { node: name }); + this.sseService.emit(account.hash, event.name, event.data); + }); + + sub.on('error', err => { + sub.removeAllListeners(); + this.logger.error(`ErrorInLdkServerEventStream: ${name}`, { err }); + }); + + this.ldkSubscriptions.push(sub); + } catch (err) { + this.logger.error( + `Failed to start gRPC event stream for ldk-server account ${account.name}`, + { err } + ); + } + } } async startSubscription() { @@ -70,6 +118,7 @@ export class SubService implements OnApplicationBootstrap { if ( !account.encrypted && + account.type !== NodeType.LDK_SERVER && this.providerRegistry.hasProvider(account.type) ) { const provider = this.providerRegistry.getProvider(