diff --git a/dist/public/bitcoin-com-mainnet-rest-v2.json b/dist/public/bitcoin-com-mainnet-rest-v2.json index 6d02b739..48e81f2b 100644 --- a/dist/public/bitcoin-com-mainnet-rest-v2.json +++ b/dist/public/bitcoin-com-mainnet-rest-v2.json @@ -1083,19 +1083,6 @@ "excessutxocharge": { "type": "number" }, - "localaddresses": [ - { - "address": { - "type": "string" - }, - "port": { - "type": "number" - }, - "score": { - "type": "number" - } - } - ], "warnings": { "type": "string" } @@ -1199,7 +1186,7 @@ "openapi": "3.0.0", "info": { "description": "rest.bitcoin.com is the REST layer for Bitcoin.com's Cloud. More info: [developer.bitcoin.com/rest](https://developer.bitcoin.com/rest). Chatroom [geni.us/CashDev](http://geni.us/CashDev)", - "version": "3.11.8", + "version": "3.11.9", "title": "REST", "license": { "name": "MIT", diff --git a/dist/public/bitcoin-com-testnet-rest-v2.json b/dist/public/bitcoin-com-testnet-rest-v2.json index 350026bf..9a5444a4 100644 --- a/dist/public/bitcoin-com-testnet-rest-v2.json +++ b/dist/public/bitcoin-com-testnet-rest-v2.json @@ -1083,19 +1083,6 @@ "excessutxocharge": { "type": "number" }, - "localaddresses": [ - { - "address": { - "type": "string" - }, - "port": { - "type": "number" - }, - "score": { - "type": "number" - } - } - ], "warnings": { "type": "string" } @@ -1199,7 +1186,7 @@ "openapi": "3.0.0", "info": { "description": "trest.bitcoin.com is the REST layer for Bitcoin.com's Cloud. More info: [developer.bitcoin.com/rest](https://developer.bitcoin.com/rest). Chatroom [geni.us/CashDev](http://geni.us/CashDev)", - "version": "3.11.8", + "version": "3.11.9", "title": "REST", "license": { "name": "MIT", diff --git a/package.json b/package.json index f6eb818c..d091f009 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rest.bitcoin.com", - "version": "3.11.8", + "version": "3.11.9", "description": "REST API for Bitcoin.com's Cloud", "author": "Gabriel Cardona ", "contributors": [ diff --git a/src/routes/v2/control.ts b/src/routes/v2/control.ts index 428ffef7..252be19a 100644 --- a/src/routes/v2/control.ts +++ b/src/routes/v2/control.ts @@ -1,7 +1,10 @@ // imports import { AxiosResponse } from "axios" import * as express from "express" -import { InfoInterface } from "./interfaces/RESTInterfaces" +import { + InfoInterface, + NetworkInfoInterface +} from "./interfaces/RESTInterfaces" import routeUtils = require("./route-utils") import wlogger = require("../../util/winston-logging") @@ -54,7 +57,6 @@ async function getInfo( } } - // Execute the RPC getinfo call. async function getNetworkInfo( req: express.Request, @@ -69,9 +71,10 @@ async function getNetworkInfo( try { const response: AxiosResponse = await BitboxHTTP(requestConfig) - const info: InfoInterface = response.data.result + const networkInfo: NetworkInfoInterface = response.data.result + delete networkInfo.localaddresses - return res.json(info) + return res.json(networkInfo) } catch (error) { wlogger.error(`Error in control.ts/getNetworkInfo().`, error) diff --git a/src/routes/v2/interfaces/RESTInterfaces.ts b/src/routes/v2/interfaces/RESTInterfaces.ts index 5816263a..8520462f 100644 --- a/src/routes/v2/interfaces/RESTInterfaces.ts +++ b/src/routes/v2/interfaces/RESTInterfaces.ts @@ -237,6 +237,30 @@ export interface InfoInterface { errors: string } +export interface NetworkInfoInterface { + version: number + subversion: string + protocolversion: number + localservices: string + localrelay: boolean + timeoffset: number + networkactive: boolean + connections: number + networks: [ + { + name: string + limited: boolean + reachable: boolean + proxy: string + proxy_randomize_credentials: boolean + } + ] + relayfee: number + excessutxocharge: number + localaddresses?: [] + warnings: string +} + export interface MiningInfoInterface { blocks: number currentblocksize: number diff --git a/swaggerJSONFiles/components.json b/swaggerJSONFiles/components.json index d954f585..e8402149 100644 --- a/swaggerJSONFiles/components.json +++ b/swaggerJSONFiles/components.json @@ -1065,19 +1065,6 @@ "excessutxocharge": { "type": "number" }, - "localaddresses": [ - { - "address": { - "type": "string" - }, - "port": { - "type": "number" - }, - "score": { - "type": "number" - } - } - ], "warnings": { "type": "string" } diff --git a/swaggerJSONFiles/info.json b/swaggerJSONFiles/info.json index 54f709ec..f117f644 100644 --- a/swaggerJSONFiles/info.json +++ b/swaggerJSONFiles/info.json @@ -2,7 +2,7 @@ "openapi": "3.0.0", "info": { "description": "The Bitcoin Cash JSON PRC over HTTP", - "version": "3.11.8", + "version": "3.11.9", "title": "REST", "license": { "name": "MIT", diff --git a/swaggerJSONFilesBuilt/mainnet/components.json b/swaggerJSONFilesBuilt/mainnet/components.json index 9b10b456..562f56cf 100644 --- a/swaggerJSONFilesBuilt/mainnet/components.json +++ b/swaggerJSONFilesBuilt/mainnet/components.json @@ -1083,19 +1083,6 @@ "excessutxocharge": { "type": "number" }, - "localaddresses": [ - { - "address": { - "type": "string" - }, - "port": { - "type": "number" - }, - "score": { - "type": "number" - } - } - ], "warnings": { "type": "string" } diff --git a/swaggerJSONFilesBuilt/mainnet/info.json b/swaggerJSONFilesBuilt/mainnet/info.json index ad189b68..baad4115 100644 --- a/swaggerJSONFilesBuilt/mainnet/info.json +++ b/swaggerJSONFilesBuilt/mainnet/info.json @@ -2,7 +2,7 @@ "openapi": "3.0.0", "info": { "description": "rest.bitcoin.com is the REST layer for Bitcoin.com's Cloud. More info: [developer.bitcoin.com/rest](https://developer.bitcoin.com/rest). Chatroom [geni.us/CashDev](http://geni.us/CashDev)", - "version": "3.11.8", + "version": "3.11.9", "title": "REST", "license": { "name": "MIT", diff --git a/swaggerJSONFilesBuilt/testnet/components.json b/swaggerJSONFilesBuilt/testnet/components.json index 10a3833c..52a41737 100644 --- a/swaggerJSONFilesBuilt/testnet/components.json +++ b/swaggerJSONFilesBuilt/testnet/components.json @@ -1083,19 +1083,6 @@ "excessutxocharge": { "type": "number" }, - "localaddresses": [ - { - "address": { - "type": "string" - }, - "port": { - "type": "number" - }, - "score": { - "type": "number" - } - } - ], "warnings": { "type": "string" } diff --git a/swaggerJSONFilesBuilt/testnet/info.json b/swaggerJSONFilesBuilt/testnet/info.json index 1efa8177..4eb5d32c 100644 --- a/swaggerJSONFilesBuilt/testnet/info.json +++ b/swaggerJSONFilesBuilt/testnet/info.json @@ -2,7 +2,7 @@ "openapi": "3.0.0", "info": { "description": "trest.bitcoin.com is the REST layer for Bitcoin.com's Cloud. More info: [developer.bitcoin.com/rest](https://developer.bitcoin.com/rest). Chatroom [geni.us/CashDev](http://geni.us/CashDev)", - "version": "3.11.8", + "version": "3.11.9", "title": "REST", "license": { "name": "MIT",