From 059035a9c2b3ee964d3e948001876471c5d33069 Mon Sep 17 00:00:00 2001 From: rsercano Date: Wed, 24 Jul 2019 14:30:33 +0200 Subject: [PATCH] initial commit for #1067 --- docs/api.md | 20 ++- lib/cli/commands/listcurrencies.ts | 46 ++++++ lib/grpc/GrpcService.ts | 11 +- lib/orderbook/OrderBook.ts | 2 +- lib/proto/xudrpc.swagger.json | 70 +++++---- lib/proto/xudrpc_pb.d.ts | 37 ++++- lib/proto/xudrpc_pb.js | 226 +++++++++++++++++++++++++++-- lib/service/Service.ts | 2 +- proto/xudrpc.proto | 15 +- 9 files changed, 379 insertions(+), 50 deletions(-) create mode 100644 lib/cli/commands/listcurrencies.ts diff --git a/docs/api.md b/docs/api.md index 92edf033a..16fc262e1 100644 --- a/docs/api.md +++ b/docs/api.md @@ -19,6 +19,7 @@ - [ConnectResponse](#xudrpc.ConnectResponse) - [CreateNodeRequest](#xudrpc.CreateNodeRequest) - [CreateNodeResponse](#xudrpc.CreateNodeResponse) + - [Currency](#xudrpc.Currency) - [DiscoverNodesRequest](#xudrpc.DiscoverNodesRequest) - [DiscoverNodesResponse](#xudrpc.DiscoverNodesResponse) - [ExecuteSwapRequest](#xudrpc.ExecuteSwapRequest) @@ -300,6 +301,23 @@ + + +### Currency + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ticker_symbol | [string](#string) | | Ticker symbol of this currency (e.g. BTC) | +| digits | [uint64](#uint64) | | The places to the right of the decimal point of the smallest subunit (e.g. 8, 18) | +| global_identifier | [string](#string) | | Global identifier of this currency | + + + + + + ### DiscoverNodesRequest @@ -445,7 +463,7 @@ | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| currencies | [string](#string) | repeated | A list of ticker symbols of the supported currencies. | +| currencies | [Currency](#xudrpc.Currency) | repeated | The list of available currencies in orderbook. | diff --git a/lib/cli/commands/listcurrencies.ts b/lib/cli/commands/listcurrencies.ts new file mode 100644 index 000000000..341a17ffe --- /dev/null +++ b/lib/cli/commands/listcurrencies.ts @@ -0,0 +1,46 @@ +import { callback, loadXudClient } from '../command'; +import { Arguments } from 'yargs'; +import colors from 'colors/safe'; +import Table, { HorizontalTable } from 'cli-table3'; +import { ListCurrenciesRequest, ListCurrenciesResponse } from '../../proto/xudrpc_pb'; + +const HEADERS = [ + colors.blue('Ticker'), + colors.blue('Digits'), + colors.blue('Global Identifier'), +]; + +const formatCurrencies = (currencies: ListCurrenciesResponse.AsObject) => { + const formatted: any[] = []; + currencies.currenciesList.forEach((currency) => { + const element = []; + element.push(currency.tickerSymbol, currency.digits, currency.globalIdentifier); + formatted.push(element); + }); + return formatted; +}; + +const createTable = () => { + const table = new Table({ + head: HEADERS, + }) as HorizontalTable; + return table; +}; + +const displayTable = (response: ListCurrenciesResponse.AsObject) => { + const table = createTable(); + + formatCurrencies(response).forEach((currency) => { + table.push(currency); + }); + console.log(colors.underline(colors.bold('\nCurrencies:'))); + console.log(table.toString()); +}; + +export const command = 'listcurrencies'; + +export const describe = 'list available currencies'; + +export const handler = (argv: Arguments) => { + loadXudClient(argv).listCurrencies(new ListCurrenciesRequest(), callback(argv, displayTable)); +}; diff --git a/lib/grpc/GrpcService.ts b/lib/grpc/GrpcService.ts index 5a4aac43d..e75988a27 100644 --- a/lib/grpc/GrpcService.ts +++ b/lib/grpc/GrpcService.ts @@ -471,9 +471,16 @@ class GrpcService { */ public listCurrencies: grpc.handleUnaryCall = (_, callback) => { try { - const listCurrenciesResponse = this.service.listCurrencies(); + const currencies = this.service.listCurrencies(); const response = new xudrpc.ListCurrenciesResponse(); - response.setCurrenciesList(listCurrenciesResponse); + + currencies.forEach((currency) => { + const resultCurrency = new xudrpc.Currency(); + resultCurrency.setDigits(currency.decimalPlaces); + resultCurrency.setTickerSymbol(currency.id); + resultCurrency.setGlobalIdentifier('TODO'); + response.getCurrenciesList().push(resultCurrency); + }); callback(null, response); } catch (err) { diff --git a/lib/orderbook/OrderBook.ts b/lib/orderbook/OrderBook.ts index 850301d0f..ab1f38525 100644 --- a/lib/orderbook/OrderBook.ts +++ b/lib/orderbook/OrderBook.ts @@ -89,7 +89,7 @@ class OrderBook extends EventEmitter { } public get currencies() { - return this.currencyInstances.keys(); + return this.currencyInstances; } constructor({ logger, models, thresholds, pool, swaps, nosanityswaps, nobalancechecks, nomatching = false }: diff --git a/lib/proto/xudrpc.swagger.json b/lib/proto/xudrpc.swagger.json index a527d8b01..620b5fc3d 100644 --- a/lib/proto/xudrpc.swagger.json +++ b/lib/proto/xudrpc.swagger.json @@ -21,7 +21,7 @@ "operationId": "AddCurrency", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcAddCurrencyResponse" } @@ -48,7 +48,7 @@ "operationId": "AddPair", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcAddPairResponse" } @@ -75,7 +75,7 @@ "operationId": "Ban", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcBanResponse" } @@ -102,7 +102,7 @@ "operationId": "ChannelBalance", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcChannelBalanceResponse" } @@ -128,7 +128,7 @@ "operationId": "Connect", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcConnectResponse" } @@ -155,7 +155,7 @@ "operationId": "ListCurrencies", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcListCurrenciesResponse" } @@ -172,7 +172,7 @@ "operationId": "DiscoverNodes", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcDiscoverNodesResponse" } @@ -199,7 +199,7 @@ "operationId": "ExecuteSwap", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcSwapSuccess" } @@ -226,7 +226,7 @@ "operationId": "GetInfo", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcGetInfoResponse" } @@ -243,7 +243,7 @@ "operationId": "GetNodeInfo", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcGetNodeInfoResponse" } @@ -269,7 +269,7 @@ "operationId": "OpenChannel", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcOpenChannelResponse" } @@ -286,7 +286,7 @@ "operationId": "ListOrders", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcListOrdersResponse" } @@ -328,7 +328,7 @@ "operationId": "ListPairs", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcListPairsResponse" } @@ -345,7 +345,7 @@ "operationId": "ListPeers", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcListPeersResponse" } @@ -362,7 +362,7 @@ "operationId": "PlaceOrder", "responses": { "200": { - "description": "(streaming responses)", + "description": "A successful response.(streaming responses)", "schema": { "$ref": "#/definitions/xudrpcPlaceOrderEvent" } @@ -389,7 +389,7 @@ "operationId": "PlaceOrderSync", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcPlaceOrderResponse" } @@ -416,7 +416,7 @@ "operationId": "RemoveCurrency", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcRemoveCurrencyResponse" } @@ -443,7 +443,7 @@ "operationId": "RemoveOrder", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcRemoveOrderResponse" } @@ -470,7 +470,7 @@ "operationId": "RemovePair", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcRemovePairResponse" } @@ -497,7 +497,7 @@ "operationId": "Shutdown", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcShutdownResponse" } @@ -524,7 +524,7 @@ "operationId": "SubscribeOrders", "responses": { "200": { - "description": "(streaming responses)", + "description": "A successful response.(streaming responses)", "schema": { "$ref": "#/definitions/xudrpcOrderUpdate" } @@ -551,7 +551,7 @@ "operationId": "SubscribeSwapFailures", "responses": { "200": { - "description": "(streaming responses)", + "description": "A successful response.(streaming responses)", "schema": { "$ref": "#/definitions/xudrpcSwapFailure" } @@ -578,7 +578,7 @@ "operationId": "SubscribeSwaps", "responses": { "200": { - "description": "(streaming responses)", + "description": "A successful response.(streaming responses)", "schema": { "$ref": "#/definitions/xudrpcSwapSuccess" } @@ -605,7 +605,7 @@ "operationId": "Unban", "responses": { "200": { - "description": "", + "description": "A successful response.", "schema": { "$ref": "#/definitions/xudrpcUnbanResponse" } @@ -760,6 +760,24 @@ } } }, + "xudrpcCurrency": { + "type": "object", + "properties": { + "ticker_symbol": { + "type": "string", + "title": "Ticker symbol of this currency (e.g. BTC)" + }, + "digits": { + "type": "string", + "format": "uint64", + "title": "The places to the right of the decimal point of the smallest subunit (e.g. 8, 18)" + }, + "global_identifier": { + "type": "string", + "title": "Global identifier of this currency" + } + } + }, "xudrpcDiscoverNodesRequest": { "type": "object", "properties": { @@ -864,9 +882,9 @@ "currencies": { "type": "array", "items": { - "type": "string" + "$ref": "#/definitions/xudrpcCurrency" }, - "description": "A list of ticker symbols of the supported currencies." + "description": "The list of available currencies in orderbook." } } }, diff --git a/lib/proto/xudrpc_pb.d.ts b/lib/proto/xudrpc_pb.d.ts index 7d58e1a3f..7e7ddf62e 100644 --- a/lib/proto/xudrpc_pb.d.ts +++ b/lib/proto/xudrpc_pb.d.ts @@ -665,9 +665,9 @@ export namespace ListCurrenciesRequest { export class ListCurrenciesResponse extends jspb.Message { clearCurrenciesList(): void; - getCurrenciesList(): Array; - setCurrenciesList(value: Array): void; - addCurrencies(value: string, index?: number): string; + getCurrenciesList(): Array; + setCurrenciesList(value: Array): void; + addCurrencies(value?: Currency, index?: number): Currency; serializeBinary(): Uint8Array; @@ -682,7 +682,7 @@ export class ListCurrenciesResponse extends jspb.Message { export namespace ListCurrenciesResponse { export type AsObject = { - currenciesList: Array, + currenciesList: Array, } } @@ -922,6 +922,35 @@ export namespace Order { } +export class Currency extends jspb.Message { + getTickerSymbol(): string; + setTickerSymbol(value: string): void; + + getDigits(): number; + setDigits(value: number): void; + + getGlobalIdentifier(): string; + setGlobalIdentifier(value: string): void; + + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Currency.AsObject; + static toObject(includeInstance: boolean, msg: Currency): Currency.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Currency, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Currency; + static deserializeBinaryFromReader(message: Currency, reader: jspb.BinaryReader): Currency; +} + +export namespace Currency { + export type AsObject = { + tickerSymbol: string, + digits: number, + globalIdentifier: string, + } +} + export class OrderUpdate extends jspb.Message { hasOrder(): boolean; diff --git a/lib/proto/xudrpc_pb.js b/lib/proto/xudrpc_pb.js index ce5ca90be..d0e133b78 100644 --- a/lib/proto/xudrpc_pb.js +++ b/lib/proto/xudrpc_pb.js @@ -27,6 +27,7 @@ goog.exportSymbol('proto.xudrpc.ConnectRequest', null, global); goog.exportSymbol('proto.xudrpc.ConnectResponse', null, global); goog.exportSymbol('proto.xudrpc.CreateNodeRequest', null, global); goog.exportSymbol('proto.xudrpc.CreateNodeResponse', null, global); +goog.exportSymbol('proto.xudrpc.Currency', null, global); goog.exportSymbol('proto.xudrpc.DiscoverNodesRequest', null, global); goog.exportSymbol('proto.xudrpc.DiscoverNodesResponse', null, global); goog.exportSymbol('proto.xudrpc.ExecuteSwapRequest', null, global); @@ -4523,7 +4524,8 @@ proto.xudrpc.ListCurrenciesResponse.prototype.toObject = function(opt_includeIns */ proto.xudrpc.ListCurrenciesResponse.toObject = function(includeInstance, msg) { var f, obj = { - currenciesList: jspb.Message.getRepeatedField(msg, 1) + currenciesList: jspb.Message.toObjectList(msg.getCurrenciesList(), + proto.xudrpc.Currency.toObject, includeInstance) }; if (includeInstance) { @@ -4561,7 +4563,8 @@ proto.xudrpc.ListCurrenciesResponse.deserializeBinaryFromReader = function(msg, var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {string} */ (reader.readString()); + var value = new proto.xudrpc.Currency; + reader.readMessage(value,proto.xudrpc.Currency.deserializeBinaryFromReader); msg.addCurrencies(value); break; default: @@ -4595,35 +4598,38 @@ proto.xudrpc.ListCurrenciesResponse.serializeBinaryToWriter = function(message, var f = undefined; f = message.getCurrenciesList(); if (f.length > 0) { - writer.writeRepeatedString( + writer.writeRepeatedMessage( 1, - f + f, + proto.xudrpc.Currency.serializeBinaryToWriter ); } }; /** - * repeated string currencies = 1; - * @return {!Array.} + * repeated Currency currencies = 1; + * @return {!Array.} */ proto.xudrpc.ListCurrenciesResponse.prototype.getCurrenciesList = function() { - return /** @type {!Array.} */ (jspb.Message.getRepeatedField(this, 1)); + return /** @type{!Array.} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.xudrpc.Currency, 1)); }; -/** @param {!Array.} value */ +/** @param {!Array.} value */ proto.xudrpc.ListCurrenciesResponse.prototype.setCurrenciesList = function(value) { - jspb.Message.setField(this, 1, value || []); + jspb.Message.setRepeatedWrapperField(this, 1, value); }; /** - * @param {!string} value + * @param {!proto.xudrpc.Currency=} opt_value * @param {number=} opt_index + * @return {!proto.xudrpc.Currency} */ -proto.xudrpc.ListCurrenciesResponse.prototype.addCurrencies = function(value, opt_index) { - jspb.Message.addToRepeatedField(this, 1, value, opt_index); +proto.xudrpc.ListCurrenciesResponse.prototype.addCurrencies = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.xudrpc.Currency, opt_index); }; @@ -6194,6 +6200,202 @@ proto.xudrpc.Order.prototype.setHold = function(value) { +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.xudrpc.Currency = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.xudrpc.Currency, jspb.Message); +if (goog.DEBUG && !COMPILED) { + proto.xudrpc.Currency.displayName = 'proto.xudrpc.Currency'; +} + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.xudrpc.Currency.prototype.toObject = function(opt_includeInstance) { + return proto.xudrpc.Currency.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.xudrpc.Currency} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.xudrpc.Currency.toObject = function(includeInstance, msg) { + var f, obj = { + tickerSymbol: jspb.Message.getFieldWithDefault(msg, 1, ""), + digits: jspb.Message.getFieldWithDefault(msg, 2, 0), + globalIdentifier: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.xudrpc.Currency} + */ +proto.xudrpc.Currency.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.xudrpc.Currency; + return proto.xudrpc.Currency.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.xudrpc.Currency} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.xudrpc.Currency} + */ +proto.xudrpc.Currency.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setTickerSymbol(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setDigits(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setGlobalIdentifier(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.xudrpc.Currency.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.xudrpc.Currency.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.xudrpc.Currency} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.xudrpc.Currency.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTickerSymbol(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getDigits(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } + f = message.getGlobalIdentifier(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string ticker_symbol = 1; + * @return {string} + */ +proto.xudrpc.Currency.prototype.getTickerSymbol = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.xudrpc.Currency.prototype.setTickerSymbol = function(value) { + jspb.Message.setField(this, 1, value); +}; + + +/** + * optional uint64 digits = 2; + * @return {number} + */ +proto.xudrpc.Currency.prototype.getDigits = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.xudrpc.Currency.prototype.setDigits = function(value) { + jspb.Message.setField(this, 2, value); +}; + + +/** + * optional string global_identifier = 3; + * @return {string} + */ +proto.xudrpc.Currency.prototype.getGlobalIdentifier = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +proto.xudrpc.Currency.prototype.setGlobalIdentifier = function(value) { + jspb.Message.setField(this, 3, value); +}; + + + /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a diff --git a/lib/service/Service.ts b/lib/service/Service.ts index fef4dca0b..cce22a4ea 100644 --- a/lib/service/Service.ts +++ b/lib/service/Service.ts @@ -330,7 +330,7 @@ class Service { * @returns A list of supported currency ticker symbols */ public listCurrencies = () => { - return Array.from(this.orderBook.currencies); + return this.orderBook.currencies; } /** diff --git a/proto/xudrpc.proto b/proto/xudrpc.proto index 84a6d78a3..c5240d574 100644 --- a/proto/xudrpc.proto +++ b/proto/xudrpc.proto @@ -407,8 +407,8 @@ message ListOrdersResponse { message ListCurrenciesRequest {} message ListCurrenciesResponse { - // A list of ticker symbols of the supported currencies. - repeated string currencies = 1 [json_name = "currencies"]; + // The list of available currencies in orderbook. + repeated Currency currencies = 1 [json_name = "currencies"]; } message ListPairsRequest {} @@ -467,6 +467,15 @@ message Order { uint64 hold = 10 [json_name = "hold"]; } +message Currency { + // Ticker symbol of this currency (e.g. BTC) + string ticker_symbol = 1 [json_name = "ticker_symbol"]; + // The places to the right of the decimal point of the smallest subunit (e.g. 8, 18) + uint64 digits = 2 [json_name = "digits"]; + // Global identifier of this currency + string global_identifier = 3 [json_name = "global_identifier"]; +} + message OrderUpdate { oneof order_update { // An order that was added to the order book. @@ -508,7 +517,7 @@ message Peer { string address = 1 [json_name = "address"]; // The node pub key to uniquely identify this peer. string node_pub_key = 2 [json_name = "node_pub_key"]; - // A map of ticker symbols to lnd pub keys for this peer + // A map of ticker symbols to lnd pub keys for this peer map lnd_pub_keys = 3 [json_name = "lnd_pub_keys"]; // Indicates whether this peer was connected inbound. bool inbound = 4 [json_name = "inbound"];