diff --git a/docs/LDK_SERVER_GAPS.md b/docs/LDK_SERVER_GAPS.md new file mode 100644 index 000000000..abd1cd3c5 --- /dev/null +++ b/docs/LDK_SERVER_GAPS.md @@ -0,0 +1,234 @@ +# ldk-server Gap Analysis for ThunderHub + +This document details every ThunderHub `LightningProvider` method and field that ldk-server cannot fully support. It serves as a reference for what ldk-server would need to add for full ThunderHub feature parity. + +Note: Real-time payment/invoice/forward events are handled via RabbitMQ integration, so those are not gaps. + +## Entirely Unsupported Capabilities + +These capabilities have no corresponding ldk-server endpoints. All methods throw "Not supported". + +### BACKUPS + +| Method | Notes | +|---|---| +| `getBackups()` | No backup system in ldk-server | +| `verifyBackup(backup)` | No backup system | +| `verifyBackups(args)` | No backup system | +| `recoverFundsFromChannels(backup)` | No backup system | + +**What ldk-server would need:** Backup export/import/verify endpoints. LDK Node's state is persisted in its storage backend, so the equivalent might be a database snapshot/restore API. + +### MACAROONS + +| Method | Notes | +|---|---| +| `grantAccess(permissions)` | ldk-server uses a single API key (HMAC auth), not macaroons. No fine-grained permission tokens. | + +**What ldk-server would need:** A scoped token/API key system, or the ability to create restricted API keys with specific permission sets. + +### DIFFIE_HELLMAN + +| Method | Notes | +|---|---| +| `diffieHellmanComputeSecret(options)` | No key derivation endpoint | + +**What ldk-server would need:** An endpoint wrapping LDK's `KeysManager` to compute ECDH shared secrets, taking `partner_public_key`, `key_family`, and `key_index` as inputs. + +--- + +## Partially Supported Capabilities + +These capabilities are advertised but some methods or fields within them are missing. + +### WALLET_INFO + +#### `getWalletInfo()` + +**Missing ldk-server data (fields returned as defaults):** + +| ThunderHub Field | Current Default | What ldk-server would need | +|---|---|---| +| `color` | `'#000000'` | Add `node_color` to `GetNodeInfoResponse` | +| `version` | `'ldk-server'` | Add `version` / `ldk_node_version` to `GetNodeInfoResponse` | +| `active_channels_count` | Computed via `ListChannels` | Add counts to `GetNodeInfoResponse` (nice to have) | +| `closed_channels_count` | `0` | Requires `ListClosedChannels` (see below) | +| `peers_count` | Computed via `ListPeers` | Add count to `GetNodeInfoResponse` (nice to have) | +| `latest_block_at` | `new Date().toISOString()` | Add block timestamp to `BestBlock` | +| `is_synced_to_chain` | Derived from sync timestamps | Add explicit `is_synced` boolean (nice to have) | +| `is_synced_to_graph` | Derived from RGS timestamp | Same | + +#### `getWalletVersion()` + +**Entirely unsupported.** Returns dummy data. The LND-specific RPC flags (`is_autopilotrpc_enabled`, etc.) are not applicable. + +**What ldk-server would need:** A `GetVersion` endpoint returning `ldk_node_version` and `ldk_server_version`. + +### CHANNELS + +#### `getClosedChannels()` + +**Entirely unsupported.** Returns empty array. ldk-server doesn't maintain a historical record of closed channels. + +**What ldk-server would need:** A `ListClosedChannels` endpoint. LDK Node emits `ChannelClosed` events — ldk-server could persist these and expose them via an API. + +#### `getChannel(id)` — Channel Policy Info + +Falls back to network graph (`GraphGetChannel`). Works for public channels. + +**Missing fields:** + +| Field | Notes | +|---|---| +| `time_offline` | Not tracked | +| `time_online` | Not tracked | +| `pending_payments` | In-flight HTLCs — not exposed | + +**What ldk-server would need:** Expose HTLC details per channel in `ListChannels` response, and optionally track uptime metrics. + +#### `getChannelBalance()` + +Returns `totalLightningBalanceSats` from `GetBalances`. + +**Missing:** `pending_balance` (returned as `0`). Could be derived from `pendingBalancesFromChannelClosures` but the shape differs. + +#### `openChannel()` + +ldk-server's `OpenChannel` requires a peer `address` parameter. The implementation looks up the address from `ListPeers`, so the peer must already be connected. This is an API mismatch, not a missing feature. + +### CHAIN + +#### `getChainTransactions()` + +**Entirely unsupported.** Returns empty array. + +**What ldk-server would need:** A `ListChainTransactions` endpoint, or enough data in `ListPayments` for on-chain payments to reconstruct this shape (particularly `fee`, `output_addresses`, `confirmation_count`, raw `transaction` hex). + +#### `getUtxos()` + +**Entirely unsupported.** Throws error. + +**What ldk-server would need:** A `ListUtxos` endpoint exposing the on-chain wallet's unspent outputs. BDK tracks this data internally. + +#### `sendToChainAddress()` + +Works but response only contains `txid`. + +**Missing response fields:** `confirmation_count`, `is_confirmed`, actual `tokens` sent (may differ from request when fees are deducted). + +### PAYMENTS + +#### `pay()` + +Works but `Bolt11SendResponse` only returns `payment_id`. + +**Missing response fields:** `fee`, `hops`, `is_confirmed`, `mtokens`, `secret` (preimage), `tokens`. + +Note: The RabbitMQ `PaymentSuccessful` event delivers fee/amount/preimage to the frontend in real-time, so the user experience is not degraded. However, the `pay()` resolver still returns minimal data. + +**What ldk-server would need:** Return richer data in `Bolt11SendResponse`. + +#### `getPayments()` + +Works via `ListPayments` filtered to outbound. + +**Missing fields per payment:** + +| Field | What ldk-server would need | +|---|---| +| `destination` | Add `destination_node_id` to `Payment` type | +| `hops` | Route hop tracking (significant change to LDK Node) | +| `request` | Store original BOLT11 invoice string in `Payment` | + +### INVOICES + +#### `createInvoice()` + +Works. ldk-server returns `payment_hash` and `payment_secret` in `Bolt11ReceiveResponse`. + +#### `getInvoices()` + +Works via `ListPayments` filtered to inbound. + +**Missing fields per invoice:** `description`, `description_hash`, `expires_at`, `request` (original BOLT11 string), `payments` (HTLC attempts). + +**What ldk-server would need:** Store and return richer metadata with inbound payments. + +#### `subscribeToInvoice(id)` + +Works via polling `GetPaymentDetails` every 2 seconds using the payment hash. The "wait for payment" UI functions correctly. + +### NETWORK_INFO + +#### `getNetworkInfo()` + +**Entirely unsupported.** Throws error. + +**What ldk-server would need:** A `GetNetworkInfo` endpoint aggregating graph statistics (`channel_count`, `node_count`, `total_capacity`, min/max/avg/median channel sizes). + +#### `getNode(public_key)` + +Works via `GraphGetNode`. Minor gap: `GraphNode` only lists channel IDs, not capacities — each would require a separate `GraphGetChannel` call. + +### ROUTING_FEES + +#### `updateRoutingFees()` + +Works via `UpdateChannelConfig` (requires channel lookup first). + +**Missing:** `max_htlc_mtokens` and `min_htlc_mtokens` are not mappable — ldk-server's `ChannelConfig` doesn't expose these. + +### PEERS + +#### `getPeers()` + +Works but several fields are unavailable. + +**Missing:** `bytes_received`, `bytes_sent`, `is_inbound`, `is_sync_peer`, `ping_time`, `tokens_received`, `tokens_sent`. LDK's peer handler may not track all of these natively. + +### FORWARDS + +#### `getForwards()` + +Works via `ListForwardedPayments`. + +**Missing:** `created_at` timestamp per forward. Returned as empty string. + +**What ldk-server would need:** Add a `timestamp` field to `ForwardedPayment`. + +### SIGN_MESSAGE + +#### `verifyMessage(message, signature)` + +ldk-server's `VerifySignature` requires a `public_key` parameter. ThunderHub doesn't pass one — it expects the implementation to determine who signed it (like LND does). Current workaround: uses the node's own public key, so only self-signed messages can be verified. + +**What ldk-server would need:** Return the signer's public key on successful verification, not just a boolean. + +--- + +## Summary: Priority Additions for ldk-server + +### High Priority (core ThunderHub functionality) + +1. **Add `destination_node_id` to `Payment` type** — payment history display +2. **Add `timestamp` to `ForwardedPayment`** — forward history display +3. **Add `node_color` and `version` to `GetNodeInfoResponse`** — node dashboard + +### Medium Priority (complete feature set) + +6. **`ListClosedChannels` endpoint** — channel history +7. **`ListChainTransactions` endpoint** — on-chain transaction history +8. **`ListUtxos` endpoint** — UTXO management +9. **`GetNetworkInfo` endpoint** — network statistics dashboard +10. **Richer `OnchainSendResponse`** — amount sent, fee +11. **Store invoice metadata** — description, expiry, request string + +### Low Priority (nice to have) + +12. **Peer traffic statistics** in `ListPeers` +13. **Channel uptime tracking** (`time_online`/`time_offline`) +14. **HTLC details** per channel (pending payments) +15. **`max_htlc_msat`/`min_htlc_msat`** in `UpdateChannelConfig` +16. **Backup/restore endpoints** +17. **Scoped API keys** (macaroon equivalent) +18. **ECDH shared secret computation** (Diffie-Hellman) diff --git a/docs/LDK_SERVER_SETUP.md b/docs/LDK_SERVER_SETUP.md new file mode 100644 index 000000000..1fa8903b1 --- /dev/null +++ b/docs/LDK_SERVER_SETUP.md @@ -0,0 +1,148 @@ +# Using ThunderHub with ldk-server + +This guide walks through connecting ThunderHub to an [ldk-server](https://github.com/lightningdevkit/ldk-server) node. + +## Prerequisites + +- A running ldk-server instance +- ThunderHub installed and configured + +## Account Configuration + +Add an ldk-server account to your ThunderHub YAML config file (default: `~/.thunderhub/thubConfig.yaml`): + +```yaml +masterPassword: 'your-password' +accounts: + - name: 'My LDK Node' + type: ldk-server + serverUrl: 'https://localhost:3002' + authToken: '' + password: 'account-password' +``` + +### Required Fields + +| Field | Description | +|---|---| +| `type` | Must be `ldk-server` | +| `serverUrl` | The ldk-server HTTPS URL (e.g. `https://localhost:3002`) | +| `authToken` | The API key generated by ldk-server on first run (hex-encoded) | +| `password` | Password for this account in ThunderHub (or use `masterPassword`) | +| `name` | Display name for the node in ThunderHub | + +### Finding Your API Key + +ldk-server generates a 32-byte random API key on first startup. It's stored as raw bytes at: + +``` +/api_key +``` + +Where `` is the `storage_dir_path` from your `ldk-server-config.toml`. + +The `authToken` field expects the key as a **hex-encoded string** (64 characters). Convert it with: + +```bash +xxd -p -c 32 /path/to/storage_dir/api_key +``` + +Do not use `cat` — the file contains raw bytes, not text. + +### TLS Certificate + +ldk-server requires TLS and generates a self-signed certificate by default at `/tls.crt`. + +Point ThunderHub at the cert by adding `tlsCertPath` to the account config: + +```yaml +accounts: + - name: 'My LDK Node' + type: ldk-server + serverUrl: 'https://localhost:3002' + authToken: '' + tlsCertPath: '/path/to/storage_dir/tls.crt' + password: 'account-password' +``` + +If `tlsCertPath` is omitted, ThunderHub will skip TLS verification (equivalent to `NODE_TLS_REJECT_UNAUTHORIZED=0`). This is fine for local development but not recommended for production. + +## Real-Time Events (Optional) + +If ldk-server is configured with RabbitMQ event publishing, ThunderHub can subscribe to real-time payment, invoice, and forward events. Add these fields to your account config: + +```yaml +accounts: + - name: 'My LDK Node' + type: ldk-server + serverUrl: 'https://localhost:3002' + authToken: '' + password: 'account-password' + rabbitmqUrl: 'amqp://guest:guest@localhost:5672/%2f' + rabbitmqExchangeName: 'ldk_events' +``` + +| Field | Description | Default | +|---|---|---| +| `rabbitmqUrl` | AMQP connection string for RabbitMQ | *(none — events disabled)* | +| `rabbitmqExchangeName` | Exchange name matching ldk-server's config | `ldk_events` | + +These must match the `[rabbitmq]` section in your `ldk-server-config.toml`: + +```toml +[rabbitmq] +connection_string = "amqp://guest:guest@localhost:5672/%2f" +exchange_name = "ldk_events" +``` + +Without RabbitMQ configured, all API features still work — you just won't see real-time event notifications in the ThunderHub sidebar. + +## Supported Features + +With ldk-server, ThunderHub supports: + +- Node info dashboard (alias, block height, sync status, balances) +- Channel management (open, close, force-close, list) +- On-chain wallet (receive address, send, balance) +- Lightning payments (send BOLT11 invoices, keysend) +- Invoice creation and listing +- Peer management (connect, disconnect, list) +- Forward history +- Message signing and verification +- Network graph queries +- Routing fee configuration + +### Not Supported + +Some LND-specific features are not available with ldk-server: + +- Channel backups +- Decode payment request (BOLT11 parsing) +- UTXO listing +- On-chain transaction history +- Network info aggregates +- Macaroon management +- Watchtower integration + +See [LDK_SERVER_GAPS.md](./LDK_SERVER_GAPS.md) for a detailed breakdown. + +## Example: Full Config with Both LND and ldk-server + +You can run both LND and ldk-server accounts simultaneously: + +```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:3002' + authToken: '' + rabbitmqUrl: 'amqp://guest:guest@localhost:5672/%2f' +``` + +The first account defaults to `type: lnd` when omitted. Switch between them in the ThunderHub UI. diff --git a/eslint.config.js b/eslint.config.js index e5aecc3e8..8365124e4 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -68,4 +68,5 @@ module.exports = defineConfig([{ "**/node_modules", "**/dist", "**/*.generated.tsx", + "**/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 5e4812402..48dec8884 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,6 +31,7 @@ "@tailwindcss/vite": "^4.2.1", "@tanstack/react-table": "^8.21.3", "@vulpemventures/secp256k1-zkp": "^3.2.1", + "amqplib": "^0.10.9", "async": "^3.2.6", "bcryptjs": "^3.0.3", "bech32": "^2.0.0", @@ -60,6 +61,7 @@ "otplib": "^13.3.0", "passport": "^0.7.0", "passport-jwt": "^4.0.1", + "protobufjs": "^8.0.0", "qrcode.react": "^4.2.0", "radix-ui": "^1.4.3", "react": "^18.2.0", @@ -93,6 +95,7 @@ "@graphql-codegen/typescript-resolvers": "^5.1.7", "@nestjs/cli": "^11.0.16", "@nestjs/schematics": "^11.0.9", + "@types/amqplib": "^0.10.8", "@types/async": "^3.2.25", "@types/big.js": "^6.2.2", "@types/d3-time-format": "^4.0.3", @@ -3444,6 +3447,30 @@ "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", "license": "Apache-2.0" }, + "node_modules/@grpc/proto-loader/node_modules/protobufjs": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz", + "integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==", + "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" + }, + "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", @@ -7965,6 +7992,16 @@ "tslib": "^2.4.0" } }, + "node_modules/@types/amqplib": { + "version": "0.10.8", + "resolved": "https://registry.npmjs.org/@types/amqplib/-/amqplib-0.10.8.tgz", + "integrity": "sha512-vtDp8Pk1wsE/AuQ8/Rgtm6KUZYqcnTgNvEHwzCkX8rL7AGsC6zqAfKAAJhUZXFhM/Pp++tbnUHiam/8vVpPztA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/async": { "version": "3.2.25", "resolved": "https://registry.npmjs.org/@types/async/-/async-3.2.25.tgz", @@ -9265,6 +9302,19 @@ "ajv": "^8.8.2" } }, + "node_modules/amqplib": { + "version": "0.10.9", + "resolved": "https://registry.npmjs.org/amqplib/-/amqplib-0.10.9.tgz", + "integrity": "sha512-jwSftI4QjS3mizvnSnOrPGYiUnm1vI2OP1iXeOUz5pb74Ua0nbf6nPyyTzuiCLEE3fMpaJORXh2K/TQ08H5xGA==", + "license": "MIT", + "dependencies": { + "buffer-more-ints": "~1.0.0", + "url-parse": "~1.5.10" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/ansi-colors": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", @@ -10002,6 +10052,12 @@ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, + "node_modules/buffer-more-ints": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-more-ints/-/buffer-more-ints-1.0.0.tgz", + "integrity": "sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg==", + "license": "MIT" + }, "node_modules/bundle-name": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz", @@ -18230,9 +18286,9 @@ "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.0.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-8.0.0.tgz", + "integrity": "sha512-jx6+sE9h/UryaCZhsJWbJtTEy47yXoGNYI4z8ZaRncM0zBKeRqjO2JEcOUYwrYGb1WLhXM1FfMzW3annvFv0rw==", "hasInstallScript": true, "license": "BSD-3-Clause", "dependencies": { @@ -18339,6 +18395,12 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "license": "MIT" + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -18970,6 +19032,12 @@ "node": ">=0.10.0" } }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "license": "MIT" + }, "node_modules/resize-observer-polyfill": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", @@ -21752,6 +21820,16 @@ "node": ">=6" } }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "license": "MIT", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "node_modules/urlpattern-polyfill": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-10.1.0.tgz", diff --git a/package.json b/package.json index e86b5a01c..ccdc9f7c3 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "@tailwindcss/vite": "^4.2.1", "@tanstack/react-table": "^8.21.3", "@vulpemventures/secp256k1-zkp": "^3.2.1", + "amqplib": "^0.10.9", "async": "^3.2.6", "bcryptjs": "^3.0.3", "bech32": "^2.0.0", @@ -86,6 +87,7 @@ "otplib": "^13.3.0", "passport": "^0.7.0", "passport-jwt": "^4.0.1", + "protobufjs": "^8.0.0", "qrcode.react": "^4.2.0", "radix-ui": "^1.4.3", "react": "^18.2.0", @@ -119,6 +121,7 @@ "@graphql-codegen/typescript-resolvers": "^5.1.7", "@nestjs/cli": "^11.0.16", "@nestjs/schematics": "^11.0.9", + "@types/amqplib": "^0.10.8", "@types/async": "^3.2.25", "@types/big.js": "^6.2.2", "@types/d3-time-format": "^4.0.3", diff --git a/src/server/modules/accounts/accounts.service.ts b/src/server/modules/accounts/accounts.service.ts index 9f3ec7869..2a62b7532 100644 --- a/src/server/modules/accounts/accounts.service.ts +++ b/src/server/modules/accounts/accounts.service.ts @@ -85,6 +85,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 855e28813..64725a958 100644 --- a/src/server/modules/files/files.service.ts +++ b/src/server/modules/files/files.service.ts @@ -257,6 +257,9 @@ export class FilesService { encrypted, twofaSecret, authToken, + tlsCertPath, + rabbitmqUrl, + rabbitmqExchangeName, } = resolvedAccount; const nodeType = (accountType as NodeType) || NodeType.LND; @@ -330,6 +333,9 @@ export class FilesService { password: password || masterPassword || '', twofaSecret: twofaSecret || '', authToken: authToken || undefined, + tlsCertPath: tlsCertPath || undefined, + rabbitmqUrl: rabbitmqUrl || undefined, + rabbitmqExchangeName: rabbitmqExchangeName || undefined, ...encryptedProps, }; } diff --git a/src/server/modules/files/files.types.ts b/src/server/modules/files/files.types.ts index f6ca5a768..aceae2df1 100644 --- a/src/server/modules/files/files.types.ts +++ b/src/server/modules/files/files.types.ts @@ -22,6 +22,9 @@ export type AccountType = { encrypted?: boolean; twofaSecret?: string | null; authToken?: string; + tlsCertPath?: string; + rabbitmqUrl?: string; + rabbitmqExchangeName?: string; }; export type UnresolvedAccountType = { @@ -37,6 +40,9 @@ export type UnresolvedAccountType = { certificate?: string; encrypted?: boolean | string; authToken?: string; + tlsCertPath?: string; + rabbitmqUrl?: string; + rabbitmqExchangeName?: string; }; export type ParsedAccount = { @@ -52,6 +58,9 @@ export type ParsedAccount = { encryptedMacaroon: string; twofaSecret: string; authToken?: string; + tlsCertPath?: string; + rabbitmqUrl?: string; + rabbitmqExchangeName?: string; }; export type AccountConfigType = { 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..b3ac895b6 --- /dev/null +++ b/src/server/modules/node/ldk-server/ldk-server.helpers.ts @@ -0,0 +1,176 @@ +import crypto from 'crypto'; +import https from 'https'; +import http from 'http'; +import fs from 'fs'; +import { error as errorProto } from './proto/ldk-server'; + +export class LdkServerClient { + readonly baseUrl: string; + readonly apiKey: string; + readonly httpsAgent?: https.Agent; + + constructor(baseUrl: string, apiKey: string, tlsCertPath?: string) { + this.baseUrl = baseUrl.replace(/\/$/, ''); + this.apiKey = apiKey; + + if (baseUrl.startsWith('https')) { + if (tlsCertPath) { + const ca = fs.readFileSync(tlsCertPath); + this.httpsAgent = new https.Agent({ ca }); + } else { + // No cert provided — skip verification for self-signed certs + this.httpsAgent = new https.Agent({ rejectUnauthorized: false }); + } + } + } + + 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 writer = RequestClass.encode(data); + const body = writer.finish() as Uint8Array; + + const timestamp = BigInt(Math.floor(Date.now() / 1000)); + const hmacHex = this.computeHmac(timestamp, body); + + const url = `${this.baseUrl}/${endpoint}`; + const bodyBuf = Buffer.from(body); + + const resp = await this.doRequest(url, bodyBuf, timestamp, hmacHex); + + if (resp.statusCode < 200 || resp.statusCode >= 300) { + let errorMsg = `ldk-server error (${resp.statusCode})`; + try { + const errorResponse = errorProto.ErrorResponse.decode( + new Uint8Array(resp.data) + ); + errorMsg = errorResponse.message || errorMsg; + } catch { + // Could not decode error response + } + throw new Error(errorMsg); + } + + return ResponseClass.decode(new Uint8Array(resp.data)); + } + + private doRequest( + url: string, + body: Buffer, + timestamp: bigint, + hmacHex: string + ): Promise<{ statusCode: number; data: Buffer }> { + return new Promise((resolve, reject) => { + const parsedUrl = new URL(url); + const isHttps = parsedUrl.protocol === 'https:'; + const mod = isHttps ? https : http; + + const options: https.RequestOptions = { + method: 'POST', + hostname: parsedUrl.hostname, + port: parsedUrl.port, + path: parsedUrl.pathname, + headers: { + 'Content-Type': 'application/octet-stream', + 'X-Auth': `HMAC ${timestamp.toString()}:${hmacHex}`, + 'Content-Length': body.length, + }, + ...(isHttps && this.httpsAgent ? { agent: this.httpsAgent } : {}), + }; + + const req = mod.request(options, res => { + const chunks: Buffer[] = []; + res.on('data', (chunk: Buffer) => chunks.push(chunk)); + res.on('end', () => { + resolve({ + statusCode: res.statusCode || 0, + data: Buffer.concat(chunks), + }); + }); + }); + + req.on('error', reject); + req.write(body); + req.end(); + }); + } +} + +export function createLdkServerClient(config: { + socket: 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 + ); +} + +/** 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', +} as const; 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.rabbitmq.ts b/src/server/modules/node/ldk-server/ldk-server.rabbitmq.ts new file mode 100644 index 000000000..4e9b4ab2d --- /dev/null +++ b/src/server/modules/node/ldk-server/ldk-server.rabbitmq.ts @@ -0,0 +1,185 @@ +import amqplib from 'amqplib'; +import { Logger } from 'winston'; +import { SseService } from '../../sse/sse.service'; +import { events, types } from './proto/ldk-server'; +import { toNumber, msatToSat } from './ldk-server.helpers'; + +export type LdkServerRabbitMqConfig = { + rabbitmqUrl: string; + exchangeName: string; + accountId: string; + sseService: SseService; + logger: Logger; +}; + +export class LdkServerRabbitMqConsumer { + private config: LdkServerRabbitMqConfig; + private connection: amqplib.ChannelModel | null = null; + private channel: amqplib.Channel | null = null; + + constructor(config: LdkServerRabbitMqConfig) { + this.config = config; + } + + async start(): Promise { + const { rabbitmqUrl, exchangeName, logger } = this.config; + + this.connection = await amqplib.connect(rabbitmqUrl); + this.channel = await this.connection.createChannel(); + + // Assert the fanout exchange (must match ldk-server's config) + await this.channel.assertExchange(exchangeName, 'fanout', { + durable: true, + }); + + // Create an exclusive, auto-delete queue for this consumer + const { queue } = await this.channel.assertQueue('', { + exclusive: true, + autoDelete: true, + }); + + await this.channel.bindQueue(queue, exchangeName, ''); + + logger.info( + `ldk-server RabbitMQ: bound to exchange "${exchangeName}", queue "${queue}"` + ); + + this.channel.consume(queue, msg => { + if (!msg) return; + + try { + this.handleMessage(msg.content); + } catch (err) { + logger.error('ldk-server RabbitMQ: error handling message', { err }); + } + + this.channel?.ack(msg); + }); + + // Reconnect on connection close + this.connection.on('close', () => { + logger.warn('ldk-server RabbitMQ: connection closed, reconnecting...'); + setTimeout(() => this.start().catch(() => {}), 5000); + }); + + this.connection.on('error', err => { + logger.error('ldk-server RabbitMQ: connection error', { err }); + }); + } + + async stop(): Promise { + await this.channel?.close(); + await this.connection?.close(); + this.channel = null; + this.connection = null; + } + + private handleMessage(data: Buffer): void { + const envelope = events.EventEnvelope.decode(new Uint8Array(data)); + const { accountId, sseService, logger } = this.config; + + if (envelope.paymentReceived) { + const payment = envelope.paymentReceived.payment; + if (!payment) return; + + logger.info('ldk-server event: PaymentReceived'); + sseService.emit( + accountId, + 'invoice_updated', + mapPaymentToInvoiceEvent(payment) + ); + } else if (envelope.paymentSuccessful) { + const payment = envelope.paymentSuccessful.payment; + if (!payment) return; + + logger.info('ldk-server event: PaymentSuccessful'); + if (payment.direction === types.PaymentDirection.OUTBOUND) { + sseService.emit( + accountId, + 'payment', + mapPaymentToPaymentEvent(payment) + ); + } else { + // Inbound successful payment = invoice paid + sseService.emit( + accountId, + 'invoice_updated', + mapPaymentToInvoiceEvent(payment) + ); + } + } else if (envelope.paymentFailed) { + const payment = envelope.paymentFailed.payment; + if (!payment) return; + + logger.info('ldk-server event: PaymentFailed'); + // Emit as payment event so frontend can refetch + if (payment.direction === types.PaymentDirection.OUTBOUND) { + sseService.emit( + accountId, + 'payment', + mapPaymentToPaymentEvent(payment) + ); + } + } else if (envelope.paymentForwarded) { + const forward = envelope.paymentForwarded.forwardedPayment; + if (!forward) return; + + logger.info('ldk-server event: PaymentForwarded'); + sseService.emit( + accountId, + 'forward', + mapForwardedPaymentToForwardEvent(forward) + ); + } + } +} + +export function createLdkServerRabbitMqConsumer( + config: LdkServerRabbitMqConfig +): LdkServerRabbitMqConsumer { + return new LdkServerRabbitMqConsumer(config); +} + +// ── Event mapping helpers ── +// These map ldk-server protobuf types to the shapes the ThunderHub frontend expects. + +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.service.ts b/src/server/modules/node/ldk-server/ldk-server.service.ts new file mode 100644 index 000000000..d0e9fb74f --- /dev/null +++ b/src/server/modules/node/ldk-server/ldk-server.service.ts @@ -0,0 +1,1177 @@ +/* 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, + SendToChainAddressOptions, + CreateChainAddressFormat, + UpdateRoutingFeesOptions, + VerifyBackupsOptions, + GrantAccessOptions, + DiffieHellmanComputeSecretOptions, +} from '../lightning.types'; +import { + LdkServerClient, + createLdkServerClient, + Endpoints, + toNumber, + msatToSat, +} from './ldk-server.helpers'; +import { api, 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); + } + + // ── 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 resp = await connection.request( + Endpoints.BOLT11_SEND, + api.Bolt11SendRequest, + api.Bolt11SendResponse, + { + invoice: options.request, + amountMsat: 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 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 connection.request( + Endpoints.LIST_PAYMENTS, + api.ListPaymentsRequest, + api.ListPaymentsResponse, + { + pageToken: options.token + ? { token: options.token, index: 0 } + : undefined, + } + ); + + // 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 connection.request( + Endpoints.LIST_PAYMENTS, + api.ListPaymentsRequest, + api.ListPaymentsResponse, + { + pageToken: options.token + ? { token: options.token, index: 0 } + : undefined, + } + ); + + // 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); + } + + // ── 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: [], + }; +} + +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/ldk-server.d.ts b/src/server/modules/node/ldk-server/proto/ldk-server.d.ts new file mode 100644 index 000000000..9d469876f --- /dev/null +++ b/src/server/modules/node/ldk-server/proto/ldk-server.d.ts @@ -0,0 +1,15516 @@ +import * as $protobuf from 'protobufjs'; +import Long = require('long'); +/** Namespace api. */ +export namespace api { + /** Properties of a GetNodeInfoRequest. */ + interface IGetNodeInfoRequest {} + + /** Represents a GetNodeInfoRequest. */ + class GetNodeInfoRequest implements IGetNodeInfoRequest { + /** + * Constructs a new GetNodeInfoRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGetNodeInfoRequest); + + /** + * Creates a new GetNodeInfoRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNodeInfoRequest instance + */ + public static create( + properties?: api.IGetNodeInfoRequest + ): api.GetNodeInfoRequest; + + /** + * Encodes the specified GetNodeInfoRequest message. Does not implicitly {@link api.GetNodeInfoRequest.verify|verify} messages. + * @param message GetNodeInfoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGetNodeInfoRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GetNodeInfoRequest message, length delimited. Does not implicitly {@link api.GetNodeInfoRequest.verify|verify} messages. + * @param message GetNodeInfoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGetNodeInfoRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GetNodeInfoRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNodeInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.GetNodeInfoRequest; + + /** + * Decodes a GetNodeInfoRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNodeInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.GetNodeInfoRequest; + + /** + * Verifies a GetNodeInfoRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a GetNodeInfoRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNodeInfoRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.GetNodeInfoRequest; + + /** + * Creates a plain object from a GetNodeInfoRequest message. Also converts values to other types if specified. + * @param message GetNodeInfoRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GetNodeInfoRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GetNodeInfoRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetNodeInfoRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetNodeInfoResponse. */ + interface IGetNodeInfoResponse { + /** GetNodeInfoResponse 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; + } + + /** 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 | null; + + /** GetNodeInfoResponse latestOnchainWalletSyncTimestamp. */ + public latestOnchainWalletSyncTimestamp?: number | Long | null; + + /** GetNodeInfoResponse latestFeeRateCacheUpdateTimestamp. */ + public latestFeeRateCacheUpdateTimestamp?: number | Long | null; + + /** GetNodeInfoResponse latestRgsSnapshotTimestamp. */ + public latestRgsSnapshotTimestamp?: number | Long | null; + + /** GetNodeInfoResponse latestNodeAnnouncementBroadcastTimestamp. */ + public latestNodeAnnouncementBroadcastTimestamp?: number | Long | null; + + /** GetNodeInfoResponse listeningAddresses. */ + public listeningAddresses: string[]; + + /** GetNodeInfoResponse announcementAddresses. */ + public announcementAddresses: string[]; + + /** GetNodeInfoResponse nodeAlias. */ + public nodeAlias?: string | null; + + /** GetNodeInfoResponse nodeUris. */ + public nodeUris: string[]; + + /** + * Creates a new GetNodeInfoResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNodeInfoResponse instance + */ + public static create( + properties?: api.IGetNodeInfoResponse + ): api.GetNodeInfoResponse; + + /** + * Encodes the specified GetNodeInfoResponse message. Does not implicitly {@link api.GetNodeInfoResponse.verify|verify} messages. + * @param message GetNodeInfoResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGetNodeInfoResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GetNodeInfoResponse message, length delimited. Does not implicitly {@link api.GetNodeInfoResponse.verify|verify} messages. + * @param message GetNodeInfoResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGetNodeInfoResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GetNodeInfoResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNodeInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.GetNodeInfoResponse; + + /** + * Decodes a GetNodeInfoResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNodeInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.GetNodeInfoResponse; + + /** + * Verifies a GetNodeInfoResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a GetNodeInfoResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNodeInfoResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.GetNodeInfoResponse; + + /** + * Creates a plain object from a GetNodeInfoResponse message. Also converts values to other types if specified. + * @param message GetNodeInfoResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GetNodeInfoResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GetNodeInfoResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetNodeInfoResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OnchainReceiveRequest. */ + interface IOnchainReceiveRequest {} + + /** Represents an OnchainReceiveRequest. */ + class OnchainReceiveRequest implements IOnchainReceiveRequest { + /** + * Constructs a new OnchainReceiveRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IOnchainReceiveRequest); + + /** + * Creates a new OnchainReceiveRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns OnchainReceiveRequest instance + */ + public static create( + properties?: api.IOnchainReceiveRequest + ): api.OnchainReceiveRequest; + + /** + * Encodes the specified OnchainReceiveRequest message. Does not implicitly {@link api.OnchainReceiveRequest.verify|verify} messages. + * @param message OnchainReceiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IOnchainReceiveRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified OnchainReceiveRequest message, length delimited. Does not implicitly {@link api.OnchainReceiveRequest.verify|verify} messages. + * @param message OnchainReceiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IOnchainReceiveRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an OnchainReceiveRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OnchainReceiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.OnchainReceiveRequest; + + /** + * Decodes an OnchainReceiveRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OnchainReceiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.OnchainReceiveRequest; + + /** + * Verifies an OnchainReceiveRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates an OnchainReceiveRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OnchainReceiveRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.OnchainReceiveRequest; + + /** + * Creates a plain object from an OnchainReceiveRequest message. Also converts values to other types if specified. + * @param message OnchainReceiveRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.OnchainReceiveRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this OnchainReceiveRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OnchainReceiveRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OnchainReceiveResponse. */ + interface IOnchainReceiveResponse { + /** OnchainReceiveResponse address */ + address?: string | null; + } + + /** Represents an OnchainReceiveResponse. */ + class OnchainReceiveResponse implements IOnchainReceiveResponse { + /** + * Constructs a new OnchainReceiveResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IOnchainReceiveResponse); + + /** OnchainReceiveResponse address. */ + public address: string; + + /** + * Creates a new OnchainReceiveResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns OnchainReceiveResponse instance + */ + public static create( + properties?: api.IOnchainReceiveResponse + ): api.OnchainReceiveResponse; + + /** + * Encodes the specified OnchainReceiveResponse message. Does not implicitly {@link api.OnchainReceiveResponse.verify|verify} messages. + * @param message OnchainReceiveResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IOnchainReceiveResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified OnchainReceiveResponse message, length delimited. Does not implicitly {@link api.OnchainReceiveResponse.verify|verify} messages. + * @param message OnchainReceiveResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IOnchainReceiveResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an OnchainReceiveResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OnchainReceiveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.OnchainReceiveResponse; + + /** + * Decodes an OnchainReceiveResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OnchainReceiveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.OnchainReceiveResponse; + + /** + * Verifies an OnchainReceiveResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates an OnchainReceiveResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OnchainReceiveResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.OnchainReceiveResponse; + + /** + * Creates a plain object from an OnchainReceiveResponse message. Also converts values to other types if specified. + * @param message OnchainReceiveResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.OnchainReceiveResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this OnchainReceiveResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OnchainReceiveResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OnchainSendRequest. */ + interface IOnchainSendRequest { + /** OnchainSendRequest address */ + address?: string | null; + + /** OnchainSendRequest 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 | null; + + /** OnchainSendRequest sendAll. */ + public sendAll?: boolean | null; + + /** OnchainSendRequest feeRateSatPerVb. */ + public feeRateSatPerVb?: number | Long | null; + + /** + * Creates a new OnchainSendRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns OnchainSendRequest instance + */ + public static create( + properties?: api.IOnchainSendRequest + ): api.OnchainSendRequest; + + /** + * Encodes the specified OnchainSendRequest message. Does not implicitly {@link api.OnchainSendRequest.verify|verify} messages. + * @param message OnchainSendRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IOnchainSendRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified OnchainSendRequest message, length delimited. Does not implicitly {@link api.OnchainSendRequest.verify|verify} messages. + * @param message OnchainSendRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IOnchainSendRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an OnchainSendRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OnchainSendRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.OnchainSendRequest; + + /** + * Decodes an OnchainSendRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OnchainSendRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.OnchainSendRequest; + + /** + * Verifies an OnchainSendRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates an OnchainSendRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OnchainSendRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.OnchainSendRequest; + + /** + * Creates a plain object from an OnchainSendRequest message. Also converts values to other types if specified. + * @param message OnchainSendRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.OnchainSendRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this OnchainSendRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OnchainSendRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OnchainSendResponse. */ + interface IOnchainSendResponse { + /** OnchainSendResponse txid */ + txid?: string | null; + } + + /** Represents an OnchainSendResponse. */ + class OnchainSendResponse implements IOnchainSendResponse { + /** + * Constructs a new OnchainSendResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IOnchainSendResponse); + + /** OnchainSendResponse txid. */ + public txid: string; + + /** + * Creates a new OnchainSendResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns OnchainSendResponse instance + */ + public static create( + properties?: api.IOnchainSendResponse + ): api.OnchainSendResponse; + + /** + * Encodes the specified OnchainSendResponse message. Does not implicitly {@link api.OnchainSendResponse.verify|verify} messages. + * @param message OnchainSendResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IOnchainSendResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified OnchainSendResponse message, length delimited. Does not implicitly {@link api.OnchainSendResponse.verify|verify} messages. + * @param message OnchainSendResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IOnchainSendResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an OnchainSendResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OnchainSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.OnchainSendResponse; + + /** + * Decodes an OnchainSendResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OnchainSendResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.OnchainSendResponse; + + /** + * Verifies an OnchainSendResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates an OnchainSendResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OnchainSendResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.OnchainSendResponse; + + /** + * Creates a plain object from an OnchainSendResponse message. Also converts values to other types if specified. + * @param message OnchainSendResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.OnchainSendResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this OnchainSendResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OnchainSendResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ReceiveRequest. */ + interface IBolt11ReceiveRequest { + /** Bolt11ReceiveRequest 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 | null; + + /** 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 }; + + /** + * Gets the default type url for Bolt11ReceiveRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ReceiveResponse. */ + interface IBolt11ReceiveResponse { + /** Bolt11ReceiveResponse invoice */ + invoice?: string | null; + + /** Bolt11ReceiveResponse 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 }; + + /** + * Gets the default type url for Bolt11ReceiveResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ReceiveForHashRequest. */ + interface IBolt11ReceiveForHashRequest { + /** Bolt11ReceiveForHashRequest 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 | null; + + /** 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 }; + + /** + * Gets the default type url for Bolt11ReceiveForHashRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ReceiveForHashResponse. */ + interface IBolt11ReceiveForHashResponse { + /** Bolt11ReceiveForHashResponse invoice */ + invoice?: string | null; + } + + /** Represents a Bolt11ReceiveForHashResponse. */ + class Bolt11ReceiveForHashResponse implements IBolt11ReceiveForHashResponse { + /** + * Constructs a new Bolt11ReceiveForHashResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11ReceiveForHashResponse); + + /** Bolt11ReceiveForHashResponse invoice. */ + public invoice: string; + + /** + * Creates a new Bolt11ReceiveForHashResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11ReceiveForHashResponse instance + */ + public static create( + properties?: api.IBolt11ReceiveForHashResponse + ): api.Bolt11ReceiveForHashResponse; + + /** + * Encodes the specified Bolt11ReceiveForHashResponse message. Does not implicitly {@link api.Bolt11ReceiveForHashResponse.verify|verify} messages. + * @param message Bolt11ReceiveForHashResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11ReceiveForHashResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11ReceiveForHashResponse message, length delimited. Does not implicitly {@link api.Bolt11ReceiveForHashResponse.verify|verify} messages. + * @param message Bolt11ReceiveForHashResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11ReceiveForHashResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11ReceiveForHashResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11ReceiveForHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.Bolt11ReceiveForHashResponse; + + /** + * Decodes a Bolt11ReceiveForHashResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11ReceiveForHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.Bolt11ReceiveForHashResponse; + + /** + * Verifies a Bolt11ReceiveForHashResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Bolt11ReceiveForHashResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11ReceiveForHashResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11ReceiveForHashResponse; + + /** + * Creates a plain object from a Bolt11ReceiveForHashResponse message. Also converts values to other types if specified. + * @param message Bolt11ReceiveForHashResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11ReceiveForHashResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11ReceiveForHashResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11ReceiveForHashResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ClaimForHashRequest. */ + interface IBolt11ClaimForHashRequest { + /** Bolt11ClaimForHashRequest 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 | null; + + /** Bolt11ClaimForHashRequest claimableAmountMsat. */ + public claimableAmountMsat?: number | Long | null; + + /** Bolt11ClaimForHashRequest preimage. */ + public preimage: string; + + /** + * Creates a new Bolt11ClaimForHashRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11ClaimForHashRequest instance + */ + public static create( + properties?: api.IBolt11ClaimForHashRequest + ): api.Bolt11ClaimForHashRequest; + + /** + * Encodes the specified Bolt11ClaimForHashRequest message. Does not implicitly {@link api.Bolt11ClaimForHashRequest.verify|verify} messages. + * @param message Bolt11ClaimForHashRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11ClaimForHashRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11ClaimForHashRequest message, length delimited. Does not implicitly {@link api.Bolt11ClaimForHashRequest.verify|verify} messages. + * @param message Bolt11ClaimForHashRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11ClaimForHashRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11ClaimForHashRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11ClaimForHashRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.Bolt11ClaimForHashRequest; + + /** + * Decodes a Bolt11ClaimForHashRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11ClaimForHashRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.Bolt11ClaimForHashRequest; + + /** + * Verifies a Bolt11ClaimForHashRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Bolt11ClaimForHashRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11ClaimForHashRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11ClaimForHashRequest; + + /** + * Creates a plain object from a Bolt11ClaimForHashRequest message. Also converts values to other types if specified. + * @param message Bolt11ClaimForHashRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11ClaimForHashRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11ClaimForHashRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11ClaimForHashRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ClaimForHashResponse. */ + interface IBolt11ClaimForHashResponse {} + + /** Represents a Bolt11ClaimForHashResponse. */ + class Bolt11ClaimForHashResponse implements IBolt11ClaimForHashResponse { + /** + * Constructs a new Bolt11ClaimForHashResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11ClaimForHashResponse); + + /** + * Creates a new Bolt11ClaimForHashResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11ClaimForHashResponse instance + */ + public static create( + properties?: api.IBolt11ClaimForHashResponse + ): api.Bolt11ClaimForHashResponse; + + /** + * Encodes the specified Bolt11ClaimForHashResponse message. Does not implicitly {@link api.Bolt11ClaimForHashResponse.verify|verify} messages. + * @param message Bolt11ClaimForHashResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11ClaimForHashResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11ClaimForHashResponse message, length delimited. Does not implicitly {@link api.Bolt11ClaimForHashResponse.verify|verify} messages. + * @param message Bolt11ClaimForHashResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11ClaimForHashResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11ClaimForHashResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11ClaimForHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.Bolt11ClaimForHashResponse; + + /** + * Decodes a Bolt11ClaimForHashResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11ClaimForHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.Bolt11ClaimForHashResponse; + + /** + * Verifies a Bolt11ClaimForHashResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Bolt11ClaimForHashResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11ClaimForHashResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11ClaimForHashResponse; + + /** + * Creates a plain object from a Bolt11ClaimForHashResponse message. Also converts values to other types if specified. + * @param message Bolt11ClaimForHashResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11ClaimForHashResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11ClaimForHashResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11ClaimForHashResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11FailForHashRequest. */ + interface IBolt11FailForHashRequest { + /** Bolt11FailForHashRequest 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 }; + + /** + * Gets the default type url for Bolt11FailForHashRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11FailForHashResponse. */ + interface IBolt11FailForHashResponse {} + + /** Represents a Bolt11FailForHashResponse. */ + class Bolt11FailForHashResponse implements IBolt11FailForHashResponse { + /** + * Constructs a new Bolt11FailForHashResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11FailForHashResponse); + + /** + * Creates a new Bolt11FailForHashResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11FailForHashResponse instance + */ + public static create( + properties?: api.IBolt11FailForHashResponse + ): api.Bolt11FailForHashResponse; + + /** + * Encodes the specified Bolt11FailForHashResponse message. Does not implicitly {@link api.Bolt11FailForHashResponse.verify|verify} messages. + * @param message Bolt11FailForHashResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11FailForHashResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11FailForHashResponse message, length delimited. Does not implicitly {@link api.Bolt11FailForHashResponse.verify|verify} messages. + * @param message Bolt11FailForHashResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11FailForHashResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11FailForHashResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11FailForHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.Bolt11FailForHashResponse; + + /** + * Decodes a Bolt11FailForHashResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11FailForHashResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.Bolt11FailForHashResponse; + + /** + * Verifies a Bolt11FailForHashResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Bolt11FailForHashResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11FailForHashResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11FailForHashResponse; + + /** + * Creates a plain object from a Bolt11FailForHashResponse message. Also converts values to other types if specified. + * @param message Bolt11FailForHashResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11FailForHashResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11FailForHashResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11FailForHashResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ReceiveViaJitChannelRequest. */ + interface IBolt11ReceiveViaJitChannelRequest { + /** Bolt11ReceiveViaJitChannelRequest 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 | null; + + /** + * Creates a new Bolt11ReceiveViaJitChannelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11ReceiveViaJitChannelRequest instance + */ + public static create( + properties?: api.IBolt11ReceiveViaJitChannelRequest + ): api.Bolt11ReceiveViaJitChannelRequest; + + /** + * Encodes the specified Bolt11ReceiveViaJitChannelRequest message. Does not implicitly {@link api.Bolt11ReceiveViaJitChannelRequest.verify|verify} messages. + * @param message Bolt11ReceiveViaJitChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11ReceiveViaJitChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11ReceiveViaJitChannelRequest message, length delimited. Does not implicitly {@link api.Bolt11ReceiveViaJitChannelRequest.verify|verify} messages. + * @param message Bolt11ReceiveViaJitChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11ReceiveViaJitChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11ReceiveViaJitChannelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11ReceiveViaJitChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.Bolt11ReceiveViaJitChannelRequest; + + /** + * Decodes a Bolt11ReceiveViaJitChannelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11ReceiveViaJitChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.Bolt11ReceiveViaJitChannelRequest; + + /** + * Verifies a Bolt11ReceiveViaJitChannelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Bolt11ReceiveViaJitChannelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11ReceiveViaJitChannelRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11ReceiveViaJitChannelRequest; + + /** + * Creates a plain object from a Bolt11ReceiveViaJitChannelRequest message. Also converts values to other types if specified. + * @param message Bolt11ReceiveViaJitChannelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11ReceiveViaJitChannelRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11ReceiveViaJitChannelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11ReceiveViaJitChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ReceiveViaJitChannelResponse. */ + interface IBolt11ReceiveViaJitChannelResponse { + /** Bolt11ReceiveViaJitChannelResponse invoice */ + invoice?: string | null; + } + + /** Represents a Bolt11ReceiveViaJitChannelResponse. */ + class Bolt11ReceiveViaJitChannelResponse implements IBolt11ReceiveViaJitChannelResponse { + /** + * Constructs a new Bolt11ReceiveViaJitChannelResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IBolt11ReceiveViaJitChannelResponse); + + /** Bolt11ReceiveViaJitChannelResponse invoice. */ + public invoice: string; + + /** + * Creates a new Bolt11ReceiveViaJitChannelResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11ReceiveViaJitChannelResponse instance + */ + public static create( + properties?: api.IBolt11ReceiveViaJitChannelResponse + ): api.Bolt11ReceiveViaJitChannelResponse; + + /** + * Encodes the specified Bolt11ReceiveViaJitChannelResponse message. Does not implicitly {@link api.Bolt11ReceiveViaJitChannelResponse.verify|verify} messages. + * @param message Bolt11ReceiveViaJitChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11ReceiveViaJitChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11ReceiveViaJitChannelResponse message, length delimited. Does not implicitly {@link api.Bolt11ReceiveViaJitChannelResponse.verify|verify} messages. + * @param message Bolt11ReceiveViaJitChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11ReceiveViaJitChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11ReceiveViaJitChannelResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11ReceiveViaJitChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.Bolt11ReceiveViaJitChannelResponse; + + /** + * Decodes a Bolt11ReceiveViaJitChannelResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11ReceiveViaJitChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.Bolt11ReceiveViaJitChannelResponse; + + /** + * Verifies a Bolt11ReceiveViaJitChannelResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Bolt11ReceiveViaJitChannelResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11ReceiveViaJitChannelResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11ReceiveViaJitChannelResponse; + + /** + * Creates a plain object from a Bolt11ReceiveViaJitChannelResponse message. Also converts values to other types if specified. + * @param message Bolt11ReceiveViaJitChannelResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11ReceiveViaJitChannelResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11ReceiveViaJitChannelResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11ReceiveViaJitChannelResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ReceiveVariableAmountViaJitChannelRequest. */ + interface IBolt11ReceiveVariableAmountViaJitChannelRequest { + /** Bolt11ReceiveVariableAmountViaJitChannelRequest description */ + description?: types.IBolt11InvoiceDescription | null; + + /** Bolt11ReceiveVariableAmountViaJitChannelRequest 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 | null; + + /** + * Creates a new Bolt11ReceiveVariableAmountViaJitChannelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11ReceiveVariableAmountViaJitChannelRequest instance + */ + public static create( + properties?: api.IBolt11ReceiveVariableAmountViaJitChannelRequest + ): api.Bolt11ReceiveVariableAmountViaJitChannelRequest; + + /** + * Encodes the specified Bolt11ReceiveVariableAmountViaJitChannelRequest message. Does not implicitly {@link api.Bolt11ReceiveVariableAmountViaJitChannelRequest.verify|verify} messages. + * @param message Bolt11ReceiveVariableAmountViaJitChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11ReceiveVariableAmountViaJitChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11ReceiveVariableAmountViaJitChannelRequest message, length delimited. Does not implicitly {@link api.Bolt11ReceiveVariableAmountViaJitChannelRequest.verify|verify} messages. + * @param message Bolt11ReceiveVariableAmountViaJitChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11ReceiveVariableAmountViaJitChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11ReceiveVariableAmountViaJitChannelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11ReceiveVariableAmountViaJitChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.Bolt11ReceiveVariableAmountViaJitChannelRequest; + + /** + * Decodes a Bolt11ReceiveVariableAmountViaJitChannelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11ReceiveVariableAmountViaJitChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.Bolt11ReceiveVariableAmountViaJitChannelRequest; + + /** + * Verifies a Bolt11ReceiveVariableAmountViaJitChannelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Bolt11ReceiveVariableAmountViaJitChannelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11ReceiveVariableAmountViaJitChannelRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11ReceiveVariableAmountViaJitChannelRequest; + + /** + * Creates a plain object from a Bolt11ReceiveVariableAmountViaJitChannelRequest message. Also converts values to other types if specified. + * @param message Bolt11ReceiveVariableAmountViaJitChannelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11ReceiveVariableAmountViaJitChannelRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11ReceiveVariableAmountViaJitChannelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11ReceiveVariableAmountViaJitChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11ReceiveVariableAmountViaJitChannelResponse. */ + interface IBolt11ReceiveVariableAmountViaJitChannelResponse { + /** Bolt11ReceiveVariableAmountViaJitChannelResponse invoice */ + invoice?: string | null; + } + + /** Represents a Bolt11ReceiveVariableAmountViaJitChannelResponse. */ + class Bolt11ReceiveVariableAmountViaJitChannelResponse implements IBolt11ReceiveVariableAmountViaJitChannelResponse { + /** + * Constructs a new Bolt11ReceiveVariableAmountViaJitChannelResponse. + * @param [properties] Properties to set + */ + constructor( + properties?: api.IBolt11ReceiveVariableAmountViaJitChannelResponse + ); + + /** Bolt11ReceiveVariableAmountViaJitChannelResponse invoice. */ + public invoice: string; + + /** + * Creates a new Bolt11ReceiveVariableAmountViaJitChannelResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11ReceiveVariableAmountViaJitChannelResponse instance + */ + public static create( + properties?: api.IBolt11ReceiveVariableAmountViaJitChannelResponse + ): api.Bolt11ReceiveVariableAmountViaJitChannelResponse; + + /** + * Encodes the specified Bolt11ReceiveVariableAmountViaJitChannelResponse message. Does not implicitly {@link api.Bolt11ReceiveVariableAmountViaJitChannelResponse.verify|verify} messages. + * @param message Bolt11ReceiveVariableAmountViaJitChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt11ReceiveVariableAmountViaJitChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11ReceiveVariableAmountViaJitChannelResponse message, length delimited. Does not implicitly {@link api.Bolt11ReceiveVariableAmountViaJitChannelResponse.verify|verify} messages. + * @param message Bolt11ReceiveVariableAmountViaJitChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt11ReceiveVariableAmountViaJitChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11ReceiveVariableAmountViaJitChannelResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11ReceiveVariableAmountViaJitChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.Bolt11ReceiveVariableAmountViaJitChannelResponse; + + /** + * Decodes a Bolt11ReceiveVariableAmountViaJitChannelResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11ReceiveVariableAmountViaJitChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.Bolt11ReceiveVariableAmountViaJitChannelResponse; + + /** + * Verifies a Bolt11ReceiveVariableAmountViaJitChannelResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Bolt11ReceiveVariableAmountViaJitChannelResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11ReceiveVariableAmountViaJitChannelResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt11ReceiveVariableAmountViaJitChannelResponse; + + /** + * Creates a plain object from a Bolt11ReceiveVariableAmountViaJitChannelResponse message. Also converts values to other types if specified. + * @param message Bolt11ReceiveVariableAmountViaJitChannelResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt11ReceiveVariableAmountViaJitChannelResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11ReceiveVariableAmountViaJitChannelResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11ReceiveVariableAmountViaJitChannelResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11SendRequest. */ + interface IBolt11SendRequest { + /** Bolt11SendRequest invoice */ + invoice?: string | null; + + /** Bolt11SendRequest 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 | null; + + /** 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 }; + + /** + * Gets the default type url for Bolt11SendRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11SendResponse. */ + interface IBolt11SendResponse { + /** Bolt11SendResponse 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 }; + + /** + * Gets the default type url for Bolt11SendResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt12ReceiveRequest. */ + interface IBolt12ReceiveRequest { + /** Bolt12ReceiveRequest description */ + description?: string | null; + + /** Bolt12ReceiveRequest 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 | null; + + /** Bolt12ReceiveRequest expirySecs. */ + public expirySecs?: number | null; + + /** Bolt12ReceiveRequest quantity. */ + public quantity?: number | Long | null; + + /** + * Creates a new Bolt12ReceiveRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt12ReceiveRequest instance + */ + public static create( + properties?: api.IBolt12ReceiveRequest + ): api.Bolt12ReceiveRequest; + + /** + * Encodes the specified Bolt12ReceiveRequest message. Does not implicitly {@link api.Bolt12ReceiveRequest.verify|verify} messages. + * @param message Bolt12ReceiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IBolt12ReceiveRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt12ReceiveRequest message, length delimited. Does not implicitly {@link api.Bolt12ReceiveRequest.verify|verify} messages. + * @param message Bolt12ReceiveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IBolt12ReceiveRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt12ReceiveRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt12ReceiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.Bolt12ReceiveRequest; + + /** + * Decodes a Bolt12ReceiveRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt12ReceiveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.Bolt12ReceiveRequest; + + /** + * Verifies a Bolt12ReceiveRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Bolt12ReceiveRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt12ReceiveRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.Bolt12ReceiveRequest; + + /** + * Creates a plain object from a Bolt12ReceiveRequest message. Also converts values to other types if specified. + * @param message Bolt12ReceiveRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.Bolt12ReceiveRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt12ReceiveRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt12ReceiveRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt12ReceiveResponse. */ + interface IBolt12ReceiveResponse { + /** Bolt12ReceiveResponse offer */ + offer?: string | null; + + /** Bolt12ReceiveResponse 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 }; + + /** + * Gets the default type url for Bolt12ReceiveResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt12SendRequest. */ + interface IBolt12SendRequest { + /** Bolt12SendRequest offer */ + offer?: string | null; + + /** Bolt12SendRequest 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 | null; + + /** Bolt12SendRequest quantity. */ + public quantity?: number | Long | null; + + /** Bolt12SendRequest payerNote. */ + public payerNote?: string | null; + + /** 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 }; + + /** + * Gets the default type url for Bolt12SendRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt12SendResponse. */ + interface IBolt12SendResponse { + /** Bolt12SendResponse 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 }; + + /** + * Gets the default type url for Bolt12SendResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpontaneousSendRequest. */ + interface ISpontaneousSendRequest { + /** SpontaneousSendRequest 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 }; + + /** + * Gets the default type url for SpontaneousSendRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpontaneousSendResponse. */ + interface ISpontaneousSendResponse { + /** SpontaneousSendResponse 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 }; + + /** + * Gets the default type url for SpontaneousSendResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OpenChannelRequest. */ + interface IOpenChannelRequest { + /** OpenChannelRequest 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; + } + + /** 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 | null; + + /** OpenChannelRequest channelConfig. */ + public channelConfig?: types.IChannelConfig | null; + + /** OpenChannelRequest announceChannel. */ + public announceChannel: boolean; + + /** + * Creates a new OpenChannelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenChannelRequest instance + */ + public static create( + properties?: api.IOpenChannelRequest + ): api.OpenChannelRequest; + + /** + * Encodes the specified OpenChannelRequest message. Does not implicitly {@link api.OpenChannelRequest.verify|verify} messages. + * @param message OpenChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IOpenChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified OpenChannelRequest message, length delimited. Does not implicitly {@link api.OpenChannelRequest.verify|verify} messages. + * @param message OpenChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IOpenChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an OpenChannelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.OpenChannelRequest; + + /** + * Decodes an OpenChannelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.OpenChannelRequest; + + /** + * Verifies an OpenChannelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates an OpenChannelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenChannelRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.OpenChannelRequest; + + /** + * Creates a plain object from an OpenChannelRequest message. Also converts values to other types if specified. + * @param message OpenChannelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.OpenChannelRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this OpenChannelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OpenChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OpenChannelResponse. */ + interface IOpenChannelResponse { + /** OpenChannelResponse 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 }; + + /** + * Gets the default type url for OpenChannelResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpliceInRequest. */ + interface ISpliceInRequest { + /** SpliceInRequest 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 }; + + /** + * Gets the default type url for SpliceInRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpliceInResponse. */ + interface ISpliceInResponse {} + + /** Represents a SpliceInResponse. */ + class SpliceInResponse implements ISpliceInResponse { + /** + * Constructs a new SpliceInResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.ISpliceInResponse); + + /** + * Creates a new SpliceInResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SpliceInResponse instance + */ + public static create( + properties?: api.ISpliceInResponse + ): api.SpliceInResponse; + + /** + * Encodes the specified SpliceInResponse message. Does not implicitly {@link api.SpliceInResponse.verify|verify} messages. + * @param message SpliceInResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.ISpliceInResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified SpliceInResponse message, length delimited. Does not implicitly {@link api.SpliceInResponse.verify|verify} messages. + * @param message SpliceInResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.ISpliceInResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a SpliceInResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpliceInResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.SpliceInResponse; + + /** + * Decodes a SpliceInResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpliceInResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.SpliceInResponse; + + /** + * Verifies a SpliceInResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a SpliceInResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpliceInResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.SpliceInResponse; + + /** + * Creates a plain object from a SpliceInResponse message. Also converts values to other types if specified. + * @param message SpliceInResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.SpliceInResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this SpliceInResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpliceInResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpliceOutRequest. */ + interface ISpliceOutRequest { + /** SpliceOutRequest 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 | null; + + /** 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 }; + + /** + * Gets the default type url for SpliceOutRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpliceOutResponse. */ + interface ISpliceOutResponse { + /** SpliceOutResponse address */ + address?: string | null; + } + + /** Represents a SpliceOutResponse. */ + class SpliceOutResponse implements ISpliceOutResponse { + /** + * Constructs a new SpliceOutResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.ISpliceOutResponse); + + /** SpliceOutResponse address. */ + public address: string; + + /** + * Creates a new SpliceOutResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SpliceOutResponse instance + */ + public static create( + properties?: api.ISpliceOutResponse + ): api.SpliceOutResponse; + + /** + * Encodes the specified SpliceOutResponse message. Does not implicitly {@link api.SpliceOutResponse.verify|verify} messages. + * @param message SpliceOutResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.ISpliceOutResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified SpliceOutResponse message, length delimited. Does not implicitly {@link api.SpliceOutResponse.verify|verify} messages. + * @param message SpliceOutResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.ISpliceOutResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a SpliceOutResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpliceOutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.SpliceOutResponse; + + /** + * Decodes a SpliceOutResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpliceOutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.SpliceOutResponse; + + /** + * Verifies a SpliceOutResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a SpliceOutResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpliceOutResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.SpliceOutResponse; + + /** + * Creates a plain object from a SpliceOutResponse message. Also converts values to other types if specified. + * @param message SpliceOutResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.SpliceOutResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this SpliceOutResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpliceOutResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateChannelConfigRequest. */ + interface IUpdateChannelConfigRequest { + /** UpdateChannelConfigRequest 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 }; + + /** + * Gets the default type url for UpdateChannelConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateChannelConfigResponse. */ + interface IUpdateChannelConfigResponse {} + + /** Represents an UpdateChannelConfigResponse. */ + class UpdateChannelConfigResponse implements IUpdateChannelConfigResponse { + /** + * Constructs a new UpdateChannelConfigResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IUpdateChannelConfigResponse); + + /** + * Creates a new UpdateChannelConfigResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateChannelConfigResponse instance + */ + public static create( + properties?: api.IUpdateChannelConfigResponse + ): api.UpdateChannelConfigResponse; + + /** + * Encodes the specified UpdateChannelConfigResponse message. Does not implicitly {@link api.UpdateChannelConfigResponse.verify|verify} messages. + * @param message UpdateChannelConfigResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IUpdateChannelConfigResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified UpdateChannelConfigResponse message, length delimited. Does not implicitly {@link api.UpdateChannelConfigResponse.verify|verify} messages. + * @param message UpdateChannelConfigResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IUpdateChannelConfigResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an UpdateChannelConfigResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateChannelConfigResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.UpdateChannelConfigResponse; + + /** + * Decodes an UpdateChannelConfigResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateChannelConfigResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.UpdateChannelConfigResponse; + + /** + * Verifies an UpdateChannelConfigResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates an UpdateChannelConfigResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateChannelConfigResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.UpdateChannelConfigResponse; + + /** + * Creates a plain object from an UpdateChannelConfigResponse message. Also converts values to other types if specified. + * @param message UpdateChannelConfigResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.UpdateChannelConfigResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this UpdateChannelConfigResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateChannelConfigResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloseChannelRequest. */ + interface ICloseChannelRequest { + /** CloseChannelRequest 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 }; + + /** + * Gets the default type url for CloseChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloseChannelResponse. */ + interface ICloseChannelResponse {} + + /** Represents a CloseChannelResponse. */ + class CloseChannelResponse implements ICloseChannelResponse { + /** + * Constructs a new CloseChannelResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.ICloseChannelResponse); + + /** + * Creates a new CloseChannelResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CloseChannelResponse instance + */ + public static create( + properties?: api.ICloseChannelResponse + ): api.CloseChannelResponse; + + /** + * Encodes the specified CloseChannelResponse message. Does not implicitly {@link api.CloseChannelResponse.verify|verify} messages. + * @param message CloseChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.ICloseChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified CloseChannelResponse message, length delimited. Does not implicitly {@link api.CloseChannelResponse.verify|verify} messages. + * @param message CloseChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.ICloseChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a CloseChannelResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloseChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.CloseChannelResponse; + + /** + * Decodes a CloseChannelResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloseChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.CloseChannelResponse; + + /** + * Verifies a CloseChannelResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a CloseChannelResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloseChannelResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.CloseChannelResponse; + + /** + * Creates a plain object from a CloseChannelResponse message. Also converts values to other types if specified. + * @param message CloseChannelResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.CloseChannelResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this CloseChannelResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloseChannelResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ForceCloseChannelRequest. */ + interface IForceCloseChannelRequest { + /** ForceCloseChannelRequest 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 | null; + + /** + * Creates a new ForceCloseChannelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ForceCloseChannelRequest instance + */ + public static create( + properties?: api.IForceCloseChannelRequest + ): api.ForceCloseChannelRequest; + + /** + * Encodes the specified ForceCloseChannelRequest message. Does not implicitly {@link api.ForceCloseChannelRequest.verify|verify} messages. + * @param message ForceCloseChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IForceCloseChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ForceCloseChannelRequest message, length delimited. Does not implicitly {@link api.ForceCloseChannelRequest.verify|verify} messages. + * @param message ForceCloseChannelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IForceCloseChannelRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ForceCloseChannelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForceCloseChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.ForceCloseChannelRequest; + + /** + * Decodes a ForceCloseChannelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForceCloseChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.ForceCloseChannelRequest; + + /** + * Verifies a ForceCloseChannelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a ForceCloseChannelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForceCloseChannelRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.ForceCloseChannelRequest; + + /** + * Creates a plain object from a ForceCloseChannelRequest message. Also converts values to other types if specified. + * @param message ForceCloseChannelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ForceCloseChannelRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ForceCloseChannelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ForceCloseChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ForceCloseChannelResponse. */ + interface IForceCloseChannelResponse {} + + /** Represents a ForceCloseChannelResponse. */ + class ForceCloseChannelResponse implements IForceCloseChannelResponse { + /** + * Constructs a new ForceCloseChannelResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IForceCloseChannelResponse); + + /** + * Creates a new ForceCloseChannelResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ForceCloseChannelResponse instance + */ + public static create( + properties?: api.IForceCloseChannelResponse + ): api.ForceCloseChannelResponse; + + /** + * Encodes the specified ForceCloseChannelResponse message. Does not implicitly {@link api.ForceCloseChannelResponse.verify|verify} messages. + * @param message ForceCloseChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IForceCloseChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ForceCloseChannelResponse message, length delimited. Does not implicitly {@link api.ForceCloseChannelResponse.verify|verify} messages. + * @param message ForceCloseChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IForceCloseChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ForceCloseChannelResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForceCloseChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.ForceCloseChannelResponse; + + /** + * Decodes a ForceCloseChannelResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForceCloseChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.ForceCloseChannelResponse; + + /** + * Verifies a ForceCloseChannelResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a ForceCloseChannelResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForceCloseChannelResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.ForceCloseChannelResponse; + + /** + * Creates a plain object from a ForceCloseChannelResponse message. Also converts values to other types if specified. + * @param message ForceCloseChannelResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ForceCloseChannelResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ForceCloseChannelResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ForceCloseChannelResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListChannelsRequest. */ + interface IListChannelsRequest {} + + /** Represents a ListChannelsRequest. */ + class ListChannelsRequest implements IListChannelsRequest { + /** + * Constructs a new ListChannelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IListChannelsRequest); + + /** + * Creates a new ListChannelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChannelsRequest instance + */ + public static create( + properties?: api.IListChannelsRequest + ): api.ListChannelsRequest; + + /** + * Encodes the specified ListChannelsRequest message. Does not implicitly {@link api.ListChannelsRequest.verify|verify} messages. + * @param message ListChannelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IListChannelsRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ListChannelsRequest message, length delimited. Does not implicitly {@link api.ListChannelsRequest.verify|verify} messages. + * @param message ListChannelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IListChannelsRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ListChannelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChannelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.ListChannelsRequest; + + /** + * Decodes a ListChannelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChannelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.ListChannelsRequest; + + /** + * Verifies a ListChannelsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a ListChannelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChannelsRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.ListChannelsRequest; + + /** + * Creates a plain object from a ListChannelsRequest message. Also converts values to other types if specified. + * @param message ListChannelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ListChannelsRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ListChannelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChannelsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListChannelsResponse. */ + interface IListChannelsResponse { + /** ListChannelsResponse channels */ + channels?: types.IChannel[] | null; + } + + /** Represents a ListChannelsResponse. */ + class ListChannelsResponse implements IListChannelsResponse { + /** + * Constructs a new ListChannelsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IListChannelsResponse); + + /** ListChannelsResponse channels. */ + public channels: types.IChannel[]; + + /** + * Creates a new ListChannelsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChannelsResponse instance + */ + public static create( + properties?: api.IListChannelsResponse + ): api.ListChannelsResponse; + + /** + * Encodes the specified ListChannelsResponse message. Does not implicitly {@link api.ListChannelsResponse.verify|verify} messages. + * @param message ListChannelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IListChannelsResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ListChannelsResponse message, length delimited. Does not implicitly {@link api.ListChannelsResponse.verify|verify} messages. + * @param message ListChannelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IListChannelsResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ListChannelsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChannelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.ListChannelsResponse; + + /** + * Decodes a ListChannelsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChannelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.ListChannelsResponse; + + /** + * Verifies a ListChannelsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a ListChannelsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChannelsResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.ListChannelsResponse; + + /** + * Creates a plain object from a ListChannelsResponse message. Also converts values to other types if specified. + * @param message ListChannelsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ListChannelsResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ListChannelsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChannelsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPaymentDetailsRequest. */ + interface IGetPaymentDetailsRequest { + /** GetPaymentDetailsRequest 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 }; + + /** + * Gets the default type url for GetPaymentDetailsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPaymentDetailsResponse. */ + interface IGetPaymentDetailsResponse { + /** GetPaymentDetailsResponse payment */ + payment?: types.IPayment | null; + } + + /** Represents a GetPaymentDetailsResponse. */ + class GetPaymentDetailsResponse implements IGetPaymentDetailsResponse { + /** + * Constructs a new GetPaymentDetailsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGetPaymentDetailsResponse); + + /** GetPaymentDetailsResponse payment. */ + public payment?: types.IPayment | null; + + /** + * Creates a new GetPaymentDetailsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPaymentDetailsResponse instance + */ + public static create( + properties?: api.IGetPaymentDetailsResponse + ): api.GetPaymentDetailsResponse; + + /** + * Encodes the specified GetPaymentDetailsResponse message. Does not implicitly {@link api.GetPaymentDetailsResponse.verify|verify} messages. + * @param message GetPaymentDetailsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGetPaymentDetailsResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GetPaymentDetailsResponse message, length delimited. Does not implicitly {@link api.GetPaymentDetailsResponse.verify|verify} messages. + * @param message GetPaymentDetailsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGetPaymentDetailsResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GetPaymentDetailsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPaymentDetailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.GetPaymentDetailsResponse; + + /** + * Decodes a GetPaymentDetailsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPaymentDetailsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.GetPaymentDetailsResponse; + + /** + * Verifies a GetPaymentDetailsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a GetPaymentDetailsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPaymentDetailsResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.GetPaymentDetailsResponse; + + /** + * Creates a plain object from a GetPaymentDetailsResponse message. Also converts values to other types if specified. + * @param message GetPaymentDetailsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GetPaymentDetailsResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GetPaymentDetailsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPaymentDetailsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPaymentsRequest. */ + interface IListPaymentsRequest { + /** ListPaymentsRequest 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 }; + + /** + * Gets the default type url for ListPaymentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPaymentsResponse. */ + interface IListPaymentsResponse { + /** ListPaymentsResponse payments */ + payments?: types.IPayment[] | null; + + /** ListPaymentsResponse 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 }; + + /** + * Gets the default type url for ListPaymentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListForwardedPaymentsRequest. */ + interface IListForwardedPaymentsRequest { + /** ListForwardedPaymentsRequest 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 }; + + /** + * Gets the default type url for ListForwardedPaymentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListForwardedPaymentsResponse. */ + interface IListForwardedPaymentsResponse { + /** ListForwardedPaymentsResponse 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 }; + + /** + * Gets the default type url for ListForwardedPaymentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignMessageRequest. */ + interface ISignMessageRequest { + /** SignMessageRequest message */ + message?: Uint8Array | null; + } + + /** Represents a SignMessageRequest. */ + class SignMessageRequest implements ISignMessageRequest { + /** + * Constructs a new SignMessageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.ISignMessageRequest); + + /** SignMessageRequest message. */ + public message: Uint8Array; + + /** + * Creates a new SignMessageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SignMessageRequest instance + */ + public static create( + properties?: api.ISignMessageRequest + ): api.SignMessageRequest; + + /** + * Encodes the specified SignMessageRequest message. Does not implicitly {@link api.SignMessageRequest.verify|verify} messages. + * @param message SignMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.ISignMessageRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified SignMessageRequest message, length delimited. Does not implicitly {@link api.SignMessageRequest.verify|verify} messages. + * @param message SignMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.ISignMessageRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a SignMessageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SignMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.SignMessageRequest; + + /** + * Decodes a SignMessageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SignMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.SignMessageRequest; + + /** + * Verifies a SignMessageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a SignMessageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SignMessageRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.SignMessageRequest; + + /** + * Creates a plain object from a SignMessageRequest message. Also converts values to other types if specified. + * @param message SignMessageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.SignMessageRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this SignMessageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SignMessageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SignMessageResponse. */ + interface ISignMessageResponse { + /** SignMessageResponse signature */ + signature?: string | null; + } + + /** Represents a SignMessageResponse. */ + class SignMessageResponse implements ISignMessageResponse { + /** + * Constructs a new SignMessageResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.ISignMessageResponse); + + /** SignMessageResponse signature. */ + public signature: string; + + /** + * Creates a new SignMessageResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SignMessageResponse instance + */ + public static create( + properties?: api.ISignMessageResponse + ): api.SignMessageResponse; + + /** + * Encodes the specified SignMessageResponse message. Does not implicitly {@link api.SignMessageResponse.verify|verify} messages. + * @param message SignMessageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.ISignMessageResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified SignMessageResponse message, length delimited. Does not implicitly {@link api.SignMessageResponse.verify|verify} messages. + * @param message SignMessageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.ISignMessageResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a SignMessageResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SignMessageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.SignMessageResponse; + + /** + * Decodes a SignMessageResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SignMessageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.SignMessageResponse; + + /** + * Verifies a SignMessageResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a SignMessageResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SignMessageResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.SignMessageResponse; + + /** + * Creates a plain object from a SignMessageResponse message. Also converts values to other types if specified. + * @param message SignMessageResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.SignMessageResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this SignMessageResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SignMessageResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VerifySignatureRequest. */ + interface IVerifySignatureRequest { + /** VerifySignatureRequest message */ + message?: Uint8Array | null; + + /** VerifySignatureRequest signature */ + signature?: string | null; + + /** VerifySignatureRequest 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 }; + + /** + * Gets the default type url for VerifySignatureRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VerifySignatureResponse. */ + interface IVerifySignatureResponse { + /** VerifySignatureResponse valid */ + valid?: boolean | null; + } + + /** Represents a VerifySignatureResponse. */ + class VerifySignatureResponse implements IVerifySignatureResponse { + /** + * Constructs a new VerifySignatureResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IVerifySignatureResponse); + + /** VerifySignatureResponse valid. */ + public valid: boolean; + + /** + * Creates a new VerifySignatureResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns VerifySignatureResponse instance + */ + public static create( + properties?: api.IVerifySignatureResponse + ): api.VerifySignatureResponse; + + /** + * Encodes the specified VerifySignatureResponse message. Does not implicitly {@link api.VerifySignatureResponse.verify|verify} messages. + * @param message VerifySignatureResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IVerifySignatureResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified VerifySignatureResponse message, length delimited. Does not implicitly {@link api.VerifySignatureResponse.verify|verify} messages. + * @param message VerifySignatureResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IVerifySignatureResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a VerifySignatureResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VerifySignatureResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.VerifySignatureResponse; + + /** + * Decodes a VerifySignatureResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VerifySignatureResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.VerifySignatureResponse; + + /** + * Verifies a VerifySignatureResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a VerifySignatureResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VerifySignatureResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.VerifySignatureResponse; + + /** + * Creates a plain object from a VerifySignatureResponse message. Also converts values to other types if specified. + * @param message VerifySignatureResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.VerifySignatureResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this VerifySignatureResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VerifySignatureResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportPathfindingScoresRequest. */ + interface IExportPathfindingScoresRequest {} + + /** Represents an ExportPathfindingScoresRequest. */ + class ExportPathfindingScoresRequest implements IExportPathfindingScoresRequest { + /** + * Constructs a new ExportPathfindingScoresRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IExportPathfindingScoresRequest); + + /** + * Creates a new ExportPathfindingScoresRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportPathfindingScoresRequest instance + */ + public static create( + properties?: api.IExportPathfindingScoresRequest + ): api.ExportPathfindingScoresRequest; + + /** + * Encodes the specified ExportPathfindingScoresRequest message. Does not implicitly {@link api.ExportPathfindingScoresRequest.verify|verify} messages. + * @param message ExportPathfindingScoresRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IExportPathfindingScoresRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ExportPathfindingScoresRequest message, length delimited. Does not implicitly {@link api.ExportPathfindingScoresRequest.verify|verify} messages. + * @param message ExportPathfindingScoresRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IExportPathfindingScoresRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an ExportPathfindingScoresRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportPathfindingScoresRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.ExportPathfindingScoresRequest; + + /** + * Decodes an ExportPathfindingScoresRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportPathfindingScoresRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.ExportPathfindingScoresRequest; + + /** + * Verifies an ExportPathfindingScoresRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates an ExportPathfindingScoresRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportPathfindingScoresRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.ExportPathfindingScoresRequest; + + /** + * Creates a plain object from an ExportPathfindingScoresRequest message. Also converts values to other types if specified. + * @param message ExportPathfindingScoresRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ExportPathfindingScoresRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ExportPathfindingScoresRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportPathfindingScoresRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportPathfindingScoresResponse. */ + interface IExportPathfindingScoresResponse { + /** ExportPathfindingScoresResponse scores */ + scores?: Uint8Array | null; + } + + /** Represents an ExportPathfindingScoresResponse. */ + class ExportPathfindingScoresResponse implements IExportPathfindingScoresResponse { + /** + * Constructs a new ExportPathfindingScoresResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IExportPathfindingScoresResponse); + + /** ExportPathfindingScoresResponse scores. */ + public scores: Uint8Array; + + /** + * Creates a new ExportPathfindingScoresResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportPathfindingScoresResponse instance + */ + public static create( + properties?: api.IExportPathfindingScoresResponse + ): api.ExportPathfindingScoresResponse; + + /** + * Encodes the specified ExportPathfindingScoresResponse message. Does not implicitly {@link api.ExportPathfindingScoresResponse.verify|verify} messages. + * @param message ExportPathfindingScoresResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IExportPathfindingScoresResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ExportPathfindingScoresResponse message, length delimited. Does not implicitly {@link api.ExportPathfindingScoresResponse.verify|verify} messages. + * @param message ExportPathfindingScoresResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IExportPathfindingScoresResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an ExportPathfindingScoresResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportPathfindingScoresResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.ExportPathfindingScoresResponse; + + /** + * Decodes an ExportPathfindingScoresResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportPathfindingScoresResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.ExportPathfindingScoresResponse; + + /** + * Verifies an ExportPathfindingScoresResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates an ExportPathfindingScoresResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportPathfindingScoresResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.ExportPathfindingScoresResponse; + + /** + * Creates a plain object from an ExportPathfindingScoresResponse message. Also converts values to other types if specified. + * @param message ExportPathfindingScoresResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ExportPathfindingScoresResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ExportPathfindingScoresResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportPathfindingScoresResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBalancesRequest. */ + interface IGetBalancesRequest {} + + /** Represents a GetBalancesRequest. */ + class GetBalancesRequest implements IGetBalancesRequest { + /** + * Constructs a new GetBalancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGetBalancesRequest); + + /** + * Creates a new GetBalancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBalancesRequest instance + */ + public static create( + properties?: api.IGetBalancesRequest + ): api.GetBalancesRequest; + + /** + * Encodes the specified GetBalancesRequest message. Does not implicitly {@link api.GetBalancesRequest.verify|verify} messages. + * @param message GetBalancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGetBalancesRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GetBalancesRequest message, length delimited. Does not implicitly {@link api.GetBalancesRequest.verify|verify} messages. + * @param message GetBalancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGetBalancesRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GetBalancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.GetBalancesRequest; + + /** + * Decodes a GetBalancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBalancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.GetBalancesRequest; + + /** + * Verifies a GetBalancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a GetBalancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBalancesRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.GetBalancesRequest; + + /** + * Creates a plain object from a GetBalancesRequest message. Also converts values to other types if specified. + * @param message GetBalancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GetBalancesRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GetBalancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBalancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBalancesResponse. */ + interface IGetBalancesResponse { + /** GetBalancesResponse 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 }; + + /** + * Gets the default type url for GetBalancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConnectPeerRequest. */ + interface IConnectPeerRequest { + /** ConnectPeerRequest 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 }; + + /** + * Gets the default type url for ConnectPeerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConnectPeerResponse. */ + interface IConnectPeerResponse {} + + /** Represents a ConnectPeerResponse. */ + class ConnectPeerResponse implements IConnectPeerResponse { + /** + * Constructs a new ConnectPeerResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IConnectPeerResponse); + + /** + * Creates a new ConnectPeerResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectPeerResponse instance + */ + public static create( + properties?: api.IConnectPeerResponse + ): api.ConnectPeerResponse; + + /** + * Encodes the specified ConnectPeerResponse message. Does not implicitly {@link api.ConnectPeerResponse.verify|verify} messages. + * @param message ConnectPeerResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IConnectPeerResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ConnectPeerResponse message, length delimited. Does not implicitly {@link api.ConnectPeerResponse.verify|verify} messages. + * @param message ConnectPeerResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IConnectPeerResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ConnectPeerResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectPeerResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.ConnectPeerResponse; + + /** + * Decodes a ConnectPeerResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectPeerResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.ConnectPeerResponse; + + /** + * Verifies a ConnectPeerResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a ConnectPeerResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectPeerResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.ConnectPeerResponse; + + /** + * Creates a plain object from a ConnectPeerResponse message. Also converts values to other types if specified. + * @param message ConnectPeerResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ConnectPeerResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ConnectPeerResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectPeerResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisconnectPeerRequest. */ + interface IDisconnectPeerRequest { + /** DisconnectPeerRequest 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 }; + + /** + * Gets the default type url for DisconnectPeerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisconnectPeerResponse. */ + interface IDisconnectPeerResponse {} + + /** Represents a DisconnectPeerResponse. */ + class DisconnectPeerResponse implements IDisconnectPeerResponse { + /** + * Constructs a new DisconnectPeerResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IDisconnectPeerResponse); + + /** + * Creates a new DisconnectPeerResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DisconnectPeerResponse instance + */ + public static create( + properties?: api.IDisconnectPeerResponse + ): api.DisconnectPeerResponse; + + /** + * Encodes the specified DisconnectPeerResponse message. Does not implicitly {@link api.DisconnectPeerResponse.verify|verify} messages. + * @param message DisconnectPeerResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IDisconnectPeerResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified DisconnectPeerResponse message, length delimited. Does not implicitly {@link api.DisconnectPeerResponse.verify|verify} messages. + * @param message DisconnectPeerResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IDisconnectPeerResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a DisconnectPeerResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisconnectPeerResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.DisconnectPeerResponse; + + /** + * Decodes a DisconnectPeerResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisconnectPeerResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.DisconnectPeerResponse; + + /** + * Verifies a DisconnectPeerResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a DisconnectPeerResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisconnectPeerResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.DisconnectPeerResponse; + + /** + * Creates a plain object from a DisconnectPeerResponse message. Also converts values to other types if specified. + * @param message DisconnectPeerResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.DisconnectPeerResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this DisconnectPeerResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisconnectPeerResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPeersRequest. */ + interface IListPeersRequest {} + + /** Represents a ListPeersRequest. */ + class ListPeersRequest implements IListPeersRequest { + /** + * Constructs a new ListPeersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IListPeersRequest); + + /** + * Creates a new ListPeersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPeersRequest instance + */ + public static create( + properties?: api.IListPeersRequest + ): api.ListPeersRequest; + + /** + * Encodes the specified ListPeersRequest message. Does not implicitly {@link api.ListPeersRequest.verify|verify} messages. + * @param message ListPeersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IListPeersRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ListPeersRequest message, length delimited. Does not implicitly {@link api.ListPeersRequest.verify|verify} messages. + * @param message ListPeersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IListPeersRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ListPeersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPeersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.ListPeersRequest; + + /** + * Decodes a ListPeersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPeersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.ListPeersRequest; + + /** + * Verifies a ListPeersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a ListPeersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPeersRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.ListPeersRequest; + + /** + * Creates a plain object from a ListPeersRequest message. Also converts values to other types if specified. + * @param message ListPeersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ListPeersRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ListPeersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPeersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPeersResponse. */ + interface IListPeersResponse { + /** ListPeersResponse peers */ + peers?: types.IPeer[] | null; + } + + /** Represents a ListPeersResponse. */ + class ListPeersResponse implements IListPeersResponse { + /** + * Constructs a new ListPeersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IListPeersResponse); + + /** ListPeersResponse peers. */ + public peers: types.IPeer[]; + + /** + * Creates a new ListPeersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPeersResponse instance + */ + public static create( + properties?: api.IListPeersResponse + ): api.ListPeersResponse; + + /** + * Encodes the specified ListPeersResponse message. Does not implicitly {@link api.ListPeersResponse.verify|verify} messages. + * @param message ListPeersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IListPeersResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ListPeersResponse message, length delimited. Does not implicitly {@link api.ListPeersResponse.verify|verify} messages. + * @param message ListPeersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IListPeersResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ListPeersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPeersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.ListPeersResponse; + + /** + * Decodes a ListPeersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPeersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.ListPeersResponse; + + /** + * Verifies a ListPeersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a ListPeersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPeersResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.ListPeersResponse; + + /** + * Creates a plain object from a ListPeersResponse message. Also converts values to other types if specified. + * @param message ListPeersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.ListPeersResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ListPeersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPeersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphListChannelsRequest. */ + interface IGraphListChannelsRequest {} + + /** Represents a GraphListChannelsRequest. */ + class GraphListChannelsRequest implements IGraphListChannelsRequest { + /** + * Constructs a new GraphListChannelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGraphListChannelsRequest); + + /** + * Creates a new GraphListChannelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphListChannelsRequest instance + */ + public static create( + properties?: api.IGraphListChannelsRequest + ): api.GraphListChannelsRequest; + + /** + * Encodes the specified GraphListChannelsRequest message. Does not implicitly {@link api.GraphListChannelsRequest.verify|verify} messages. + * @param message GraphListChannelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGraphListChannelsRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GraphListChannelsRequest message, length delimited. Does not implicitly {@link api.GraphListChannelsRequest.verify|verify} messages. + * @param message GraphListChannelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGraphListChannelsRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GraphListChannelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphListChannelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.GraphListChannelsRequest; + + /** + * Decodes a GraphListChannelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphListChannelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.GraphListChannelsRequest; + + /** + * Verifies a GraphListChannelsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a GraphListChannelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphListChannelsRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.GraphListChannelsRequest; + + /** + * Creates a plain object from a GraphListChannelsRequest message. Also converts values to other types if specified. + * @param message GraphListChannelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GraphListChannelsRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GraphListChannelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphListChannelsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphListChannelsResponse. */ + interface IGraphListChannelsResponse { + /** GraphListChannelsResponse 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 }; + + /** + * Gets the default type url for GraphListChannelsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphGetChannelRequest. */ + interface IGraphGetChannelRequest { + /** GraphGetChannelRequest 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 }; + + /** + * Gets the default type url for GraphGetChannelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphGetChannelResponse. */ + interface IGraphGetChannelResponse { + /** GraphGetChannelResponse channel */ + channel?: types.IGraphChannel | null; + } + + /** Represents a GraphGetChannelResponse. */ + class GraphGetChannelResponse implements IGraphGetChannelResponse { + /** + * Constructs a new GraphGetChannelResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGraphGetChannelResponse); + + /** GraphGetChannelResponse channel. */ + public channel?: types.IGraphChannel | null; + + /** + * Creates a new GraphGetChannelResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphGetChannelResponse instance + */ + public static create( + properties?: api.IGraphGetChannelResponse + ): api.GraphGetChannelResponse; + + /** + * Encodes the specified GraphGetChannelResponse message. Does not implicitly {@link api.GraphGetChannelResponse.verify|verify} messages. + * @param message GraphGetChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGraphGetChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GraphGetChannelResponse message, length delimited. Does not implicitly {@link api.GraphGetChannelResponse.verify|verify} messages. + * @param message GraphGetChannelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGraphGetChannelResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GraphGetChannelResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphGetChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.GraphGetChannelResponse; + + /** + * Decodes a GraphGetChannelResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphGetChannelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.GraphGetChannelResponse; + + /** + * Verifies a GraphGetChannelResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a GraphGetChannelResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphGetChannelResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.GraphGetChannelResponse; + + /** + * Creates a plain object from a GraphGetChannelResponse message. Also converts values to other types if specified. + * @param message GraphGetChannelResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GraphGetChannelResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GraphGetChannelResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphGetChannelResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphListNodesRequest. */ + interface IGraphListNodesRequest {} + + /** Represents a GraphListNodesRequest. */ + class GraphListNodesRequest implements IGraphListNodesRequest { + /** + * Constructs a new GraphListNodesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGraphListNodesRequest); + + /** + * Creates a new GraphListNodesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphListNodesRequest instance + */ + public static create( + properties?: api.IGraphListNodesRequest + ): api.GraphListNodesRequest; + + /** + * Encodes the specified GraphListNodesRequest message. Does not implicitly {@link api.GraphListNodesRequest.verify|verify} messages. + * @param message GraphListNodesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGraphListNodesRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GraphListNodesRequest message, length delimited. Does not implicitly {@link api.GraphListNodesRequest.verify|verify} messages. + * @param message GraphListNodesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGraphListNodesRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GraphListNodesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphListNodesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.GraphListNodesRequest; + + /** + * Decodes a GraphListNodesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphListNodesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.GraphListNodesRequest; + + /** + * Verifies a GraphListNodesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a GraphListNodesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphListNodesRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.GraphListNodesRequest; + + /** + * Creates a plain object from a GraphListNodesRequest message. Also converts values to other types if specified. + * @param message GraphListNodesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GraphListNodesRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GraphListNodesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphListNodesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphListNodesResponse. */ + interface IGraphListNodesResponse { + /** GraphListNodesResponse 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 }; + + /** + * Gets the default type url for GraphListNodesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UnifiedSendRequest. */ + interface IUnifiedSendRequest { + /** UnifiedSendRequest uri */ + uri?: string | null; + + /** UnifiedSendRequest 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 | null; + + /** 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 }; + + /** + * Gets the default type url for UnifiedSendRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UnifiedSendResponse. */ + interface IUnifiedSendResponse { + /** UnifiedSendResponse txid */ + txid?: string | null; + + /** UnifiedSendResponse 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 | null; + + /** UnifiedSendResponse bolt11PaymentId. */ + public bolt11PaymentId?: string | null; + + /** UnifiedSendResponse bolt12PaymentId. */ + public bolt12PaymentId?: string | null; + + /** 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 }; + + /** + * Gets the default type url for UnifiedSendResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphGetNodeRequest. */ + interface IGraphGetNodeRequest { + /** GraphGetNodeRequest 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 }; + + /** + * Gets the default type url for GraphGetNodeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphGetNodeResponse. */ + interface IGraphGetNodeResponse { + /** GraphGetNodeResponse node */ + node?: types.IGraphNode | null; + } + + /** Represents a GraphGetNodeResponse. */ + class GraphGetNodeResponse implements IGraphGetNodeResponse { + /** + * Constructs a new GraphGetNodeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: api.IGraphGetNodeResponse); + + /** GraphGetNodeResponse node. */ + public node?: types.IGraphNode | null; + + /** + * Creates a new GraphGetNodeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GraphGetNodeResponse instance + */ + public static create( + properties?: api.IGraphGetNodeResponse + ): api.GraphGetNodeResponse; + + /** + * Encodes the specified GraphGetNodeResponse message. Does not implicitly {@link api.GraphGetNodeResponse.verify|verify} messages. + * @param message GraphGetNodeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IGraphGetNodeResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified GraphGetNodeResponse message, length delimited. Does not implicitly {@link api.GraphGetNodeResponse.verify|verify} messages. + * @param message GraphGetNodeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IGraphGetNodeResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a GraphGetNodeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GraphGetNodeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.GraphGetNodeResponse; + + /** + * Decodes a GraphGetNodeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GraphGetNodeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.GraphGetNodeResponse; + + /** + * Verifies a GraphGetNodeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a GraphGetNodeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GraphGetNodeResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.GraphGetNodeResponse; + + /** + * Creates a plain object from a GraphGetNodeResponse message. Also converts values to other types if specified. + * @param message GraphGetNodeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.GraphGetNodeResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this GraphGetNodeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GraphGetNodeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DecodeInvoiceRequest. */ + interface IDecodeInvoiceRequest { + /** DecodeInvoiceRequest invoice */ + invoice?: string | null; + } + + /** Represents a DecodeInvoiceRequest. */ + class DecodeInvoiceRequest implements IDecodeInvoiceRequest { + /** + * Constructs a new DecodeInvoiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IDecodeInvoiceRequest); + + /** DecodeInvoiceRequest invoice. */ + public invoice: string; + + /** + * Creates a new DecodeInvoiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DecodeInvoiceRequest instance + */ + public static create( + properties?: api.IDecodeInvoiceRequest + ): api.DecodeInvoiceRequest; + + /** + * Encodes the specified DecodeInvoiceRequest message. Does not implicitly {@link api.DecodeInvoiceRequest.verify|verify} messages. + * @param message DecodeInvoiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IDecodeInvoiceRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified DecodeInvoiceRequest message, length delimited. Does not implicitly {@link api.DecodeInvoiceRequest.verify|verify} messages. + * @param message DecodeInvoiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IDecodeInvoiceRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a DecodeInvoiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DecodeInvoiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.DecodeInvoiceRequest; + + /** + * Decodes a DecodeInvoiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DecodeInvoiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.DecodeInvoiceRequest; + + /** + * Verifies a DecodeInvoiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a DecodeInvoiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DecodeInvoiceRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.DecodeInvoiceRequest; + + /** + * Creates a plain object from a DecodeInvoiceRequest message. Also converts values to other types if specified. + * @param message DecodeInvoiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.DecodeInvoiceRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this DecodeInvoiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DecodeInvoiceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DecodeInvoiceResponse. */ + interface IDecodeInvoiceResponse { + /** DecodeInvoiceResponse destination */ + destination?: string | null; + + /** DecodeInvoiceResponse 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; + } + + /** 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 | null; + + /** DecodeInvoiceResponse timestamp. */ + public timestamp: number | Long; + + /** DecodeInvoiceResponse expiry. */ + public expiry: number | Long; + + /** DecodeInvoiceResponse description. */ + public description?: string | null; + + /** DecodeInvoiceResponse descriptionHash. */ + public descriptionHash?: string | null; + + /** DecodeInvoiceResponse fallbackAddress. */ + public fallbackAddress?: string | null; + + /** 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 | null; + + /** + * Creates a new DecodeInvoiceResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DecodeInvoiceResponse instance + */ + public static create( + properties?: api.IDecodeInvoiceResponse + ): api.DecodeInvoiceResponse; + + /** + * Encodes the specified DecodeInvoiceResponse message. Does not implicitly {@link api.DecodeInvoiceResponse.verify|verify} messages. + * @param message DecodeInvoiceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IDecodeInvoiceResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified DecodeInvoiceResponse message, length delimited. Does not implicitly {@link api.DecodeInvoiceResponse.verify|verify} messages. + * @param message DecodeInvoiceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IDecodeInvoiceResponse, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a DecodeInvoiceResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DecodeInvoiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.DecodeInvoiceResponse; + + /** + * Decodes a DecodeInvoiceResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DecodeInvoiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.DecodeInvoiceResponse; + + /** + * Verifies a DecodeInvoiceResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a DecodeInvoiceResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DecodeInvoiceResponse + */ + public static fromObject(object: { + [k: string]: any; + }): api.DecodeInvoiceResponse; + + /** + * Creates a plain object from a DecodeInvoiceResponse message. Also converts values to other types if specified. + * @param message DecodeInvoiceResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.DecodeInvoiceResponse, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this DecodeInvoiceResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DecodeInvoiceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DecodeOfferRequest. */ + interface IDecodeOfferRequest { + /** DecodeOfferRequest offer */ + offer?: string | null; + } + + /** Represents a DecodeOfferRequest. */ + class DecodeOfferRequest implements IDecodeOfferRequest { + /** + * Constructs a new DecodeOfferRequest. + * @param [properties] Properties to set + */ + constructor(properties?: api.IDecodeOfferRequest); + + /** DecodeOfferRequest offer. */ + public offer: string; + + /** + * Creates a new DecodeOfferRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DecodeOfferRequest instance + */ + public static create( + properties?: api.IDecodeOfferRequest + ): api.DecodeOfferRequest; + + /** + * Encodes the specified DecodeOfferRequest message. Does not implicitly {@link api.DecodeOfferRequest.verify|verify} messages. + * @param message DecodeOfferRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: api.IDecodeOfferRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified DecodeOfferRequest message, length delimited. Does not implicitly {@link api.DecodeOfferRequest.verify|verify} messages. + * @param message DecodeOfferRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: api.IDecodeOfferRequest, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a DecodeOfferRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DecodeOfferRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): api.DecodeOfferRequest; + + /** + * Decodes a DecodeOfferRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DecodeOfferRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): api.DecodeOfferRequest; + + /** + * Verifies a DecodeOfferRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a DecodeOfferRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DecodeOfferRequest + */ + public static fromObject(object: { + [k: string]: any; + }): api.DecodeOfferRequest; + + /** + * Creates a plain object from a DecodeOfferRequest message. Also converts values to other types if specified. + * @param message DecodeOfferRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: api.DecodeOfferRequest, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this DecodeOfferRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DecodeOfferRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DecodeOfferResponse. */ + interface IDecodeOfferResponse { + /** DecodeOfferResponse 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 | null; + + /** DecodeOfferResponse issuer. */ + public issuer?: string | null; + + /** DecodeOfferResponse amount. */ + public amount?: types.IOfferAmount | null; + + /** DecodeOfferResponse issuerSigningPubkey. */ + public issuerSigningPubkey?: string | null; + + /** DecodeOfferResponse absoluteExpiry. */ + public absoluteExpiry?: number | Long | null; + + /** DecodeOfferResponse quantity. */ + public quantity?: types.IOfferQuantity | null; + + /** DecodeOfferResponse paths. */ + public paths: types.IBlindedPath[]; + + /** DecodeOfferResponse features. */ + public features: { [k: string]: types.IBolt11Feature }; + + /** DecodeOfferResponse chains. */ + public chains: string[]; + + /** DecodeOfferResponse metadata. */ + public metadata?: string | null; + + /** DecodeOfferResponse 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 }; + + /** + * Gets the default type url for DecodeOfferResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } +} + +/** 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 | null; + + /** Payment feePaidMsat. */ + public feePaidMsat?: number | Long | null; + + /** 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 }; + + /** + * Gets the default type url for Payment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PaymentKind. */ + interface IPaymentKind { + /** PaymentKind onchain */ + onchain?: types.IOnchain | null; + + /** PaymentKind bolt11 */ + bolt11?: types.IBolt11 | null; + + /** PaymentKind 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 }; + + /** + * Gets the default type url for PaymentKind + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Onchain. */ + interface IOnchain { + /** Onchain txid */ + txid?: string | null; + + /** Onchain status */ + status?: types.IConfirmationStatus | null; + } + + /** Represents an Onchain. */ + class Onchain implements IOnchain { + /** + * Constructs a new Onchain. + * @param [properties] Properties to set + */ + constructor(properties?: types.IOnchain); + + /** Onchain txid. */ + public txid: string; + + /** Onchain status. */ + public status?: types.IConfirmationStatus | null; + + /** + * Creates a new Onchain instance using the specified properties. + * @param [properties] Properties to set + * @returns Onchain instance + */ + public static create(properties?: types.IOnchain): types.Onchain; + + /** + * Encodes the specified Onchain message. Does not implicitly {@link types.Onchain.verify|verify} messages. + * @param message Onchain message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IOnchain, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Onchain message, length delimited. Does not implicitly {@link types.Onchain.verify|verify} messages. + * @param message Onchain message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IOnchain, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an Onchain message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Onchain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): types.Onchain; + + /** + * Decodes an Onchain message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Onchain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): types.Onchain; + + /** + * Verifies an Onchain message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates an Onchain message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Onchain + */ + public static fromObject(object: { [k: string]: any }): types.Onchain; + + /** + * Creates a plain object from an Onchain message. Also converts values to other types if specified. + * @param message Onchain + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Onchain, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Onchain to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Onchain + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConfirmationStatus. */ + interface IConfirmationStatus { + /** ConfirmationStatus confirmed */ + confirmed?: types.IConfirmed | null; + + /** ConfirmationStatus unconfirmed */ + unconfirmed?: types.IUnconfirmed | null; + } + + /** Represents a ConfirmationStatus. */ + class ConfirmationStatus implements IConfirmationStatus { + /** + * Constructs a new ConfirmationStatus. + * @param [properties] Properties to set + */ + constructor(properties?: types.IConfirmationStatus); + + /** ConfirmationStatus confirmed. */ + public confirmed?: types.IConfirmed | null; + + /** ConfirmationStatus unconfirmed. */ + public unconfirmed?: types.IUnconfirmed | null; + + /** ConfirmationStatus status. */ + public status?: 'confirmed' | 'unconfirmed'; + + /** + * Creates a new ConfirmationStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfirmationStatus instance + */ + public static create( + properties?: types.IConfirmationStatus + ): types.ConfirmationStatus; + + /** + * Encodes the specified ConfirmationStatus message. Does not implicitly {@link types.ConfirmationStatus.verify|verify} messages. + * @param message ConfirmationStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IConfirmationStatus, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ConfirmationStatus message, length delimited. Does not implicitly {@link types.ConfirmationStatus.verify|verify} messages. + * @param message ConfirmationStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IConfirmationStatus, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ConfirmationStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfirmationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): types.ConfirmationStatus; + + /** + * Decodes a ConfirmationStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfirmationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): types.ConfirmationStatus; + + /** + * Verifies a ConfirmationStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a ConfirmationStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfirmationStatus + */ + public static fromObject(object: { + [k: string]: any; + }): types.ConfirmationStatus; + + /** + * Creates a plain object from a ConfirmationStatus message. Also converts values to other types if specified. + * @param message ConfirmationStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.ConfirmationStatus, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ConfirmationStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfirmationStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Confirmed. */ + interface IConfirmed { + /** Confirmed 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 }; + + /** + * Gets the default type url for Confirmed + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Unconfirmed. */ + interface IUnconfirmed {} + + /** Represents an Unconfirmed. */ + class Unconfirmed implements IUnconfirmed { + /** + * Constructs a new Unconfirmed. + * @param [properties] Properties to set + */ + constructor(properties?: types.IUnconfirmed); + + /** + * Creates a new Unconfirmed instance using the specified properties. + * @param [properties] Properties to set + * @returns Unconfirmed instance + */ + public static create(properties?: types.IUnconfirmed): types.Unconfirmed; + + /** + * Encodes the specified Unconfirmed message. Does not implicitly {@link types.Unconfirmed.verify|verify} messages. + * @param message Unconfirmed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IUnconfirmed, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Unconfirmed message, length delimited. Does not implicitly {@link types.Unconfirmed.verify|verify} messages. + * @param message Unconfirmed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IUnconfirmed, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an Unconfirmed message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Unconfirmed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): types.Unconfirmed; + + /** + * Decodes an Unconfirmed message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Unconfirmed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): types.Unconfirmed; + + /** + * Verifies an Unconfirmed message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates an Unconfirmed message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Unconfirmed + */ + public static fromObject(object: { [k: string]: any }): types.Unconfirmed; + + /** + * Creates a plain object from an Unconfirmed message. Also converts values to other types if specified. + * @param message Unconfirmed + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Unconfirmed, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Unconfirmed to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Unconfirmed + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11. */ + interface IBolt11 { + /** Bolt11 hash */ + hash?: string | null; + + /** Bolt11 preimage */ + preimage?: string | null; + + /** Bolt11 secret */ + secret?: Uint8Array | null; + } + + /** Represents a Bolt11. */ + class Bolt11 implements IBolt11 { + /** + * Constructs a new Bolt11. + * @param [properties] Properties to set + */ + constructor(properties?: types.IBolt11); + + /** Bolt11 hash. */ + public hash: string; + + /** Bolt11 preimage. */ + public preimage?: string | null; + + /** Bolt11 secret. */ + public secret?: Uint8Array | null; + + /** + * Creates a new Bolt11 instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11 instance + */ + public static create(properties?: types.IBolt11): types.Bolt11; + + /** + * Encodes the specified Bolt11 message. Does not implicitly {@link types.Bolt11.verify|verify} messages. + * @param message Bolt11 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IBolt11, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11 message, length delimited. Does not implicitly {@link types.Bolt11.verify|verify} messages. + * @param message Bolt11 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IBolt11, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): types.Bolt11; + + /** + * Decodes a Bolt11 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): types.Bolt11; + + /** + * Verifies a Bolt11 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Bolt11 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11 + */ + public static fromObject(object: { [k: string]: any }): types.Bolt11; + + /** + * Creates a plain object from a Bolt11 message. Also converts values to other types if specified. + * @param message Bolt11 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Bolt11, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11 + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11Jit. */ + interface IBolt11Jit { + /** Bolt11Jit hash */ + hash?: string | null; + + /** Bolt11Jit preimage */ + preimage?: string | null; + + /** Bolt11Jit secret */ + secret?: Uint8Array | null; + + /** Bolt11Jit 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 | null; + + /** Bolt11Jit secret. */ + public secret?: Uint8Array | null; + + /** Bolt11Jit lspFeeLimits. */ + public lspFeeLimits?: types.ILSPFeeLimits | null; + + /** Bolt11Jit counterpartySkimmedFeeMsat. */ + public counterpartySkimmedFeeMsat?: number | Long | null; + + /** + * Creates a new Bolt11Jit instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11Jit instance + */ + public static create(properties?: types.IBolt11Jit): types.Bolt11Jit; + + /** + * Encodes the specified Bolt11Jit message. Does not implicitly {@link types.Bolt11Jit.verify|verify} messages. + * @param message Bolt11Jit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IBolt11Jit, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11Jit message, length delimited. Does not implicitly {@link types.Bolt11Jit.verify|verify} messages. + * @param message Bolt11Jit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IBolt11Jit, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11Jit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11Jit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): types.Bolt11Jit; + + /** + * Decodes a Bolt11Jit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11Jit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): types.Bolt11Jit; + + /** + * Verifies a Bolt11Jit message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Bolt11Jit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11Jit + */ + public static fromObject(object: { [k: string]: any }): types.Bolt11Jit; + + /** + * Creates a plain object from a Bolt11Jit message. Also converts values to other types if specified. + * @param message Bolt11Jit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Bolt11Jit, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11Jit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11Jit + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt12Offer. */ + interface IBolt12Offer { + /** Bolt12Offer hash */ + hash?: string | null; + + /** Bolt12Offer preimage */ + preimage?: string | null; + + /** Bolt12Offer secret */ + secret?: Uint8Array | null; + + /** Bolt12Offer 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 | null; + + /** Bolt12Offer preimage. */ + public preimage?: string | null; + + /** Bolt12Offer secret. */ + public secret?: Uint8Array | null; + + /** Bolt12Offer offerId. */ + public offerId: string; + + /** Bolt12Offer payerNote. */ + public payerNote?: string | null; + + /** Bolt12Offer quantity. */ + public quantity?: number | Long | null; + + /** + * Creates a new Bolt12Offer instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt12Offer instance + */ + public static create(properties?: types.IBolt12Offer): types.Bolt12Offer; + + /** + * Encodes the specified Bolt12Offer message. Does not implicitly {@link types.Bolt12Offer.verify|verify} messages. + * @param message Bolt12Offer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IBolt12Offer, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt12Offer message, length delimited. Does not implicitly {@link types.Bolt12Offer.verify|verify} messages. + * @param message Bolt12Offer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IBolt12Offer, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt12Offer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt12Offer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): types.Bolt12Offer; + + /** + * Decodes a Bolt12Offer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt12Offer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): types.Bolt12Offer; + + /** + * Verifies a Bolt12Offer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Bolt12Offer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt12Offer + */ + public static fromObject(object: { [k: string]: any }): types.Bolt12Offer; + + /** + * Creates a plain object from a Bolt12Offer message. Also converts values to other types if specified. + * @param message Bolt12Offer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Bolt12Offer, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt12Offer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt12Offer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt12Refund. */ + interface IBolt12Refund { + /** Bolt12Refund hash */ + hash?: string | null; + + /** Bolt12Refund preimage */ + preimage?: string | null; + + /** Bolt12Refund secret */ + secret?: Uint8Array | null; + + /** Bolt12Refund 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 | null; + + /** Bolt12Refund preimage. */ + public preimage?: string | null; + + /** Bolt12Refund secret. */ + public secret?: Uint8Array | null; + + /** Bolt12Refund payerNote. */ + public payerNote?: string | null; + + /** Bolt12Refund quantity. */ + public quantity?: number | Long | null; + + /** + * Creates a new Bolt12Refund instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt12Refund instance + */ + public static create(properties?: types.IBolt12Refund): types.Bolt12Refund; + + /** + * Encodes the specified Bolt12Refund message. Does not implicitly {@link types.Bolt12Refund.verify|verify} messages. + * @param message Bolt12Refund message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IBolt12Refund, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt12Refund message, length delimited. Does not implicitly {@link types.Bolt12Refund.verify|verify} messages. + * @param message Bolt12Refund message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IBolt12Refund, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt12Refund message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt12Refund + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): types.Bolt12Refund; + + /** + * Decodes a Bolt12Refund message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt12Refund + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): types.Bolt12Refund; + + /** + * Verifies a Bolt12Refund message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Bolt12Refund message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt12Refund + */ + public static fromObject(object: { [k: string]: any }): types.Bolt12Refund; + + /** + * Creates a plain object from a Bolt12Refund message. Also converts values to other types if specified. + * @param message Bolt12Refund + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Bolt12Refund, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt12Refund to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt12Refund + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Spontaneous. */ + interface ISpontaneous { + /** Spontaneous hash */ + hash?: string | null; + + /** Spontaneous preimage */ + preimage?: string | null; + } + + /** Represents a Spontaneous. */ + class Spontaneous implements ISpontaneous { + /** + * Constructs a new Spontaneous. + * @param [properties] Properties to set + */ + constructor(properties?: types.ISpontaneous); + + /** Spontaneous hash. */ + public hash: string; + + /** Spontaneous preimage. */ + public preimage?: string | null; + + /** + * Creates a new Spontaneous instance using the specified properties. + * @param [properties] Properties to set + * @returns Spontaneous instance + */ + public static create(properties?: types.ISpontaneous): types.Spontaneous; + + /** + * Encodes the specified Spontaneous message. Does not implicitly {@link types.Spontaneous.verify|verify} messages. + * @param message Spontaneous message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.ISpontaneous, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Spontaneous message, length delimited. Does not implicitly {@link types.Spontaneous.verify|verify} messages. + * @param message Spontaneous message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.ISpontaneous, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Spontaneous message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Spontaneous + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): types.Spontaneous; + + /** + * Decodes a Spontaneous message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Spontaneous + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): types.Spontaneous; + + /** + * Verifies a Spontaneous message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Spontaneous message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Spontaneous + */ + public static fromObject(object: { [k: string]: any }): types.Spontaneous; + + /** + * Creates a plain object from a Spontaneous message. Also converts values to other types if specified. + * @param message Spontaneous + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Spontaneous, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Spontaneous to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Spontaneous + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LSPFeeLimits. */ + interface ILSPFeeLimits { + /** LSPFeeLimits 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 | null; + + /** LSPFeeLimits maxProportionalOpeningFeePpmMsat. */ + public maxProportionalOpeningFeePpmMsat?: number | Long | null; + + /** + * Creates a new LSPFeeLimits instance using the specified properties. + * @param [properties] Properties to set + * @returns LSPFeeLimits instance + */ + public static create(properties?: types.ILSPFeeLimits): types.LSPFeeLimits; + + /** + * Encodes the specified LSPFeeLimits message. Does not implicitly {@link types.LSPFeeLimits.verify|verify} messages. + * @param message LSPFeeLimits message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.ILSPFeeLimits, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified LSPFeeLimits message, length delimited. Does not implicitly {@link types.LSPFeeLimits.verify|verify} messages. + * @param message LSPFeeLimits message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.ILSPFeeLimits, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a LSPFeeLimits message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LSPFeeLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): types.LSPFeeLimits; + + /** + * Decodes a LSPFeeLimits message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LSPFeeLimits + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): types.LSPFeeLimits; + + /** + * Verifies a LSPFeeLimits message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a LSPFeeLimits message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LSPFeeLimits + */ + public static fromObject(object: { [k: string]: any }): types.LSPFeeLimits; + + /** + * Creates a plain object from a LSPFeeLimits message. Also converts values to other types if specified. + * @param message LSPFeeLimits + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.LSPFeeLimits, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this LSPFeeLimits to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LSPFeeLimits + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** PaymentDirection enum. */ + enum PaymentDirection { + INBOUND = 0, + OUTBOUND = 1, + } + + /** PaymentStatus enum. */ + enum PaymentStatus { + PENDING = 0, + SUCCEEDED = 1, + FAILED = 2, + } + + /** 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 | null; + + /** ForwardedPayment totalFeeEarnedMsat. */ + public totalFeeEarnedMsat?: number | Long | null; + + /** ForwardedPayment skimmedFeeMsat. */ + public skimmedFeeMsat?: number | Long | null; + + /** ForwardedPayment claimFromOnchainTx. */ + public claimFromOnchainTx: boolean; + + /** ForwardedPayment outboundAmountForwardedMsat. */ + public outboundAmountForwardedMsat?: number | Long | null; + + /** + * Creates a new ForwardedPayment instance using the specified properties. + * @param [properties] Properties to set + * @returns ForwardedPayment instance + */ + public static create( + properties?: types.IForwardedPayment + ): types.ForwardedPayment; + + /** + * Encodes the specified ForwardedPayment message. Does not implicitly {@link types.ForwardedPayment.verify|verify} messages. + * @param message ForwardedPayment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IForwardedPayment, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified ForwardedPayment message, length delimited. Does not implicitly {@link types.ForwardedPayment.verify|verify} messages. + * @param message ForwardedPayment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IForwardedPayment, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a ForwardedPayment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForwardedPayment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): types.ForwardedPayment; + + /** + * Decodes a ForwardedPayment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForwardedPayment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): types.ForwardedPayment; + + /** + * Verifies a ForwardedPayment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a ForwardedPayment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForwardedPayment + */ + public static fromObject(object: { + [k: string]: any; + }): types.ForwardedPayment; + + /** + * Creates a plain object from a ForwardedPayment message. Also converts values to other types if specified. + * @param message ForwardedPayment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.ForwardedPayment, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this ForwardedPayment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ForwardedPayment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Channel. */ + interface IChannel { + /** Channel 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 | null; + + /** 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 | null; + + /** Channel confirmations. */ + public confirmations?: number | null; + + /** 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 | null; + + /** Channel counterpartyOutboundHtlcMinimumMsat. */ + public counterpartyOutboundHtlcMinimumMsat?: number | Long | null; + + /** Channel counterpartyOutboundHtlcMaximumMsat. */ + public counterpartyOutboundHtlcMaximumMsat?: number | Long | null; + + /** Channel counterpartyUnspendablePunishmentReserve. */ + public counterpartyUnspendablePunishmentReserve: number | Long; + + /** Channel counterpartyForwardingInfoFeeBaseMsat. */ + public counterpartyForwardingInfoFeeBaseMsat?: number | null; + + /** Channel counterpartyForwardingInfoFeeProportionalMillionths. */ + public counterpartyForwardingInfoFeeProportionalMillionths?: number | null; + + /** Channel counterpartyForwardingInfoCltvExpiryDelta. */ + public counterpartyForwardingInfoCltvExpiryDelta?: number | null; + + /** + * Creates a new Channel instance using the specified properties. + * @param [properties] Properties to set + * @returns Channel instance + */ + public static create(properties?: types.IChannel): types.Channel; + + /** + * Encodes the specified Channel message. Does not implicitly {@link types.Channel.verify|verify} messages. + * @param message Channel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IChannel, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Channel message, length delimited. Does not implicitly {@link types.Channel.verify|verify} messages. + * @param message Channel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IChannel, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Channel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Channel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): types.Channel; + + /** + * Decodes a Channel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Channel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): types.Channel; + + /** + * Verifies a Channel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Channel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Channel + */ + public static fromObject(object: { [k: string]: any }): types.Channel; + + /** + * Creates a plain object from a Channel message. Also converts values to other types if specified. + * @param message Channel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Channel, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Channel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Channel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ChannelConfig. */ + interface IChannelConfig { + /** ChannelConfig 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 | null; + + /** ChannelConfig forwardingFeeBaseMsat. */ + public forwardingFeeBaseMsat?: number | null; + + /** ChannelConfig cltvExpiryDelta. */ + public cltvExpiryDelta?: number | null; + + /** ChannelConfig forceCloseAvoidanceMaxFeeSatoshis. */ + public forceCloseAvoidanceMaxFeeSatoshis?: number | Long | null; + + /** ChannelConfig acceptUnderpayingHtlcs. */ + public acceptUnderpayingHtlcs?: boolean | null; + + /** ChannelConfig fixedLimitMsat. */ + public fixedLimitMsat?: number | Long | null; + + /** ChannelConfig feeRateMultiplier. */ + public feeRateMultiplier?: number | Long | null; + + /** 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 }; + + /** + * Gets the default type url for ChannelConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutPoint. */ + interface IOutPoint { + /** OutPoint txid */ + txid?: string | null; + + /** OutPoint vout */ + vout?: number | null; + } + + /** Represents an OutPoint. */ + class OutPoint implements IOutPoint { + /** + * Constructs a new OutPoint. + * @param [properties] Properties to set + */ + constructor(properties?: types.IOutPoint); + + /** OutPoint txid. */ + public txid: string; + + /** OutPoint vout. */ + public vout: number; + + /** + * Creates a new OutPoint instance using the specified properties. + * @param [properties] Properties to set + * @returns OutPoint instance + */ + public static create(properties?: types.IOutPoint): types.OutPoint; + + /** + * Encodes the specified OutPoint message. Does not implicitly {@link types.OutPoint.verify|verify} messages. + * @param message OutPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IOutPoint, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified OutPoint message, length delimited. Does not implicitly {@link types.OutPoint.verify|verify} messages. + * @param message OutPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IOutPoint, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an OutPoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): types.OutPoint; + + /** + * Decodes an OutPoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): types.OutPoint; + + /** + * Verifies an OutPoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates an OutPoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutPoint + */ + public static fromObject(object: { [k: string]: any }): types.OutPoint; + + /** + * Creates a plain object from an OutPoint message. Also converts values to other types if specified. + * @param message OutPoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.OutPoint, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this OutPoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutPoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BestBlock. */ + interface IBestBlock { + /** BestBlock 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 }; + + /** + * Gets the default type url for BestBlock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LightningBalance. */ + interface ILightningBalance { + /** LightningBalance 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 }; + + /** + * Gets the default type url for LightningBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClaimableOnChannelClose. */ + interface IClaimableOnChannelClose { + /** ClaimableOnChannelClose 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 }; + + /** + * Gets the default type url for ClaimableOnChannelClose + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClaimableAwaitingConfirmations. */ + interface IClaimableAwaitingConfirmations { + /** ClaimableAwaitingConfirmations 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 }; + + /** + * Gets the default type url for ClaimableAwaitingConfirmations + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** BalanceSource enum. */ + enum BalanceSource { + HOLDER_FORCE_CLOSED = 0, + COUNTERPARTY_FORCE_CLOSED = 1, + COOP_CLOSE = 2, + HTLC = 3, + } + + /** Properties of a ContentiousClaimable. */ + interface IContentiousClaimable { + /** ContentiousClaimable 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 }; + + /** + * Gets the default type url for ContentiousClaimable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MaybeTimeoutClaimableHTLC. */ + interface IMaybeTimeoutClaimableHTLC { + /** MaybeTimeoutClaimableHTLC 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 }; + + /** + * Gets the default type url for MaybeTimeoutClaimableHTLC + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MaybePreimageClaimableHTLC. */ + interface IMaybePreimageClaimableHTLC { + /** MaybePreimageClaimableHTLC 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 }; + + /** + * Gets the default type url for MaybePreimageClaimableHTLC + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CounterpartyRevokedOutputClaimable. */ + interface ICounterpartyRevokedOutputClaimable { + /** CounterpartyRevokedOutputClaimable 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 }; + + /** + * Gets the default type url for CounterpartyRevokedOutputClaimable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingSweepBalance. */ + interface IPendingSweepBalance { + /** PendingSweepBalance 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 }; + + /** + * Gets the default type url for PendingSweepBalance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PendingBroadcast. */ + interface IPendingBroadcast { + /** PendingBroadcast 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 | null; + + /** 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 }; + + /** + * Gets the default type url for PendingBroadcast + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BroadcastAwaitingConfirmation. */ + interface IBroadcastAwaitingConfirmation { + /** BroadcastAwaitingConfirmation 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 | null; + + /** 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 }; + + /** + * Gets the default type url for BroadcastAwaitingConfirmation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AwaitingThresholdConfirmations. */ + interface IAwaitingThresholdConfirmations { + /** AwaitingThresholdConfirmations 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 | null; + + /** 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 }; + + /** + * Gets the default type url for AwaitingThresholdConfirmations + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PageToken. */ + interface IPageToken { + /** PageToken token */ + token?: string | null; + + /** PageToken index */ + index?: 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 }; + + /** + * Gets the default type url for PageToken + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11InvoiceDescription. */ + interface IBolt11InvoiceDescription { + /** Bolt11InvoiceDescription direct */ + direct?: string | null; + + /** Bolt11InvoiceDescription hash */ + hash?: string | null; + } + + /** Represents a Bolt11InvoiceDescription. */ + class Bolt11InvoiceDescription implements IBolt11InvoiceDescription { + /** + * Constructs a new Bolt11InvoiceDescription. + * @param [properties] Properties to set + */ + constructor(properties?: types.IBolt11InvoiceDescription); + + /** Bolt11InvoiceDescription direct. */ + public direct?: string | null; + + /** Bolt11InvoiceDescription hash. */ + public hash?: string | null; + + /** Bolt11InvoiceDescription kind. */ + public kind?: 'direct' | 'hash'; + + /** + * Creates a new Bolt11InvoiceDescription instance using the specified properties. + * @param [properties] Properties to set + * @returns Bolt11InvoiceDescription instance + */ + public static create( + properties?: types.IBolt11InvoiceDescription + ): types.Bolt11InvoiceDescription; + + /** + * Encodes the specified Bolt11InvoiceDescription message. Does not implicitly {@link types.Bolt11InvoiceDescription.verify|verify} messages. + * @param message Bolt11InvoiceDescription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IBolt11InvoiceDescription, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified Bolt11InvoiceDescription message, length delimited. Does not implicitly {@link types.Bolt11InvoiceDescription.verify|verify} messages. + * @param message Bolt11InvoiceDescription message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IBolt11InvoiceDescription, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a Bolt11InvoiceDescription message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Bolt11InvoiceDescription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): types.Bolt11InvoiceDescription; + + /** + * Decodes a Bolt11InvoiceDescription message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Bolt11InvoiceDescription + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): types.Bolt11InvoiceDescription; + + /** + * Verifies a Bolt11InvoiceDescription message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a Bolt11InvoiceDescription message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Bolt11InvoiceDescription + */ + public static fromObject(object: { + [k: string]: any; + }): types.Bolt11InvoiceDescription; + + /** + * Creates a plain object from a Bolt11InvoiceDescription message. Also converts values to other types if specified. + * @param message Bolt11InvoiceDescription + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.Bolt11InvoiceDescription, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this Bolt11InvoiceDescription to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Bolt11InvoiceDescription + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteParametersConfig. */ + interface IRouteParametersConfig { + /** RouteParametersConfig 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 | null; + + /** 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 }; + + /** + * Gets the default type url for RouteParametersConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphRoutingFees. */ + interface IGraphRoutingFees { + /** GraphRoutingFees 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 }; + + /** + * Gets the default type url for GraphRoutingFees + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphChannelUpdate. */ + interface IGraphChannelUpdate { + /** GraphChannelUpdate 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 }; + + /** + * Gets the default type url for GraphChannelUpdate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphChannel. */ + interface IGraphChannel { + /** GraphChannel 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 | null; + + /** 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 }; + + /** + * Gets the default type url for GraphChannel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphNodeAnnouncement. */ + interface IGraphNodeAnnouncement { + /** GraphNodeAnnouncement 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 }; + + /** + * Gets the default type url for GraphNodeAnnouncement + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Peer. */ + interface IPeer { + /** Peer 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 }; + + /** + * Gets the default type url for Peer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GraphNode. */ + interface IGraphNode { + /** GraphNode channels */ + channels?: (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 }; + + /** + * Gets the default type url for GraphNode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11RouteHint. */ + interface IBolt11RouteHint { + /** Bolt11RouteHint 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 }; + + /** + * Gets the default type url for Bolt11RouteHint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Bolt11HopHint. */ + interface IBolt11HopHint { + /** Bolt11HopHint 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 }; + + /** + * Gets the default type url for Bolt11HopHint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OfferAmount. */ + interface IOfferAmount { + /** OfferAmount 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 | null; + + /** 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 }; + + /** + * Gets the default type url for OfferAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CurrencyAmount. */ + interface ICurrencyAmount { + /** CurrencyAmount 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 }; + + /** + * Gets the default type url for CurrencyAmount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OfferQuantity. */ + interface IOfferQuantity { + /** OfferQuantity one */ + one?: boolean | null; + + /** OfferQuantity bounded */ + bounded?: 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 | null; + + /** OfferQuantity bounded. */ + public bounded?: number | Long | null; + + /** OfferQuantity unbounded. */ + public unbounded?: boolean | null; + + /** OfferQuantity quantity. */ + public quantity?: 'one' | 'bounded' | 'unbounded'; + + /** + * Creates a new OfferQuantity instance using the specified properties. + * @param [properties] Properties to set + * @returns OfferQuantity instance + */ + public static create( + properties?: types.IOfferQuantity + ): types.OfferQuantity; + + /** + * Encodes the specified OfferQuantity message. Does not implicitly {@link types.OfferQuantity.verify|verify} messages. + * @param message OfferQuantity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IOfferQuantity, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified OfferQuantity message, length delimited. Does not implicitly {@link types.OfferQuantity.verify|verify} messages. + * @param message OfferQuantity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IOfferQuantity, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an OfferQuantity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OfferQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): types.OfferQuantity; + + /** + * Decodes an OfferQuantity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OfferQuantity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): types.OfferQuantity; + + /** + * Verifies an OfferQuantity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates an OfferQuantity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OfferQuantity + */ + public static fromObject(object: { [k: string]: any }): types.OfferQuantity; + + /** + * Creates a plain object from an OfferQuantity message. Also converts values to other types if specified. + * @param message OfferQuantity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.OfferQuantity, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this OfferQuantity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OfferQuantity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BlindedPath. */ + interface IBlindedPath { + /** BlindedPath introductionNodeId */ + introductionNodeId?: string | null; + + /** BlindedPath blindingPoint */ + blindingPoint?: string | null; + + /** BlindedPath numHops */ + numHops?: number | null; + + /** BlindedPath introductionScid */ + introductionScid?: number | Long | null; + } + + /** Represents a BlindedPath. */ + class BlindedPath implements IBlindedPath { + /** + * Constructs a new BlindedPath. + * @param [properties] Properties to set + */ + constructor(properties?: types.IBlindedPath); + + /** BlindedPath introductionNodeId. */ + public introductionNodeId?: string | null; + + /** BlindedPath blindingPoint. */ + public blindingPoint: string; + + /** BlindedPath numHops. */ + public numHops: number; + + /** BlindedPath introductionScid. */ + public introductionScid?: number | Long | null; + + /** + * Creates a new BlindedPath instance using the specified properties. + * @param [properties] Properties to set + * @returns BlindedPath instance + */ + public static create(properties?: types.IBlindedPath): types.BlindedPath; + + /** + * Encodes the specified BlindedPath message. Does not implicitly {@link types.BlindedPath.verify|verify} messages. + * @param message BlindedPath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: types.IBlindedPath, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified BlindedPath message, length delimited. Does not implicitly {@link types.BlindedPath.verify|verify} messages. + * @param message BlindedPath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: types.IBlindedPath, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a BlindedPath message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BlindedPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): types.BlindedPath; + + /** + * Decodes a BlindedPath message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BlindedPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): types.BlindedPath; + + /** + * Verifies a BlindedPath message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a BlindedPath message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BlindedPath + */ + public static fromObject(object: { [k: string]: any }): types.BlindedPath; + + /** + * Creates a plain object from a BlindedPath message. Also converts values to other types if specified. + * @param message BlindedPath + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: types.BlindedPath, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this BlindedPath to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BlindedPath + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a 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 }; + + /** + * Gets the default type url for Bolt11Feature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } +} + +/** Namespace 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 }; + + /** + * Gets the default type url for ErrorResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ErrorCode enum. */ + enum ErrorCode { + UNKNOWN_ERROR = 0, + INVALID_REQUEST_ERROR = 1, + AUTH_ERROR = 2, + LIGHTNING_ERROR = 3, + INTERNAL_SERVER_ERROR = 4, + } +} + +/** 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; + } + + /** 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 event. */ + public event?: + | 'paymentReceived' + | 'paymentSuccessful' + | 'paymentFailed' + | 'paymentForwarded' + | 'paymentClaimable'; + + /** + * Creates a new EventEnvelope instance using the specified properties. + * @param [properties] Properties to set + * @returns EventEnvelope instance + */ + public static create( + properties?: events.IEventEnvelope + ): events.EventEnvelope; + + /** + * Encodes the specified EventEnvelope message. Does not implicitly {@link events.EventEnvelope.verify|verify} messages. + * @param message EventEnvelope message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: events.IEventEnvelope, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified EventEnvelope message, length delimited. Does not implicitly {@link events.EventEnvelope.verify|verify} messages. + * @param message EventEnvelope message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: events.IEventEnvelope, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes an EventEnvelope message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventEnvelope + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): events.EventEnvelope; + + /** + * Decodes an EventEnvelope message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventEnvelope + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): events.EventEnvelope; + + /** + * Verifies an EventEnvelope message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates an EventEnvelope message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventEnvelope + */ + public static fromObject(object: { + [k: string]: any; + }): events.EventEnvelope; + + /** + * Creates a plain object from an EventEnvelope message. Also converts values to other types if specified. + * @param message EventEnvelope + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: events.EventEnvelope, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this EventEnvelope to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EventEnvelope + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PaymentReceived. */ + interface IPaymentReceived { + /** PaymentReceived payment */ + payment?: types.IPayment | null; + } + + /** Represents a PaymentReceived. */ + class PaymentReceived implements IPaymentReceived { + /** + * Constructs a new PaymentReceived. + * @param [properties] Properties to set + */ + constructor(properties?: events.IPaymentReceived); + + /** PaymentReceived payment. */ + public payment?: types.IPayment | null; + + /** + * Creates a new PaymentReceived instance using the specified properties. + * @param [properties] Properties to set + * @returns PaymentReceived instance + */ + public static create( + properties?: events.IPaymentReceived + ): events.PaymentReceived; + + /** + * Encodes the specified PaymentReceived message. Does not implicitly {@link events.PaymentReceived.verify|verify} messages. + * @param message PaymentReceived message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: events.IPaymentReceived, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified PaymentReceived message, length delimited. Does not implicitly {@link events.PaymentReceived.verify|verify} messages. + * @param message PaymentReceived message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: events.IPaymentReceived, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a PaymentReceived message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PaymentReceived + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): events.PaymentReceived; + + /** + * Decodes a PaymentReceived message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PaymentReceived + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): events.PaymentReceived; + + /** + * Verifies a PaymentReceived message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a PaymentReceived message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PaymentReceived + */ + public static fromObject(object: { + [k: string]: any; + }): events.PaymentReceived; + + /** + * Creates a plain object from a PaymentReceived message. Also converts values to other types if specified. + * @param message PaymentReceived + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: events.PaymentReceived, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this PaymentReceived to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PaymentReceived + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PaymentSuccessful. */ + interface IPaymentSuccessful { + /** PaymentSuccessful payment */ + payment?: types.IPayment | null; + } + + /** Represents a PaymentSuccessful. */ + class PaymentSuccessful implements IPaymentSuccessful { + /** + * Constructs a new PaymentSuccessful. + * @param [properties] Properties to set + */ + constructor(properties?: events.IPaymentSuccessful); + + /** PaymentSuccessful payment. */ + public payment?: types.IPayment | null; + + /** + * Creates a new PaymentSuccessful instance using the specified properties. + * @param [properties] Properties to set + * @returns PaymentSuccessful instance + */ + public static create( + properties?: events.IPaymentSuccessful + ): events.PaymentSuccessful; + + /** + * Encodes the specified PaymentSuccessful message. Does not implicitly {@link events.PaymentSuccessful.verify|verify} messages. + * @param message PaymentSuccessful message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: events.IPaymentSuccessful, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified PaymentSuccessful message, length delimited. Does not implicitly {@link events.PaymentSuccessful.verify|verify} messages. + * @param message PaymentSuccessful message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: events.IPaymentSuccessful, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a PaymentSuccessful message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PaymentSuccessful + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): events.PaymentSuccessful; + + /** + * Decodes a PaymentSuccessful message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PaymentSuccessful + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): events.PaymentSuccessful; + + /** + * Verifies a PaymentSuccessful message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a PaymentSuccessful message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PaymentSuccessful + */ + public static fromObject(object: { + [k: string]: any; + }): events.PaymentSuccessful; + + /** + * Creates a plain object from a PaymentSuccessful message. Also converts values to other types if specified. + * @param message PaymentSuccessful + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: events.PaymentSuccessful, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this PaymentSuccessful to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PaymentSuccessful + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PaymentFailed. */ + interface IPaymentFailed { + /** PaymentFailed payment */ + payment?: types.IPayment | null; + } + + /** Represents a PaymentFailed. */ + class PaymentFailed implements IPaymentFailed { + /** + * Constructs a new PaymentFailed. + * @param [properties] Properties to set + */ + constructor(properties?: events.IPaymentFailed); + + /** PaymentFailed payment. */ + public payment?: types.IPayment | null; + + /** + * Creates a new PaymentFailed instance using the specified properties. + * @param [properties] Properties to set + * @returns PaymentFailed instance + */ + public static create( + properties?: events.IPaymentFailed + ): events.PaymentFailed; + + /** + * Encodes the specified PaymentFailed message. Does not implicitly {@link events.PaymentFailed.verify|verify} messages. + * @param message PaymentFailed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: events.IPaymentFailed, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified PaymentFailed message, length delimited. Does not implicitly {@link events.PaymentFailed.verify|verify} messages. + * @param message PaymentFailed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: events.IPaymentFailed, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a PaymentFailed message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PaymentFailed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): events.PaymentFailed; + + /** + * Decodes a PaymentFailed message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PaymentFailed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): events.PaymentFailed; + + /** + * Verifies a PaymentFailed message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a PaymentFailed message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PaymentFailed + */ + public static fromObject(object: { + [k: string]: any; + }): events.PaymentFailed; + + /** + * Creates a plain object from a PaymentFailed message. Also converts values to other types if specified. + * @param message PaymentFailed + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: events.PaymentFailed, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this PaymentFailed to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PaymentFailed + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PaymentClaimable. */ + interface IPaymentClaimable { + /** PaymentClaimable payment */ + payment?: types.IPayment | null; + } + + /** Represents a PaymentClaimable. */ + class PaymentClaimable implements IPaymentClaimable { + /** + * Constructs a new PaymentClaimable. + * @param [properties] Properties to set + */ + constructor(properties?: events.IPaymentClaimable); + + /** PaymentClaimable payment. */ + public payment?: types.IPayment | null; + + /** + * Creates a new PaymentClaimable instance using the specified properties. + * @param [properties] Properties to set + * @returns PaymentClaimable instance + */ + public static create( + properties?: events.IPaymentClaimable + ): events.PaymentClaimable; + + /** + * Encodes the specified PaymentClaimable message. Does not implicitly {@link events.PaymentClaimable.verify|verify} messages. + * @param message PaymentClaimable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode( + message: events.IPaymentClaimable, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Encodes the specified PaymentClaimable message, length delimited. Does not implicitly {@link events.PaymentClaimable.verify|verify} messages. + * @param message PaymentClaimable message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited( + message: events.IPaymentClaimable, + writer?: $protobuf.Writer + ): $protobuf.Writer; + + /** + * Decodes a PaymentClaimable message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PaymentClaimable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode( + reader: $protobuf.Reader | Uint8Array, + length?: number + ): events.PaymentClaimable; + + /** + * Decodes a PaymentClaimable message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PaymentClaimable + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited( + reader: $protobuf.Reader | Uint8Array + ): events.PaymentClaimable; + + /** + * Verifies a PaymentClaimable message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): string | null; + + /** + * Creates a PaymentClaimable message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PaymentClaimable + */ + public static fromObject(object: { + [k: string]: any; + }): events.PaymentClaimable; + + /** + * Creates a plain object from a PaymentClaimable message. Also converts values to other types if specified. + * @param message PaymentClaimable + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject( + message: events.PaymentClaimable, + options?: $protobuf.IConversionOptions + ): { [k: string]: any }; + + /** + * Converts this PaymentClaimable to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PaymentClaimable + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PaymentForwarded. */ + interface IPaymentForwarded { + /** PaymentForwarded 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 }; + + /** + * Gets the default type url for PaymentForwarded + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } +} 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..25a49c2a0 --- /dev/null +++ b/src/server/modules/node/ldk-server/proto/ldk-server.js @@ -0,0 +1,34301 @@ +/*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("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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for GetNodeInfoRequest + * @function getTypeUrl + * @memberof api.GetNodeInfoRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetNodeInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GetNodeInfoRequest"; + }; + + return GetNodeInfoRequest; + })(); + + api.GetNodeInfoResponse = (function() { + + /** + * Properties of a GetNodeInfoResponse. + * @memberof api + * @interface IGetNodeInfoResponse + * @property {string|null} [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 + */ + + /** + * 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|null|undefined} latestLightningWalletSyncTimestamp + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.latestLightningWalletSyncTimestamp = null; + + /** + * GetNodeInfoResponse latestOnchainWalletSyncTimestamp. + * @member {number|Long|null|undefined} latestOnchainWalletSyncTimestamp + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.latestOnchainWalletSyncTimestamp = null; + + /** + * GetNodeInfoResponse latestFeeRateCacheUpdateTimestamp. + * @member {number|Long|null|undefined} latestFeeRateCacheUpdateTimestamp + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.latestFeeRateCacheUpdateTimestamp = null; + + /** + * GetNodeInfoResponse latestRgsSnapshotTimestamp. + * @member {number|Long|null|undefined} latestRgsSnapshotTimestamp + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.latestRgsSnapshotTimestamp = null; + + /** + * GetNodeInfoResponse latestNodeAnnouncementBroadcastTimestamp. + * @member {number|Long|null|undefined} latestNodeAnnouncementBroadcastTimestamp + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.latestNodeAnnouncementBroadcastTimestamp = null; + + /** + * 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|null|undefined} nodeAlias + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.nodeAlias = null; + + /** + * GetNodeInfoResponse nodeUris. + * @member {Array.} nodeUris + * @memberof api.GetNodeInfoResponse + * @instance + */ + GetNodeInfoResponse.prototype.nodeUris = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetNodeInfoResponse.prototype, "_latestLightningWalletSyncTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["latestLightningWalletSyncTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetNodeInfoResponse.prototype, "_latestOnchainWalletSyncTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["latestOnchainWalletSyncTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetNodeInfoResponse.prototype, "_latestFeeRateCacheUpdateTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["latestFeeRateCacheUpdateTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetNodeInfoResponse.prototype, "_latestRgsSnapshotTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["latestRgsSnapshotTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetNodeInfoResponse.prototype, "_latestNodeAnnouncementBroadcastTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["latestNodeAnnouncementBroadcastTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GetNodeInfoResponse.prototype, "_nodeAlias", { + get: $util.oneOfGetter($oneOfFields = ["nodeAlias"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetNodeInfoResponse instance using the specified properties. + * @function create + * @memberof api.GetNodeInfoResponse + * @static + * @param {api.IGetNodeInfoResponse=} [properties] Properties to set + * @returns {api.GetNodeInfoResponse} GetNodeInfoResponse instance + */ + GetNodeInfoResponse.create = function create(properties) { + return new GetNodeInfoResponse(properties); + }; + + /** + * Encodes the specified GetNodeInfoResponse message. Does not implicitly {@link api.GetNodeInfoResponse.verify|verify} messages. + * @function encode + * @memberof api.GetNodeInfoResponse + * @static + * @param {api.IGetNodeInfoResponse} message GetNodeInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeInfoResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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]); + return writer; + }; + + /** + * Encodes the specified GetNodeInfoResponse message, length delimited. Does not implicitly {@link api.GetNodeInfoResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.GetNodeInfoResponse + * @static + * @param {api.IGetNodeInfoResponse} message GetNodeInfoResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeInfoResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetNodeInfoResponse message from the specified reader or buffer. + * @function decode + * @memberof api.GetNodeInfoResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.GetNodeInfoResponse} GetNodeInfoResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeInfoResponse.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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; + } + 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"; + var properties = {}; + 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")) { + properties._latestLightningWalletSyncTimestamp = 1; + 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")) { + properties._latestOnchainWalletSyncTimestamp = 1; + 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")) { + properties._latestFeeRateCacheUpdateTimestamp = 1; + 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")) { + properties._latestRgsSnapshotTimestamp = 1; + 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")) { + properties._latestNodeAnnouncementBroadcastTimestamp = 1; + 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")) { + properties._nodeAlias = 1; + 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"; + } + 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]); + } + 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; + } + 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 (options.oneofs) + object._latestLightningWalletSyncTimestamp = "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 (options.oneofs) + object._latestOnchainWalletSyncTimestamp = "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 (options.oneofs) + object._latestFeeRateCacheUpdateTimestamp = "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 (options.oneofs) + object._latestRgsSnapshotTimestamp = "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 (options.oneofs) + object._latestNodeAnnouncementBroadcastTimestamp = "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 (options.oneofs) + object._nodeAlias = "nodeAlias"; + } + if (message.nodeUris && message.nodeUris.length) { + object.nodeUris = []; + for (var j = 0; j < message.nodeUris.length; ++j) + object.nodeUris[j] = message.nodeUris[j]; + } + return object; + }; + + /** + * Converts this GetNodeInfoResponse to JSON. + * @function toJSON + * @memberof api.GetNodeInfoResponse + * @instance + * @returns {Object.} JSON object + */ + GetNodeInfoResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetNodeInfoResponse + * @function getTypeUrl + * @memberof api.GetNodeInfoResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetNodeInfoResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GetNodeInfoResponse"; + }; + + return GetNodeInfoResponse; + })(); + + api.OnchainReceiveRequest = (function() { + + /** + * Properties of an OnchainReceiveRequest. + * @memberof api + * @interface IOnchainReceiveRequest + */ + + /** + * Constructs a new OnchainReceiveRequest. + * @memberof api + * @classdesc Represents an OnchainReceiveRequest. + * @implements IOnchainReceiveRequest + * @constructor + * @param {api.IOnchainReceiveRequest=} [properties] Properties to set + */ + function OnchainReceiveRequest(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for OnchainReceiveRequest + * @function getTypeUrl + * @memberof api.OnchainReceiveRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OnchainReceiveRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.OnchainReceiveRequest"; + }; + + return OnchainReceiveRequest; + })(); + + api.OnchainReceiveResponse = (function() { + + /** + * Properties of an OnchainReceiveResponse. + * @memberof api + * @interface IOnchainReceiveResponse + * @property {string|null} [address] OnchainReceiveResponse address + */ + + /** + * Constructs a new OnchainReceiveResponse. + * @memberof api + * @classdesc Represents an OnchainReceiveResponse. + * @implements IOnchainReceiveResponse + * @constructor + * @param {api.IOnchainReceiveResponse=} [properties] Properties to set + */ + function OnchainReceiveResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for OnchainReceiveResponse + * @function getTypeUrl + * @memberof api.OnchainReceiveResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OnchainReceiveResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.OnchainReceiveResponse"; + }; + + return OnchainReceiveResponse; + })(); + + api.OnchainSendRequest = (function() { + + /** + * Properties of an OnchainSendRequest. + * @memberof api + * @interface IOnchainSendRequest + * @property {string|null} [address] OnchainSendRequest address + * @property {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|null|undefined} amountSats + * @memberof api.OnchainSendRequest + * @instance + */ + OnchainSendRequest.prototype.amountSats = null; + + /** + * OnchainSendRequest sendAll. + * @member {boolean|null|undefined} sendAll + * @memberof api.OnchainSendRequest + * @instance + */ + OnchainSendRequest.prototype.sendAll = null; + + /** + * OnchainSendRequest feeRateSatPerVb. + * @member {number|Long|null|undefined} feeRateSatPerVb + * @memberof api.OnchainSendRequest + * @instance + */ + OnchainSendRequest.prototype.feeRateSatPerVb = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OnchainSendRequest.prototype, "_amountSats", { + get: $util.oneOfGetter($oneOfFields = ["amountSats"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OnchainSendRequest.prototype, "_sendAll", { + get: $util.oneOfGetter($oneOfFields = ["sendAll"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OnchainSendRequest.prototype, "_feeRateSatPerVb", { + get: $util.oneOfGetter($oneOfFields = ["feeRateSatPerVb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OnchainSendRequest instance using the specified properties. + * @function create + * @memberof api.OnchainSendRequest + * @static + * @param {api.IOnchainSendRequest=} [properties] Properties to set + * @returns {api.OnchainSendRequest} OnchainSendRequest instance + */ + OnchainSendRequest.create = function create(properties) { + return new OnchainSendRequest(properties); + }; + + /** + * Encodes the specified OnchainSendRequest message. Does not implicitly {@link api.OnchainSendRequest.verify|verify} messages. + * @function encode + * @memberof api.OnchainSendRequest + * @static + * @param {api.IOnchainSendRequest} message OnchainSendRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnchainSendRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.address); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.amountSats != null && message.hasOwnProperty("amountSats")) { + properties._amountSats = 1; + 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")) { + properties._sendAll = 1; + if (typeof message.sendAll !== "boolean") + return "sendAll: boolean expected"; + } + if (message.feeRateSatPerVb != null && message.hasOwnProperty("feeRateSatPerVb")) { + properties._feeRateSatPerVb = 1; + 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 = ""; + 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 (options.oneofs) + object._amountSats = "amountSats"; + } + if (message.sendAll != null && message.hasOwnProperty("sendAll")) { + object.sendAll = message.sendAll; + if (options.oneofs) + object._sendAll = "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; + if (options.oneofs) + object._feeRateSatPerVb = "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); + }; + + /** + * Gets the default type url for OnchainSendRequest + * @function getTypeUrl + * @memberof api.OnchainSendRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OnchainSendRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.OnchainSendRequest"; + }; + + return OnchainSendRequest; + })(); + + api.OnchainSendResponse = (function() { + + /** + * Properties of an OnchainSendResponse. + * @memberof api + * @interface IOnchainSendResponse + * @property {string|null} [txid] OnchainSendResponse txid + */ + + /** + * Constructs a new OnchainSendResponse. + * @memberof api + * @classdesc Represents an OnchainSendResponse. + * @implements IOnchainSendResponse + * @constructor + * @param {api.IOnchainSendResponse=} [properties] Properties to set + */ + function OnchainSendResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for OnchainSendResponse + * @function getTypeUrl + * @memberof api.OnchainSendResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OnchainSendResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.OnchainSendResponse"; + }; + + return OnchainSendResponse; + })(); + + api.Bolt11ReceiveRequest = (function() { + + /** + * Properties of a Bolt11ReceiveRequest. + * @memberof api + * @interface IBolt11ReceiveRequest + * @property {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|null|undefined} amountMsat + * @memberof api.Bolt11ReceiveRequest + * @instance + */ + Bolt11ReceiveRequest.prototype.amountMsat = null; + + /** + * 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; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11ReceiveRequest.prototype, "_amountMsat", { + get: $util.oneOfGetter($oneOfFields = ["amountMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt11ReceiveRequest instance using the specified properties. + * @function create + * @memberof api.Bolt11ReceiveRequest + * @static + * @param {api.IBolt11ReceiveRequest=} [properties] Properties to set + * @returns {api.Bolt11ReceiveRequest} Bolt11ReceiveRequest instance + */ + Bolt11ReceiveRequest.create = function create(properties) { + return new Bolt11ReceiveRequest(properties); + }; + + /** + * Encodes the specified Bolt11ReceiveRequest message. Does not implicitly {@link api.Bolt11ReceiveRequest.verify|verify} messages. + * @function encode + * @memberof api.Bolt11ReceiveRequest + * @static + * @param {api.IBolt11ReceiveRequest} message Bolt11ReceiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) { + properties._amountMsat = 1; + 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.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 (options.oneofs) + object._amountMsat = "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); + }; + + /** + * Gets the default type url for Bolt11ReceiveRequest + * @function getTypeUrl + * @memberof api.Bolt11ReceiveRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ReceiveRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ReceiveRequest"; + }; + + return Bolt11ReceiveRequest; + })(); + + api.Bolt11ReceiveResponse = (function() { + + /** + * Properties of a Bolt11ReceiveResponse. + * @memberof api + * @interface IBolt11ReceiveResponse + * @property {string|null} [invoice] Bolt11ReceiveResponse invoice + * @property {string|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Bolt11ReceiveResponse + * @function getTypeUrl + * @memberof api.Bolt11ReceiveResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ReceiveResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ReceiveResponse"; + }; + + return Bolt11ReceiveResponse; + })(); + + api.Bolt11ReceiveForHashRequest = (function() { + + /** + * Properties of a Bolt11ReceiveForHashRequest. + * @memberof api + * @interface IBolt11ReceiveForHashRequest + * @property {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|null|undefined} amountMsat + * @memberof api.Bolt11ReceiveForHashRequest + * @instance + */ + Bolt11ReceiveForHashRequest.prototype.amountMsat = null; + + /** + * 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 = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11ReceiveForHashRequest.prototype, "_amountMsat", { + get: $util.oneOfGetter($oneOfFields = ["amountMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt11ReceiveForHashRequest instance using the specified properties. + * @function create + * @memberof api.Bolt11ReceiveForHashRequest + * @static + * @param {api.IBolt11ReceiveForHashRequest=} [properties] Properties to set + * @returns {api.Bolt11ReceiveForHashRequest} Bolt11ReceiveForHashRequest instance + */ + Bolt11ReceiveForHashRequest.create = function create(properties) { + return new Bolt11ReceiveForHashRequest(properties); + }; + + /** + * Encodes the specified Bolt11ReceiveForHashRequest message. Does not implicitly {@link api.Bolt11ReceiveForHashRequest.verify|verify} messages. + * @function encode + * @memberof api.Bolt11ReceiveForHashRequest + * @static + * @param {api.IBolt11ReceiveForHashRequest} message Bolt11ReceiveForHashRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveForHashRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) { + properties._amountMsat = 1; + 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.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 (options.oneofs) + object._amountMsat = "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); + }; + + /** + * Gets the default type url for Bolt11ReceiveForHashRequest + * @function getTypeUrl + * @memberof api.Bolt11ReceiveForHashRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ReceiveForHashRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ReceiveForHashRequest"; + }; + + return Bolt11ReceiveForHashRequest; + })(); + + api.Bolt11ReceiveForHashResponse = (function() { + + /** + * Properties of a Bolt11ReceiveForHashResponse. + * @memberof api + * @interface IBolt11ReceiveForHashResponse + * @property {string|null} [invoice] Bolt11ReceiveForHashResponse invoice + */ + + /** + * Constructs a new Bolt11ReceiveForHashResponse. + * @memberof api + * @classdesc Represents a Bolt11ReceiveForHashResponse. + * @implements IBolt11ReceiveForHashResponse + * @constructor + * @param {api.IBolt11ReceiveForHashResponse=} [properties] Properties to set + */ + function Bolt11ReceiveForHashResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Bolt11ReceiveForHashResponse + * @function getTypeUrl + * @memberof api.Bolt11ReceiveForHashResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ReceiveForHashResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ReceiveForHashResponse"; + }; + + return Bolt11ReceiveForHashResponse; + })(); + + api.Bolt11ClaimForHashRequest = (function() { + + /** + * Properties of a Bolt11ClaimForHashRequest. + * @memberof api + * @interface IBolt11ClaimForHashRequest + * @property {string|null} [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|null|undefined} paymentHash + * @memberof api.Bolt11ClaimForHashRequest + * @instance + */ + Bolt11ClaimForHashRequest.prototype.paymentHash = null; + + /** + * Bolt11ClaimForHashRequest claimableAmountMsat. + * @member {number|Long|null|undefined} claimableAmountMsat + * @memberof api.Bolt11ClaimForHashRequest + * @instance + */ + Bolt11ClaimForHashRequest.prototype.claimableAmountMsat = null; + + /** + * Bolt11ClaimForHashRequest preimage. + * @member {string} preimage + * @memberof api.Bolt11ClaimForHashRequest + * @instance + */ + Bolt11ClaimForHashRequest.prototype.preimage = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11ClaimForHashRequest.prototype, "_paymentHash", { + get: $util.oneOfGetter($oneOfFields = ["paymentHash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11ClaimForHashRequest.prototype, "_claimableAmountMsat", { + get: $util.oneOfGetter($oneOfFields = ["claimableAmountMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt11ClaimForHashRequest instance using the specified properties. + * @function create + * @memberof api.Bolt11ClaimForHashRequest + * @static + * @param {api.IBolt11ClaimForHashRequest=} [properties] Properties to set + * @returns {api.Bolt11ClaimForHashRequest} Bolt11ClaimForHashRequest instance + */ + Bolt11ClaimForHashRequest.create = function create(properties) { + return new Bolt11ClaimForHashRequest(properties); + }; + + /** + * Encodes the specified Bolt11ClaimForHashRequest message. Does not implicitly {@link api.Bolt11ClaimForHashRequest.verify|verify} messages. + * @function encode + * @memberof api.Bolt11ClaimForHashRequest + * @static + * @param {api.IBolt11ClaimForHashRequest} message Bolt11ClaimForHashRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ClaimForHashRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) { + properties._paymentHash = 1; + if (!$util.isString(message.paymentHash)) + return "paymentHash: string expected"; + } + if (message.claimableAmountMsat != null && message.hasOwnProperty("claimableAmountMsat")) { + properties._claimableAmountMsat = 1; + 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.preimage = ""; + if (message.paymentHash != null && message.hasOwnProperty("paymentHash")) { + object.paymentHash = message.paymentHash; + if (options.oneofs) + object._paymentHash = "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 (options.oneofs) + object._claimableAmountMsat = "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); + }; + + /** + * Gets the default type url for Bolt11ClaimForHashRequest + * @function getTypeUrl + * @memberof api.Bolt11ClaimForHashRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ClaimForHashRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ClaimForHashRequest"; + }; + + return Bolt11ClaimForHashRequest; + })(); + + api.Bolt11ClaimForHashResponse = (function() { + + /** + * Properties of a Bolt11ClaimForHashResponse. + * @memberof api + * @interface IBolt11ClaimForHashResponse + */ + + /** + * Constructs a new Bolt11ClaimForHashResponse. + * @memberof api + * @classdesc Represents a Bolt11ClaimForHashResponse. + * @implements IBolt11ClaimForHashResponse + * @constructor + * @param {api.IBolt11ClaimForHashResponse=} [properties] Properties to set + */ + function Bolt11ClaimForHashResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Bolt11ClaimForHashResponse + * @function getTypeUrl + * @memberof api.Bolt11ClaimForHashResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ClaimForHashResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ClaimForHashResponse"; + }; + + return Bolt11ClaimForHashResponse; + })(); + + api.Bolt11FailForHashRequest = (function() { + + /** + * Properties of a Bolt11FailForHashRequest. + * @memberof api + * @interface IBolt11FailForHashRequest + * @property {string|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Bolt11FailForHashRequest + * @function getTypeUrl + * @memberof api.Bolt11FailForHashRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11FailForHashRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11FailForHashRequest"; + }; + + return Bolt11FailForHashRequest; + })(); + + api.Bolt11FailForHashResponse = (function() { + + /** + * Properties of a Bolt11FailForHashResponse. + * @memberof api + * @interface IBolt11FailForHashResponse + */ + + /** + * Constructs a new Bolt11FailForHashResponse. + * @memberof api + * @classdesc Represents a Bolt11FailForHashResponse. + * @implements IBolt11FailForHashResponse + * @constructor + * @param {api.IBolt11FailForHashResponse=} [properties] Properties to set + */ + function Bolt11FailForHashResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Bolt11FailForHashResponse + * @function getTypeUrl + * @memberof api.Bolt11FailForHashResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11FailForHashResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11FailForHashResponse"; + }; + + return Bolt11FailForHashResponse; + })(); + + api.Bolt11ReceiveViaJitChannelRequest = (function() { + + /** + * Properties of a Bolt11ReceiveViaJitChannelRequest. + * @memberof api + * @interface IBolt11ReceiveViaJitChannelRequest + * @property {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 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Bolt11ReceiveViaJitChannelRequest description. + * @member {types.IBolt11InvoiceDescription|null|undefined} description + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @instance + */ + Bolt11ReceiveViaJitChannelRequest.prototype.description = null; + + /** + * Bolt11ReceiveViaJitChannelRequest expirySecs. + * @member {number} expirySecs + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @instance + */ + Bolt11ReceiveViaJitChannelRequest.prototype.expirySecs = 0; + + /** + * Bolt11ReceiveViaJitChannelRequest maxTotalLspFeeLimitMsat. + * @member {number|Long|null|undefined} maxTotalLspFeeLimitMsat + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @instance + */ + Bolt11ReceiveViaJitChannelRequest.prototype.maxTotalLspFeeLimitMsat = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11ReceiveViaJitChannelRequest.prototype, "_maxTotalLspFeeLimitMsat", { + get: $util.oneOfGetter($oneOfFields = ["maxTotalLspFeeLimitMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt11ReceiveViaJitChannelRequest instance using the specified properties. + * @function create + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @static + * @param {api.IBolt11ReceiveViaJitChannelRequest=} [properties] Properties to set + * @returns {api.Bolt11ReceiveViaJitChannelRequest} Bolt11ReceiveViaJitChannelRequest instance + */ + Bolt11ReceiveViaJitChannelRequest.create = function create(properties) { + return new Bolt11ReceiveViaJitChannelRequest(properties); + }; + + /** + * Encodes the specified Bolt11ReceiveViaJitChannelRequest message. Does not implicitly {@link api.Bolt11ReceiveViaJitChannelRequest.verify|verify} messages. + * @function encode + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @static + * @param {api.IBolt11ReceiveViaJitChannelRequest} message Bolt11ReceiveViaJitChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveViaJitChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + 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")) { + properties._maxTotalLspFeeLimitMsat = 1; + 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) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amountMsat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amountMsat = options.longs === String ? "0" : 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; + 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; + if (options.oneofs) + object._maxTotalLspFeeLimitMsat = "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); + }; + + /** + * Gets the default type url for Bolt11ReceiveViaJitChannelRequest + * @function getTypeUrl + * @memberof api.Bolt11ReceiveViaJitChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ReceiveViaJitChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ReceiveViaJitChannelRequest"; + }; + + return Bolt11ReceiveViaJitChannelRequest; + })(); + + api.Bolt11ReceiveViaJitChannelResponse = (function() { + + /** + * Properties of a Bolt11ReceiveViaJitChannelResponse. + * @memberof api + * @interface IBolt11ReceiveViaJitChannelResponse + * @property {string|null} [invoice] Bolt11ReceiveViaJitChannelResponse invoice + */ + + /** + * Constructs a new Bolt11ReceiveViaJitChannelResponse. + * @memberof api + * @classdesc Represents a Bolt11ReceiveViaJitChannelResponse. + * @implements IBolt11ReceiveViaJitChannelResponse + * @constructor + * @param {api.IBolt11ReceiveViaJitChannelResponse=} [properties] Properties to set + */ + function Bolt11ReceiveViaJitChannelResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Bolt11ReceiveViaJitChannelResponse + * @function getTypeUrl + * @memberof api.Bolt11ReceiveViaJitChannelResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ReceiveViaJitChannelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ReceiveViaJitChannelResponse"; + }; + + return Bolt11ReceiveViaJitChannelResponse; + })(); + + api.Bolt11ReceiveVariableAmountViaJitChannelRequest = (function() { + + /** + * Properties of a Bolt11ReceiveVariableAmountViaJitChannelRequest. + * @memberof api + * @interface IBolt11ReceiveVariableAmountViaJitChannelRequest + * @property {types.IBolt11InvoiceDescription|null} [description] Bolt11ReceiveVariableAmountViaJitChannelRequest description + * @property {number|null} [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|null|undefined} maxProportionalLspFeeLimitPpmMsat + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @instance + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.prototype.maxProportionalLspFeeLimitPpmMsat = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11ReceiveVariableAmountViaJitChannelRequest.prototype, "_maxProportionalLspFeeLimitPpmMsat", { + get: $util.oneOfGetter($oneOfFields = ["maxProportionalLspFeeLimitPpmMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt11ReceiveVariableAmountViaJitChannelRequest instance using the specified properties. + * @function create + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @static + * @param {api.IBolt11ReceiveVariableAmountViaJitChannelRequest=} [properties] Properties to set + * @returns {api.Bolt11ReceiveVariableAmountViaJitChannelRequest} Bolt11ReceiveVariableAmountViaJitChannelRequest instance + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.create = function create(properties) { + return new Bolt11ReceiveVariableAmountViaJitChannelRequest(properties); + }; + + /** + * Encodes the specified Bolt11ReceiveVariableAmountViaJitChannelRequest message. Does not implicitly {@link api.Bolt11ReceiveVariableAmountViaJitChannelRequest.verify|verify} messages. + * @function encode + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @static + * @param {api.IBolt11ReceiveVariableAmountViaJitChannelRequest} message Bolt11ReceiveVariableAmountViaJitChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + $root.types.Bolt11InvoiceDescription.encode(message.description, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + 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")) { + properties._maxProportionalLspFeeLimitPpmMsat = 1; + 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; + } + 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; + if (options.oneofs) + object._maxProportionalLspFeeLimitPpmMsat = "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); + }; + + /** + * Gets the default type url for Bolt11ReceiveVariableAmountViaJitChannelRequest + * @function getTypeUrl + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ReceiveVariableAmountViaJitChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ReceiveVariableAmountViaJitChannelRequest"; + }; + + return Bolt11ReceiveVariableAmountViaJitChannelRequest; + })(); + + api.Bolt11ReceiveVariableAmountViaJitChannelResponse = (function() { + + /** + * Properties of a Bolt11ReceiveVariableAmountViaJitChannelResponse. + * @memberof api + * @interface IBolt11ReceiveVariableAmountViaJitChannelResponse + * @property {string|null} [invoice] Bolt11ReceiveVariableAmountViaJitChannelResponse invoice + */ + + /** + * Constructs a new Bolt11ReceiveVariableAmountViaJitChannelResponse. + * @memberof api + * @classdesc Represents a Bolt11ReceiveVariableAmountViaJitChannelResponse. + * @implements IBolt11ReceiveVariableAmountViaJitChannelResponse + * @constructor + * @param {api.IBolt11ReceiveVariableAmountViaJitChannelResponse=} [properties] Properties to set + */ + function Bolt11ReceiveVariableAmountViaJitChannelResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Bolt11ReceiveVariableAmountViaJitChannelResponse + * @function getTypeUrl + * @memberof api.Bolt11ReceiveVariableAmountViaJitChannelResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11ReceiveVariableAmountViaJitChannelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11ReceiveVariableAmountViaJitChannelResponse"; + }; + + return Bolt11ReceiveVariableAmountViaJitChannelResponse; + })(); + + api.Bolt11SendRequest = (function() { + + /** + * Properties of a Bolt11SendRequest. + * @memberof api + * @interface IBolt11SendRequest + * @property {string|null} [invoice] Bolt11SendRequest invoice + * @property {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|null|undefined} amountMsat + * @memberof api.Bolt11SendRequest + * @instance + */ + Bolt11SendRequest.prototype.amountMsat = null; + + /** + * Bolt11SendRequest routeParameters. + * @member {types.IRouteParametersConfig|null|undefined} routeParameters + * @memberof api.Bolt11SendRequest + * @instance + */ + Bolt11SendRequest.prototype.routeParameters = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11SendRequest.prototype, "_amountMsat", { + get: $util.oneOfGetter($oneOfFields = ["amountMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11SendRequest.prototype, "_routeParameters", { + get: $util.oneOfGetter($oneOfFields = ["routeParameters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt11SendRequest instance using the specified properties. + * @function create + * @memberof api.Bolt11SendRequest + * @static + * @param {api.IBolt11SendRequest=} [properties] Properties to set + * @returns {api.Bolt11SendRequest} Bolt11SendRequest instance + */ + Bolt11SendRequest.create = function create(properties) { + return new Bolt11SendRequest(properties); + }; + + /** + * Encodes the specified Bolt11SendRequest message. Does not implicitly {@link api.Bolt11SendRequest.verify|verify} messages. + * @function encode + * @memberof api.Bolt11SendRequest + * @static + * @param {api.IBolt11SendRequest} message Bolt11SendRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11SendRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.invoice != null && Object.hasOwnProperty.call(message, "invoice")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.invoice); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + if (message.invoice != null && message.hasOwnProperty("invoice")) + if (!$util.isString(message.invoice)) + return "invoice: string expected"; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) { + properties._amountMsat = 1; + 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")) { + properties._routeParameters = 1; + { + 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 = ""; + 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 (options.oneofs) + object._amountMsat = "amountMsat"; + } + if (message.routeParameters != null && message.hasOwnProperty("routeParameters")) { + object.routeParameters = $root.types.RouteParametersConfig.toObject(message.routeParameters, options); + if (options.oneofs) + object._routeParameters = "routeParameters"; + } + return object; + }; + + /** + * Converts this Bolt11SendRequest to JSON. + * @function toJSON + * @memberof api.Bolt11SendRequest + * @instance + * @returns {Object.} JSON object + */ + Bolt11SendRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11SendRequest + * @function getTypeUrl + * @memberof api.Bolt11SendRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11SendRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11SendRequest"; + }; + + return Bolt11SendRequest; + })(); + + api.Bolt11SendResponse = (function() { + + /** + * Properties of a Bolt11SendResponse. + * @memberof api + * @interface IBolt11SendResponse + * @property {string|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Bolt11SendResponse + * @function getTypeUrl + * @memberof api.Bolt11SendResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11SendResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt11SendResponse"; + }; + + return Bolt11SendResponse; + })(); + + api.Bolt12ReceiveRequest = (function() { + + /** + * Properties of a Bolt12ReceiveRequest. + * @memberof api + * @interface IBolt12ReceiveRequest + * @property {string|null} [description] Bolt12ReceiveRequest description + * @property {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|null|undefined} amountMsat + * @memberof api.Bolt12ReceiveRequest + * @instance + */ + Bolt12ReceiveRequest.prototype.amountMsat = null; + + /** + * Bolt12ReceiveRequest expirySecs. + * @member {number|null|undefined} expirySecs + * @memberof api.Bolt12ReceiveRequest + * @instance + */ + Bolt12ReceiveRequest.prototype.expirySecs = null; + + /** + * Bolt12ReceiveRequest quantity. + * @member {number|Long|null|undefined} quantity + * @memberof api.Bolt12ReceiveRequest + * @instance + */ + Bolt12ReceiveRequest.prototype.quantity = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12ReceiveRequest.prototype, "_amountMsat", { + get: $util.oneOfGetter($oneOfFields = ["amountMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12ReceiveRequest.prototype, "_expirySecs", { + get: $util.oneOfGetter($oneOfFields = ["expirySecs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12ReceiveRequest.prototype, "_quantity", { + get: $util.oneOfGetter($oneOfFields = ["quantity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt12ReceiveRequest instance using the specified properties. + * @function create + * @memberof api.Bolt12ReceiveRequest + * @static + * @param {api.IBolt12ReceiveRequest=} [properties] Properties to set + * @returns {api.Bolt12ReceiveRequest} Bolt12ReceiveRequest instance + */ + Bolt12ReceiveRequest.create = function create(properties) { + return new Bolt12ReceiveRequest(properties); + }; + + /** + * Encodes the specified Bolt12ReceiveRequest message. Does not implicitly {@link api.Bolt12ReceiveRequest.verify|verify} messages. + * @function encode + * @memberof api.Bolt12ReceiveRequest + * @static + * @param {api.IBolt12ReceiveRequest} message Bolt12ReceiveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt12ReceiveRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) { + properties._amountMsat = 1; + 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")) { + properties._expirySecs = 1; + if (!$util.isInteger(message.expirySecs)) + return "expirySecs: integer expected"; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) { + properties._quantity = 1; + if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) + return "quantity: integer|Long expected"; + } + return null; + }; + + /** + * Creates a Bolt12ReceiveRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.Bolt12ReceiveRequest + * @static + * @param {Object.} object Plain object + * @returns {api.Bolt12ReceiveRequest} Bolt12ReceiveRequest + */ + Bolt12ReceiveRequest.fromObject = function fromObject(object) { + 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 = ""; + 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 (options.oneofs) + object._amountMsat = "amountMsat"; + } + if (message.expirySecs != null && message.hasOwnProperty("expirySecs")) { + object.expirySecs = message.expirySecs; + if (options.oneofs) + object._expirySecs = "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; + if (options.oneofs) + object._quantity = "quantity"; + } + return object; + }; + + /** + * Converts this Bolt12ReceiveRequest to JSON. + * @function toJSON + * @memberof api.Bolt12ReceiveRequest + * @instance + * @returns {Object.} JSON object + */ + Bolt12ReceiveRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt12ReceiveRequest + * @function getTypeUrl + * @memberof api.Bolt12ReceiveRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt12ReceiveRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt12ReceiveRequest"; + }; + + return Bolt12ReceiveRequest; + })(); + + api.Bolt12ReceiveResponse = (function() { + + /** + * Properties of a Bolt12ReceiveResponse. + * @memberof api + * @interface IBolt12ReceiveResponse + * @property {string|null} [offer] Bolt12ReceiveResponse offer + * @property {string|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Bolt12ReceiveResponse + * @function getTypeUrl + * @memberof api.Bolt12ReceiveResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt12ReceiveResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt12ReceiveResponse"; + }; + + return Bolt12ReceiveResponse; + })(); + + api.Bolt12SendRequest = (function() { + + /** + * Properties of a Bolt12SendRequest. + * @memberof api + * @interface IBolt12SendRequest + * @property {string|null} [offer] Bolt12SendRequest offer + * @property {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|null|undefined} amountMsat + * @memberof api.Bolt12SendRequest + * @instance + */ + Bolt12SendRequest.prototype.amountMsat = null; + + /** + * Bolt12SendRequest quantity. + * @member {number|Long|null|undefined} quantity + * @memberof api.Bolt12SendRequest + * @instance + */ + Bolt12SendRequest.prototype.quantity = null; + + /** + * Bolt12SendRequest payerNote. + * @member {string|null|undefined} payerNote + * @memberof api.Bolt12SendRequest + * @instance + */ + Bolt12SendRequest.prototype.payerNote = null; + + /** + * Bolt12SendRequest routeParameters. + * @member {types.IRouteParametersConfig|null|undefined} routeParameters + * @memberof api.Bolt12SendRequest + * @instance + */ + Bolt12SendRequest.prototype.routeParameters = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12SendRequest.prototype, "_amountMsat", { + get: $util.oneOfGetter($oneOfFields = ["amountMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12SendRequest.prototype, "_quantity", { + get: $util.oneOfGetter($oneOfFields = ["quantity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12SendRequest.prototype, "_payerNote", { + get: $util.oneOfGetter($oneOfFields = ["payerNote"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12SendRequest.prototype, "_routeParameters", { + get: $util.oneOfGetter($oneOfFields = ["routeParameters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt12SendRequest instance using the specified properties. + * @function create + * @memberof api.Bolt12SendRequest + * @static + * @param {api.IBolt12SendRequest=} [properties] Properties to set + * @returns {api.Bolt12SendRequest} Bolt12SendRequest instance + */ + Bolt12SendRequest.create = function create(properties) { + return new Bolt12SendRequest(properties); + }; + + /** + * Encodes the specified Bolt12SendRequest message. Does not implicitly {@link api.Bolt12SendRequest.verify|verify} messages. + * @function encode + * @memberof api.Bolt12SendRequest + * @static + * @param {api.IBolt12SendRequest} message Bolt12SendRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt12SendRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.offer != null && Object.hasOwnProperty.call(message, "offer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.offer); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + if (message.offer != null && message.hasOwnProperty("offer")) + if (!$util.isString(message.offer)) + return "offer: string expected"; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) { + properties._amountMsat = 1; + 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")) { + properties._quantity = 1; + if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) + return "quantity: integer|Long expected"; + } + if (message.payerNote != null && message.hasOwnProperty("payerNote")) { + properties._payerNote = 1; + if (!$util.isString(message.payerNote)) + return "payerNote: string expected"; + } + if (message.routeParameters != null && message.hasOwnProperty("routeParameters")) { + properties._routeParameters = 1; + { + 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 = ""; + 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 (options.oneofs) + object._amountMsat = "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 (options.oneofs) + object._quantity = "quantity"; + } + if (message.payerNote != null && message.hasOwnProperty("payerNote")) { + object.payerNote = message.payerNote; + if (options.oneofs) + object._payerNote = "payerNote"; + } + if (message.routeParameters != null && message.hasOwnProperty("routeParameters")) { + object.routeParameters = $root.types.RouteParametersConfig.toObject(message.routeParameters, options); + if (options.oneofs) + object._routeParameters = "routeParameters"; + } + return object; + }; + + /** + * Converts this Bolt12SendRequest to JSON. + * @function toJSON + * @memberof api.Bolt12SendRequest + * @instance + * @returns {Object.} JSON object + */ + Bolt12SendRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt12SendRequest + * @function getTypeUrl + * @memberof api.Bolt12SendRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt12SendRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt12SendRequest"; + }; + + return Bolt12SendRequest; + })(); + + api.Bolt12SendResponse = (function() { + + /** + * Properties of a Bolt12SendResponse. + * @memberof api + * @interface IBolt12SendResponse + * @property {string|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Bolt12SendResponse + * @function getTypeUrl + * @memberof api.Bolt12SendResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt12SendResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.Bolt12SendResponse"; + }; + + return Bolt12SendResponse; + })(); + + api.SpontaneousSendRequest = (function() { + + /** + * Properties of a SpontaneousSendRequest. + * @memberof api + * @interface ISpontaneousSendRequest + * @property {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 = $util.Long ? $util.Long.fromBits(0,0,true) : 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; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SpontaneousSendRequest.prototype, "_routeParameters", { + get: $util.oneOfGetter($oneOfFields = ["routeParameters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SpontaneousSendRequest instance using the specified properties. + * @function create + * @memberof api.SpontaneousSendRequest + * @static + * @param {api.ISpontaneousSendRequest=} [properties] Properties to set + * @returns {api.SpontaneousSendRequest} SpontaneousSendRequest instance + */ + SpontaneousSendRequest.create = function create(properties) { + return new SpontaneousSendRequest(properties); + }; + + /** + * Encodes the specified SpontaneousSendRequest message. Does not implicitly {@link api.SpontaneousSendRequest.verify|verify} messages. + * @function encode + * @memberof api.SpontaneousSendRequest + * @static + * @param {api.ISpontaneousSendRequest} message SpontaneousSendRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpontaneousSendRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + 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")) { + properties._routeParameters = 1; + { + 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) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amountMsat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amountMsat = options.longs === String ? "0" : 0; + object.nodeId = ""; + } + 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); + if (options.oneofs) + object._routeParameters = "routeParameters"; + } + return object; + }; + + /** + * Converts this SpontaneousSendRequest to JSON. + * @function toJSON + * @memberof api.SpontaneousSendRequest + * @instance + * @returns {Object.} JSON object + */ + SpontaneousSendRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpontaneousSendRequest + * @function getTypeUrl + * @memberof api.SpontaneousSendRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpontaneousSendRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.SpontaneousSendRequest"; + }; + + return SpontaneousSendRequest; + })(); + + api.SpontaneousSendResponse = (function() { + + /** + * Properties of a SpontaneousSendResponse. + * @memberof api + * @interface ISpontaneousSendResponse + * @property {string|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for SpontaneousSendResponse + * @function getTypeUrl + * @memberof api.SpontaneousSendResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpontaneousSendResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.SpontaneousSendResponse"; + }; + + return SpontaneousSendResponse; + })(); + + api.OpenChannelRequest = (function() { + + /** + * Properties of an OpenChannelRequest. + * @memberof api + * @interface IOpenChannelRequest + * @property {string|null} [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 + */ + + /** + * 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 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * OpenChannelRequest pushToCounterpartyMsat. + * @member {number|Long|null|undefined} pushToCounterpartyMsat + * @memberof api.OpenChannelRequest + * @instance + */ + OpenChannelRequest.prototype.pushToCounterpartyMsat = null; + + /** + * 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; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OpenChannelRequest.prototype, "_pushToCounterpartyMsat", { + get: $util.oneOfGetter($oneOfFields = ["pushToCounterpartyMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(OpenChannelRequest.prototype, "_channelConfig", { + get: $util.oneOfGetter($oneOfFields = ["channelConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OpenChannelRequest instance using the specified properties. + * @function create + * @memberof api.OpenChannelRequest + * @static + * @param {api.IOpenChannelRequest=} [properties] Properties to set + * @returns {api.OpenChannelRequest} OpenChannelRequest instance + */ + OpenChannelRequest.create = function create(properties) { + return new OpenChannelRequest(properties); + }; + + /** + * Encodes the specified OpenChannelRequest message. Does not implicitly {@link api.OpenChannelRequest.verify|verify} messages. + * @function encode + * @memberof api.OpenChannelRequest + * @static + * @param {api.IOpenChannelRequest} message OpenChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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); + return writer; + }; + + /** + * Encodes the specified OpenChannelRequest message, length delimited. Does not implicitly {@link api.OpenChannelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof api.OpenChannelRequest + * @static + * @param {api.IOpenChannelRequest} message OpenChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenChannelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenChannelRequest message from the specified reader or buffer. + * @function decode + * @memberof api.OpenChannelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.OpenChannelRequest} OpenChannelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenChannelRequest.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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; + } + 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"; + var properties = {}; + 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")) { + properties._pushToCounterpartyMsat = 1; + 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")) { + properties._channelConfig = 1; + { + 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"; + 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); + 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 = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.channelAmountSats = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.channelAmountSats = options.longs === String ? "0" : 0; + object.announceChannel = 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 (options.oneofs) + object._pushToCounterpartyMsat = "pushToCounterpartyMsat"; + } + if (message.channelConfig != null && message.hasOwnProperty("channelConfig")) { + object.channelConfig = $root.types.ChannelConfig.toObject(message.channelConfig, options); + if (options.oneofs) + object._channelConfig = "channelConfig"; + } + if (message.announceChannel != null && message.hasOwnProperty("announceChannel")) + object.announceChannel = message.announceChannel; + return object; + }; + + /** + * Converts this OpenChannelRequest to JSON. + * @function toJSON + * @memberof api.OpenChannelRequest + * @instance + * @returns {Object.} JSON object + */ + OpenChannelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OpenChannelRequest + * @function getTypeUrl + * @memberof api.OpenChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpenChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.OpenChannelRequest"; + }; + + return OpenChannelRequest; + })(); + + api.OpenChannelResponse = (function() { + + /** + * Properties of an OpenChannelResponse. + * @memberof api + * @interface IOpenChannelResponse + * @property {string|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for OpenChannelResponse + * @function getTypeUrl + * @memberof api.OpenChannelResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpenChannelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.OpenChannelResponse"; + }; + + return OpenChannelResponse; + })(); + + api.SpliceInRequest = (function() { + + /** + * Properties of a SpliceInRequest. + * @memberof api + * @interface ISpliceInRequest + * @property {string|null} [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 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new SpliceInRequest instance using the specified properties. + * @function create + * @memberof api.SpliceInRequest + * @static + * @param {api.ISpliceInRequest=} [properties] Properties to set + * @returns {api.SpliceInRequest} SpliceInRequest instance + */ + SpliceInRequest.create = function create(properties) { + return new SpliceInRequest(properties); + }; + + /** + * Encodes the specified SpliceInRequest message. Does not implicitly {@link api.SpliceInRequest.verify|verify} messages. + * @function encode + * @memberof api.SpliceInRequest + * @static + * @param {api.ISpliceInRequest} message SpliceInRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpliceInRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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 = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.spliceAmountSats = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.spliceAmountSats = options.longs === String ? "0" : 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); + }; + + /** + * Gets the default type url for SpliceInRequest + * @function getTypeUrl + * @memberof api.SpliceInRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpliceInRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.SpliceInRequest"; + }; + + return SpliceInRequest; + })(); + + api.SpliceInResponse = (function() { + + /** + * Properties of a SpliceInResponse. + * @memberof api + * @interface ISpliceInResponse + */ + + /** + * Constructs a new SpliceInResponse. + * @memberof api + * @classdesc Represents a SpliceInResponse. + * @implements ISpliceInResponse + * @constructor + * @param {api.ISpliceInResponse=} [properties] Properties to set + */ + function SpliceInResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for SpliceInResponse + * @function getTypeUrl + * @memberof api.SpliceInResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpliceInResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.SpliceInResponse"; + }; + + return SpliceInResponse; + })(); + + api.SpliceOutRequest = (function() { + + /** + * Properties of a SpliceOutRequest. + * @memberof api + * @interface ISpliceOutRequest + * @property {string|null} [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|null|undefined} address + * @memberof api.SpliceOutRequest + * @instance + */ + SpliceOutRequest.prototype.address = null; + + /** + * SpliceOutRequest spliceAmountSats. + * @member {number|Long} spliceAmountSats + * @memberof api.SpliceOutRequest + * @instance + */ + SpliceOutRequest.prototype.spliceAmountSats = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SpliceOutRequest.prototype, "_address", { + get: $util.oneOfGetter($oneOfFields = ["address"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SpliceOutRequest instance using the specified properties. + * @function create + * @memberof api.SpliceOutRequest + * @static + * @param {api.ISpliceOutRequest=} [properties] Properties to set + * @returns {api.SpliceOutRequest} SpliceOutRequest instance + */ + SpliceOutRequest.create = function create(properties) { + return new SpliceOutRequest(properties); + }; + + /** + * Encodes the specified SpliceOutRequest message. Does not implicitly {@link api.SpliceOutRequest.verify|verify} messages. + * @function encode + * @memberof api.SpliceOutRequest + * @static + * @param {api.ISpliceOutRequest} message SpliceOutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpliceOutRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + 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")) { + properties._address = 1; + 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 = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.spliceAmountSats = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.spliceAmountSats = options.longs === String ? "0" : 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 (options.oneofs) + object._address = "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); + }; + + /** + * Gets the default type url for SpliceOutRequest + * @function getTypeUrl + * @memberof api.SpliceOutRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpliceOutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.SpliceOutRequest"; + }; + + return SpliceOutRequest; + })(); + + api.SpliceOutResponse = (function() { + + /** + * Properties of a SpliceOutResponse. + * @memberof api + * @interface ISpliceOutResponse + * @property {string|null} [address] SpliceOutResponse address + */ + + /** + * Constructs a new SpliceOutResponse. + * @memberof api + * @classdesc Represents a SpliceOutResponse. + * @implements ISpliceOutResponse + * @constructor + * @param {api.ISpliceOutResponse=} [properties] Properties to set + */ + function SpliceOutResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for SpliceOutResponse + * @function getTypeUrl + * @memberof api.SpliceOutResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpliceOutResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.SpliceOutResponse"; + }; + + return SpliceOutResponse; + })(); + + api.UpdateChannelConfigRequest = (function() { + + /** + * Properties of an UpdateChannelConfigRequest. + * @memberof api + * @interface IUpdateChannelConfigRequest + * @property {string|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for UpdateChannelConfigRequest + * @function getTypeUrl + * @memberof api.UpdateChannelConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateChannelConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.UpdateChannelConfigRequest"; + }; + + return UpdateChannelConfigRequest; + })(); + + api.UpdateChannelConfigResponse = (function() { + + /** + * Properties of an UpdateChannelConfigResponse. + * @memberof api + * @interface IUpdateChannelConfigResponse + */ + + /** + * Constructs a new UpdateChannelConfigResponse. + * @memberof api + * @classdesc Represents an UpdateChannelConfigResponse. + * @implements IUpdateChannelConfigResponse + * @constructor + * @param {api.IUpdateChannelConfigResponse=} [properties] Properties to set + */ + function UpdateChannelConfigResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for UpdateChannelConfigResponse + * @function getTypeUrl + * @memberof api.UpdateChannelConfigResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateChannelConfigResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.UpdateChannelConfigResponse"; + }; + + return UpdateChannelConfigResponse; + })(); + + api.CloseChannelRequest = (function() { + + /** + * Properties of a CloseChannelRequest. + * @memberof api + * @interface ICloseChannelRequest + * @property {string|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for CloseChannelRequest + * @function getTypeUrl + * @memberof api.CloseChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloseChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.CloseChannelRequest"; + }; + + return CloseChannelRequest; + })(); + + api.CloseChannelResponse = (function() { + + /** + * Properties of a CloseChannelResponse. + * @memberof api + * @interface ICloseChannelResponse + */ + + /** + * Constructs a new CloseChannelResponse. + * @memberof api + * @classdesc Represents a CloseChannelResponse. + * @implements ICloseChannelResponse + * @constructor + * @param {api.ICloseChannelResponse=} [properties] Properties to set + */ + function CloseChannelResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for CloseChannelResponse + * @function getTypeUrl + * @memberof api.CloseChannelResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloseChannelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.CloseChannelResponse"; + }; + + return CloseChannelResponse; + })(); + + api.ForceCloseChannelRequest = (function() { + + /** + * Properties of a ForceCloseChannelRequest. + * @memberof api + * @interface IForceCloseChannelRequest + * @property {string|null} [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|null|undefined} forceCloseReason + * @memberof api.ForceCloseChannelRequest + * @instance + */ + ForceCloseChannelRequest.prototype.forceCloseReason = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ForceCloseChannelRequest.prototype, "_forceCloseReason", { + get: $util.oneOfGetter($oneOfFields = ["forceCloseReason"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ForceCloseChannelRequest instance using the specified properties. + * @function create + * @memberof api.ForceCloseChannelRequest + * @static + * @param {api.IForceCloseChannelRequest=} [properties] Properties to set + * @returns {api.ForceCloseChannelRequest} ForceCloseChannelRequest instance + */ + ForceCloseChannelRequest.create = function create(properties) { + return new ForceCloseChannelRequest(properties); + }; + + /** + * Encodes the specified ForceCloseChannelRequest message. Does not implicitly {@link api.ForceCloseChannelRequest.verify|verify} messages. + * @function encode + * @memberof api.ForceCloseChannelRequest + * @static + * @param {api.IForceCloseChannelRequest} message ForceCloseChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForceCloseChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + 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")) { + properties._forceCloseReason = 1; + 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 = ""; + } + 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; + if (options.oneofs) + object._forceCloseReason = "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); + }; + + /** + * Gets the default type url for ForceCloseChannelRequest + * @function getTypeUrl + * @memberof api.ForceCloseChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ForceCloseChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ForceCloseChannelRequest"; + }; + + return ForceCloseChannelRequest; + })(); + + api.ForceCloseChannelResponse = (function() { + + /** + * Properties of a ForceCloseChannelResponse. + * @memberof api + * @interface IForceCloseChannelResponse + */ + + /** + * Constructs a new ForceCloseChannelResponse. + * @memberof api + * @classdesc Represents a ForceCloseChannelResponse. + * @implements IForceCloseChannelResponse + * @constructor + * @param {api.IForceCloseChannelResponse=} [properties] Properties to set + */ + function ForceCloseChannelResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ForceCloseChannelResponse + * @function getTypeUrl + * @memberof api.ForceCloseChannelResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ForceCloseChannelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ForceCloseChannelResponse"; + }; + + return ForceCloseChannelResponse; + })(); + + api.ListChannelsRequest = (function() { + + /** + * Properties of a ListChannelsRequest. + * @memberof api + * @interface IListChannelsRequest + */ + + /** + * Constructs a new ListChannelsRequest. + * @memberof api + * @classdesc Represents a ListChannelsRequest. + * @implements IListChannelsRequest + * @constructor + * @param {api.IListChannelsRequest=} [properties] Properties to set + */ + function ListChannelsRequest(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ListChannelsRequest + * @function getTypeUrl + * @memberof api.ListChannelsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChannelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ListChannelsRequest"; + }; + + return ListChannelsRequest; + })(); + + api.ListChannelsResponse = (function() { + + /** + * Properties of a ListChannelsResponse. + * @memberof api + * @interface IListChannelsResponse + * @property {Array.|null} [channels] ListChannelsResponse channels + */ + + /** + * Constructs a new ListChannelsResponse. + * @memberof api + * @classdesc Represents a ListChannelsResponse. + * @implements IListChannelsResponse + * @constructor + * @param {api.IListChannelsResponse=} [properties] Properties to set + */ + function ListChannelsResponse(properties) { + this.channels = []; + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.channels && message.channels.length)) + message.channels = []; + message.channels.push($root.types.Channel.decode(reader, reader.uint32())); + 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); + }; + + /** + * Gets the default type url for ListChannelsResponse + * @function getTypeUrl + * @memberof api.ListChannelsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChannelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ListChannelsResponse"; + }; + + return ListChannelsResponse; + })(); + + api.GetPaymentDetailsRequest = (function() { + + /** + * Properties of a GetPaymentDetailsRequest. + * @memberof api + * @interface IGetPaymentDetailsRequest + * @property {string|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for GetPaymentDetailsRequest + * @function getTypeUrl + * @memberof api.GetPaymentDetailsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPaymentDetailsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GetPaymentDetailsRequest"; + }; + + return GetPaymentDetailsRequest; + })(); + + api.GetPaymentDetailsResponse = (function() { + + /** + * Properties of a GetPaymentDetailsResponse. + * @memberof api + * @interface IGetPaymentDetailsResponse + * @property {types.IPayment|null} [payment] GetPaymentDetailsResponse payment + */ + + /** + * Constructs a new GetPaymentDetailsResponse. + * @memberof api + * @classdesc Represents a GetPaymentDetailsResponse. + * @implements IGetPaymentDetailsResponse + * @constructor + * @param {api.IGetPaymentDetailsResponse=} [properties] Properties to set + */ + function GetPaymentDetailsResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for GetPaymentDetailsResponse + * @function getTypeUrl + * @memberof api.GetPaymentDetailsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPaymentDetailsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GetPaymentDetailsResponse"; + }; + + return GetPaymentDetailsResponse; + })(); + + api.ListPaymentsRequest = (function() { + + /** + * Properties of a ListPaymentsRequest. + * @memberof api + * @interface IListPaymentsRequest + * @property {types.IPageToken|null} [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; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListPaymentsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListPaymentsRequest instance using the specified properties. + * @function create + * @memberof api.ListPaymentsRequest + * @static + * @param {api.IListPaymentsRequest=} [properties] Properties to set + * @returns {api.ListPaymentsRequest} ListPaymentsRequest instance + */ + ListPaymentsRequest.create = function create(properties) { + return new ListPaymentsRequest(properties); + }; + + /** + * Encodes the specified ListPaymentsRequest message. Does not implicitly {@link api.ListPaymentsRequest.verify|verify} messages. + * @function encode + * @memberof api.ListPaymentsRequest + * @static + * @param {api.IListPaymentsRequest} message ListPaymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPaymentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + { + 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 (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = $root.types.PageToken.toObject(message.pageToken, options); + if (options.oneofs) + object._pageToken = "pageToken"; + } + return object; + }; + + /** + * Converts this ListPaymentsRequest to JSON. + * @function toJSON + * @memberof api.ListPaymentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListPaymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPaymentsRequest + * @function getTypeUrl + * @memberof api.ListPaymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPaymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ListPaymentsRequest"; + }; + + return ListPaymentsRequest; + })(); + + api.ListPaymentsResponse = (function() { + + /** + * Properties of a ListPaymentsResponse. + * @memberof api + * @interface IListPaymentsResponse + * @property {Array.|null} [payments] ListPaymentsResponse payments + * @property {types.IPageToken|null} [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; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListPaymentsResponse.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListPaymentsResponse instance using the specified properties. + * @function create + * @memberof api.ListPaymentsResponse + * @static + * @param {api.IListPaymentsResponse=} [properties] Properties to set + * @returns {api.ListPaymentsResponse} ListPaymentsResponse instance + */ + ListPaymentsResponse.create = function create(properties) { + return new ListPaymentsResponse(properties); + }; + + /** + * Encodes the specified ListPaymentsResponse message. Does not implicitly {@link api.ListPaymentsResponse.verify|verify} messages. + * @function encode + * @memberof api.ListPaymentsResponse + * @static + * @param {api.IListPaymentsResponse} message ListPaymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPaymentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.payments != null && message.payments.length) + for (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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.payments && message.payments.length)) + message.payments = []; + message.payments.push($root.types.Payment.decode(reader, reader.uint32())); + 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"; + var properties = {}; + 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")) { + properties._nextPageToken = 1; + { + 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 (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); + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + return object; + }; + + /** + * Converts this ListPaymentsResponse to JSON. + * @function toJSON + * @memberof api.ListPaymentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListPaymentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPaymentsResponse + * @function getTypeUrl + * @memberof api.ListPaymentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPaymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ListPaymentsResponse"; + }; + + return ListPaymentsResponse; + })(); + + api.ListForwardedPaymentsRequest = (function() { + + /** + * Properties of a ListForwardedPaymentsRequest. + * @memberof api + * @interface IListForwardedPaymentsRequest + * @property {types.IPageToken|null} [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; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListForwardedPaymentsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListForwardedPaymentsRequest instance using the specified properties. + * @function create + * @memberof api.ListForwardedPaymentsRequest + * @static + * @param {api.IListForwardedPaymentsRequest=} [properties] Properties to set + * @returns {api.ListForwardedPaymentsRequest} ListForwardedPaymentsRequest instance + */ + ListForwardedPaymentsRequest.create = function create(properties) { + return new ListForwardedPaymentsRequest(properties); + }; + + /** + * Encodes the specified ListForwardedPaymentsRequest message. Does not implicitly {@link api.ListForwardedPaymentsRequest.verify|verify} messages. + * @function encode + * @memberof api.ListForwardedPaymentsRequest + * @static + * @param {api.IListForwardedPaymentsRequest} message ListForwardedPaymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListForwardedPaymentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + { + 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 (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = $root.types.PageToken.toObject(message.pageToken, options); + if (options.oneofs) + object._pageToken = "pageToken"; + } + return object; + }; + + /** + * Converts this ListForwardedPaymentsRequest to JSON. + * @function toJSON + * @memberof api.ListForwardedPaymentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListForwardedPaymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListForwardedPaymentsRequest + * @function getTypeUrl + * @memberof api.ListForwardedPaymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListForwardedPaymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ListForwardedPaymentsRequest"; + }; + + return ListForwardedPaymentsRequest; + })(); + + api.ListForwardedPaymentsResponse = (function() { + + /** + * Properties of a ListForwardedPaymentsResponse. + * @memberof api + * @interface IListForwardedPaymentsResponse + * @property {Array.|null} [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; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListForwardedPaymentsResponse.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListForwardedPaymentsResponse instance using the specified properties. + * @function create + * @memberof api.ListForwardedPaymentsResponse + * @static + * @param {api.IListForwardedPaymentsResponse=} [properties] Properties to set + * @returns {api.ListForwardedPaymentsResponse} ListForwardedPaymentsResponse instance + */ + ListForwardedPaymentsResponse.create = function create(properties) { + return new ListForwardedPaymentsResponse(properties); + }; + + /** + * Encodes the specified ListForwardedPaymentsResponse message. Does not implicitly {@link api.ListForwardedPaymentsResponse.verify|verify} messages. + * @function encode + * @memberof api.ListForwardedPaymentsResponse + * @static + * @param {api.IListForwardedPaymentsResponse} message ListForwardedPaymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListForwardedPaymentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + 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")) { + properties._nextPageToken = 1; + { + 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 (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); + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + return object; + }; + + /** + * Converts this ListForwardedPaymentsResponse to JSON. + * @function toJSON + * @memberof api.ListForwardedPaymentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListForwardedPaymentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListForwardedPaymentsResponse + * @function getTypeUrl + * @memberof api.ListForwardedPaymentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListForwardedPaymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ListForwardedPaymentsResponse"; + }; + + return ListForwardedPaymentsResponse; + })(); + + api.SignMessageRequest = (function() { + + /** + * Properties of a SignMessageRequest. + * @memberof api + * @interface ISignMessageRequest + * @property {Uint8Array|null} [message] SignMessageRequest message + */ + + /** + * Constructs a new SignMessageRequest. + * @memberof api + * @classdesc Represents a SignMessageRequest. + * @implements ISignMessageRequest + * @constructor + * @param {api.ISignMessageRequest=} [properties] Properties to set + */ + function SignMessageRequest(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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 >= 0) + message.message = object.message; + return message; + }; + + /** + * Creates a plain object from a SignMessageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof api.SignMessageRequest + * @static + * @param {api.SignMessageRequest} message SignMessageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignMessageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + 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); + }; + + /** + * Gets the default type url for SignMessageRequest + * @function getTypeUrl + * @memberof api.SignMessageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.SignMessageRequest"; + }; + + return SignMessageRequest; + })(); + + api.SignMessageResponse = (function() { + + /** + * Properties of a SignMessageResponse. + * @memberof api + * @interface ISignMessageResponse + * @property {string|null} [signature] SignMessageResponse signature + */ + + /** + * Constructs a new SignMessageResponse. + * @memberof api + * @classdesc Represents a SignMessageResponse. + * @implements ISignMessageResponse + * @constructor + * @param {api.ISignMessageResponse=} [properties] Properties to set + */ + function SignMessageResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for SignMessageResponse + * @function getTypeUrl + * @memberof api.SignMessageResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SignMessageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.SignMessageResponse"; + }; + + return SignMessageResponse; + })(); + + api.VerifySignatureRequest = (function() { + + /** + * Properties of a VerifySignatureRequest. + * @memberof api + * @interface IVerifySignatureRequest + * @property {Uint8Array|null} [message] VerifySignatureRequest message + * @property {string|null} [signature] VerifySignatureRequest signature + * @property {string|null} [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, error) { + 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(); + if (tag === error) + break; + 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 >= 0) + 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); + }; + + /** + * Gets the default type url for VerifySignatureRequest + * @function getTypeUrl + * @memberof api.VerifySignatureRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VerifySignatureRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.VerifySignatureRequest"; + }; + + return VerifySignatureRequest; + })(); + + api.VerifySignatureResponse = (function() { + + /** + * Properties of a VerifySignatureResponse. + * @memberof api + * @interface IVerifySignatureResponse + * @property {boolean|null} [valid] VerifySignatureResponse valid + */ + + /** + * Constructs a new VerifySignatureResponse. + * @memberof api + * @classdesc Represents a VerifySignatureResponse. + * @implements IVerifySignatureResponse + * @constructor + * @param {api.IVerifySignatureResponse=} [properties] Properties to set + */ + function VerifySignatureResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for VerifySignatureResponse + * @function getTypeUrl + * @memberof api.VerifySignatureResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VerifySignatureResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.VerifySignatureResponse"; + }; + + return VerifySignatureResponse; + })(); + + api.ExportPathfindingScoresRequest = (function() { + + /** + * Properties of an ExportPathfindingScoresRequest. + * @memberof api + * @interface IExportPathfindingScoresRequest + */ + + /** + * Constructs a new ExportPathfindingScoresRequest. + * @memberof api + * @classdesc Represents an ExportPathfindingScoresRequest. + * @implements IExportPathfindingScoresRequest + * @constructor + * @param {api.IExportPathfindingScoresRequest=} [properties] Properties to set + */ + function ExportPathfindingScoresRequest(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ExportPathfindingScoresRequest + * @function getTypeUrl + * @memberof api.ExportPathfindingScoresRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportPathfindingScoresRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ExportPathfindingScoresRequest"; + }; + + return ExportPathfindingScoresRequest; + })(); + + api.ExportPathfindingScoresResponse = (function() { + + /** + * Properties of an ExportPathfindingScoresResponse. + * @memberof api + * @interface IExportPathfindingScoresResponse + * @property {Uint8Array|null} [scores] ExportPathfindingScoresResponse scores + */ + + /** + * Constructs a new ExportPathfindingScoresResponse. + * @memberof api + * @classdesc Represents an ExportPathfindingScoresResponse. + * @implements IExportPathfindingScoresResponse + * @constructor + * @param {api.IExportPathfindingScoresResponse=} [properties] Properties to set + */ + function ExportPathfindingScoresResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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 >= 0) + message.scores = object.scores; + return message; + }; + + /** + * Creates a plain object from an ExportPathfindingScoresResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof api.ExportPathfindingScoresResponse + * @static + * @param {api.ExportPathfindingScoresResponse} message ExportPathfindingScoresResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportPathfindingScoresResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + 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); + }; + + /** + * Gets the default type url for ExportPathfindingScoresResponse + * @function getTypeUrl + * @memberof api.ExportPathfindingScoresResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportPathfindingScoresResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ExportPathfindingScoresResponse"; + }; + + return ExportPathfindingScoresResponse; + })(); + + api.GetBalancesRequest = (function() { + + /** + * Properties of a GetBalancesRequest. + * @memberof api + * @interface IGetBalancesRequest + */ + + /** + * Constructs a new GetBalancesRequest. + * @memberof api + * @classdesc Represents a GetBalancesRequest. + * @implements IGetBalancesRequest + * @constructor + * @param {api.IGetBalancesRequest=} [properties] Properties to set + */ + function GetBalancesRequest(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for GetBalancesRequest + * @function getTypeUrl + * @memberof api.GetBalancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBalancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GetBalancesRequest"; + }; + + return GetBalancesRequest; + })(); + + api.GetBalancesResponse = (function() { + + /** + * Properties of a GetBalancesResponse. + * @memberof api + * @interface IGetBalancesResponse + * @property {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 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetBalancesResponse spendableOnchainBalanceSats. + * @member {number|Long} spendableOnchainBalanceSats + * @memberof api.GetBalancesResponse + * @instance + */ + GetBalancesResponse.prototype.spendableOnchainBalanceSats = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetBalancesResponse totalAnchorChannelsReserveSats. + * @member {number|Long} totalAnchorChannelsReserveSats + * @memberof api.GetBalancesResponse + * @instance + */ + GetBalancesResponse.prototype.totalAnchorChannelsReserveSats = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GetBalancesResponse totalLightningBalanceSats. + * @member {number|Long} totalLightningBalanceSats + * @memberof api.GetBalancesResponse + * @instance + */ + GetBalancesResponse.prototype.totalLightningBalanceSats = $util.Long ? $util.Long.fromBits(0,0,true) : 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, error) { + 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(); + if (tag === error) + break; + 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) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.totalOnchainBalanceSats = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalOnchainBalanceSats = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.spendableOnchainBalanceSats = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.spendableOnchainBalanceSats = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.totalAnchorChannelsReserveSats = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalAnchorChannelsReserveSats = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.totalLightningBalanceSats = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalLightningBalanceSats = options.longs === String ? "0" : 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); + }; + + /** + * Gets the default type url for GetBalancesResponse + * @function getTypeUrl + * @memberof api.GetBalancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBalancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GetBalancesResponse"; + }; + + return GetBalancesResponse; + })(); + + api.ConnectPeerRequest = (function() { + + /** + * Properties of a ConnectPeerRequest. + * @memberof api + * @interface IConnectPeerRequest + * @property {string|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ConnectPeerRequest + * @function getTypeUrl + * @memberof api.ConnectPeerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectPeerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ConnectPeerRequest"; + }; + + return ConnectPeerRequest; + })(); + + api.ConnectPeerResponse = (function() { + + /** + * Properties of a ConnectPeerResponse. + * @memberof api + * @interface IConnectPeerResponse + */ + + /** + * Constructs a new ConnectPeerResponse. + * @memberof api + * @classdesc Represents a ConnectPeerResponse. + * @implements IConnectPeerResponse + * @constructor + * @param {api.IConnectPeerResponse=} [properties] Properties to set + */ + function ConnectPeerResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ConnectPeerResponse + * @function getTypeUrl + * @memberof api.ConnectPeerResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectPeerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ConnectPeerResponse"; + }; + + return ConnectPeerResponse; + })(); + + api.DisconnectPeerRequest = (function() { + + /** + * Properties of a DisconnectPeerRequest. + * @memberof api + * @interface IDisconnectPeerRequest + * @property {string|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for DisconnectPeerRequest + * @function getTypeUrl + * @memberof api.DisconnectPeerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisconnectPeerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.DisconnectPeerRequest"; + }; + + return DisconnectPeerRequest; + })(); + + api.DisconnectPeerResponse = (function() { + + /** + * Properties of a DisconnectPeerResponse. + * @memberof api + * @interface IDisconnectPeerResponse + */ + + /** + * Constructs a new DisconnectPeerResponse. + * @memberof api + * @classdesc Represents a DisconnectPeerResponse. + * @implements IDisconnectPeerResponse + * @constructor + * @param {api.IDisconnectPeerResponse=} [properties] Properties to set + */ + function DisconnectPeerResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for DisconnectPeerResponse + * @function getTypeUrl + * @memberof api.DisconnectPeerResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisconnectPeerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.DisconnectPeerResponse"; + }; + + return DisconnectPeerResponse; + })(); + + api.ListPeersRequest = (function() { + + /** + * Properties of a ListPeersRequest. + * @memberof api + * @interface IListPeersRequest + */ + + /** + * Constructs a new ListPeersRequest. + * @memberof api + * @classdesc Represents a ListPeersRequest. + * @implements IListPeersRequest + * @constructor + * @param {api.IListPeersRequest=} [properties] Properties to set + */ + function ListPeersRequest(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ListPeersRequest + * @function getTypeUrl + * @memberof api.ListPeersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPeersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ListPeersRequest"; + }; + + return ListPeersRequest; + })(); + + api.ListPeersResponse = (function() { + + /** + * Properties of a ListPeersResponse. + * @memberof api + * @interface IListPeersResponse + * @property {Array.|null} [peers] ListPeersResponse peers + */ + + /** + * Constructs a new ListPeersResponse. + * @memberof api + * @classdesc Represents a ListPeersResponse. + * @implements IListPeersResponse + * @constructor + * @param {api.IListPeersResponse=} [properties] Properties to set + */ + function ListPeersResponse(properties) { + this.peers = []; + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.peers && message.peers.length)) + message.peers = []; + message.peers.push($root.types.Peer.decode(reader, reader.uint32())); + 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); + }; + + /** + * Gets the default type url for ListPeersResponse + * @function getTypeUrl + * @memberof api.ListPeersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPeersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.ListPeersResponse"; + }; + + return ListPeersResponse; + })(); + + api.GraphListChannelsRequest = (function() { + + /** + * Properties of a GraphListChannelsRequest. + * @memberof api + * @interface IGraphListChannelsRequest + */ + + /** + * Constructs a new GraphListChannelsRequest. + * @memberof api + * @classdesc Represents a GraphListChannelsRequest. + * @implements IGraphListChannelsRequest + * @constructor + * @param {api.IGraphListChannelsRequest=} [properties] Properties to set + */ + function GraphListChannelsRequest(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for GraphListChannelsRequest + * @function getTypeUrl + * @memberof api.GraphListChannelsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphListChannelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GraphListChannelsRequest"; + }; + + return GraphListChannelsRequest; + })(); + + api.GraphListChannelsResponse = (function() { + + /** + * Properties of a GraphListChannelsResponse. + * @memberof api + * @interface IGraphListChannelsResponse + * @property {Array.|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for GraphListChannelsResponse + * @function getTypeUrl + * @memberof api.GraphListChannelsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphListChannelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GraphListChannelsResponse"; + }; + + return GraphListChannelsResponse; + })(); + + api.GraphGetChannelRequest = (function() { + + /** + * Properties of a GraphGetChannelRequest. + * @memberof api + * @interface IGraphGetChannelRequest + * @property {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 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new GraphGetChannelRequest instance using the specified properties. + * @function create + * @memberof api.GraphGetChannelRequest + * @static + * @param {api.IGraphGetChannelRequest=} [properties] Properties to set + * @returns {api.GraphGetChannelRequest} GraphGetChannelRequest instance + */ + GraphGetChannelRequest.create = function create(properties) { + return new GraphGetChannelRequest(properties); + }; + + /** + * Encodes the specified GraphGetChannelRequest message. Does not implicitly {@link api.GraphGetChannelRequest.verify|verify} messages. + * @function encode + * @memberof api.GraphGetChannelRequest + * @static + * @param {api.IGraphGetChannelRequest} message GraphGetChannelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphGetChannelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.shortChannelId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.shortChannelId = options.longs === String ? "0" : 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); + }; + + /** + * Gets the default type url for GraphGetChannelRequest + * @function getTypeUrl + * @memberof api.GraphGetChannelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphGetChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GraphGetChannelRequest"; + }; + + return GraphGetChannelRequest; + })(); + + api.GraphGetChannelResponse = (function() { + + /** + * Properties of a GraphGetChannelResponse. + * @memberof api + * @interface IGraphGetChannelResponse + * @property {types.IGraphChannel|null} [channel] GraphGetChannelResponse channel + */ + + /** + * Constructs a new GraphGetChannelResponse. + * @memberof api + * @classdesc Represents a GraphGetChannelResponse. + * @implements IGraphGetChannelResponse + * @constructor + * @param {api.IGraphGetChannelResponse=} [properties] Properties to set + */ + function GraphGetChannelResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for GraphGetChannelResponse + * @function getTypeUrl + * @memberof api.GraphGetChannelResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphGetChannelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GraphGetChannelResponse"; + }; + + return GraphGetChannelResponse; + })(); + + api.GraphListNodesRequest = (function() { + + /** + * Properties of a GraphListNodesRequest. + * @memberof api + * @interface IGraphListNodesRequest + */ + + /** + * Constructs a new GraphListNodesRequest. + * @memberof api + * @classdesc Represents a GraphListNodesRequest. + * @implements IGraphListNodesRequest + * @constructor + * @param {api.IGraphListNodesRequest=} [properties] Properties to set + */ + function GraphListNodesRequest(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for GraphListNodesRequest + * @function getTypeUrl + * @memberof api.GraphListNodesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphListNodesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GraphListNodesRequest"; + }; + + return GraphListNodesRequest; + })(); + + api.GraphListNodesResponse = (function() { + + /** + * Properties of a GraphListNodesResponse. + * @memberof api + * @interface IGraphListNodesResponse + * @property {Array.|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for GraphListNodesResponse + * @function getTypeUrl + * @memberof api.GraphListNodesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphListNodesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GraphListNodesResponse"; + }; + + return GraphListNodesResponse; + })(); + + api.UnifiedSendRequest = (function() { + + /** + * Properties of an UnifiedSendRequest. + * @memberof api + * @interface IUnifiedSendRequest + * @property {string|null} [uri] UnifiedSendRequest uri + * @property {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|null|undefined} amountMsat + * @memberof api.UnifiedSendRequest + * @instance + */ + UnifiedSendRequest.prototype.amountMsat = null; + + /** + * UnifiedSendRequest routeParameters. + * @member {types.IRouteParametersConfig|null|undefined} routeParameters + * @memberof api.UnifiedSendRequest + * @instance + */ + UnifiedSendRequest.prototype.routeParameters = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UnifiedSendRequest.prototype, "_amountMsat", { + get: $util.oneOfGetter($oneOfFields = ["amountMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UnifiedSendRequest.prototype, "_routeParameters", { + get: $util.oneOfGetter($oneOfFields = ["routeParameters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UnifiedSendRequest instance using the specified properties. + * @function create + * @memberof api.UnifiedSendRequest + * @static + * @param {api.IUnifiedSendRequest=} [properties] Properties to set + * @returns {api.UnifiedSendRequest} UnifiedSendRequest instance + */ + UnifiedSendRequest.create = function create(properties) { + return new UnifiedSendRequest(properties); + }; + + /** + * Encodes the specified UnifiedSendRequest message. Does not implicitly {@link api.UnifiedSendRequest.verify|verify} messages. + * @function encode + * @memberof api.UnifiedSendRequest + * @static + * @param {api.IUnifiedSendRequest} message UnifiedSendRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnifiedSendRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.amountMsat != null && message.hasOwnProperty("amountMsat")) { + properties._amountMsat = 1; + 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")) { + properties._routeParameters = 1; + { + 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 = ""; + 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 (options.oneofs) + object._amountMsat = "amountMsat"; + } + if (message.routeParameters != null && message.hasOwnProperty("routeParameters")) { + object.routeParameters = $root.types.RouteParametersConfig.toObject(message.routeParameters, options); + if (options.oneofs) + object._routeParameters = "routeParameters"; + } + return object; + }; + + /** + * Converts this UnifiedSendRequest to JSON. + * @function toJSON + * @memberof api.UnifiedSendRequest + * @instance + * @returns {Object.} JSON object + */ + UnifiedSendRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UnifiedSendRequest + * @function getTypeUrl + * @memberof api.UnifiedSendRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UnifiedSendRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.UnifiedSendRequest"; + }; + + return UnifiedSendRequest; + })(); + + api.UnifiedSendResponse = (function() { + + /** + * Properties of an UnifiedSendResponse. + * @memberof api + * @interface IUnifiedSendResponse + * @property {string|null} [txid] UnifiedSendResponse txid + * @property {string|null} [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|null|undefined} txid + * @memberof api.UnifiedSendResponse + * @instance + */ + UnifiedSendResponse.prototype.txid = null; + + /** + * UnifiedSendResponse bolt11PaymentId. + * @member {string|null|undefined} bolt11PaymentId + * @memberof api.UnifiedSendResponse + * @instance + */ + UnifiedSendResponse.prototype.bolt11PaymentId = null; + + /** + * UnifiedSendResponse bolt12PaymentId. + * @member {string|null|undefined} bolt12PaymentId + * @memberof api.UnifiedSendResponse + * @instance + */ + UnifiedSendResponse.prototype.bolt12PaymentId = null; + + // 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for UnifiedSendResponse + * @function getTypeUrl + * @memberof api.UnifiedSendResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UnifiedSendResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.UnifiedSendResponse"; + }; + + return UnifiedSendResponse; + })(); + + api.GraphGetNodeRequest = (function() { + + /** + * Properties of a GraphGetNodeRequest. + * @memberof api + * @interface IGraphGetNodeRequest + * @property {string|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for GraphGetNodeRequest + * @function getTypeUrl + * @memberof api.GraphGetNodeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphGetNodeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GraphGetNodeRequest"; + }; + + return GraphGetNodeRequest; + })(); + + api.GraphGetNodeResponse = (function() { + + /** + * Properties of a GraphGetNodeResponse. + * @memberof api + * @interface IGraphGetNodeResponse + * @property {types.IGraphNode|null} [node] GraphGetNodeResponse node + */ + + /** + * Constructs a new GraphGetNodeResponse. + * @memberof api + * @classdesc Represents a GraphGetNodeResponse. + * @implements IGraphGetNodeResponse + * @constructor + * @param {api.IGraphGetNodeResponse=} [properties] Properties to set + */ + function GraphGetNodeResponse(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for GraphGetNodeResponse + * @function getTypeUrl + * @memberof api.GraphGetNodeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphGetNodeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.GraphGetNodeResponse"; + }; + + return GraphGetNodeResponse; + })(); + + api.DecodeInvoiceRequest = (function() { + + /** + * Properties of a DecodeInvoiceRequest. + * @memberof api + * @interface IDecodeInvoiceRequest + * @property {string|null} [invoice] DecodeInvoiceRequest invoice + */ + + /** + * Constructs a new DecodeInvoiceRequest. + * @memberof api + * @classdesc Represents a DecodeInvoiceRequest. + * @implements IDecodeInvoiceRequest + * @constructor + * @param {api.IDecodeInvoiceRequest=} [properties] Properties to set + */ + function DecodeInvoiceRequest(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for DecodeInvoiceRequest + * @function getTypeUrl + * @memberof api.DecodeInvoiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DecodeInvoiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.DecodeInvoiceRequest"; + }; + + return DecodeInvoiceRequest; + })(); + + api.DecodeInvoiceResponse = (function() { + + /** + * Properties of a DecodeInvoiceResponse. + * @memberof api + * @interface IDecodeInvoiceResponse + * @property {string|null} [destination] DecodeInvoiceResponse destination + * @property {string|null} [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 + */ + + /** + * 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|null|undefined} amountMsat + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.amountMsat = null; + + /** + * DecodeInvoiceResponse timestamp. + * @member {number|Long} timestamp + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * DecodeInvoiceResponse expiry. + * @member {number|Long} expiry + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.expiry = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * DecodeInvoiceResponse description. + * @member {string|null|undefined} description + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.description = null; + + /** + * DecodeInvoiceResponse descriptionHash. + * @member {string|null|undefined} descriptionHash + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.descriptionHash = null; + + /** + * DecodeInvoiceResponse fallbackAddress. + * @member {string|null|undefined} fallbackAddress + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.fallbackAddress = null; + + /** + * DecodeInvoiceResponse minFinalCltvExpiryDelta. + * @member {number|Long} minFinalCltvExpiryDelta + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.minFinalCltvExpiryDelta = $util.Long ? $util.Long.fromBits(0,0,true) : 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|null|undefined} paymentMetadata + * @memberof api.DecodeInvoiceResponse + * @instance + */ + DecodeInvoiceResponse.prototype.paymentMetadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeInvoiceResponse.prototype, "_amountMsat", { + get: $util.oneOfGetter($oneOfFields = ["amountMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeInvoiceResponse.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeInvoiceResponse.prototype, "_descriptionHash", { + get: $util.oneOfGetter($oneOfFields = ["descriptionHash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeInvoiceResponse.prototype, "_fallbackAddress", { + get: $util.oneOfGetter($oneOfFields = ["fallbackAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeInvoiceResponse.prototype, "_paymentMetadata", { + get: $util.oneOfGetter($oneOfFields = ["paymentMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DecodeInvoiceResponse instance using the specified properties. + * @function create + * @memberof api.DecodeInvoiceResponse + * @static + * @param {api.IDecodeInvoiceResponse=} [properties] Properties to set + * @returns {api.DecodeInvoiceResponse} DecodeInvoiceResponse instance + */ + DecodeInvoiceResponse.create = function create(properties) { + return new DecodeInvoiceResponse(properties); + }; + + /** + * Encodes the specified DecodeInvoiceResponse message. Does not implicitly {@link api.DecodeInvoiceResponse.verify|verify} messages. + * @function encode + * @memberof api.DecodeInvoiceResponse + * @static + * @param {api.IDecodeInvoiceResponse} message DecodeInvoiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecodeInvoiceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.destination); + if (message.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); + return writer; + }; + + /** + * Encodes the specified DecodeInvoiceResponse message, length delimited. Does not implicitly {@link api.DecodeInvoiceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof api.DecodeInvoiceResponse + * @static + * @param {api.IDecodeInvoiceResponse} message DecodeInvoiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecodeInvoiceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DecodeInvoiceResponse message from the specified reader or buffer. + * @function decode + * @memberof api.DecodeInvoiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.DecodeInvoiceResponse} DecodeInvoiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DecodeInvoiceResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.DecodeInvoiceResponse(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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: { + if (message.features === $util.emptyObject) + message.features = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint32(); + break; + case 2: + value = $root.types.Bolt11Feature.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.features[key] = value; + break; + } + case 12: { + message.currency = reader.string(); + break; + } + case 13: { + message.paymentMetadata = reader.string(); + 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"; + var properties = {}; + 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")) { + properties._amountMsat = 1; + 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")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.descriptionHash != null && message.hasOwnProperty("descriptionHash")) { + properties._descriptionHash = 1; + if (!$util.isString(message.descriptionHash)) + return "descriptionHash: string expected"; + } + if (message.fallbackAddress != null && message.hasOwnProperty("fallbackAddress")) { + properties._fallbackAddress = 1; + 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")) { + properties._paymentMetadata = 1; + if (!$util.isString(message.paymentMetadata)) + return "paymentMetadata: string 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); + 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 = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.expiry = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.expiry = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.minFinalCltvExpiryDelta = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.minFinalCltvExpiryDelta = options.longs === String ? "0" : 0; + object.paymentSecret = ""; + object.currency = ""; + } + 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 (options.oneofs) + object._amountMsat = "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 (options.oneofs) + object._description = "description"; + } + if (message.fallbackAddress != null && message.hasOwnProperty("fallbackAddress")) { + object.fallbackAddress = message.fallbackAddress; + if (options.oneofs) + object._fallbackAddress = "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 (options.oneofs) + object._paymentMetadata = "paymentMetadata"; + } + if (message.descriptionHash != null && message.hasOwnProperty("descriptionHash")) { + object.descriptionHash = message.descriptionHash; + if (options.oneofs) + object._descriptionHash = "descriptionHash"; + } + return object; + }; + + /** + * Converts this DecodeInvoiceResponse to JSON. + * @function toJSON + * @memberof api.DecodeInvoiceResponse + * @instance + * @returns {Object.} JSON object + */ + DecodeInvoiceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DecodeInvoiceResponse + * @function getTypeUrl + * @memberof api.DecodeInvoiceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DecodeInvoiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.DecodeInvoiceResponse"; + }; + + return DecodeInvoiceResponse; + })(); + + api.DecodeOfferRequest = (function() { + + /** + * Properties of a DecodeOfferRequest. + * @memberof api + * @interface IDecodeOfferRequest + * @property {string|null} [offer] DecodeOfferRequest offer + */ + + /** + * Constructs a new DecodeOfferRequest. + * @memberof api + * @classdesc Represents a DecodeOfferRequest. + * @implements IDecodeOfferRequest + * @constructor + * @param {api.IDecodeOfferRequest=} [properties] Properties to set + */ + function DecodeOfferRequest(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for DecodeOfferRequest + * @function getTypeUrl + * @memberof api.DecodeOfferRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DecodeOfferRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.DecodeOfferRequest"; + }; + + return DecodeOfferRequest; + })(); + + api.DecodeOfferResponse = (function() { + + /** + * Properties of a DecodeOfferResponse. + * @memberof api + * @interface IDecodeOfferResponse + * @property {string|null} [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|null|undefined} description + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.description = null; + + /** + * DecodeOfferResponse issuer. + * @member {string|null|undefined} issuer + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.issuer = null; + + /** + * DecodeOfferResponse amount. + * @member {types.IOfferAmount|null|undefined} amount + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.amount = null; + + /** + * DecodeOfferResponse issuerSigningPubkey. + * @member {string|null|undefined} issuerSigningPubkey + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.issuerSigningPubkey = null; + + /** + * DecodeOfferResponse absoluteExpiry. + * @member {number|Long|null|undefined} absoluteExpiry + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.absoluteExpiry = null; + + /** + * DecodeOfferResponse quantity. + * @member {types.IOfferQuantity|null|undefined} quantity + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.quantity = null; + + /** + * DecodeOfferResponse paths. + * @member {Array.} paths + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.paths = $util.emptyArray; + + /** + * DecodeOfferResponse features. + * @member {Object.} features + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.features = $util.emptyObject; + + /** + * DecodeOfferResponse chains. + * @member {Array.} chains + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.chains = $util.emptyArray; + + /** + * DecodeOfferResponse metadata. + * @member {string|null|undefined} metadata + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.metadata = null; + + /** + * DecodeOfferResponse isExpired. + * @member {boolean} isExpired + * @memberof api.DecodeOfferResponse + * @instance + */ + DecodeOfferResponse.prototype.isExpired = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeOfferResponse.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeOfferResponse.prototype, "_issuer", { + get: $util.oneOfGetter($oneOfFields = ["issuer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeOfferResponse.prototype, "_issuerSigningPubkey", { + get: $util.oneOfGetter($oneOfFields = ["issuerSigningPubkey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeOfferResponse.prototype, "_absoluteExpiry", { + get: $util.oneOfGetter($oneOfFields = ["absoluteExpiry"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DecodeOfferResponse.prototype, "_metadata", { + get: $util.oneOfGetter($oneOfFields = ["metadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DecodeOfferResponse instance using the specified properties. + * @function create + * @memberof api.DecodeOfferResponse + * @static + * @param {api.IDecodeOfferResponse=} [properties] Properties to set + * @returns {api.DecodeOfferResponse} DecodeOfferResponse instance + */ + DecodeOfferResponse.create = function create(properties) { + return new DecodeOfferResponse(properties); + }; + + /** + * Encodes the specified DecodeOfferResponse message. Does not implicitly {@link api.DecodeOfferResponse.verify|verify} messages. + * @function encode + * @memberof api.DecodeOfferResponse + * @static + * @param {api.IDecodeOfferResponse} message DecodeOfferResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DecodeOfferResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.DecodeOfferResponse(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + 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: { + if (message.features === $util.emptyObject) + message.features = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint32(); + break; + case 2: + value = $root.types.Bolt11Feature.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.features[key] = value; + break; + } + case 10: { + if (!(message.chains && message.chains.length)) + message.chains = []; + message.chains.push(reader.string()); + break; + } + case 11: { + message.metadata = reader.string(); + break; + } + case 12: { + message.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"; + var properties = {}; + if (message.offerId != null && message.hasOwnProperty("offerId")) + if (!$util.isString(message.offerId)) + return "offerId: string expected"; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.issuer != null && message.hasOwnProperty("issuer")) { + properties._issuer = 1; + if (!$util.isString(message.issuer)) + return "issuer: string expected"; + } + if (message.amount != null && message.hasOwnProperty("amount")) { + var error = $root.types.OfferAmount.verify(message.amount); + if (error) + return "amount." + error; + } + if (message.issuerSigningPubkey != null && message.hasOwnProperty("issuerSigningPubkey")) { + properties._issuerSigningPubkey = 1; + if (!$util.isString(message.issuerSigningPubkey)) + return "issuerSigningPubkey: string expected"; + } + if (message.absoluteExpiry != null && message.hasOwnProperty("absoluteExpiry")) { + properties._absoluteExpiry = 1; + 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")) { + properties._metadata = 1; + 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.amount = null; + object.quantity = null; + 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 (options.oneofs) + object._description = "description"; + } + if (message.issuer != null && message.hasOwnProperty("issuer")) { + object.issuer = message.issuer; + if (options.oneofs) + object._issuer = "issuer"; + } + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = $root.types.OfferAmount.toObject(message.amount, options); + if (message.issuerSigningPubkey != null && message.hasOwnProperty("issuerSigningPubkey")) { + object.issuerSigningPubkey = message.issuerSigningPubkey; + if (options.oneofs) + object._issuerSigningPubkey = "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 (options.oneofs) + object._absoluteExpiry = "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 (options.oneofs) + object._metadata = "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); + }; + + /** + * Gets the default type url for DecodeOfferResponse + * @function getTypeUrl + * @memberof api.DecodeOfferResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DecodeOfferResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.DecodeOfferResponse"; + }; + + return DecodeOfferResponse; + })(); + + 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|null|undefined} amountMsat + * @memberof types.Payment + * @instance + */ + Payment.prototype.amountMsat = null; + + /** + * Payment feePaidMsat. + * @member {number|Long|null|undefined} feePaidMsat + * @memberof types.Payment + * @instance + */ + Payment.prototype.feePaidMsat = null; + + /** + * Payment direction. + * @member {types.PaymentDirection} direction + * @memberof types.Payment + * @instance + */ + Payment.prototype.direction = 0; + + /** + * Payment status. + * @member {types.PaymentStatus} status + * @memberof types.Payment + * @instance + */ + Payment.prototype.status = 0; + + /** + * Payment latestUpdateTimestamp. + * @member {number|Long} latestUpdateTimestamp + * @memberof types.Payment + * @instance + */ + Payment.prototype.latestUpdateTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Payment.prototype, "_amountMsat", { + get: $util.oneOfGetter($oneOfFields = ["amountMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Payment.prototype, "_feePaidMsat", { + get: $util.oneOfGetter($oneOfFields = ["feePaidMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Payment instance using the specified properties. + * @function create + * @memberof types.Payment + * @static + * @param {types.IPayment=} [properties] Properties to set + * @returns {types.Payment} Payment instance + */ + Payment.create = function create(properties) { + return new Payment(properties); + }; + + /** + * Encodes the specified Payment message. Does not implicitly {@link types.Payment.verify|verify} messages. + * @function encode + * @memberof types.Payment + * @static + * @param {types.IPayment} message Payment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Payment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + $root.types.PaymentKind.encode(message.kind, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.kind = $root.types.PaymentKind.decode(reader, reader.uint32()); + 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"; + var properties = {}; + 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")) { + properties._amountMsat = 1; + 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")) { + properties._feePaidMsat = 1; + 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) { + default: + if (typeof object.direction === "number") { + message.direction = object.direction; + break; + } + break; + case "INBOUND": + case 0: + message.direction = 0; + break; + case "OUTBOUND": + case 1: + message.direction = 1; + break; + } + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "PENDING": + case 0: + message.status = 0; + break; + case "SUCCEEDED": + case 1: + message.status = 1; + break; + case "FAILED": + case 2: + message.status = 2; + break; + } + if (object.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.direction = options.enums === String ? "INBOUND" : 0; + object.status = options.enums === String ? "PENDING" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.latestUpdateTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.latestUpdateTimestamp = options.longs === String ? "0" : 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = $root.types.PaymentKind.toObject(message.kind, options); + if (message.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 (options.oneofs) + object._amountMsat = "amountMsat"; + } + if (message.direction != null && message.hasOwnProperty("direction")) + object.direction = options.enums === String ? $root.types.PaymentDirection[message.direction] === undefined ? message.direction : $root.types.PaymentDirection[message.direction] : message.direction; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.types.PaymentStatus[message.status] === undefined ? message.status : $root.types.PaymentStatus[message.status] : message.status; + if (message.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; + if (options.oneofs) + object._feePaidMsat = "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); + }; + + /** + * Gets the default type url for Payment + * @function getTypeUrl + * @memberof types.Payment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Payment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Payment"; + }; + + return Payment; + })(); + + types.PaymentKind = (function() { + + /** + * Properties of a PaymentKind. + * @memberof types + * @interface IPaymentKind + * @property {types.IOnchain|null} [onchain] PaymentKind onchain + * @property {types.IBolt11|null} [bolt11] PaymentKind bolt11 + * @property {types.IBolt11Jit|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for PaymentKind + * @function getTypeUrl + * @memberof types.PaymentKind + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PaymentKind.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.PaymentKind"; + }; + + return PaymentKind; + })(); + + types.Onchain = (function() { + + /** + * Properties of an Onchain. + * @memberof types + * @interface IOnchain + * @property {string|null} [txid] Onchain txid + * @property {types.IConfirmationStatus|null} [status] Onchain status + */ + + /** + * Constructs a new Onchain. + * @memberof types + * @classdesc Represents an Onchain. + * @implements IOnchain + * @constructor + * @param {types.IOnchain=} [properties] Properties to set + */ + function Onchain(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.txid = reader.string(); + break; + } + case 2: { + message.status = $root.types.ConfirmationStatus.decode(reader, reader.uint32()); + 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); + }; + + /** + * Gets the default type url for Onchain + * @function getTypeUrl + * @memberof types.Onchain + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Onchain.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Onchain"; + }; + + return Onchain; + })(); + + types.ConfirmationStatus = (function() { + + /** + * Properties of a ConfirmationStatus. + * @memberof types + * @interface IConfirmationStatus + * @property {types.IConfirmed|null} [confirmed] ConfirmationStatus confirmed + * @property {types.IUnconfirmed|null} [unconfirmed] ConfirmationStatus unconfirmed + */ + + /** + * Constructs a new ConfirmationStatus. + * @memberof types + * @classdesc Represents a ConfirmationStatus. + * @implements IConfirmationStatus + * @constructor + * @param {types.IConfirmationStatus=} [properties] Properties to set + */ + function ConfirmationStatus(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for ConfirmationStatus + * @function getTypeUrl + * @memberof types.ConfirmationStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfirmationStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.ConfirmationStatus"; + }; + + return ConfirmationStatus; + })(); + + types.Confirmed = (function() { + + /** + * Properties of a Confirmed. + * @memberof types + * @interface IConfirmed + * @property {string|null} [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 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new Confirmed instance using the specified properties. + * @function create + * @memberof types.Confirmed + * @static + * @param {types.IConfirmed=} [properties] Properties to set + * @returns {types.Confirmed} Confirmed instance + */ + Confirmed.create = function create(properties) { + return new Confirmed(properties); + }; + + /** + * Encodes the specified Confirmed message. Does not implicitly {@link types.Confirmed.verify|verify} messages. + * @function encode + * @memberof types.Confirmed + * @static + * @param {types.IConfirmed} message Confirmed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Confirmed.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 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); + }; + + /** + * Gets the default type url for Confirmed + * @function getTypeUrl + * @memberof types.Confirmed + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Confirmed.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Confirmed"; + }; + + return Confirmed; + })(); + + types.Unconfirmed = (function() { + + /** + * Properties of an Unconfirmed. + * @memberof types + * @interface IUnconfirmed + */ + + /** + * Constructs a new Unconfirmed. + * @memberof types + * @classdesc Represents an Unconfirmed. + * @implements IUnconfirmed + * @constructor + * @param {types.IUnconfirmed=} [properties] Properties to set + */ + function Unconfirmed(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Unconfirmed + * @function getTypeUrl + * @memberof types.Unconfirmed + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Unconfirmed.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Unconfirmed"; + }; + + return Unconfirmed; + })(); + + types.Bolt11 = (function() { + + /** + * Properties of a Bolt11. + * @memberof types + * @interface IBolt11 + * @property {string|null} [hash] Bolt11 hash + * @property {string|null} [preimage] Bolt11 preimage + * @property {Uint8Array|null} [secret] Bolt11 secret + */ + + /** + * Constructs a new Bolt11. + * @memberof types + * @classdesc Represents a Bolt11. + * @implements IBolt11 + * @constructor + * @param {types.IBolt11=} [properties] Properties to set + */ + function Bolt11(properties) { + if (properties) + for (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|null|undefined} preimage + * @memberof types.Bolt11 + * @instance + */ + Bolt11.prototype.preimage = null; + + /** + * Bolt11 secret. + * @member {Uint8Array|null|undefined} secret + * @memberof types.Bolt11 + * @instance + */ + Bolt11.prototype.secret = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11.prototype, "_preimage", { + get: $util.oneOfGetter($oneOfFields = ["preimage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11.prototype, "_secret", { + get: $util.oneOfGetter($oneOfFields = ["secret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt11 instance using the specified properties. + * @function create + * @memberof types.Bolt11 + * @static + * @param {types.IBolt11=} [properties] Properties to set + * @returns {types.Bolt11} Bolt11 instance + */ + Bolt11.create = function create(properties) { + return new Bolt11(properties); + }; + + /** + * Encodes the specified Bolt11 message. Does not implicitly {@link types.Bolt11.verify|verify} messages. + * @function encode + * @memberof types.Bolt11 + * @static + * @param {types.IBolt11} message Bolt11 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); + if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.preimage); + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.secret); + return writer; + }; + + /** + * Encodes the specified Bolt11 message, length delimited. Does not implicitly {@link types.Bolt11.verify|verify} messages. + * @function encodeDelimited + * @memberof types.Bolt11 + * @static + * @param {types.IBolt11} message Bolt11 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Bolt11 message from the specified reader or buffer. + * @function decode + * @memberof types.Bolt11 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.Bolt11} Bolt11 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Bolt11.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.hash = reader.string(); + break; + } + case 2: { + message.preimage = reader.string(); + break; + } + case 3: { + message.secret = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + 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"; + var properties = {}; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + if (message.preimage != null && message.hasOwnProperty("preimage")) { + properties._preimage = 1; + if (!$util.isString(message.preimage)) + return "preimage: string expected"; + } + if (message.secret != null && message.hasOwnProperty("secret")) { + properties._secret = 1; + if (!(message.secret && typeof message.secret.length === "number" || $util.isString(message.secret))) + return "secret: buffer expected"; + } + return null; + }; + + /** + * Creates a Bolt11 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Bolt11 + * @static + * @param {Object.} object Plain object + * @returns {types.Bolt11} Bolt11 + */ + Bolt11.fromObject = function fromObject(object) { + 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 >= 0) + message.secret = object.secret; + return message; + }; + + /** + * Creates a plain object from a Bolt11 message. Also converts values to other types if specified. + * @function toObject + * @memberof types.Bolt11 + * @static + * @param {types.Bolt11} message Bolt11 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Bolt11.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.hash = ""; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + if (message.preimage != null && message.hasOwnProperty("preimage")) { + object.preimage = message.preimage; + if (options.oneofs) + object._preimage = "preimage"; + } + if (message.secret != null && message.hasOwnProperty("secret")) { + object.secret = options.bytes === String ? $util.base64.encode(message.secret, 0, message.secret.length) : options.bytes === Array ? Array.prototype.slice.call(message.secret) : message.secret; + if (options.oneofs) + object._secret = "secret"; + } + return object; + }; + + /** + * Converts this Bolt11 to JSON. + * @function toJSON + * @memberof types.Bolt11 + * @instance + * @returns {Object.} JSON object + */ + Bolt11.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt11 + * @function getTypeUrl + * @memberof types.Bolt11 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Bolt11"; + }; + + return Bolt11; + })(); + + types.Bolt11Jit = (function() { + + /** + * Properties of a Bolt11Jit. + * @memberof types + * @interface IBolt11Jit + * @property {string|null} [hash] Bolt11Jit hash + * @property {string|null} [preimage] Bolt11Jit preimage + * @property {Uint8Array|null} [secret] Bolt11Jit secret + * @property {types.ILSPFeeLimits|null} [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|null|undefined} preimage + * @memberof types.Bolt11Jit + * @instance + */ + Bolt11Jit.prototype.preimage = null; + + /** + * Bolt11Jit secret. + * @member {Uint8Array|null|undefined} secret + * @memberof types.Bolt11Jit + * @instance + */ + Bolt11Jit.prototype.secret = null; + + /** + * Bolt11Jit lspFeeLimits. + * @member {types.ILSPFeeLimits|null|undefined} lspFeeLimits + * @memberof types.Bolt11Jit + * @instance + */ + Bolt11Jit.prototype.lspFeeLimits = null; + + /** + * Bolt11Jit counterpartySkimmedFeeMsat. + * @member {number|Long|null|undefined} counterpartySkimmedFeeMsat + * @memberof types.Bolt11Jit + * @instance + */ + Bolt11Jit.prototype.counterpartySkimmedFeeMsat = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11Jit.prototype, "_preimage", { + get: $util.oneOfGetter($oneOfFields = ["preimage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11Jit.prototype, "_secret", { + get: $util.oneOfGetter($oneOfFields = ["secret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt11Jit.prototype, "_counterpartySkimmedFeeMsat", { + get: $util.oneOfGetter($oneOfFields = ["counterpartySkimmedFeeMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt11Jit instance using the specified properties. + * @function create + * @memberof types.Bolt11Jit + * @static + * @param {types.IBolt11Jit=} [properties] Properties to set + * @returns {types.Bolt11Jit} Bolt11Jit instance + */ + Bolt11Jit.create = function create(properties) { + return new Bolt11Jit(properties); + }; + + /** + * Encodes the specified Bolt11Jit message. Does not implicitly {@link types.Bolt11Jit.verify|verify} messages. + * @function encode + * @memberof types.Bolt11Jit + * @static + * @param {types.IBolt11Jit} message Bolt11Jit message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt11Jit.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); + if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.preimage); + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.secret); + if (message.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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.hash = reader.string(); + break; + } + case 2: { + message.preimage = reader.string(); + break; + } + case 3: { + message.secret = reader.bytes(); + break; + } + case 4: { + message.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"; + var properties = {}; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + if (message.preimage != null && message.hasOwnProperty("preimage")) { + properties._preimage = 1; + if (!$util.isString(message.preimage)) + return "preimage: string expected"; + } + if (message.secret != null && message.hasOwnProperty("secret")) { + properties._secret = 1; + if (!(message.secret && typeof message.secret.length === "number" || $util.isString(message.secret))) + return "secret: buffer expected"; + } + if (message.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")) { + properties._counterpartySkimmedFeeMsat = 1; + 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 >= 0) + 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.lspFeeLimits = null; + } + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + if (message.preimage != null && message.hasOwnProperty("preimage")) { + object.preimage = message.preimage; + if (options.oneofs) + object._preimage = "preimage"; + } + if (message.secret != null && message.hasOwnProperty("secret")) { + object.secret = options.bytes === String ? $util.base64.encode(message.secret, 0, message.secret.length) : options.bytes === Array ? Array.prototype.slice.call(message.secret) : message.secret; + if (options.oneofs) + object._secret = "secret"; + } + if (message.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; + if (options.oneofs) + object._counterpartySkimmedFeeMsat = "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); + }; + + /** + * Gets the default type url for Bolt11Jit + * @function getTypeUrl + * @memberof types.Bolt11Jit + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11Jit.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Bolt11Jit"; + }; + + return Bolt11Jit; + })(); + + types.Bolt12Offer = (function() { + + /** + * Properties of a Bolt12Offer. + * @memberof types + * @interface IBolt12Offer + * @property {string|null} [hash] Bolt12Offer hash + * @property {string|null} [preimage] Bolt12Offer preimage + * @property {Uint8Array|null} [secret] Bolt12Offer secret + * @property {string|null} [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|null|undefined} hash + * @memberof types.Bolt12Offer + * @instance + */ + Bolt12Offer.prototype.hash = null; + + /** + * Bolt12Offer preimage. + * @member {string|null|undefined} preimage + * @memberof types.Bolt12Offer + * @instance + */ + Bolt12Offer.prototype.preimage = null; + + /** + * Bolt12Offer secret. + * @member {Uint8Array|null|undefined} secret + * @memberof types.Bolt12Offer + * @instance + */ + Bolt12Offer.prototype.secret = null; + + /** + * Bolt12Offer offerId. + * @member {string} offerId + * @memberof types.Bolt12Offer + * @instance + */ + Bolt12Offer.prototype.offerId = ""; + + /** + * Bolt12Offer payerNote. + * @member {string|null|undefined} payerNote + * @memberof types.Bolt12Offer + * @instance + */ + Bolt12Offer.prototype.payerNote = null; + + /** + * Bolt12Offer quantity. + * @member {number|Long|null|undefined} quantity + * @memberof types.Bolt12Offer + * @instance + */ + Bolt12Offer.prototype.quantity = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Offer.prototype, "_hash", { + get: $util.oneOfGetter($oneOfFields = ["hash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Offer.prototype, "_preimage", { + get: $util.oneOfGetter($oneOfFields = ["preimage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Offer.prototype, "_secret", { + get: $util.oneOfGetter($oneOfFields = ["secret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Offer.prototype, "_payerNote", { + get: $util.oneOfGetter($oneOfFields = ["payerNote"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Offer.prototype, "_quantity", { + get: $util.oneOfGetter($oneOfFields = ["quantity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt12Offer instance using the specified properties. + * @function create + * @memberof types.Bolt12Offer + * @static + * @param {types.IBolt12Offer=} [properties] Properties to set + * @returns {types.Bolt12Offer} Bolt12Offer instance + */ + Bolt12Offer.create = function create(properties) { + return new Bolt12Offer(properties); + }; + + /** + * Encodes the specified Bolt12Offer message. Does not implicitly {@link types.Bolt12Offer.verify|verify} messages. + * @function encode + * @memberof types.Bolt12Offer + * @static + * @param {types.IBolt12Offer} message Bolt12Offer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt12Offer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); + if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.preimage); + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.secret); + if (message.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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.hash = reader.string(); + break; + } + case 2: { + message.preimage = reader.string(); + break; + } + case 3: { + message.secret = reader.bytes(); + break; + } + case 4: { + message.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"; + var properties = {}; + if (message.hash != null && message.hasOwnProperty("hash")) { + properties._hash = 1; + if (!$util.isString(message.hash)) + return "hash: string expected"; + } + if (message.preimage != null && message.hasOwnProperty("preimage")) { + properties._preimage = 1; + if (!$util.isString(message.preimage)) + return "preimage: string expected"; + } + if (message.secret != null && message.hasOwnProperty("secret")) { + properties._secret = 1; + if (!(message.secret && typeof message.secret.length === "number" || $util.isString(message.secret))) + return "secret: buffer expected"; + } + if (message.offerId != null && message.hasOwnProperty("offerId")) + if (!$util.isString(message.offerId)) + return "offerId: string expected"; + if (message.payerNote != null && message.hasOwnProperty("payerNote")) { + properties._payerNote = 1; + if (!$util.isString(message.payerNote)) + return "payerNote: string expected"; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) { + properties._quantity = 1; + if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) + return "quantity: integer|Long expected"; + } + return null; + }; + + /** + * Creates a Bolt12Offer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Bolt12Offer + * @static + * @param {Object.} object Plain object + * @returns {types.Bolt12Offer} Bolt12Offer + */ + Bolt12Offer.fromObject = function fromObject(object) { + 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 >= 0) + 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.offerId = ""; + if (message.hash != null && message.hasOwnProperty("hash")) { + object.hash = message.hash; + if (options.oneofs) + object._hash = "hash"; + } + if (message.preimage != null && message.hasOwnProperty("preimage")) { + object.preimage = message.preimage; + if (options.oneofs) + object._preimage = "preimage"; + } + if (message.secret != null && message.hasOwnProperty("secret")) { + object.secret = options.bytes === String ? $util.base64.encode(message.secret, 0, message.secret.length) : options.bytes === Array ? Array.prototype.slice.call(message.secret) : message.secret; + if (options.oneofs) + object._secret = "secret"; + } + if (message.offerId != null && message.hasOwnProperty("offerId")) + object.offerId = message.offerId; + if (message.payerNote != null && message.hasOwnProperty("payerNote")) { + object.payerNote = message.payerNote; + if (options.oneofs) + object._payerNote = "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; + if (options.oneofs) + object._quantity = "quantity"; + } + return object; + }; + + /** + * Converts this Bolt12Offer to JSON. + * @function toJSON + * @memberof types.Bolt12Offer + * @instance + * @returns {Object.} JSON object + */ + Bolt12Offer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt12Offer + * @function getTypeUrl + * @memberof types.Bolt12Offer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt12Offer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Bolt12Offer"; + }; + + return Bolt12Offer; + })(); + + types.Bolt12Refund = (function() { + + /** + * Properties of a Bolt12Refund. + * @memberof types + * @interface IBolt12Refund + * @property {string|null} [hash] Bolt12Refund hash + * @property {string|null} [preimage] Bolt12Refund preimage + * @property {Uint8Array|null} [secret] Bolt12Refund secret + * @property {string|null} [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|null|undefined} hash + * @memberof types.Bolt12Refund + * @instance + */ + Bolt12Refund.prototype.hash = null; + + /** + * Bolt12Refund preimage. + * @member {string|null|undefined} preimage + * @memberof types.Bolt12Refund + * @instance + */ + Bolt12Refund.prototype.preimage = null; + + /** + * Bolt12Refund secret. + * @member {Uint8Array|null|undefined} secret + * @memberof types.Bolt12Refund + * @instance + */ + Bolt12Refund.prototype.secret = null; + + /** + * Bolt12Refund payerNote. + * @member {string|null|undefined} payerNote + * @memberof types.Bolt12Refund + * @instance + */ + Bolt12Refund.prototype.payerNote = null; + + /** + * Bolt12Refund quantity. + * @member {number|Long|null|undefined} quantity + * @memberof types.Bolt12Refund + * @instance + */ + Bolt12Refund.prototype.quantity = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Refund.prototype, "_hash", { + get: $util.oneOfGetter($oneOfFields = ["hash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Refund.prototype, "_preimage", { + get: $util.oneOfGetter($oneOfFields = ["preimage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Refund.prototype, "_secret", { + get: $util.oneOfGetter($oneOfFields = ["secret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Refund.prototype, "_payerNote", { + get: $util.oneOfGetter($oneOfFields = ["payerNote"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Bolt12Refund.prototype, "_quantity", { + get: $util.oneOfGetter($oneOfFields = ["quantity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Bolt12Refund instance using the specified properties. + * @function create + * @memberof types.Bolt12Refund + * @static + * @param {types.IBolt12Refund=} [properties] Properties to set + * @returns {types.Bolt12Refund} Bolt12Refund instance + */ + Bolt12Refund.create = function create(properties) { + return new Bolt12Refund(properties); + }; + + /** + * Encodes the specified Bolt12Refund message. Does not implicitly {@link types.Bolt12Refund.verify|verify} messages. + * @function encode + * @memberof types.Bolt12Refund + * @static + * @param {types.IBolt12Refund} message Bolt12Refund message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Bolt12Refund.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); + if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.preimage); + if (message.secret != null && Object.hasOwnProperty.call(message, "secret")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.secret); + if (message.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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.hash = reader.string(); + break; + } + case 2: { + message.preimage = reader.string(); + break; + } + case 3: { + message.secret = reader.bytes(); + break; + } + case 5: { + message.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"; + var properties = {}; + if (message.hash != null && message.hasOwnProperty("hash")) { + properties._hash = 1; + if (!$util.isString(message.hash)) + return "hash: string expected"; + } + if (message.preimage != null && message.hasOwnProperty("preimage")) { + properties._preimage = 1; + if (!$util.isString(message.preimage)) + return "preimage: string expected"; + } + if (message.secret != null && message.hasOwnProperty("secret")) { + properties._secret = 1; + if (!(message.secret && typeof message.secret.length === "number" || $util.isString(message.secret))) + return "secret: buffer expected"; + } + if (message.payerNote != null && message.hasOwnProperty("payerNote")) { + properties._payerNote = 1; + if (!$util.isString(message.payerNote)) + return "payerNote: string expected"; + } + if (message.quantity != null && message.hasOwnProperty("quantity")) { + properties._quantity = 1; + if (!$util.isInteger(message.quantity) && !(message.quantity && $util.isInteger(message.quantity.low) && $util.isInteger(message.quantity.high))) + return "quantity: integer|Long expected"; + } + return null; + }; + + /** + * Creates a Bolt12Refund message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Bolt12Refund + * @static + * @param {Object.} object Plain object + * @returns {types.Bolt12Refund} Bolt12Refund + */ + Bolt12Refund.fromObject = function fromObject(object) { + 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 >= 0) + 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 (message.hash != null && message.hasOwnProperty("hash")) { + object.hash = message.hash; + if (options.oneofs) + object._hash = "hash"; + } + if (message.preimage != null && message.hasOwnProperty("preimage")) { + object.preimage = message.preimage; + if (options.oneofs) + object._preimage = "preimage"; + } + if (message.secret != null && message.hasOwnProperty("secret")) { + object.secret = options.bytes === String ? $util.base64.encode(message.secret, 0, message.secret.length) : options.bytes === Array ? Array.prototype.slice.call(message.secret) : message.secret; + if (options.oneofs) + object._secret = "secret"; + } + if (message.payerNote != null && message.hasOwnProperty("payerNote")) { + object.payerNote = message.payerNote; + if (options.oneofs) + object._payerNote = "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; + if (options.oneofs) + object._quantity = "quantity"; + } + return object; + }; + + /** + * Converts this Bolt12Refund to JSON. + * @function toJSON + * @memberof types.Bolt12Refund + * @instance + * @returns {Object.} JSON object + */ + Bolt12Refund.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Bolt12Refund + * @function getTypeUrl + * @memberof types.Bolt12Refund + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt12Refund.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Bolt12Refund"; + }; + + return Bolt12Refund; + })(); + + types.Spontaneous = (function() { + + /** + * Properties of a Spontaneous. + * @memberof types + * @interface ISpontaneous + * @property {string|null} [hash] Spontaneous hash + * @property {string|null} [preimage] Spontaneous preimage + */ + + /** + * Constructs a new Spontaneous. + * @memberof types + * @classdesc Represents a Spontaneous. + * @implements ISpontaneous + * @constructor + * @param {types.ISpontaneous=} [properties] Properties to set + */ + function Spontaneous(properties) { + if (properties) + for (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|null|undefined} preimage + * @memberof types.Spontaneous + * @instance + */ + Spontaneous.prototype.preimage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Spontaneous.prototype, "_preimage", { + get: $util.oneOfGetter($oneOfFields = ["preimage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Spontaneous instance using the specified properties. + * @function create + * @memberof types.Spontaneous + * @static + * @param {types.ISpontaneous=} [properties] Properties to set + * @returns {types.Spontaneous} Spontaneous instance + */ + Spontaneous.create = function create(properties) { + return new Spontaneous(properties); + }; + + /** + * Encodes the specified Spontaneous message. Does not implicitly {@link types.Spontaneous.verify|verify} messages. + * @function encode + * @memberof types.Spontaneous + * @static + * @param {types.ISpontaneous} message Spontaneous message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Spontaneous.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hash != null && Object.hasOwnProperty.call(message, "hash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash); + if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.preimage); + return writer; + }; + + /** + * Encodes the specified Spontaneous message, length delimited. Does not implicitly {@link types.Spontaneous.verify|verify} messages. + * @function encodeDelimited + * @memberof types.Spontaneous + * @static + * @param {types.ISpontaneous} message Spontaneous message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Spontaneous.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Spontaneous message from the specified reader or buffer. + * @function decode + * @memberof types.Spontaneous + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.Spontaneous} Spontaneous + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Spontaneous.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.hash = reader.string(); + break; + } + case 2: { + message.preimage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + 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"; + var properties = {}; + if (message.hash != null && message.hasOwnProperty("hash")) + if (!$util.isString(message.hash)) + return "hash: string expected"; + if (message.preimage != null && message.hasOwnProperty("preimage")) { + properties._preimage = 1; + if (!$util.isString(message.preimage)) + return "preimage: string expected"; + } + return null; + }; + + /** + * Creates a Spontaneous message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof types.Spontaneous + * @static + * @param {Object.} object Plain object + * @returns {types.Spontaneous} Spontaneous + */ + Spontaneous.fromObject = function fromObject(object) { + 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 = ""; + if (message.hash != null && message.hasOwnProperty("hash")) + object.hash = message.hash; + if (message.preimage != null && message.hasOwnProperty("preimage")) { + object.preimage = message.preimage; + if (options.oneofs) + object._preimage = "preimage"; + } + return object; + }; + + /** + * Converts this Spontaneous to JSON. + * @function toJSON + * @memberof types.Spontaneous + * @instance + * @returns {Object.} JSON object + */ + Spontaneous.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Spontaneous + * @function getTypeUrl + * @memberof types.Spontaneous + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Spontaneous.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Spontaneous"; + }; + + return Spontaneous; + })(); + + types.LSPFeeLimits = (function() { + + /** + * Properties of a LSPFeeLimits. + * @memberof types + * @interface ILSPFeeLimits + * @property {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|null|undefined} maxTotalOpeningFeeMsat + * @memberof types.LSPFeeLimits + * @instance + */ + LSPFeeLimits.prototype.maxTotalOpeningFeeMsat = null; + + /** + * LSPFeeLimits maxProportionalOpeningFeePpmMsat. + * @member {number|Long|null|undefined} maxProportionalOpeningFeePpmMsat + * @memberof types.LSPFeeLimits + * @instance + */ + LSPFeeLimits.prototype.maxProportionalOpeningFeePpmMsat = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LSPFeeLimits.prototype, "_maxTotalOpeningFeeMsat", { + get: $util.oneOfGetter($oneOfFields = ["maxTotalOpeningFeeMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(LSPFeeLimits.prototype, "_maxProportionalOpeningFeePpmMsat", { + get: $util.oneOfGetter($oneOfFields = ["maxProportionalOpeningFeePpmMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LSPFeeLimits instance using the specified properties. + * @function create + * @memberof types.LSPFeeLimits + * @static + * @param {types.ILSPFeeLimits=} [properties] Properties to set + * @returns {types.LSPFeeLimits} LSPFeeLimits instance + */ + LSPFeeLimits.create = function create(properties) { + return new LSPFeeLimits(properties); + }; + + /** + * Encodes the specified LSPFeeLimits message. Does not implicitly {@link types.LSPFeeLimits.verify|verify} messages. + * @function encode + * @memberof types.LSPFeeLimits + * @static + * @param {types.ILSPFeeLimits} message LSPFeeLimits message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LSPFeeLimits.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + if (message.maxTotalOpeningFeeMsat != null && message.hasOwnProperty("maxTotalOpeningFeeMsat")) { + properties._maxTotalOpeningFeeMsat = 1; + 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")) { + properties._maxProportionalOpeningFeePpmMsat = 1; + 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 (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 (options.oneofs) + object._maxTotalOpeningFeeMsat = "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; + if (options.oneofs) + object._maxProportionalOpeningFeePpmMsat = "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); + }; + + /** + * Gets the default type url for LSPFeeLimits + * @function getTypeUrl + * @memberof types.LSPFeeLimits + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LSPFeeLimits.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.LSPFeeLimits"; + }; + + return LSPFeeLimits; + })(); + + /** + * PaymentDirection enum. + * @name types.PaymentDirection + * @enum {number} + * @property {number} INBOUND=0 INBOUND value + * @property {number} OUTBOUND=1 OUTBOUND value + */ + types.PaymentDirection = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INBOUND"] = 0; + values[valuesById[1] = "OUTBOUND"] = 1; + return values; + })(); + + /** + * PaymentStatus enum. + * @name types.PaymentStatus + * @enum {number} + * @property {number} PENDING=0 PENDING value + * @property {number} SUCCEEDED=1 SUCCEEDED value + * @property {number} FAILED=2 FAILED value + */ + types.PaymentStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PENDING"] = 0; + values[valuesById[1] = "SUCCEEDED"] = 1; + values[valuesById[2] = "FAILED"] = 2; + 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|null|undefined} nextUserChannelId + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.nextUserChannelId = null; + + /** + * ForwardedPayment totalFeeEarnedMsat. + * @member {number|Long|null|undefined} totalFeeEarnedMsat + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.totalFeeEarnedMsat = null; + + /** + * ForwardedPayment skimmedFeeMsat. + * @member {number|Long|null|undefined} skimmedFeeMsat + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.skimmedFeeMsat = null; + + /** + * ForwardedPayment claimFromOnchainTx. + * @member {boolean} claimFromOnchainTx + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.claimFromOnchainTx = false; + + /** + * ForwardedPayment outboundAmountForwardedMsat. + * @member {number|Long|null|undefined} outboundAmountForwardedMsat + * @memberof types.ForwardedPayment + * @instance + */ + ForwardedPayment.prototype.outboundAmountForwardedMsat = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ForwardedPayment.prototype, "_nextUserChannelId", { + get: $util.oneOfGetter($oneOfFields = ["nextUserChannelId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ForwardedPayment.prototype, "_totalFeeEarnedMsat", { + get: $util.oneOfGetter($oneOfFields = ["totalFeeEarnedMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ForwardedPayment.prototype, "_skimmedFeeMsat", { + get: $util.oneOfGetter($oneOfFields = ["skimmedFeeMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ForwardedPayment.prototype, "_outboundAmountForwardedMsat", { + get: $util.oneOfGetter($oneOfFields = ["outboundAmountForwardedMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ForwardedPayment instance using the specified properties. + * @function create + * @memberof types.ForwardedPayment + * @static + * @param {types.IForwardedPayment=} [properties] Properties to set + * @returns {types.ForwardedPayment} ForwardedPayment instance + */ + ForwardedPayment.create = function create(properties) { + return new ForwardedPayment(properties); + }; + + /** + * Encodes the specified ForwardedPayment message. Does not implicitly {@link types.ForwardedPayment.verify|verify} messages. + * @function encode + * @memberof types.ForwardedPayment + * @static + * @param {types.IForwardedPayment} message ForwardedPayment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForwardedPayment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + 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")) { + properties._nextUserChannelId = 1; + if (!$util.isString(message.nextUserChannelId)) + return "nextUserChannelId: string expected"; + } + if (message.totalFeeEarnedMsat != null && message.hasOwnProperty("totalFeeEarnedMsat")) { + properties._totalFeeEarnedMsat = 1; + 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")) { + properties._skimmedFeeMsat = 1; + 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")) { + properties._outboundAmountForwardedMsat = 1; + 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.claimFromOnchainTx = false; + 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 (options.oneofs) + object._nextUserChannelId = "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 (options.oneofs) + object._totalFeeEarnedMsat = "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 (options.oneofs) + object._skimmedFeeMsat = "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 (options.oneofs) + object._outboundAmountForwardedMsat = "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); + }; + + /** + * Gets the default type url for ForwardedPayment + * @function getTypeUrl + * @memberof types.ForwardedPayment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ForwardedPayment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.ForwardedPayment"; + }; + + return ForwardedPayment; + })(); + + types.Channel = (function() { + + /** + * Properties of a Channel. + * @memberof types + * @interface IChannel + * @property {string|null} [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|null|undefined} unspendablePunishmentReserve + * @memberof types.Channel + * @instance + */ + Channel.prototype.unspendablePunishmentReserve = null; + + /** + * Channel channelValueSats. + * @member {number|Long} channelValueSats + * @memberof types.Channel + * @instance + */ + Channel.prototype.channelValueSats = $util.Long ? $util.Long.fromBits(0,0,true) : 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 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Channel inboundCapacityMsat. + * @member {number|Long} inboundCapacityMsat + * @memberof types.Channel + * @instance + */ + Channel.prototype.inboundCapacityMsat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Channel confirmationsRequired. + * @member {number|null|undefined} confirmationsRequired + * @memberof types.Channel + * @instance + */ + Channel.prototype.confirmationsRequired = null; + + /** + * Channel confirmations. + * @member {number|null|undefined} confirmations + * @memberof types.Channel + * @instance + */ + Channel.prototype.confirmations = null; + + /** + * 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 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Channel nextOutboundHtlcMinimumMsat. + * @member {number|Long} nextOutboundHtlcMinimumMsat + * @memberof types.Channel + * @instance + */ + Channel.prototype.nextOutboundHtlcMinimumMsat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Channel forceCloseSpendDelay. + * @member {number|null|undefined} forceCloseSpendDelay + * @memberof types.Channel + * @instance + */ + Channel.prototype.forceCloseSpendDelay = null; + + /** + * Channel counterpartyOutboundHtlcMinimumMsat. + * @member {number|Long|null|undefined} counterpartyOutboundHtlcMinimumMsat + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterpartyOutboundHtlcMinimumMsat = null; + + /** + * Channel counterpartyOutboundHtlcMaximumMsat. + * @member {number|Long|null|undefined} counterpartyOutboundHtlcMaximumMsat + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterpartyOutboundHtlcMaximumMsat = null; + + /** + * Channel counterpartyUnspendablePunishmentReserve. + * @member {number|Long} counterpartyUnspendablePunishmentReserve + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterpartyUnspendablePunishmentReserve = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Channel counterpartyForwardingInfoFeeBaseMsat. + * @member {number|null|undefined} counterpartyForwardingInfoFeeBaseMsat + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterpartyForwardingInfoFeeBaseMsat = null; + + /** + * Channel counterpartyForwardingInfoFeeProportionalMillionths. + * @member {number|null|undefined} counterpartyForwardingInfoFeeProportionalMillionths + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterpartyForwardingInfoFeeProportionalMillionths = null; + + /** + * Channel counterpartyForwardingInfoCltvExpiryDelta. + * @member {number|null|undefined} counterpartyForwardingInfoCltvExpiryDelta + * @memberof types.Channel + * @instance + */ + Channel.prototype.counterpartyForwardingInfoCltvExpiryDelta = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_fundingTxo", { + get: $util.oneOfGetter($oneOfFields = ["fundingTxo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_unspendablePunishmentReserve", { + get: $util.oneOfGetter($oneOfFields = ["unspendablePunishmentReserve"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_confirmationsRequired", { + get: $util.oneOfGetter($oneOfFields = ["confirmationsRequired"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_confirmations", { + get: $util.oneOfGetter($oneOfFields = ["confirmations"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_forceCloseSpendDelay", { + get: $util.oneOfGetter($oneOfFields = ["forceCloseSpendDelay"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_counterpartyOutboundHtlcMinimumMsat", { + get: $util.oneOfGetter($oneOfFields = ["counterpartyOutboundHtlcMinimumMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_counterpartyOutboundHtlcMaximumMsat", { + get: $util.oneOfGetter($oneOfFields = ["counterpartyOutboundHtlcMaximumMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_counterpartyForwardingInfoFeeBaseMsat", { + get: $util.oneOfGetter($oneOfFields = ["counterpartyForwardingInfoFeeBaseMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_counterpartyForwardingInfoFeeProportionalMillionths", { + get: $util.oneOfGetter($oneOfFields = ["counterpartyForwardingInfoFeeProportionalMillionths"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Channel.prototype, "_counterpartyForwardingInfoCltvExpiryDelta", { + get: $util.oneOfGetter($oneOfFields = ["counterpartyForwardingInfoCltvExpiryDelta"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Channel instance using the specified properties. + * @function create + * @memberof types.Channel + * @static + * @param {types.IChannel=} [properties] Properties to set + * @returns {types.Channel} Channel instance + */ + Channel.create = function create(properties) { + return new Channel(properties); + }; + + /** + * Encodes the specified Channel message. Does not implicitly {@link types.Channel.verify|verify} messages. + * @function encode + * @memberof types.Channel + * @static + * @param {types.IChannel} message Channel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Channel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + 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")) { + properties._fundingTxo = 1; + { + 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")) { + properties._unspendablePunishmentReserve = 1; + 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")) { + properties._confirmationsRequired = 1; + if (!$util.isInteger(message.confirmationsRequired)) + return "confirmationsRequired: integer expected"; + } + if (message.confirmations != null && message.hasOwnProperty("confirmations")) { + properties._confirmations = 1; + 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")) { + properties._forceCloseSpendDelay = 1; + if (!$util.isInteger(message.forceCloseSpendDelay)) + return "forceCloseSpendDelay: integer expected"; + } + if (message.counterpartyOutboundHtlcMinimumMsat != null && message.hasOwnProperty("counterpartyOutboundHtlcMinimumMsat")) { + properties._counterpartyOutboundHtlcMinimumMsat = 1; + 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")) { + properties._counterpartyOutboundHtlcMaximumMsat = 1; + 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")) { + properties._counterpartyForwardingInfoFeeBaseMsat = 1; + if (!$util.isInteger(message.counterpartyForwardingInfoFeeBaseMsat)) + return "counterpartyForwardingInfoFeeBaseMsat: integer expected"; + } + if (message.counterpartyForwardingInfoFeeProportionalMillionths != null && message.hasOwnProperty("counterpartyForwardingInfoFeeProportionalMillionths")) { + properties._counterpartyForwardingInfoFeeProportionalMillionths = 1; + if (!$util.isInteger(message.counterpartyForwardingInfoFeeProportionalMillionths)) + return "counterpartyForwardingInfoFeeProportionalMillionths: integer expected"; + } + if (message.counterpartyForwardingInfoCltvExpiryDelta != null && message.hasOwnProperty("counterpartyForwardingInfoCltvExpiryDelta")) { + properties._counterpartyForwardingInfoCltvExpiryDelta = 1; + 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.userChannelId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.channelValueSats = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.channelValueSats = options.longs === String ? "0" : 0; + object.feerateSatPer_1000Weight = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.outboundCapacityMsat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.outboundCapacityMsat = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.inboundCapacityMsat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.inboundCapacityMsat = options.longs === String ? "0" : 0; + object.isOutbound = false; + object.isChannelReady = false; + object.isUsable = false; + object.isAnnounced = false; + object.channelConfig = null; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.nextOutboundHtlcLimitMsat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nextOutboundHtlcLimitMsat = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.nextOutboundHtlcMinimumMsat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.nextOutboundHtlcMinimumMsat = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.counterpartyUnspendablePunishmentReserve = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.counterpartyUnspendablePunishmentReserve = options.longs === String ? "0" : 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 (options.oneofs) + object._fundingTxo = "fundingTxo"; + } + 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 (options.oneofs) + object._unspendablePunishmentReserve = "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 (options.oneofs) + object._confirmationsRequired = "confirmationsRequired"; + } + if (message.confirmations != null && message.hasOwnProperty("confirmations")) { + object.confirmations = message.confirmations; + if (options.oneofs) + object._confirmations = "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 (options.oneofs) + object._forceCloseSpendDelay = "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 (options.oneofs) + object._counterpartyOutboundHtlcMinimumMsat = "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 (options.oneofs) + object._counterpartyOutboundHtlcMaximumMsat = "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 (options.oneofs) + object._counterpartyForwardingInfoFeeBaseMsat = "counterpartyForwardingInfoFeeBaseMsat"; + } + if (message.counterpartyForwardingInfoFeeProportionalMillionths != null && message.hasOwnProperty("counterpartyForwardingInfoFeeProportionalMillionths")) { + object.counterpartyForwardingInfoFeeProportionalMillionths = message.counterpartyForwardingInfoFeeProportionalMillionths; + if (options.oneofs) + object._counterpartyForwardingInfoFeeProportionalMillionths = "counterpartyForwardingInfoFeeProportionalMillionths"; + } + if (message.counterpartyForwardingInfoCltvExpiryDelta != null && message.hasOwnProperty("counterpartyForwardingInfoCltvExpiryDelta")) { + object.counterpartyForwardingInfoCltvExpiryDelta = message.counterpartyForwardingInfoCltvExpiryDelta; + if (options.oneofs) + object._counterpartyForwardingInfoCltvExpiryDelta = "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); + }; + + /** + * Gets the default type url for Channel + * @function getTypeUrl + * @memberof types.Channel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Channel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Channel"; + }; + + return Channel; + })(); + + types.ChannelConfig = (function() { + + /** + * Properties of a ChannelConfig. + * @memberof types + * @interface IChannelConfig + * @property {number|null} [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|null|undefined} forwardingFeeProportionalMillionths + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.forwardingFeeProportionalMillionths = null; + + /** + * ChannelConfig forwardingFeeBaseMsat. + * @member {number|null|undefined} forwardingFeeBaseMsat + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.forwardingFeeBaseMsat = null; + + /** + * ChannelConfig cltvExpiryDelta. + * @member {number|null|undefined} cltvExpiryDelta + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.cltvExpiryDelta = null; + + /** + * ChannelConfig forceCloseAvoidanceMaxFeeSatoshis. + * @member {number|Long|null|undefined} forceCloseAvoidanceMaxFeeSatoshis + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.forceCloseAvoidanceMaxFeeSatoshis = null; + + /** + * ChannelConfig acceptUnderpayingHtlcs. + * @member {boolean|null|undefined} acceptUnderpayingHtlcs + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.acceptUnderpayingHtlcs = null; + + /** + * ChannelConfig fixedLimitMsat. + * @member {number|Long|null|undefined} fixedLimitMsat + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.fixedLimitMsat = null; + + /** + * ChannelConfig feeRateMultiplier. + * @member {number|Long|null|undefined} feeRateMultiplier + * @memberof types.ChannelConfig + * @instance + */ + ChannelConfig.prototype.feeRateMultiplier = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChannelConfig.prototype, "_forwardingFeeProportionalMillionths", { + get: $util.oneOfGetter($oneOfFields = ["forwardingFeeProportionalMillionths"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChannelConfig.prototype, "_forwardingFeeBaseMsat", { + get: $util.oneOfGetter($oneOfFields = ["forwardingFeeBaseMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChannelConfig.prototype, "_cltvExpiryDelta", { + get: $util.oneOfGetter($oneOfFields = ["cltvExpiryDelta"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChannelConfig.prototype, "_forceCloseAvoidanceMaxFeeSatoshis", { + get: $util.oneOfGetter($oneOfFields = ["forceCloseAvoidanceMaxFeeSatoshis"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ChannelConfig.prototype, "_acceptUnderpayingHtlcs", { + get: $util.oneOfGetter($oneOfFields = ["acceptUnderpayingHtlcs"]), + set: $util.oneOfSetter($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, error) { + 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(); + if (tag === error) + break; + 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")) { + properties._forwardingFeeProportionalMillionths = 1; + if (!$util.isInteger(message.forwardingFeeProportionalMillionths)) + return "forwardingFeeProportionalMillionths: integer expected"; + } + if (message.forwardingFeeBaseMsat != null && message.hasOwnProperty("forwardingFeeBaseMsat")) { + properties._forwardingFeeBaseMsat = 1; + if (!$util.isInteger(message.forwardingFeeBaseMsat)) + return "forwardingFeeBaseMsat: integer expected"; + } + if (message.cltvExpiryDelta != null && message.hasOwnProperty("cltvExpiryDelta")) { + properties._cltvExpiryDelta = 1; + if (!$util.isInteger(message.cltvExpiryDelta)) + return "cltvExpiryDelta: integer expected"; + } + if (message.forceCloseAvoidanceMaxFeeSatoshis != null && message.hasOwnProperty("forceCloseAvoidanceMaxFeeSatoshis")) { + properties._forceCloseAvoidanceMaxFeeSatoshis = 1; + 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")) { + properties._acceptUnderpayingHtlcs = 1; + 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 (message.forwardingFeeProportionalMillionths != null && message.hasOwnProperty("forwardingFeeProportionalMillionths")) { + object.forwardingFeeProportionalMillionths = message.forwardingFeeProportionalMillionths; + if (options.oneofs) + object._forwardingFeeProportionalMillionths = "forwardingFeeProportionalMillionths"; + } + if (message.forwardingFeeBaseMsat != null && message.hasOwnProperty("forwardingFeeBaseMsat")) { + object.forwardingFeeBaseMsat = message.forwardingFeeBaseMsat; + if (options.oneofs) + object._forwardingFeeBaseMsat = "forwardingFeeBaseMsat"; + } + if (message.cltvExpiryDelta != null && message.hasOwnProperty("cltvExpiryDelta")) { + object.cltvExpiryDelta = message.cltvExpiryDelta; + if (options.oneofs) + object._cltvExpiryDelta = "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 (options.oneofs) + object._forceCloseAvoidanceMaxFeeSatoshis = "forceCloseAvoidanceMaxFeeSatoshis"; + } + if (message.acceptUnderpayingHtlcs != null && message.hasOwnProperty("acceptUnderpayingHtlcs")) { + object.acceptUnderpayingHtlcs = message.acceptUnderpayingHtlcs; + if (options.oneofs) + object._acceptUnderpayingHtlcs = "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); + }; + + /** + * Gets the default type url for ChannelConfig + * @function getTypeUrl + * @memberof types.ChannelConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChannelConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.ChannelConfig"; + }; + + return ChannelConfig; + })(); + + types.OutPoint = (function() { + + /** + * Properties of an OutPoint. + * @memberof types + * @interface IOutPoint + * @property {string|null} [txid] OutPoint txid + * @property {number|null} [vout] OutPoint vout + */ + + /** + * Constructs a new OutPoint. + * @memberof types + * @classdesc Represents an OutPoint. + * @implements IOutPoint + * @constructor + * @param {types.IOutPoint=} [properties] Properties to set + */ + function OutPoint(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.txid = reader.string(); + break; + } + case 2: { + message.vout = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + 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); + }; + + /** + * Gets the default type url for OutPoint + * @function getTypeUrl + * @memberof types.OutPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.OutPoint"; + }; + + return OutPoint; + })(); + + types.BestBlock = (function() { + + /** + * Properties of a BestBlock. + * @memberof types + * @interface IBestBlock + * @property {string|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for BestBlock + * @function getTypeUrl + * @memberof types.BestBlock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BestBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.BestBlock"; + }; + + return BestBlock; + })(); + + types.LightningBalance = (function() { + + /** + * Properties of a LightningBalance. + * @memberof types + * @interface ILightningBalance + * @property {types.IClaimableOnChannelClose|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for LightningBalance + * @function getTypeUrl + * @memberof types.LightningBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LightningBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.LightningBalance"; + }; + + return LightningBalance; + })(); + + types.ClaimableOnChannelClose = (function() { + + /** + * Properties of a ClaimableOnChannelClose. + * @memberof types + * @interface IClaimableOnChannelClose + * @property {string|null} [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 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ClaimableOnChannelClose transactionFeeSatoshis. + * @member {number|Long} transactionFeeSatoshis + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.transactionFeeSatoshis = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ClaimableOnChannelClose outboundPaymentHtlcRoundedMsat. + * @member {number|Long} outboundPaymentHtlcRoundedMsat + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.outboundPaymentHtlcRoundedMsat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ClaimableOnChannelClose outboundForwardedHtlcRoundedMsat. + * @member {number|Long} outboundForwardedHtlcRoundedMsat + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.outboundForwardedHtlcRoundedMsat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ClaimableOnChannelClose inboundClaimingHtlcRoundedMsat. + * @member {number|Long} inboundClaimingHtlcRoundedMsat + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.inboundClaimingHtlcRoundedMsat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ClaimableOnChannelClose inboundHtlcRoundedMsat. + * @member {number|Long} inboundHtlcRoundedMsat + * @memberof types.ClaimableOnChannelClose + * @instance + */ + ClaimableOnChannelClose.prototype.inboundHtlcRoundedMsat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new ClaimableOnChannelClose instance using the specified properties. + * @function create + * @memberof types.ClaimableOnChannelClose + * @static + * @param {types.IClaimableOnChannelClose=} [properties] Properties to set + * @returns {types.ClaimableOnChannelClose} ClaimableOnChannelClose instance + */ + ClaimableOnChannelClose.create = function create(properties) { + return new ClaimableOnChannelClose(properties); + }; + + /** + * Encodes the specified ClaimableOnChannelClose message. Does not implicitly {@link types.ClaimableOnChannelClose.verify|verify} messages. + * @function encode + * @memberof types.ClaimableOnChannelClose + * @static + * @param {types.IClaimableOnChannelClose} message ClaimableOnChannelClose message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClaimableOnChannelClose.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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 = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amountSatoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amountSatoshis = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.transactionFeeSatoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.transactionFeeSatoshis = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.outboundPaymentHtlcRoundedMsat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.outboundPaymentHtlcRoundedMsat = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.outboundForwardedHtlcRoundedMsat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.outboundForwardedHtlcRoundedMsat = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.inboundClaimingHtlcRoundedMsat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.inboundClaimingHtlcRoundedMsat = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.inboundHtlcRoundedMsat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.inboundHtlcRoundedMsat = options.longs === String ? "0" : 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); + }; + + /** + * Gets the default type url for ClaimableOnChannelClose + * @function getTypeUrl + * @memberof types.ClaimableOnChannelClose + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClaimableOnChannelClose.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.ClaimableOnChannelClose"; + }; + + return ClaimableOnChannelClose; + })(); + + types.ClaimableAwaitingConfirmations = (function() { + + /** + * Properties of a ClaimableAwaitingConfirmations. + * @memberof types + * @interface IClaimableAwaitingConfirmations + * @property {string|null} [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 = $util.Long ? $util.Long.fromBits(0,0,true) : 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, error) { + 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(); + if (tag === error) + break; + 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) { + default: + if (typeof object.source === "number") { + message.source = object.source; + break; + } + break; + case "HOLDER_FORCE_CLOSED": + case 0: + message.source = 0; + break; + case "COUNTERPARTY_FORCE_CLOSED": + case 1: + message.source = 1; + break; + case "COOP_CLOSE": + case 2: + message.source = 2; + break; + case "HTLC": + case 3: + message.source = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ClaimableAwaitingConfirmations message. Also converts values to other types if specified. + * @function toObject + * @memberof types.ClaimableAwaitingConfirmations + * @static + * @param {types.ClaimableAwaitingConfirmations} message ClaimableAwaitingConfirmations + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClaimableAwaitingConfirmations.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.channelId = ""; + object.counterpartyNodeId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amountSatoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amountSatoshis = options.longs === String ? "0" : 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] === undefined ? message.source : $root.types.BalanceSource[message.source] : message.source; + return object; + }; + + /** + * Converts this ClaimableAwaitingConfirmations to JSON. + * @function toJSON + * @memberof types.ClaimableAwaitingConfirmations + * @instance + * @returns {Object.} JSON object + */ + ClaimableAwaitingConfirmations.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClaimableAwaitingConfirmations + * @function getTypeUrl + * @memberof types.ClaimableAwaitingConfirmations + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClaimableAwaitingConfirmations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.ClaimableAwaitingConfirmations"; + }; + + return ClaimableAwaitingConfirmations; + })(); + + /** + * BalanceSource enum. + * @name types.BalanceSource + * @enum {number} + * @property {number} HOLDER_FORCE_CLOSED=0 HOLDER_FORCE_CLOSED value + * @property {number} COUNTERPARTY_FORCE_CLOSED=1 COUNTERPARTY_FORCE_CLOSED value + * @property {number} COOP_CLOSE=2 COOP_CLOSE value + * @property {number} HTLC=3 HTLC value + */ + types.BalanceSource = (function() { + 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 = $util.Long ? $util.Long.fromBits(0,0,true) : 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, error) { + 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(); + if (tag === error) + break; + 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 = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amountSatoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amountSatoshis = options.longs === String ? "0" : 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); + }; + + /** + * Gets the default type url for ContentiousClaimable + * @function getTypeUrl + * @memberof types.ContentiousClaimable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContentiousClaimable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.ContentiousClaimable"; + }; + + return ContentiousClaimable; + })(); + + types.MaybeTimeoutClaimableHTLC = (function() { + + /** + * Properties of a MaybeTimeoutClaimableHTLC. + * @memberof types + * @interface IMaybeTimeoutClaimableHTLC + * @property {string|null} [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 = $util.Long ? $util.Long.fromBits(0,0,true) : 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, error) { + 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(); + if (tag === error) + break; + 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 = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amountSatoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amountSatoshis = options.longs === String ? "0" : 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); + }; + + /** + * Gets the default type url for MaybeTimeoutClaimableHTLC + * @function getTypeUrl + * @memberof types.MaybeTimeoutClaimableHTLC + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaybeTimeoutClaimableHTLC.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.MaybeTimeoutClaimableHTLC"; + }; + + return MaybeTimeoutClaimableHTLC; + })(); + + types.MaybePreimageClaimableHTLC = (function() { + + /** + * Properties of a MaybePreimageClaimableHTLC. + * @memberof types + * @interface IMaybePreimageClaimableHTLC + * @property {string|null} [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 = $util.Long ? $util.Long.fromBits(0,0,true) : 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, error) { + 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(); + if (tag === error) + break; + 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 = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amountSatoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amountSatoshis = options.longs === String ? "0" : 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); + }; + + /** + * Gets the default type url for MaybePreimageClaimableHTLC + * @function getTypeUrl + * @memberof types.MaybePreimageClaimableHTLC + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MaybePreimageClaimableHTLC.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.MaybePreimageClaimableHTLC"; + }; + + return MaybePreimageClaimableHTLC; + })(); + + types.CounterpartyRevokedOutputClaimable = (function() { + + /** + * Properties of a CounterpartyRevokedOutputClaimable. + * @memberof types + * @interface ICounterpartyRevokedOutputClaimable + * @property {string|null} [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 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new CounterpartyRevokedOutputClaimable instance using the specified properties. + * @function create + * @memberof types.CounterpartyRevokedOutputClaimable + * @static + * @param {types.ICounterpartyRevokedOutputClaimable=} [properties] Properties to set + * @returns {types.CounterpartyRevokedOutputClaimable} CounterpartyRevokedOutputClaimable instance + */ + CounterpartyRevokedOutputClaimable.create = function create(properties) { + return new CounterpartyRevokedOutputClaimable(properties); + }; + + /** + * Encodes the specified CounterpartyRevokedOutputClaimable message. Does not implicitly {@link types.CounterpartyRevokedOutputClaimable.verify|verify} messages. + * @function encode + * @memberof types.CounterpartyRevokedOutputClaimable + * @static + * @param {types.ICounterpartyRevokedOutputClaimable} message CounterpartyRevokedOutputClaimable message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CounterpartyRevokedOutputClaimable.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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 = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amountSatoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amountSatoshis = options.longs === String ? "0" : 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); + }; + + /** + * Gets the default type url for CounterpartyRevokedOutputClaimable + * @function getTypeUrl + * @memberof types.CounterpartyRevokedOutputClaimable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CounterpartyRevokedOutputClaimable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.CounterpartyRevokedOutputClaimable"; + }; + + return CounterpartyRevokedOutputClaimable; + })(); + + types.PendingSweepBalance = (function() { + + /** + * Properties of a PendingSweepBalance. + * @memberof types + * @interface IPendingSweepBalance + * @property {types.IPendingBroadcast|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for PendingSweepBalance + * @function getTypeUrl + * @memberof types.PendingSweepBalance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingSweepBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.PendingSweepBalance"; + }; + + return PendingSweepBalance; + })(); + + types.PendingBroadcast = (function() { + + /** + * Properties of a PendingBroadcast. + * @memberof types + * @interface IPendingBroadcast + * @property {string|null} [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|null|undefined} channelId + * @memberof types.PendingBroadcast + * @instance + */ + PendingBroadcast.prototype.channelId = null; + + /** + * PendingBroadcast amountSatoshis. + * @member {number|Long} amountSatoshis + * @memberof types.PendingBroadcast + * @instance + */ + PendingBroadcast.prototype.amountSatoshis = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(PendingBroadcast.prototype, "_channelId", { + get: $util.oneOfGetter($oneOfFields = ["channelId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PendingBroadcast instance using the specified properties. + * @function create + * @memberof types.PendingBroadcast + * @static + * @param {types.IPendingBroadcast=} [properties] Properties to set + * @returns {types.PendingBroadcast} PendingBroadcast instance + */ + PendingBroadcast.create = function create(properties) { + return new PendingBroadcast(properties); + }; + + /** + * Encodes the specified PendingBroadcast message. Does not implicitly {@link types.PendingBroadcast.verify|verify} messages. + * @function encode + * @memberof types.PendingBroadcast + * @static + * @param {types.IPendingBroadcast} message PendingBroadcast message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PendingBroadcast.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + if (message.channelId != null && message.hasOwnProperty("channelId")) { + properties._channelId = 1; + 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) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amountSatoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amountSatoshis = options.longs === String ? "0" : 0; + if (message.channelId != null && message.hasOwnProperty("channelId")) { + object.channelId = message.channelId; + if (options.oneofs) + object._channelId = "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); + }; + + /** + * Gets the default type url for PendingBroadcast + * @function getTypeUrl + * @memberof types.PendingBroadcast + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PendingBroadcast.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.PendingBroadcast"; + }; + + return PendingBroadcast; + })(); + + types.BroadcastAwaitingConfirmation = (function() { + + /** + * Properties of a BroadcastAwaitingConfirmation. + * @memberof types + * @interface IBroadcastAwaitingConfirmation + * @property {string|null} [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|null|undefined} channelId + * @memberof types.BroadcastAwaitingConfirmation + * @instance + */ + BroadcastAwaitingConfirmation.prototype.channelId = null; + + /** + * 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 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BroadcastAwaitingConfirmation.prototype, "_channelId", { + get: $util.oneOfGetter($oneOfFields = ["channelId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BroadcastAwaitingConfirmation instance using the specified properties. + * @function create + * @memberof types.BroadcastAwaitingConfirmation + * @static + * @param {types.IBroadcastAwaitingConfirmation=} [properties] Properties to set + * @returns {types.BroadcastAwaitingConfirmation} BroadcastAwaitingConfirmation instance + */ + BroadcastAwaitingConfirmation.create = function create(properties) { + return new BroadcastAwaitingConfirmation(properties); + }; + + /** + * Encodes the specified BroadcastAwaitingConfirmation message. Does not implicitly {@link types.BroadcastAwaitingConfirmation.verify|verify} messages. + * @function encode + * @memberof types.BroadcastAwaitingConfirmation + * @static + * @param {types.IBroadcastAwaitingConfirmation} message BroadcastAwaitingConfirmation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BroadcastAwaitingConfirmation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + if (message.channelId != null && message.hasOwnProperty("channelId")) { + properties._channelId = 1; + 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.latestBroadcastHeight = 0; + object.latestSpendingTxid = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amountSatoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amountSatoshis = options.longs === String ? "0" : 0; + } + if (message.channelId != null && message.hasOwnProperty("channelId")) { + object.channelId = message.channelId; + if (options.oneofs) + object._channelId = "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); + }; + + /** + * Gets the default type url for BroadcastAwaitingConfirmation + * @function getTypeUrl + * @memberof types.BroadcastAwaitingConfirmation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BroadcastAwaitingConfirmation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.BroadcastAwaitingConfirmation"; + }; + + return BroadcastAwaitingConfirmation; + })(); + + types.AwaitingThresholdConfirmations = (function() { + + /** + * Properties of an AwaitingThresholdConfirmations. + * @memberof types + * @interface IAwaitingThresholdConfirmations + * @property {string|null} [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|null|undefined} channelId + * @memberof types.AwaitingThresholdConfirmations + * @instance + */ + AwaitingThresholdConfirmations.prototype.channelId = null; + + /** + * 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 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AwaitingThresholdConfirmations.prototype, "_channelId", { + get: $util.oneOfGetter($oneOfFields = ["channelId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AwaitingThresholdConfirmations instance using the specified properties. + * @function create + * @memberof types.AwaitingThresholdConfirmations + * @static + * @param {types.IAwaitingThresholdConfirmations=} [properties] Properties to set + * @returns {types.AwaitingThresholdConfirmations} AwaitingThresholdConfirmations instance + */ + AwaitingThresholdConfirmations.create = function create(properties) { + return new AwaitingThresholdConfirmations(properties); + }; + + /** + * Encodes the specified AwaitingThresholdConfirmations message. Does not implicitly {@link types.AwaitingThresholdConfirmations.verify|verify} messages. + * @function encode + * @memberof types.AwaitingThresholdConfirmations + * @static + * @param {types.IAwaitingThresholdConfirmations} message AwaitingThresholdConfirmations message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AwaitingThresholdConfirmations.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + if (message.channelId != null && message.hasOwnProperty("channelId")) { + properties._channelId = 1; + 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.latestSpendingTxid = ""; + object.confirmationHash = ""; + object.confirmationHeight = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amountSatoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amountSatoshis = options.longs === String ? "0" : 0; + } + if (message.channelId != null && message.hasOwnProperty("channelId")) { + object.channelId = message.channelId; + if (options.oneofs) + object._channelId = "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); + }; + + /** + * Gets the default type url for AwaitingThresholdConfirmations + * @function getTypeUrl + * @memberof types.AwaitingThresholdConfirmations + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AwaitingThresholdConfirmations.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.AwaitingThresholdConfirmations"; + }; + + return AwaitingThresholdConfirmations; + })(); + + types.PageToken = (function() { + + /** + * Properties of a PageToken. + * @memberof types + * @interface IPageToken + * @property {string|null} [token] PageToken token + * @property {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 = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new PageToken instance using the specified properties. + * @function create + * @memberof types.PageToken + * @static + * @param {types.IPageToken=} [properties] Properties to set + * @returns {types.PageToken} PageToken instance + */ + PageToken.create = function create(properties) { + return new PageToken(properties); + }; + + /** + * Encodes the specified PageToken message. Does not implicitly {@link types.PageToken.verify|verify} messages. + * @function encode + * @memberof types.PageToken + * @static + * @param {types.IPageToken} message PageToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageToken.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.index); + return writer; + }; + + /** + * Encodes the specified PageToken message, length delimited. Does not implicitly {@link types.PageToken.verify|verify} messages. + * @function encodeDelimited + * @memberof types.PageToken + * @static + * @param {types.IPageToken} message PageToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PageToken.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PageToken message from the specified reader or buffer. + * @function decode + * @memberof types.PageToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.PageToken} PageToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PageToken.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.token = reader.string(); + break; + } + case 2: { + message.index = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + 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 = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.index = options.longs === String ? "0" : 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); + }; + + /** + * Gets the default type url for PageToken + * @function getTypeUrl + * @memberof types.PageToken + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PageToken.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.PageToken"; + }; + + return PageToken; + })(); + + types.Bolt11InvoiceDescription = (function() { + + /** + * Properties of a Bolt11InvoiceDescription. + * @memberof types + * @interface IBolt11InvoiceDescription + * @property {string|null} [direct] Bolt11InvoiceDescription direct + * @property {string|null} [hash] Bolt11InvoiceDescription hash + */ + + /** + * Constructs a new Bolt11InvoiceDescription. + * @memberof types + * @classdesc Represents a Bolt11InvoiceDescription. + * @implements IBolt11InvoiceDescription + * @constructor + * @param {types.IBolt11InvoiceDescription=} [properties] Properties to set + */ + function Bolt11InvoiceDescription(properties) { + if (properties) + for (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|null|undefined} direct + * @memberof types.Bolt11InvoiceDescription + * @instance + */ + Bolt11InvoiceDescription.prototype.direct = null; + + /** + * Bolt11InvoiceDescription hash. + * @member {string|null|undefined} hash + * @memberof types.Bolt11InvoiceDescription + * @instance + */ + Bolt11InvoiceDescription.prototype.hash = null; + + // OneOf field names bound to virtual getters and setters + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.direct = reader.string(); + break; + } + case 2: { + message.hash = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + 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); + }; + + /** + * Gets the default type url for Bolt11InvoiceDescription + * @function getTypeUrl + * @memberof types.Bolt11InvoiceDescription + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11InvoiceDescription.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Bolt11InvoiceDescription"; + }; + + return Bolt11InvoiceDescription; + })(); + + types.RouteParametersConfig = (function() { + + /** + * Properties of a RouteParametersConfig. + * @memberof types + * @interface IRouteParametersConfig + * @property {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|null|undefined} maxTotalRoutingFeeMsat + * @memberof types.RouteParametersConfig + * @instance + */ + RouteParametersConfig.prototype.maxTotalRoutingFeeMsat = null; + + /** + * 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; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RouteParametersConfig.prototype, "_maxTotalRoutingFeeMsat", { + get: $util.oneOfGetter($oneOfFields = ["maxTotalRoutingFeeMsat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouteParametersConfig instance using the specified properties. + * @function create + * @memberof types.RouteParametersConfig + * @static + * @param {types.IRouteParametersConfig=} [properties] Properties to set + * @returns {types.RouteParametersConfig} RouteParametersConfig instance + */ + RouteParametersConfig.create = function create(properties) { + return new RouteParametersConfig(properties); + }; + + /** + * Encodes the specified RouteParametersConfig message. Does not implicitly {@link types.RouteParametersConfig.verify|verify} messages. + * @function encode + * @memberof types.RouteParametersConfig + * @static + * @param {types.IRouteParametersConfig} message RouteParametersConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteParametersConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + if (message.maxTotalRoutingFeeMsat != null && message.hasOwnProperty("maxTotalRoutingFeeMsat")) { + properties._maxTotalRoutingFeeMsat = 1; + 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.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 (options.oneofs) + object._maxTotalRoutingFeeMsat = "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); + }; + + /** + * Gets the default type url for RouteParametersConfig + * @function getTypeUrl + * @memberof types.RouteParametersConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteParametersConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.RouteParametersConfig"; + }; + + return RouteParametersConfig; + })(); + + types.GraphRoutingFees = (function() { + + /** + * Properties of a GraphRoutingFees. + * @memberof types + * @interface IGraphRoutingFees + * @property {number|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for GraphRoutingFees + * @function getTypeUrl + * @memberof types.GraphRoutingFees + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphRoutingFees.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.GraphRoutingFees"; + }; + + return GraphRoutingFees; + })(); + + types.GraphChannelUpdate = (function() { + + /** + * Properties of a GraphChannelUpdate. + * @memberof types + * @interface IGraphChannelUpdate + * @property {number|null} [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 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GraphChannelUpdate htlcMaximumMsat. + * @member {number|Long} htlcMaximumMsat + * @memberof types.GraphChannelUpdate + * @instance + */ + GraphChannelUpdate.prototype.htlcMaximumMsat = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * GraphChannelUpdate fees. + * @member {types.IGraphRoutingFees|null|undefined} fees + * @memberof types.GraphChannelUpdate + * @instance + */ + GraphChannelUpdate.prototype.fees = null; + + /** + * Creates a new GraphChannelUpdate instance using the specified properties. + * @function create + * @memberof types.GraphChannelUpdate + * @static + * @param {types.IGraphChannelUpdate=} [properties] Properties to set + * @returns {types.GraphChannelUpdate} GraphChannelUpdate instance + */ + GraphChannelUpdate.create = function create(properties) { + return new GraphChannelUpdate(properties); + }; + + /** + * Encodes the specified GraphChannelUpdate message. Does not implicitly {@link types.GraphChannelUpdate.verify|verify} messages. + * @function encode + * @memberof types.GraphChannelUpdate + * @static + * @param {types.IGraphChannelUpdate} message GraphChannelUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphChannelUpdate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.htlcMinimumMsat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.htlcMinimumMsat = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.htlcMaximumMsat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.htlcMaximumMsat = options.longs === String ? "0" : 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); + }; + + /** + * Gets the default type url for GraphChannelUpdate + * @function getTypeUrl + * @memberof types.GraphChannelUpdate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphChannelUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.GraphChannelUpdate"; + }; + + return GraphChannelUpdate; + })(); + + types.GraphChannel = (function() { + + /** + * Properties of a GraphChannel. + * @memberof types + * @interface IGraphChannel + * @property {string|null} [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|null|undefined} capacitySats + * @memberof types.GraphChannel + * @instance + */ + GraphChannel.prototype.capacitySats = null; + + /** + * 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; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GraphChannel.prototype, "_capacitySats", { + get: $util.oneOfGetter($oneOfFields = ["capacitySats"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GraphChannel instance using the specified properties. + * @function create + * @memberof types.GraphChannel + * @static + * @param {types.IGraphChannel=} [properties] Properties to set + * @returns {types.GraphChannel} GraphChannel instance + */ + GraphChannel.create = function create(properties) { + return new GraphChannel(properties); + }; + + /** + * Encodes the specified GraphChannel message. Does not implicitly {@link types.GraphChannel.verify|verify} messages. + * @function encode + * @memberof types.GraphChannel + * @static + * @param {types.IGraphChannel} message GraphChannel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GraphChannel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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"; + var properties = {}; + 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")) { + properties._capacitySats = 1; + 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.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 (options.oneofs) + object._capacitySats = "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); + }; + + /** + * Gets the default type url for GraphChannel + * @function getTypeUrl + * @memberof types.GraphChannel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphChannel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.GraphChannel"; + }; + + return GraphChannel; + })(); + + types.GraphNodeAnnouncement = (function() { + + /** + * Properties of a GraphNodeAnnouncement. + * @memberof types + * @interface IGraphNodeAnnouncement + * @property {number|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for GraphNodeAnnouncement + * @function getTypeUrl + * @memberof types.GraphNodeAnnouncement + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphNodeAnnouncement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.GraphNodeAnnouncement"; + }; + + return GraphNodeAnnouncement; + })(); + + types.Peer = (function() { + + /** + * Properties of a Peer. + * @memberof types + * @interface IPeer + * @property {string|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Peer + * @function getTypeUrl + * @memberof types.Peer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Peer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Peer"; + }; + + return Peer; + })(); + + types.GraphNode = (function() { + + /** + * Properties of a GraphNode. + * @memberof types + * @interface IGraphNode + * @property {Array.|null} [channels] GraphNode channels + * @property {types.IGraphNodeAnnouncement|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for GraphNode + * @function getTypeUrl + * @memberof types.GraphNode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GraphNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.GraphNode"; + }; + + return GraphNode; + })(); + + types.Bolt11RouteHint = (function() { + + /** + * Properties of a Bolt11RouteHint. + * @memberof types + * @interface IBolt11RouteHint + * @property {Array.|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Bolt11RouteHint + * @function getTypeUrl + * @memberof types.Bolt11RouteHint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11RouteHint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Bolt11RouteHint"; + }; + + return Bolt11RouteHint; + })(); + + types.Bolt11HopHint = (function() { + + /** + * Properties of a Bolt11HopHint. + * @memberof types + * @interface IBolt11HopHint + * @property {string|null} [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 = $util.Long ? $util.Long.fromBits(0,0,true) : 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, error) { + 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(); + if (tag === error) + break; + 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 = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.shortChannelId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.shortChannelId = options.longs === String ? "0" : 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); + }; + + /** + * Gets the default type url for Bolt11HopHint + * @function getTypeUrl + * @memberof types.Bolt11HopHint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11HopHint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Bolt11HopHint"; + }; + + return Bolt11HopHint; + })(); + + types.OfferAmount = (function() { + + /** + * Properties of an OfferAmount. + * @memberof types + * @interface IOfferAmount + * @property {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|null|undefined} bitcoinAmountMsats + * @memberof types.OfferAmount + * @instance + */ + OfferAmount.prototype.bitcoinAmountMsats = null; + + /** + * 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for OfferAmount + * @function getTypeUrl + * @memberof types.OfferAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OfferAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.OfferAmount"; + }; + + return OfferAmount; + })(); + + types.CurrencyAmount = (function() { + + /** + * Properties of a CurrencyAmount. + * @memberof types + * @interface ICurrencyAmount + * @property {string|null} [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 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new CurrencyAmount instance using the specified properties. + * @function create + * @memberof types.CurrencyAmount + * @static + * @param {types.ICurrencyAmount=} [properties] Properties to set + * @returns {types.CurrencyAmount} CurrencyAmount instance + */ + CurrencyAmount.create = function create(properties) { + return new CurrencyAmount(properties); + }; + + /** + * Encodes the specified CurrencyAmount message. Does not implicitly {@link types.CurrencyAmount.verify|verify} messages. + * @function encode + * @memberof types.CurrencyAmount + * @static + * @param {types.ICurrencyAmount} message CurrencyAmount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrencyAmount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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, error) { + 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(); + if (tag === error) + break; + 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 = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount = options.longs === String ? "0" : 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); + }; + + /** + * Gets the default type url for CurrencyAmount + * @function getTypeUrl + * @memberof types.CurrencyAmount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrencyAmount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.CurrencyAmount"; + }; + + return CurrencyAmount; + })(); + + types.OfferQuantity = (function() { + + /** + * Properties of an OfferQuantity. + * @memberof types + * @interface IOfferQuantity + * @property {boolean|null} [one] OfferQuantity one + * @property {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|null|undefined} one + * @memberof types.OfferQuantity + * @instance + */ + OfferQuantity.prototype.one = null; + + /** + * OfferQuantity bounded. + * @member {number|Long|null|undefined} bounded + * @memberof types.OfferQuantity + * @instance + */ + OfferQuantity.prototype.bounded = null; + + /** + * OfferQuantity unbounded. + * @member {boolean|null|undefined} unbounded + * @memberof types.OfferQuantity + * @instance + */ + OfferQuantity.prototype.unbounded = null; + + // OneOf field names bound to virtual getters and setters + 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, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.one = reader.bool(); + break; + } + case 2: { + message.bounded = reader.uint64(); + break; + } + case 3: { + message.unbounded = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + 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); + }; + + /** + * Gets the default type url for OfferQuantity + * @function getTypeUrl + * @memberof types.OfferQuantity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OfferQuantity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.OfferQuantity"; + }; + + return OfferQuantity; + })(); + + types.BlindedPath = (function() { + + /** + * Properties of a BlindedPath. + * @memberof types + * @interface IBlindedPath + * @property {string|null} [introductionNodeId] BlindedPath introductionNodeId + * @property {string|null} [blindingPoint] BlindedPath blindingPoint + * @property {number|null} [numHops] BlindedPath numHops + * @property {number|Long|null} [introductionScid] BlindedPath introductionScid + */ + + /** + * 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 introductionNodeId. + * @member {string|null|undefined} introductionNodeId + * @memberof types.BlindedPath + * @instance + */ + BlindedPath.prototype.introductionNodeId = 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; + + /** + * BlindedPath introductionScid. + * @member {number|Long|null|undefined} introductionScid + * @memberof types.BlindedPath + * @instance + */ + BlindedPath.prototype.introductionScid = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BlindedPath.prototype, "_introductionNodeId", { + get: $util.oneOfGetter($oneOfFields = ["introductionNodeId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BlindedPath.prototype, "_introductionScid", { + get: $util.oneOfGetter($oneOfFields = ["introductionScid"]), + 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.introductionNodeId != null && Object.hasOwnProperty.call(message, "introductionNodeId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.introductionNodeId); + if (message.blindingPoint != null && Object.hasOwnProperty.call(message, "blindingPoint")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.blindingPoint); + if (message.numHops != null && Object.hasOwnProperty.call(message, "numHops")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.numHops); + if (message.introductionScid != null && Object.hasOwnProperty.call(message, "introductionScid")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.introductionScid); + return writer; + }; + + /** + * Encodes the specified BlindedPath message, length delimited. Does not implicitly {@link types.BlindedPath.verify|verify} messages. + * @function encodeDelimited + * @memberof types.BlindedPath + * @static + * @param {types.IBlindedPath} message BlindedPath message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BlindedPath.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BlindedPath message from the specified reader or buffer. + * @function decode + * @memberof types.BlindedPath + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {types.BlindedPath} BlindedPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BlindedPath.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.introductionNodeId = reader.string(); + break; + } + case 2: { + message.blindingPoint = reader.string(); + break; + } + case 3: { + message.numHops = reader.uint32(); + break; + } + case 4: { + message.introductionScid = reader.uint64(); + 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.introductionNodeId != null && message.hasOwnProperty("introductionNodeId")) { + properties._introductionNodeId = 1; + if (!$util.isString(message.introductionNodeId)) + return "introductionNodeId: string expected"; + } + 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"; + if (message.introductionScid != null && message.hasOwnProperty("introductionScid")) { + properties._introductionScid = 1; + if (!$util.isInteger(message.introductionScid) && !(message.introductionScid && $util.isInteger(message.introductionScid.low) && $util.isInteger(message.introductionScid.high))) + return "introductionScid: integer|Long 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.introductionNodeId != null) + message.introductionNodeId = String(object.introductionNodeId); + if (object.blindingPoint != null) + message.blindingPoint = String(object.blindingPoint); + if (object.numHops != null) + message.numHops = object.numHops >>> 0; + if (object.introductionScid != null) + if ($util.Long) + (message.introductionScid = $util.Long.fromValue(object.introductionScid)).unsigned = true; + else if (typeof object.introductionScid === "string") + message.introductionScid = parseInt(object.introductionScid, 10); + else if (typeof object.introductionScid === "number") + message.introductionScid = object.introductionScid; + else if (typeof object.introductionScid === "object") + message.introductionScid = new $util.LongBits(object.introductionScid.low >>> 0, object.introductionScid.high >>> 0).toNumber(true); + 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.introductionNodeId != null && message.hasOwnProperty("introductionNodeId")) { + object.introductionNodeId = message.introductionNodeId; + if (options.oneofs) + object._introductionNodeId = "introductionNodeId"; + } + if (message.blindingPoint != null && message.hasOwnProperty("blindingPoint")) + object.blindingPoint = message.blindingPoint; + if (message.numHops != null && message.hasOwnProperty("numHops")) + object.numHops = message.numHops; + if (message.introductionScid != null && message.hasOwnProperty("introductionScid")) { + if (typeof message.introductionScid === "number") + object.introductionScid = options.longs === String ? String(message.introductionScid) : message.introductionScid; + else + object.introductionScid = options.longs === String ? $util.Long.prototype.toString.call(message.introductionScid) : options.longs === Number ? new $util.LongBits(message.introductionScid.low >>> 0, message.introductionScid.high >>> 0).toNumber(true) : message.introductionScid; + if (options.oneofs) + object._introductionScid = "introductionScid"; + } + return object; + }; + + /** + * Converts this BlindedPath to JSON. + * @function toJSON + * @memberof types.BlindedPath + * @instance + * @returns {Object.} JSON object + */ + BlindedPath.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BlindedPath + * @function getTypeUrl + * @memberof types.BlindedPath + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BlindedPath.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.BlindedPath"; + }; + + return BlindedPath; + })(); + + types.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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for Bolt11Feature + * @function getTypeUrl + * @memberof types.Bolt11Feature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Bolt11Feature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/types.Bolt11Feature"; + }; + + return Bolt11Feature; + })(); + + return types; +})(); + +$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, error) { + 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(); + if (tag === error) + break; + 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) { + default: + if (typeof object.errorCode === "number") { + message.errorCode = object.errorCode; + break; + } + break; + 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] === undefined ? message.errorCode : $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); + }; + + /** + * Gets the default type url for ErrorResponse + * @function getTypeUrl + * @memberof error.ErrorResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ErrorResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/error.ErrorResponse"; + }; + + return ErrorResponse; + })(); + + /** + * ErrorCode enum. + * @name error.ErrorCode + * @enum {number} + * @property {number} UNKNOWN_ERROR=0 UNKNOWN_ERROR value + * @property {number} INVALID_REQUEST_ERROR=1 INVALID_REQUEST_ERROR value + * @property {number} AUTH_ERROR=2 AUTH_ERROR value + * @property {number} LIGHTNING_ERROR=3 LIGHTNING_ERROR value + * @property {number} INTERNAL_SERVER_ERROR=4 INTERNAL_SERVER_ERROR value + */ + error.ErrorCode = (function() { + 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; +})(); + +$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 + */ + + /** + * 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; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EventEnvelope event. + * @member {"paymentReceived"|"paymentSuccessful"|"paymentFailed"|"paymentForwarded"|"paymentClaimable"|undefined} event + * @memberof events.EventEnvelope + * @instance + */ + Object.defineProperty(EventEnvelope.prototype, "event", { + get: $util.oneOfGetter($oneOfFields = ["paymentReceived", "paymentSuccessful", "paymentFailed", "paymentForwarded", "paymentClaimable"]), + 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(); + return writer; + }; + + /** + * Encodes the specified EventEnvelope message, length delimited. Does not implicitly {@link events.EventEnvelope.verify|verify} messages. + * @function encodeDelimited + * @memberof events.EventEnvelope + * @static + * @param {events.IEventEnvelope} message EventEnvelope message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventEnvelope.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventEnvelope message from the specified reader or buffer. + * @function decode + * @memberof events.EventEnvelope + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {events.EventEnvelope} EventEnvelope + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventEnvelope.decode = function decode(reader, length, error) { + 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(); + if (tag === error) + break; + 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; + } + 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; + } + } + 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); + } + 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"; + } + return object; + }; + + /** + * Converts this EventEnvelope to JSON. + * @function toJSON + * @memberof events.EventEnvelope + * @instance + * @returns {Object.} JSON object + */ + EventEnvelope.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EventEnvelope + * @function getTypeUrl + * @memberof events.EventEnvelope + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EventEnvelope.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.EventEnvelope"; + }; + + return EventEnvelope; + })(); + + 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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for PaymentReceived + * @function getTypeUrl + * @memberof events.PaymentReceived + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PaymentReceived.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.PaymentReceived"; + }; + + return PaymentReceived; + })(); + + events.PaymentSuccessful = (function() { + + /** + * Properties of a PaymentSuccessful. + * @memberof events + * @interface IPaymentSuccessful + * @property {types.IPayment|null} [payment] PaymentSuccessful payment + */ + + /** + * Constructs a new PaymentSuccessful. + * @memberof events + * @classdesc Represents a PaymentSuccessful. + * @implements IPaymentSuccessful + * @constructor + * @param {events.IPaymentSuccessful=} [properties] Properties to set + */ + function PaymentSuccessful(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for PaymentSuccessful + * @function getTypeUrl + * @memberof events.PaymentSuccessful + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PaymentSuccessful.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.PaymentSuccessful"; + }; + + return PaymentSuccessful; + })(); + + events.PaymentFailed = (function() { + + /** + * Properties of a PaymentFailed. + * @memberof events + * @interface IPaymentFailed + * @property {types.IPayment|null} [payment] PaymentFailed payment + */ + + /** + * Constructs a new PaymentFailed. + * @memberof events + * @classdesc Represents a PaymentFailed. + * @implements IPaymentFailed + * @constructor + * @param {events.IPaymentFailed=} [properties] Properties to set + */ + function PaymentFailed(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for PaymentFailed + * @function getTypeUrl + * @memberof events.PaymentFailed + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PaymentFailed.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.PaymentFailed"; + }; + + return PaymentFailed; + })(); + + events.PaymentClaimable = (function() { + + /** + * Properties of a PaymentClaimable. + * @memberof events + * @interface IPaymentClaimable + * @property {types.IPayment|null} [payment] PaymentClaimable payment + */ + + /** + * Constructs a new PaymentClaimable. + * @memberof events + * @classdesc Represents a PaymentClaimable. + * @implements IPaymentClaimable + * @constructor + * @param {events.IPaymentClaimable=} [properties] Properties to set + */ + function PaymentClaimable(properties) { + if (properties) + for (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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for PaymentClaimable + * @function getTypeUrl + * @memberof events.PaymentClaimable + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PaymentClaimable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.PaymentClaimable"; + }; + + return PaymentClaimable; + })(); + + events.PaymentForwarded = (function() { + + /** + * Properties of a PaymentForwarded. + * @memberof events + * @interface IPaymentForwarded + * @property {types.IForwardedPayment|null} [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, error) { + 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(); + if (tag === error) + break; + 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); + }; + + /** + * Gets the default type url for PaymentForwarded + * @function getTypeUrl + * @memberof events.PaymentForwarded + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PaymentForwarded.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/events.PaymentForwarded"; + }; + + return PaymentForwarded; + })(); + + return events; +})(); + +module.exports = $root; diff --git a/src/server/modules/node/lightning.types.ts b/src/server/modules/node/lightning.types.ts index e4fe95ee9..51b93a725 100644 --- a/src/server/modules/node/lightning.types.ts +++ b/src/server/modules/node/lightning.types.ts @@ -4,6 +4,7 @@ import EventEmitter from 'events'; export const NodeType = { LND: 'lnd', + LDK_SERVER: 'ldk-server', } as const; export type NodeType = (typeof NodeType)[keyof typeof NodeType]; @@ -257,5 +258,6 @@ export interface LightningProvider { cert?: string; macaroon?: string; authToken?: string; + tlsCertPath?: string; }): any; } diff --git a/src/server/modules/node/provider-registry.module.ts b/src/server/modules/node/provider-registry.module.ts index 9f320f963..7e23500c4 100644 --- a/src/server/modules/node/provider-registry.module.ts +++ b/src/server/modules/node/provider-registry.module.ts @@ -1,9 +1,10 @@ import { Module } from '@nestjs/common'; import { LndModule } from './lnd/lnd.module'; +import { LdkServerModule } from './ldk-server/ldk-server.module'; import { ProviderRegistryService } from './provider-registry.service'; @Module({ - imports: [LndModule], + imports: [LndModule, 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 2191f78b7..bfc12472f 100644 --- a/src/server/modules/node/provider-registry.service.ts +++ b/src/server/modules/node/provider-registry.service.ts @@ -1,13 +1,18 @@ import { Injectable } from '@nestjs/common'; import { LightningProvider, NodeType } from './lightning.types'; import { LndService } from './lnd/lnd.service'; +import { LdkServerService } from './ldk-server/ldk-server.service'; @Injectable() export class ProviderRegistryService { private providers = new Map(); - constructor(lndService: LndService) { + constructor( + lndService: LndService, + ldkServerService: LdkServerService + ) { this.providers.set(NodeType.LND, lndService); + 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 c0127c3fe..fc3ad7e82 100644 --- a/src/server/modules/sub/sub.service.ts +++ b/src/server/modules/sub/sub.service.ts @@ -17,6 +17,10 @@ import { UserConfigService } from '../api/userConfig/userConfig.service'; import { getNetwork } from 'src/server/utils/network'; import { AmbossService } from '../api/amboss/amboss.service'; import { NodeType } from '../node/lightning.types'; +import { + LdkServerRabbitMqConsumer, + createLdkServerRabbitMqConsumer, +} from '../node/ldk-server/ldk-server.rabbitmq'; const restartSubscriptionTimeMs = 1000 * 30; @@ -30,6 +34,7 @@ type SubscriptionNode = { @Injectable() export class SubService implements OnApplicationBootstrap { subscriptions = []; + ldkConsumers: LdkServerRabbitMqConsumer[] = []; retryCount = 0; constructor( @@ -50,6 +55,54 @@ export class SubService implements OnApplicationBootstrap { } this.startSubscription(); + this.startLdkServerSubscriptions(); + } + + async startLdkServerSubscriptions() { + const accounts = this.accountsService.getAllAccounts(); + + for (const key in accounts) { + if (!accounts.hasOwnProperty(key)) continue; + + const account = accounts[key]; + if ( + account.type !== NodeType.LDK_SERVER || + account.encrypted || + !account.rabbitmqUrl + ) { + 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})`; + + this.logger.info( + `Starting RabbitMQ subscription for ldk-server node: ${name}` + ); + + const consumer = createLdkServerRabbitMqConsumer({ + rabbitmqUrl: account.rabbitmqUrl, + exchangeName: account.rabbitmqExchangeName || 'ldk_events', + accountId: account.hash, + sseService: this.sseService, + logger: this.logger, + }); + + await consumer.start(); + this.ldkConsumers.push(consumer); + + this.logger.info( + `RabbitMQ subscription active for ldk-server node: ${name}` + ); + } catch (err) { + this.logger.error( + `Failed to start RabbitMQ subscription for ldk-server account ${account.name}`, + { err } + ); + } + } } async startSubscription() {