From 383fcb3c9d473f9dcd9ebe5d4f8684a272c34f0c Mon Sep 17 00:00:00 2001 From: emi Date: Thu, 7 Jan 2021 09:37:47 -0700 Subject: [PATCH] Build 1.1.7 --- dist/api/Api.js | 12 +- .../lib/DataCollector/DataCollectorItem.js | 11 +- dist/api/lib/difficultyCalculator.js | 16 +- dist/api/modules/Address.js | 352 +++--- dist/api/modules/Balances.js | 156 +-- dist/api/modules/Block.js | 114 +- dist/api/modules/ContractVerification.js | 192 +-- dist/api/modules/Event.js | 190 +-- dist/api/modules/ExtendedStats.js | 168 +-- dist/api/modules/InternalTx.js | 286 ++--- dist/api/modules/Stats.js | 100 +- dist/api/modules/Summary.js | 110 +- dist/api/modules/Token.js | 266 ++-- dist/api/modules/Tx.js | 276 ++--- dist/lib/defaultConfig.js | 6 +- dist/lib/delayedFields.js | 12 +- dist/lib/ids.js | 14 +- dist/lib/initialConfiguration.js | 4 +- dist/lib/utils.js | 2 +- dist/services/Service/ServiceClient.js | 10 +- dist/services/Service/ServiceServer.js | 16 +- dist/services/Service/protos/services_pb.js | 1100 ++++++++--------- dist/services/classes/Address.js | 4 +- dist/services/classes/BcStats.js | 23 +- dist/services/classes/Tx.js | 4 +- dist/services/userEvents/userEventsService.js | 2 +- package-lock.json | 2 +- package.json | 2 +- public/swagger.json | 4 +- 29 files changed, 1737 insertions(+), 1717 deletions(-) diff --git a/dist/api/Api.js b/dist/api/Api.js index 61a9aa06..3671c456 100644 --- a/dist/api/Api.js +++ b/dist/api/Api.js @@ -86,7 +86,7 @@ class Api extends _DataCollector.DataCollector { } } getStats() { - return this.formatData(this.stats); + return this.stats; } getCirculatingSupply() { return this.formatData(this.circulatingSupply); @@ -151,11 +151,11 @@ class Api extends _DataCollector.DataCollector { if (!stats) return; /* const ExtendedStats = this.getModule('ExtendedStats') - if (ExtendedStats) { - const blockNumber = parseInt(stats.blockNumber) - const extendedStats = await ExtendedStats.getExtendedStats(blockNumber) - Object.assign(stats, extendedStats) - } */ + if (ExtendedStats) { + const blockNumber = parseInt(stats.blockNumber) + const extendedStats = await ExtendedStats.getExtendedStats(blockNumber) + Object.assign(stats, extendedStats) + } */ let circulatingSupply = stats.circulatingSupply || (await this.getCirculatingSupplyFromDb()); this.circulatingSupply = circulatingSupply; this.stats = Object.assign({}, stats); diff --git a/dist/api/lib/DataCollector/DataCollectorItem.js b/dist/api/lib/DataCollector/DataCollectorItem.js index 03ff6f57..3b0d4c7c 100644 --- a/dist/api/lib/DataCollector/DataCollectorItem.js +++ b/dist/api/lib/DataCollector/DataCollectorItem.js @@ -62,7 +62,8 @@ class DataCollectorItem { async getLatest(query, project) { query = query || {}; const result = await (0, _pagination.find)(this.db, query, this.sort, 1, project); - return result.length ? result[0] : null; + const data = result.length ? result[0] : null; + return { data }; } async setFieldsTypes() { @@ -127,10 +128,10 @@ class DataCollectorItem { } } /** - * Resolves item query parsing params - * @param {*} query - * @param {*} params - */ + * Resolves item query parsing params + * @param {*} query + * @param {*} params + */ async getItem(query, { fields, getPrevNext }) { try { let data = await this.getOne(query, fields); diff --git a/dist/api/lib/difficultyCalculator.js b/dist/api/lib/difficultyCalculator.js index 1f4423cb..ee676cbd 100644 --- a/dist/api/lib/difficultyCalculator.js +++ b/dist/api/lib/difficultyCalculator.js @@ -2,14 +2,14 @@ class DifficultyCalculator { /** - * Given an array of blocks, a period of time and a bucket size. Returns an array with the average - * block difficulty for each bucket. - * - * @param {*} blocks An array of blocks with timestamp and difficulty - * @param {*} tstart Period start time - * @param {*} tend Period end time - * @param {*} bucketSize Bucket time size to divide the period in - */ + * Given an array of blocks, a period of time and a bucket size. Returns an array with the average + * block difficulty for each bucket. + * + * @param {*} blocks An array of blocks with timestamp and difficulty + * @param {*} tstart Period start time + * @param {*} tend Period end time + * @param {*} bucketSize Bucket time size to divide the period in + */ difficulties(blocks, tstart, tend, bucketSize) { if (!Array.isArray(blocks) || tend < tstart) { return []; diff --git a/dist/api/modules/Address.js b/dist/api/modules/Address.js index 49970f54..33356f13 100644 --- a/dist/api/modules/Address.js +++ b/dist/api/modules/Address.js @@ -8,30 +8,30 @@ class Address extends _DataCollector.DataCollectorItem { this.fields = { code: 0, 'createdByTx.input': 0 }; this.publicActions = { /** - * @swagger - * /api?module=addresses&action=getAddress: - * get: - * description: get address data - * tags: - * - addresses - * parameters: - * - name: module - * in: query - * required: true - * enum: [addresses] - * - name: action - * in: query - * required: true - * enum: [getAddress] - * - $ref: '#/parameters/address' - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=addresses&action=getAddress: + * get: + * description: get address data + * tags: + * - addresses + * parameters: + * - name: module + * in: query + * required: true + * enum: [addresses] + * - name: action + * in: query + * required: true + * enum: [getAddress] + * - $ref: '#/parameters/address' + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getAddress: async params => { const { address } = params; @@ -48,67 +48,67 @@ class Address extends _DataCollector.DataCollectorItem { return aData; }, /** - * @swagger - * /api?module=addresses&action=getAddresses: - * get: - * description: get list of addresses - * tags: - * - addresses - * parameters: - * - name: module - * in: query - * required: true - * enum: [addresses] - * - name: action - * in: query - * required: true - * enum: [getAddresses] - * - $ref: '#/parameters/limit' - * - $ref: '#/parameters/next' - * - $ref: '#/parameters/prev' - * responses: - * 200: - * $ref: '#/definitions/ResponseList' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=addresses&action=getAddresses: + * get: + * description: get list of addresses + * tags: + * - addresses + * parameters: + * - name: module + * in: query + * required: true + * enum: [addresses] + * - name: action + * in: query + * required: true + * enum: [getAddresses] + * - $ref: '#/parameters/limit' + * - $ref: '#/parameters/next' + * - $ref: '#/parameters/prev' + * responses: + * 200: + * $ref: '#/definitions/ResponseList' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getAddresses: params => { let type = params.query ? params.query.type : null; let query = type ? { type } : {}; return this.getPageData(query, params); }, /** - * @swagger - * /api?module=addresses&action=getMiners: - * get: - * description: get list of miners - * tags: - * - addresses - * parameters: - * - name: module - * in: query - * required: true - * enum: [addresses] - * - name: action - * in: query - * required: true - * enum: [getMiners] - * - name: fromBlock - * in: query - * required: false - * - $ref: '#/parameters/limit' - * - $ref: '#/parameters/next' - * - $ref: '#/parameters/prev' - * responses: - * 200: - * $ref: '#/definitions/ResponseList' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=addresses&action=getMiners: + * get: + * description: get list of miners + * tags: + * - addresses + * parameters: + * - name: module + * in: query + * required: true + * enum: [addresses] + * - name: action + * in: query + * required: true + * enum: [getMiners] + * - name: fromBlock + * in: query + * required: false + * - $ref: '#/parameters/limit' + * - $ref: '#/parameters/next' + * - $ref: '#/parameters/prev' + * responses: + * 200: + * $ref: '#/definitions/ResponseList' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getMiners: params => { let query = {}; const lbMined = _types.fields.LAST_BLOCK_MINED; @@ -121,32 +121,32 @@ class Address extends _DataCollector.DataCollectorItem { return this.getPageData(query, params); }, /** - * @swagger - * /api?module=addresses&action=getTokens: - * get: - * description: get list of tokens - * tags: - * - addresses - * parameters: - * - name: module - * in: query - * required: true - * enum: [addresses] - * - name: action - * in: query - * required: true - * enum: [getTokens] - * - $ref: '#/parameters/limit' - * - $ref: '#/parameters/next' - * - $ref: '#/parameters/prev' - * responses: - * 200: - * $ref: '#/definitions/ResponseList' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=addresses&action=getTokens: + * get: + * description: get list of tokens + * tags: + * - addresses + * parameters: + * - name: module + * in: query + * required: true + * enum: [addresses] + * - name: action + * in: query + * required: true + * enum: [getTokens] + * - $ref: '#/parameters/limit' + * - $ref: '#/parameters/next' + * - $ref: '#/parameters/prev' + * responses: + * 200: + * $ref: '#/definitions/ResponseList' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getTokens: params => { return this.getPageData({ type: _types.addrTypes.CONTRACT, @@ -154,57 +154,57 @@ class Address extends _DataCollector.DataCollectorItem { params); }, /** - * @swagger - * /api?module=addresses&action=getCirculatingSupply: - * get: - * description: get list of tokens - * tags: - * - addresses - * parameters: - * - name: module - * in: query - * required: true - * enum: [addresses] - * - name: action - * in: query - * required: true - * enum: [getCirculatingSupply] - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=addresses&action=getCirculatingSupply: + * get: + * description: get list of tokens + * tags: + * - addresses + * parameters: + * - name: module + * in: query + * required: true + * enum: [addresses] + * - name: action + * in: query + * required: true + * enum: [getCirculatingSupply] + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getCirculatingSupply: params => { return this.parent.getCirculatingSupply(); }, /** - * @swagger - * /api?module=addresses&action=getCode: - * get: - * description: get contract code - * tags: - * - addresses - * parameters: - * - name: module - * in: query - * required: true - * enum: [addresses] - * - name: action - * in: query - * required: true - * enum: [getCode] - * - $ref: '#/parameters/address' - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=addresses&action=getCode: + * get: + * description: get contract code + * tags: + * - addresses + * parameters: + * - name: module + * in: query + * required: true + * enum: [addresses] + * - name: action + * in: query + * required: true + * enum: [getCode] + * - $ref: '#/parameters/address' + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getCode: async params => { try { const { address } = params; @@ -230,30 +230,30 @@ class Address extends _DataCollector.DataCollectorItem { } }, /** - * @swagger - * /api?module=addresses&action=findAddresses: - * get: - * description: find addresses by name - * tags: - * - addresses - * parameters: - * - name: module - * in: query - * required: true - * enum: [addresses] - * - name: action - * in: query - * required: true - * - name: name - * required: true - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=addresses&action=findAddresses: + * get: + * description: find addresses by name + * tags: + * - addresses + * parameters: + * - name: module + * in: query + * required: true + * enum: [addresses] + * - name: action + * in: query + * required: true + * - name: name + * required: true + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ findAddresses: async params => { let { name } = params; params.field = 'name'; diff --git a/dist/api/modules/Balances.js b/dist/api/modules/Balances.js index bffc9f84..5424eab0 100644 --- a/dist/api/modules/Balances.js +++ b/dist/api/modules/Balances.js @@ -8,37 +8,37 @@ class Balances extends _DataCollector.DataCollectorItem { this.fields = {}; this.publicActions = { /** - * @swagger - * /api?module=balances&action=getBalance: - * get: - * description: get address balance at blockNumber (if exists) - * tags: - * - balances - * parameters: - * - name: module - * in: query - * required: true - * enum: [balances] - * - name: action - * in: query - * required: true - * enum: [getBalance] - * - $ref: '#/parameters/address' - * - name: block - * in: query - * required: true - * schema: - * type: string - * description: block hash or block number - * example: 30000 - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=balances&action=getBalance: + * get: + * description: get address balance at blockNumber (if exists) + * tags: + * - balances + * parameters: + * - name: module + * in: query + * required: true + * enum: [balances] + * - name: action + * in: query + * required: true + * enum: [getBalance] + * - $ref: '#/parameters/address' + * - name: block + * in: query + * required: true + * schema: + * type: string + * description: block hash or block number + * example: 30000 + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getBalance: async params => { const { address, block } = params; const query = { address }; @@ -49,58 +49,58 @@ class Balances extends _DataCollector.DataCollectorItem { return this.getItem(query, params); }, /** - * @swagger - * /api?module=balances&action=getBalances: - * get: - * description: get address balances - * tags: - * - balances - * parameters: - * - name: module - * in: query - * required: true - * enum: [balances] - * - name: action - * in: query - * required: true - * enum: [getBalances] - * - $ref: '#/parameters/address' - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=balances&action=getBalances: + * get: + * description: get address balances + * tags: + * - balances + * parameters: + * - name: module + * in: query + * required: true + * enum: [balances] + * - name: action + * in: query + * required: true + * enum: [getBalances] + * - $ref: '#/parameters/address' + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getBalances: async params => { const { address } = params; return this.getPageData({ address }, params); }, /** - * @swagger - * /api?module=balances&action=getStatus: - * get: - * description: get status of balances - * tags: - * - balances - * parameters: - * - name: module - * in: query - * required: true - * enum: [balances] - * - name: action - * in: query - * required: true - * enum: [getStatus] - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=balances&action=getStatus: + * get: + * description: get status of balances + * tags: + * - balances + * parameters: + * - name: module + * in: query + * required: true + * enum: [balances] + * - name: action + * in: query + * required: true + * enum: [getStatus] + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getStatus: async params => { const projection = { blockHash: 1, blockNumber: 1, _id: 0 }; const fromBlock = await this.getOne({}, projection, { blockNumber: 1 }); diff --git a/dist/api/modules/Block.js b/dist/api/modules/Block.js index e57d16ff..da2c6a6f 100644 --- a/dist/api/modules/Block.js +++ b/dist/api/modules/Block.js @@ -10,34 +10,34 @@ class Block extends _DataCollector.DataCollectorItem { super(Blocks, key, { sortDir, cursorField, sortable }); this.publicActions = { /** - * @swagger - * /api?module=blocks&action=getBlock: - * get: - * description: get block data - * tags: - * - blocks - * parameters: - * - name: module - * in: query - * required: true - * enum: [blocks] - * - name: action - * in: query - * required: true - * enum: [getBlock] - * - name: hashOrNumber - * in: query - * schema: - * type: string - * example: 200 - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=blocks&action=getBlock: + * get: + * description: get block data + * tags: + * - blocks + * parameters: + * - name: module + * in: query + * required: true + * enum: [blocks] + * - name: action + * in: query + * required: true + * enum: [getBlock] + * - name: hashOrNumber + * in: query + * schema: + * type: string + * example: 200 + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getBlock: async params => { const hashOrNumber = params.hashOrNumber || params.hash || params.number; @@ -59,35 +59,35 @@ class Block extends _DataCollector.DataCollectorItem { return result; }, /** - * @swagger - * /api?module=blocks&action=getBlocks: - * get: - * description: get list of blocks - * tags: - * - blocks - * parameters: - * - name: module - * in: query - * required: true - * enum: [blocks] - * - name: action - * in: query - * required: true - * enum: [getBlocks] - * - name: miner - * in: query - * required: false - * - $ref: '#/parameters/limit' - * - $ref: '#/parameters/next' - * - $ref: '#/parameters/prev' - * responses: - * 200: - * $ref: '#/definitions/ResponseList' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=blocks&action=getBlocks: + * get: + * description: get list of blocks + * tags: + * - blocks + * parameters: + * - name: module + * in: query + * required: true + * enum: [blocks] + * - name: action + * in: query + * required: true + * enum: [getBlocks] + * - name: miner + * in: query + * required: false + * - $ref: '#/parameters/limit' + * - $ref: '#/parameters/next' + * - $ref: '#/parameters/prev' + * responses: + * 200: + * $ref: '#/definitions/ResponseList' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getBlocks: async params => { let { miner, addMetadata } = params; diff --git a/dist/api/modules/ContractVerification.js b/dist/api/modules/ContractVerification.js index f6105e20..99c087e4 100644 --- a/dist/api/modules/ContractVerification.js +++ b/dist/api/modules/ContractVerification.js @@ -12,44 +12,44 @@ class ContractVerification extends _DataCollector.DataCollectorItem { this.verificationsCollection = VerificationsResults; this.publicActions = { /** - * @swagger - * /api?module=contractVerifier&action=getVerifiedContracts: - * get: - * description: Gets a list of verified contracts addresses - * tags: - * - contract verifier - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=contractVerifier&action=getVerifiedContracts: + * get: + * description: Gets a list of verified contracts addresses + * tags: + * - contract verifier + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getVerifiedContracts: params => { params.fields = { address: 1 }; let query = { match: true }; return this.getPageData(query, params); }, /** - * @swagger - * /api?module=contractVerifier&action=verify: - * get: - * description: Verify contract source - * tags: - * - contract verifier - * parameters: - * - name: request - * in: query - * required: true - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=contractVerifier&action=verify: + * get: + * description: Verify contract source + * tags: + * - contract verifier + * parameters: + * - name: request + * in: query + * required: true + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ verify: async params => { try { const { request } = params; @@ -73,62 +73,62 @@ class ContractVerification extends _DataCollector.DataCollectorItem { } }, /** - * @swagger - * /api?module=contractVerifier&action=getSolcVersions: - * get: - * description: Gets solidity compiler versions - * tags: - * - contract verifier - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=contractVerifier&action=getSolcVersions: + * get: + * description: Gets solidity compiler versions + * tags: + * - contract verifier + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getSolcVersions: async () => { const data = await (0, _StoredConfig.StoredConfig)(this.parent.db).get(_ContractVerifierModule.versionsId); return { data }; }, /** - * @swagger - * /api?module=contractVerifier&action=getEvmVersions: - * get: - * description: Gets evm versions - * tags: - * - contract verifier - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=contractVerifier&action=getEvmVersions: + * get: + * description: Gets evm versions + * tags: + * - contract verifier + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getEvmVersions: async () => { const data = _types.EVMversions; return { data }; }, /** - * @swagger - * /api?module=contractVerifier&action=getVersificationResult: - * get: - * description: Gets the result of source code verification - * tags: - * - contract verifier - * parameters: - * - name: id - * in: query - * required: true - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=contractVerifier&action=getVerificationResult: + * get: + * description: Gets the result of source code verification + * tags: + * - contract verifier + * parameters: + * - name: id + * in: query + * required: true + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getVerificationResult: async params => { try { let { id } = params; @@ -144,24 +144,24 @@ class ContractVerification extends _DataCollector.DataCollectorItem { } }, /** - * @swagger - * /api?module=contractVerifier&action=isVerified: - * get: - * description: Checks if a contract was verified - * tags: - * - contract verifier - * parameters: - * - name: address - * in: query - * required: true - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=contractVerifier&action=isVerified: + * get: + * description: Checks if a contract was verified + * tags: + * - contract verifier + * parameters: + * - name: address + * in: query + * required: true + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ isVerified: async params => { const { address } = params; const data = await this.verificationsCollection.findOne({ address }); diff --git a/dist/api/modules/Event.js b/dist/api/modules/Event.js index cd090c15..d2617859 100644 --- a/dist/api/modules/Event.js +++ b/dist/api/modules/Event.js @@ -8,33 +8,33 @@ class Event extends _DataCollector.DataCollectorItem { super(Events, key, { cursorField, sortDir, sortable }); this.publicActions = { /** - * @swagger - * /api?module=events&action=getEvent: - * get: - * description: get event data - * tags: - * - events - * parameters: - * - name: module - * in: query - * required: true - * enum: [events] - * - name: action - * in: query - * required: true - * enum: [getEvent] - * - name: eventId - * in: query - * schema: - * type: string - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=events&action=getEvent: + * get: + * description: get event data + * tags: + * - events + * parameters: + * - name: module + * in: query + * required: true + * enum: [events] + * - name: action + * in: query + * required: true + * enum: [getEvent] + * - name: eventId + * in: query + * schema: + * type: string + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getEvent: async params => { try { const { eventId } = params; @@ -49,47 +49,47 @@ class Event extends _DataCollector.DataCollectorItem { } }, /** - * @swagger - * /api?module=events&action=getEventsByAddress: - * get: - * description: get events by address - * tags: - * - events - * parameters: - * - name: module - * in: query - * required: true - * enum: [events] - * - name: action - * in: query - * required: true - * enum: [getEventsByAddress] - * - $ref: '#/parameters/address' - * - name: contract - * in: query - * required: false - * schema: - * type: string - * example: "0x0000000000000000000000000000000001000008" - * - name: signatures - * in: query - * required: false - * description: filter by event's signatures - * schema: - * type: array - * example: - * e19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16 - * - $ref: '#/parameters/limit' - * - $ref: '#/parameters/next' - * - $ref: '#/parameters/prev' - * responses: - * 200: - * $ref: '#/definitions/ResponseList' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=events&action=getEventsByAddress: + * get: + * description: get events by address + * tags: + * - events + * parameters: + * - name: module + * in: query + * required: true + * enum: [events] + * - name: action + * in: query + * required: true + * enum: [getEventsByAddress] + * - $ref: '#/parameters/address' + * - name: contract + * in: query + * required: false + * schema: + * type: string + * example: "0x0000000000000000000000000000000001000008" + * - name: signatures + * in: query + * required: false + * description: filter by event's signatures + * schema: + * type: array + * example: + * e19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16 + * - $ref: '#/parameters/limit' + * - $ref: '#/parameters/next' + * - $ref: '#/parameters/prev' + * responses: + * 200: + * $ref: '#/definitions/ResponseList' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getEventsByAddress: async params => { const { address, signatures, contract } = params; if (address) { @@ -126,33 +126,33 @@ class Event extends _DataCollector.DataCollectorItem { } }, /** - * @swagger - * /api?module=events&action=getAllEventsByAddress: - * get: - * description: get events by address - * tags: - * - events - * parameters: - * - name: module - * in: query - * required: true - * enum: [events] - * - name: action - * in: query - * required: true - * enum: [getAllEventsByAddress] - * - $ref: '#/parameters/address' - * - $ref: '#/parameters/limit' - * - $ref: '#/parameters/next' - * - $ref: '#/parameters/prev' - * responses: - * 200: - * $ref: '#/definitions/ResponseList' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=events&action=getAllEventsByAddress: + * get: + * description: get events by address + * tags: + * - events + * parameters: + * - name: module + * in: query + * required: true + * enum: [events] + * - name: action + * in: query + * required: true + * enum: [getAllEventsByAddress] + * - $ref: '#/parameters/address' + * - $ref: '#/parameters/limit' + * - $ref: '#/parameters/next' + * - $ref: '#/parameters/prev' + * responses: + * 200: + * $ref: '#/definitions/ResponseList' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getAllEventsByAddress: async params => { const { address } = params; if (address) { diff --git a/dist/api/modules/ExtendedStats.js b/dist/api/modules/ExtendedStats.js index 0b680c38..bb9dc99f 100644 --- a/dist/api/modules/ExtendedStats.js +++ b/dist/api/modules/ExtendedStats.js @@ -24,102 +24,102 @@ class ExtendedStats extends _DataCollector.DataCollectorItem { this.difficultyCalculator = new _difficultyCalculator.DifficultyCalculator(); this.publicActions = { /** - * @swagger - * /api?module=extendedStats&action=getExtendedStats: - * get: - * description: get extended stats - * tags: - * - extendedStats - * parameters: - * - name: module - * in: query - * required: true - * enum: [extendedStats] - * - name: action - * in: query - * required: true - * enum: [getExtendedStats] - * - name: blockNumber - * in: query - * schema: - * type: string - * example: 200 - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=extendedStats&action=getExtendedStats: + * get: + * description: get extended stats + * tags: + * - extendedStats + * parameters: + * - name: module + * in: query + * required: true + * enum: [extendedStats] + * - name: action + * in: query + * required: true + * enum: [getExtendedStats] + * - name: blockNumber + * in: query + * schema: + * type: string + * example: 200 + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getExtendedStats: async params => { return { data: await this.getExtendedStats(parseInt(params.blockNumber)) }; }, /** - * @swagger - * /api?module=extendedStats&action=getHashrates: - * get: - * description: get hashrates - * tags: - * - extendedStats - * parameters: - * - name: module - * in: query - * required: true - * enum: [extendedStats] - * - name: action - * in: query - * required: true - * enum: [getHashrates] - * - name: blockNumber - * in: query - * schema: - * type: string - * example: 200 - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=extendedStats&action=getHashrates: + * get: + * description: get hashrates + * tags: + * - extendedStats + * parameters: + * - name: module + * in: query + * required: true + * enum: [extendedStats] + * - name: action + * in: query + * required: true + * enum: [getHashrates] + * - name: blockNumber + * in: query + * schema: + * type: string + * example: 200 + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getHashrates: async params => { return { data: await this.getHashrates(parseInt(params.blockNumber)) }; }, /** - * @swagger - * /api?module=extendedStats&action=getDifficulties: - * get: - * description: get difficulties - * tags: - * - extendedStats - * parameters: - * - name: module - * in: query - * required: true - * enum: [extendedStats] - * - name: action - * in: query - * required: true - * enum: [getDifficulties] - * - name: blockNumber - * in: query - * schema: - * type: string - * example: 200 - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=extendedStats&action=getDifficulties: + * get: + * description: get difficulties + * tags: + * - extendedStats + * parameters: + * - name: module + * in: query + * required: true + * enum: [extendedStats] + * - name: action + * in: query + * required: true + * enum: [getDifficulties] + * - name: blockNumber + * in: query + * schema: + * type: string + * example: 200 + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getDifficulties: async params => { return { data: await this.getDifficulties(parseInt(params.blockNumber)) }; diff --git a/dist/api/modules/InternalTx.js b/dist/api/modules/InternalTx.js index 262e3171..83df5155 100644 --- a/dist/api/modules/InternalTx.js +++ b/dist/api/modules/InternalTx.js @@ -10,105 +10,105 @@ class InternalTx extends _DataCollector.DataCollectorItem { super(InternalTransactions, key, { cursorField, sortDir, sortable }); this.publicActions = { /** - * @swagger - * /api?module=internalTransactions&action=getInternalTransaction: - * get: - * description: get internal transaction - * tags: - * - internal transactions - * produces: - * - application/json - * parameters: - * - name: module - * in: query - * required: true - * enum: [internalTransactions] - * - name: action - * in: query - * required: true - * enum: [getInternalTransaction] - * - name: internalTxId - * in: query - * schema: - * type: string - * - $ref: '#/parameters/limit' - * - $ref: '#/parameters/next' - * - $ref: '#/parameters/prev' - * responses: - * 200: - * $ref: '#/definitions/ResponseList' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=internalTransactions&action=getInternalTransaction: + * get: + * description: get internal transaction + * tags: + * - internal transactions + * produces: + * - application/json + * parameters: + * - name: module + * in: query + * required: true + * enum: [internalTransactions] + * - name: action + * in: query + * required: true + * enum: [getInternalTransaction] + * - name: internalTxId + * in: query + * schema: + * type: string + * - $ref: '#/parameters/limit' + * - $ref: '#/parameters/next' + * - $ref: '#/parameters/prev' + * responses: + * 200: + * $ref: '#/definitions/ResponseList' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getInternalTransaction: params => { let { internalTxId } = params; return this.getItem({ internalTxId }, params); }, /** - * @swagger - * /api?module=internalTransactions&action=getInternalTransactions: - * get: - * description: get internal transactions - * tags: - * - internal transactions - * produces: - * - application/json - * parameters: - * - name: module - * in: query - * required: true - * enum: [internalTransactions] - * - name: action - * in: query - * required: true - * enum: [getInternalTransactions] - * - name: query - * in: query - * required: false - * schema: - * type: object - * - $ref: '#/parameters/limit' - * - $ref: '#/parameters/next' - * - $ref: '#/parameters/prev' - * responses: - * 200: - * $ref: '#/definitions/ResponseList' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=internalTransactions&action=getInternalTransactions: + * get: + * description: get internal transactions + * tags: + * - internal transactions + * produces: + * - application/json + * parameters: + * - name: module + * in: query + * required: true + * enum: [internalTransactions] + * - name: action + * in: query + * required: true + * enum: [getInternalTransactions] + * - name: query + * in: query + * required: false + * schema: + * type: object + * - $ref: '#/parameters/limit' + * - $ref: '#/parameters/next' + * - $ref: '#/parameters/prev' + * responses: + * 200: + * $ref: '#/definitions/ResponseList' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getInternalTransactions: params => { let query = {}; return this.getPageData(query, params); }, /** - * @swagger - * /api?module=internalTransactions&action=getInternalTransactionsByAddress: - * get: - * description: get internal transactions by address - * tags: - * - internal transactions - * parameters: - * - name: module - * in: query - * required: true - * enum: [internalTransactions] - * - name: action - * in: query - * required: true - * enum: [getInternalTransactionsByAddress] - * - $ref: '#/parameters/address' - * responses: - * 200: - * $ref: '#/definitions/ResponseList' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=internalTransactions&action=getInternalTransactionsByAddress: + * get: + * description: get internal transactions by address + * tags: + * - internal transactions + * parameters: + * - name: module + * in: query + * required: true + * enum: [internalTransactions] + * - name: action + * in: query + * required: true + * enum: [getInternalTransactionsByAddress] + * - $ref: '#/parameters/address' + * responses: + * 200: + * $ref: '#/definitions/ResponseList' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getInternalTransactionsByAddress: params => { const { address } = params; return this.getPageData( @@ -119,33 +119,33 @@ class InternalTx extends _DataCollector.DataCollectorItem { }, /** - * @swagger - * /api?module=internalTransactions&action=getInternalTransactionsByBlock: - * get: - * description: get internal transactions by block - * tags: - * - internal transactions - * parameters: - * - name: module - * in: query - * required: true - * enum: [internalTransactions] - * - name: action - * in: query - * required: true - * enum: [getInternalTransactionsByBlock] - * - $ref: '#/parameters/hashOrNumber' - * - $ref: '#/parameters/limit' - * - $ref: '#/parameters/next' - * - $ref: '#/parameters/prev' - * responses: - * 200: - * $ref: '#/definitions/ResponseList' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=internalTransactions&action=getInternalTransactionsByBlock: + * get: + * description: get internal transactions by block + * tags: + * - internal transactions + * parameters: + * - name: module + * in: query + * required: true + * enum: [internalTransactions] + * - name: action + * in: query + * required: true + * enum: [getInternalTransactionsByBlock] + * - $ref: '#/parameters/hashOrNumber' + * - $ref: '#/parameters/limit' + * - $ref: '#/parameters/next' + * - $ref: '#/parameters/prev' + * responses: + * 200: + * $ref: '#/definitions/ResponseList' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getInternalTransactionsByBlock: params => { const hashOrNumber = params.hashOrNumber || params.number; @@ -158,33 +158,33 @@ class InternalTx extends _DataCollector.DataCollectorItem { } }, /** - * @swagger - * /api?module=internalTransactions&action=getInternalTransactionsByTxHash: - * get: - * description: get internal transactions by tx hash - * tags: - * - internal transactions - * parameters: - * - name: module - * in: query - * required: true - * enum: [internalTransactions] - * - name: action - * in: query - * required: true - * enum: [getInternalTransactionsByTxHash] - * - $ref: '#/parameters/transactionHash' - * - $ref: '#/parameters/limit' - * - $ref: '#/parameters/next' - * - $ref: '#/parameters/prev' - * responses: - * 200: - * $ref: '#/definitions/ResponseList' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=internalTransactions&action=getInternalTransactionsByTxHash: + * get: + * description: get internal transactions by tx hash + * tags: + * - internal transactions + * parameters: + * - name: module + * in: query + * required: true + * enum: [internalTransactions] + * - name: action + * in: query + * required: true + * enum: [getInternalTransactionsByTxHash] + * - $ref: '#/parameters/transactionHash' + * - $ref: '#/parameters/limit' + * - $ref: '#/parameters/next' + * - $ref: '#/parameters/prev' + * responses: + * 200: + * $ref: '#/definitions/ResponseList' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getInternalTransactionsByTxHash: params => { let { transactionHash, hash } = params; transactionHash = transactionHash || hash; diff --git a/dist/api/modules/Stats.js b/dist/api/modules/Stats.js index 7badf579..ede20914 100644 --- a/dist/api/modules/Stats.js +++ b/dist/api/modules/Stats.js @@ -6,60 +6,60 @@ class Stats extends _DataCollector.DataCollectorItem { super(Stats, key); this.publicActions = { /** - * @swagger - * /api?module=stats&action=getStats: - * get: - * description: get stats - * tags: - * - stats - * parameters: - * - name: module - * in: query - * required: true - * enum: [stats] - * - name: action - * in: query - * required: true - * enum: [getStats] - * - $ref: '#/parameters/limit' - * - $ref: '#/parameters/next' - * - $ref: '#/parameters/prev' - * responses: - * 200: - * $ref: '#/definitions/ResponseList' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=stats&action=getStats: + * get: + * description: get stats + * tags: + * - stats + * parameters: + * - name: module + * in: query + * required: true + * enum: [stats] + * - name: action + * in: query + * required: true + * enum: [getStats] + * - $ref: '#/parameters/limit' + * - $ref: '#/parameters/next' + * - $ref: '#/parameters/prev' + * responses: + * 200: + * $ref: '#/definitions/ResponseList' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getStats: params => { return this.getPageData({}, params); }, /** - * @swagger - * /api?module=stats&action=getLatest: - * get: - * description: get stats - * tags: - * - stats - * parameters: - * - name: module - * in: query - * required: true - * enum: [stats] - * - name: action - * in: query - * required: true - * enum: [getLatest] - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ - getLatest: () => { + * @swagger + * /api?module=stats&action=getLatest: + * get: + * description: get stats + * tags: + * - stats + * parameters: + * - name: module + * in: query + * required: true + * enum: [stats] + * - name: action + * in: query + * required: true + * enum: [getLatest] + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ + getLatest: async () => { return this.getLatest(); } }; diff --git a/dist/api/modules/Summary.js b/dist/api/modules/Summary.js index 3b275619..d1883637 100644 --- a/dist/api/modules/Summary.js +++ b/dist/api/modules/Summary.js @@ -8,35 +8,35 @@ class Summary extends _DataCollector.DataCollectorItem { super(BlocksSummary, key, { sortDir, cursorField, sortable }); this.publicActions = { /** - * @swagger - * /api?module=summary&action=getSummary: - * get: - * description: get block summary - * tags: - * - summary - * parameters: - * - name: module - * in: query - * required: true - * enum: [summary] - * - name: action - * in: query - * required: true - * enum: [getSummary] - * - name: hash - * description: block hash - * in: query - * schema: - * type: string - * example: - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=summary&action=getSummary: + * get: + * description: get block summary + * tags: + * - summary + * parameters: + * - name: module + * in: query + * required: true + * enum: [summary] + * - name: action + * in: query + * required: true + * enum: [getSummary] + * - name: hash + * description: block hash + * in: query + * schema: + * type: string + * example: + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getSummary: params => { const { hash } = params; @@ -46,32 +46,32 @@ class Summary extends _DataCollector.DataCollectorItem { } }, /** - * @swagger - * /api?module=summary&action=getSummaries: - * get: - * description: get list of summaries - * tags: - * - summary - * parameters: - * - name: module - * in: query - * required: true - * enum: [summary] - * - name: action - * in: query - * required: true - * enum: [getSummaries] - * - $ref: '#/parameters/limit' - * - $ref: '#/parameters/next' - * - $ref: '#/parameters/prev' - * responses: - * 200: - * $ref: '#/definitions/ResponseList' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=summary&action=getSummaries: + * get: + * description: get list of summaries + * tags: + * - summary + * parameters: + * - name: module + * in: query + * required: true + * enum: [summary] + * - name: action + * in: query + * required: true + * enum: [getSummaries] + * - $ref: '#/parameters/limit' + * - $ref: '#/parameters/next' + * - $ref: '#/parameters/prev' + * responses: + * 200: + * $ref: '#/definitions/ResponseList' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getSummaries: params => { return this.getPageData({}, params); diff --git a/dist/api/modules/Token.js b/dist/api/modules/Token.js index d7e0706f..b643cb76 100644 --- a/dist/api/modules/Token.js +++ b/dist/api/modules/Token.js @@ -7,65 +7,65 @@ class Token extends _DataCollector.DataCollectorItem { super(TokensAddrs, key); this.publicActions = { /** - * @swagger - * /api?module=tokens&action=getTokenAccounts: - * get: - * description: get token accounts - * tags: - * - tokens - * parameters: - * - name: module - * in: query - * required: true - * enum: [tokens] - * - name: action - * in: query - * required: true - * enum: [getTokenAccounts] - * - $ref: '#/parameters/address' - * - $ref: '#/parameters/limit' - * - $ref: '#/parameters/next' - * - $ref: '#/parameters/prev' - * responses: - * 200: - * $ref: '#/definitions/ResponseList' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=tokens&action=getTokenAccounts: + * get: + * description: get token accounts + * tags: + * - tokens + * parameters: + * - name: module + * in: query + * required: true + * enum: [tokens] + * - name: action + * in: query + * required: true + * enum: [getTokenAccounts] + * - $ref: '#/parameters/address' + * - $ref: '#/parameters/limit' + * - $ref: '#/parameters/next' + * - $ref: '#/parameters/prev' + * responses: + * 200: + * $ref: '#/definitions/ResponseList' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getTokenAccounts: params => { const contract = params.contract || params.address; if (contract) return this.getPageData({ contract }, params); }, /** - * @swagger - * /api?module=tokens&action=getTokensByAddress: - * get: - * description: get token by address - * tags: - * - tokens - * parameters: - * - name: module - * in: query - * required: true - * enum: [tokens] - * - name: action - * in: query - * required: true - * enum: [getTokensByAddress] - * - $ref: '#/parameters/address' - * - $ref: '#/parameters/limit' - * - $ref: '#/parameters/next' - * - $ref: '#/parameters/prev' - * responses: - * 200: - * $ref: '#/definitions/ResponseList' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=tokens&action=getTokensByAddress: + * get: + * description: get token by address + * tags: + * - tokens + * parameters: + * - name: module + * in: query + * required: true + * enum: [tokens] + * - name: action + * in: query + * required: true + * enum: [getTokensByAddress] + * - $ref: '#/parameters/address' + * - $ref: '#/parameters/limit' + * - $ref: '#/parameters/next' + * - $ref: '#/parameters/prev' + * responses: + * 200: + * $ref: '#/definitions/ResponseList' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getTokensByAddress: async params => { const address = params.address; const from = this.parent.collectionsNames.Addrs; @@ -83,96 +83,96 @@ class Token extends _DataCollector.DataCollectorItem { } }, /** - * @swagger - * /api?module=tokens&action=getContractAccount: - * get: - * description: get token account - * tags: - * - tokens - * parameters: - * - name: module - * in: query - * required: true - * enum: [tokens] - * - name: action - * in: query - * required: true - * enum: [getContractAccount] - * - $ref: '#/parameters/address' - * - $ref: '#/parameters/contract' - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=tokens&action=getContractAccount: + * get: + * description: get token account + * tags: + * - tokens + * parameters: + * - name: module + * in: query + * required: true + * enum: [tokens] + * - name: action + * in: query + * required: true + * enum: [getContractAccount] + * - $ref: '#/parameters/address' + * - $ref: '#/parameters/contract' + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getContractAccount: params => { const { address, contract } = params; return this.getOne({ address, contract }); }, /** - * @swagger - * /api?module=tokens&action=getTokenAccount: - * get: - * description: get token account and address data - * tags: - * - tokens - * parameters: - * - name: module - * in: query - * required: true - * enum: [tokens] - * - name: action - * in: query - * required: true - * enum: [getTokenAccount] - * - $ref: '#/parameters/address' - * - $ref: '#/parameters/contract' - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=tokens&action=getTokenAccount: + * get: + * description: get token account and address data + * tags: + * - tokens + * parameters: + * - name: module + * in: query + * required: true + * enum: [tokens] + * - name: action + * in: query + * required: true + * enum: [getTokenAccount] + * - $ref: '#/parameters/address' + * - $ref: '#/parameters/contract' + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getTokenAccount: async params => { const { address, contract } = params; const account = await this.getOne({ address, contract }); return this.parent.addAddressData(contract, account, '_contractData'); }, /** - * @swagger - * /api?module=tokens&action=getTokenBalance: - * get: - * description: get token balance - * tags: - * - tokens - * parameters: - * - name: module - * in: query - * required: true - * enum: [tokens] - * - name: action - * in: query - * required: true - * enum: [getTokenBalance] - * - $ref: '#/parameters/contract' - * - name: addresses - * in: query - * type: array - * required: false - * description: include only this addresses in balance - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=tokens&action=getTokenBalance: + * get: + * description: get token balance + * tags: + * - tokens + * parameters: + * - name: module + * in: query + * required: true + * enum: [tokens] + * - name: action + * in: query + * required: true + * enum: [getTokenBalance] + * - $ref: '#/parameters/contract' + * - name: addresses + * in: query + * type: array + * required: false + * description: include only this addresses in balance + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getTokenBalance: async params => { const { contract, addresses } = params; if (!contract) return; diff --git a/dist/api/modules/Tx.js b/dist/api/modules/Tx.js index 1eb6a812..9d28261d 100644 --- a/dist/api/modules/Tx.js +++ b/dist/api/modules/Tx.js @@ -10,41 +10,41 @@ class Tx extends _DataCollector.DataCollectorItem { super(Txs, key, { cursorField, sortDir, sortable }); this.publicActions = { /** - * @swagger - * /api?module=transactions&action=getTransactions: - * get: - * description: get transactions - * tags: - * - transactions - * produces: - * - application/json - * parameters: - * - name: module - * in: query - * required: true - * enum: [transactions] - * - name: action - * in: query - * required: true - * enum: [getTransactions] - * - name: query - * in: query - * required: false - * schema: - * type: object - * example: - * txType:normal - * - $ref: '#/parameters/limit' - * - $ref: '#/parameters/next' - * - $ref: '#/parameters/prev' - * responses: - * 200: - * $ref: '#/definitions/ResponseList' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=transactions&action=getTransactions: + * get: + * description: get transactions + * tags: + * - transactions + * produces: + * - application/json + * parameters: + * - name: module + * in: query + * required: true + * enum: [transactions] + * - name: action + * in: query + * required: true + * enum: [getTransactions] + * - name: query + * in: query + * required: false + * schema: + * type: object + * example: + * txType:normal + * - $ref: '#/parameters/limit' + * - $ref: '#/parameters/next' + * - $ref: '#/parameters/prev' + * responses: + * 200: + * $ref: '#/definitions/ResponseList' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getTransactions: params => { let query = {}; let txType = params.query ? params.query.txType : null; @@ -54,30 +54,30 @@ class Tx extends _DataCollector.DataCollectorItem { return this.getPageData(query, params); }, /** - * @swagger - * /api?module=transactions&action=getTransaction: - * get: - * description: get transaction - * tags: - * - transactions - * parameters: - * - name: module - * in: query - * required: true - * enum: [transactions] - * - name: action - * in: query - * required: true - * enum: [getTransaction] - * - $ref: '#/parameters/txHash' - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=transactions&action=getTransaction: + * get: + * description: get transaction + * tags: + * - transactions + * parameters: + * - name: module + * in: query + * required: true + * enum: [transactions] + * - name: action + * in: query + * required: true + * enum: [getTransaction] + * - $ref: '#/parameters/txHash' + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getTransaction: async params => { const hash = params.hash; @@ -90,34 +90,34 @@ class Tx extends _DataCollector.DataCollectorItem { }, /** - * @swagger - * /api?module=transactions&action=getTransactionWithAddressData: - * get: - * description: get transaction - * tags: - * - transactions - * parameters: - * - name: module - * in: query - * required: true - * enum: [transactions] - * - name: action - * in: query - * required: true - * enum: [getTransactionWithAddressData] - * - name: hash - * in: query - * required: true - * schema: - * type: string - * responses: - * 200: - * $ref: '#/definitions/Response' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=transactions&action=getTransactionWithAddressData: + * get: + * description: get transaction + * tags: + * - transactions + * parameters: + * - name: module + * in: query + * required: true + * enum: [transactions] + * - name: action + * in: query + * required: true + * enum: [getTransactionWithAddressData] + * - name: hash + * in: query + * required: true + * schema: + * type: string + * responses: + * 200: + * $ref: '#/definitions/Response' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getTransactionWithAddressData: async params => { let data = await this.publicActions.getTransaction(params); let tx = data ? data.data : null; @@ -142,33 +142,33 @@ class Tx extends _DataCollector.DataCollectorItem { }, /** - * @swagger - * /api?module=transactions&action=getTransactionsByBlock: - * get: - * description: get transaction - * tags: - * - transactions - * parameters: - * - name: module - * in: query - * required: true - * enum: [transactions] - * - name: action - * in: query - * required: true - * enum: [getTransactionsByBlock] - * - $ref: '#/parameters/hashOrNumber' - * - $ref: '#/parameters/limit' - * - $ref: '#/parameters/next' - * - $ref: '#/parameters/prev' - * responses: - * 200: - * $ref: '#/definitions/ResponseList' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=transactions&action=getTransactionsByBlock: + * get: + * description: get transaction + * tags: + * - transactions + * parameters: + * - name: module + * in: query + * required: true + * enum: [transactions] + * - name: action + * in: query + * required: true + * enum: [getTransactionsByBlock] + * - $ref: '#/parameters/hashOrNumber' + * - $ref: '#/parameters/limit' + * - $ref: '#/parameters/next' + * - $ref: '#/parameters/prev' + * responses: + * 200: + * $ref: '#/definitions/ResponseList' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getTransactionsByBlock: params => { const hashOrNumber = params.hashOrNumber || params.number; @@ -181,30 +181,30 @@ class Tx extends _DataCollector.DataCollectorItem { } }, /** - * @swagger - * /api?module=transactions&action=getTransactionsByAddress: - * get: - * description: get transactions by address - * tags: - * - transactions - * parameters: - * - name: module - * in: query - * required: true - * enum: [transactions] - * - name: action - * in: query - * required: true - * enum: [getTransactionsByAddress] - * - $ref: '#/parameters/address' - * responses: - * 200: - * $ref: '#/definitions/ResponseList' - * 400: - * $ref: '#/responses/BadRequest' - * 404: - * $ref: '#/responses/NotFound' - */ + * @swagger + * /api?module=transactions&action=getTransactionsByAddress: + * get: + * description: get transactions by address + * tags: + * - transactions + * parameters: + * - name: module + * in: query + * required: true + * enum: [transactions] + * - name: action + * in: query + * required: true + * enum: [getTransactionsByAddress] + * - $ref: '#/parameters/address' + * responses: + * 200: + * $ref: '#/definitions/ResponseList' + * 400: + * $ref: '#/responses/BadRequest' + * 404: + * $ref: '#/responses/NotFound' + */ getTransactionsByAddress: params => { let address = params.address; return this.getPageData( diff --git a/dist/lib/defaultConfig.js b/dist/lib/defaultConfig.js index 4ff1497e..51b98fb9 100644 --- a/dist/lib/defaultConfig.js +++ b/dist/lib/defaultConfig.js @@ -5,9 +5,9 @@ var _types = require("./types"); var _delayedFields = _interopRequireDefault(require("./delayedFields")); var _servicesConfig = require("../services/servicesConfig");function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /** - * This file provides default values, - * use /config.json, to overwrite settings - */const services = Object.assign({}, _servicesConfig.servicesNames);for (let s in services) { + * This file provides default values, + * use /config.json, to overwrite settings + */const services = Object.assign({}, _servicesConfig.servicesNames);for (let s in services) { services[s] = true; } diff --git a/dist/lib/delayedFields.js b/dist/lib/delayedFields.js index 82a7df7e..34c0f45d 100644 --- a/dist/lib/delayedFields.js +++ b/dist/lib/delayedFields.js @@ -1,11 +1,11 @@ "use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { /* Address: { - getAddress: { - fields: ['balance', 'txBalance'], - action: 'updateAddress', - runIfEmpty: true - } - }, */ + getAddress: { + fields: ['balance', 'txBalance'], + action: 'updateAddress', + runIfEmpty: true + } + }, */ ContractVerification: { getVersions: { action: 'getVersions', diff --git a/dist/lib/ids.js b/dist/lib/ids.js index ef8aa6da..de83c65a 100644 --- a/dist/lib/ids.js +++ b/dist/lib/ids.js @@ -10,13 +10,13 @@ const checkNumbers = payload => { const padBlockNumber = number => number.toString(16).padStart(7, 0); /** - * Generates sortable and immutable ids for txs and events - * id structure: - * [blockNumber](24b) - * [txIndex][16b] - * [index](optional)(16b) - * [blockHash|txHash][72b] - */ + * Generates sortable and immutable ids for txs and events + * id structure: + * [blockNumber](24b) + * [txIndex][16b] + * [index](optional)(16b) + * [blockHash|txHash][72b] + */ const generateId = ({ blockNumber, transactionIndex, hash, index }) => { try { diff --git a/dist/lib/initialConfiguration.js b/dist/lib/initialConfiguration.js index b1572a3e..7e31bbf3 100644 --- a/dist/lib/initialConfiguration.js +++ b/dist/lib/initialConfiguration.js @@ -3,8 +3,8 @@ var _fs = _interopRequireDefault(require("fs")); var _utils = require("./utils");function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /** - * - */ + * + */ const defaultConfig = { nativeContracts: { diff --git a/dist/lib/utils.js b/dist/lib/utils.js index d2083cd5..2794020d 100644 --- a/dist/lib/utils.js +++ b/dist/lib/utils.js @@ -3,7 +3,7 @@ var _types = require("./types"); var _mongodb = require("mongodb"); var _rskUtils = require("@rsksmart/rsk-utils"); -Object.keys(_rskUtils).forEach(function (key) {if (key === "default" || key === "__esModule") return;if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;Object.defineProperty(exports, key, { enumerable: true, get: function () {return _rskUtils[key];} });});var _crypto = _interopRequireDefault(require("crypto"));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} +Object.keys(_rskUtils).forEach(function (key) {if (key === "default" || key === "__esModule") return;if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;if (key in exports && exports[key] === _rskUtils[key]) return;Object.defineProperty(exports, key, { enumerable: true, get: function () {return _rskUtils[key];} });});var _crypto = _interopRequireDefault(require("crypto"));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} const bigNumberDoc = bigNumber => { return '0x' + bigNumber.toString(16); diff --git a/dist/services/Service/ServiceClient.js b/dist/services/Service/ServiceClient.js index 5db0fcab..dc343849 100644 --- a/dist/services/Service/ServiceClient.js +++ b/dist/services/Service/ServiceClient.js @@ -49,11 +49,11 @@ const clientMethodToPromise = (client, method) => { }; /** - * Service Client - * @param {String} uri - * @param {*} credentials - * @returns - */ + * Service Client + * @param {String} uri + * @param {*} credentials + * @returns + */ async function Client(uri, credentials) { credentials = credentials || (0, _ServiceServer.clientCredentials)(); diff --git a/dist/services/Service/ServiceServer.js b/dist/services/Service/ServiceServer.js index 346f0af9..37102265 100644 --- a/dist/services/Service/ServiceServer.js +++ b/dist/services/Service/ServiceServer.js @@ -6,14 +6,14 @@ const createCredentials = _grpc.default.ServerCredentials.createInsecure; const clientCredentials = _grpc.default.credentials.createInsecure; /** - * Service Server - * Creates a service - * @param {String} uri server URI - * @param {Object} [{ name }={}] - * @param {Function} executor, expose the 'create' object that contains - * the methods to create new services. - * @returns {Object} - */exports.clientCredentials = clientCredentials; + * Service Server + * Creates a service + * @param {String} uri server URI + * @param {Object} [{ name }={}] + * @param {Function} executor, expose the 'create' object that contains + * the methods to create new services. + * @returns {Object} + */exports.clientCredentials = clientCredentials; function Service(uri, options = {}, executor) { if (typeof options !== 'object') throw new Error(`Invalid options`); const { name } = options; diff --git a/dist/services/Service/protos/services_pb.js b/dist/services/Service/protos/services_pb.js index cea41b44..82c2cd7f 100644 --- a/dist/services/Service/protos/services_pb.js +++ b/dist/services/Service/protos/services_pb.js @@ -24,192 +24,192 @@ goog.exportSymbol('proto.JoinRequest', null, global); goog.exportSymbol('proto.WorkerRequest', null, global); goog.exportSymbol('proto.WorkerResponse', null, global); /** - * 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 - */ + * 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.Empty = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.Empty, jspb.Message); if (goog.DEBUG && !COMPILED) { /** - * @public - * @override - */ + * @public + * @override + */ proto.Empty.displayName = 'proto.Empty'; } /** - * 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 - */ + * 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.EmptyRequest = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.EmptyRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** - * @public - * @override - */ + * @public + * @override + */ proto.EmptyRequest.displayName = 'proto.EmptyRequest'; } /** - * 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 - */ + * 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.WorkerRequest = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.WorkerRequest.repeatedFields_, null); }; goog.inherits(proto.WorkerRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** - * @public - * @override - */ + * @public + * @override + */ proto.WorkerRequest.displayName = 'proto.WorkerRequest'; } /** - * 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 - */ + * 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.WorkerResponse = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.WorkerResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** - * @public - * @override - */ + * @public + * @override + */ proto.WorkerResponse.displayName = 'proto.WorkerResponse'; } /** - * 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 - */ + * 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.EventRequest = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.EventRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** - * @public - * @override - */ + * @public + * @override + */ proto.EventRequest.displayName = 'proto.EventRequest'; } /** - * 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 - */ + * 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.EventResponse = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.EventResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** - * @public - * @override - */ + * @public + * @override + */ proto.EventResponse.displayName = 'proto.EventResponse'; } /** - * 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 - */ + * 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.JoinRequest = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.JoinRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** - * @public - * @override - */ + * @public + * @override + */ proto.JoinRequest.displayName = 'proto.JoinRequest'; } /** - * 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 - */ + * 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.InfoRequest = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.InfoRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** - * @public - * @override - */ + * @public + * @override + */ proto.InfoRequest.displayName = 'proto.InfoRequest'; } /** - * 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 - */ + * 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.InfoResponse = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.InfoResponse.repeatedFields_, null); }; goog.inherits(proto.InfoResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** - * @public - * @override - */ + * @public + * @override + */ proto.InfoResponse.displayName = 'proto.InfoResponse'; } @@ -217,31 +217,31 @@ if (goog.DEBUG && !COMPILED) { if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ proto.Empty.prototype.toObject = function (opt_includeInstance) { return proto.Empty.toObject(opt_includeInstance, this); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.Empty} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.Empty} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ proto.Empty.toObject = function (includeInstance, msg) { var f,obj = {}; @@ -256,10 +256,10 @@ if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.Empty} - */ + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.Empty} + */ proto.Empty.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.Empty(); @@ -268,12 +268,12 @@ proto.Empty.deserializeBinary = function (bytes) { /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.Empty} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.Empty} - */ + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.Empty} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.Empty} + */ proto.Empty.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { @@ -291,9 +291,9 @@ proto.Empty.deserializeBinaryFromReader = function (msg, reader) { /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ proto.Empty.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.Empty.serializeBinaryToWriter(this, writer); @@ -302,12 +302,12 @@ proto.Empty.prototype.serializeBinary = function () { /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.Empty} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.Empty} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ proto.Empty.serializeBinaryToWriter = function (message, writer) { var f = undefined; }; @@ -318,31 +318,31 @@ proto.Empty.serializeBinaryToWriter = function (message, writer) { if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ proto.EmptyRequest.prototype.toObject = function (opt_includeInstance) { return proto.EmptyRequest.toObject(opt_includeInstance, this); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.EmptyRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.EmptyRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ proto.EmptyRequest.toObject = function (includeInstance, msg) { var f,obj = {}; @@ -357,10 +357,10 @@ if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.EmptyRequest} - */ + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.EmptyRequest} + */ proto.EmptyRequest.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.EmptyRequest(); @@ -369,12 +369,12 @@ proto.EmptyRequest.deserializeBinary = function (bytes) { /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.EmptyRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.EmptyRequest} - */ + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.EmptyRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.EmptyRequest} + */ proto.EmptyRequest.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { @@ -392,9 +392,9 @@ proto.EmptyRequest.deserializeBinaryFromReader = function (msg, reader) { /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ proto.EmptyRequest.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.EmptyRequest.serializeBinaryToWriter(this, writer); @@ -403,12 +403,12 @@ proto.EmptyRequest.prototype.serializeBinary = function () { /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.EmptyRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.EmptyRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ proto.EmptyRequest.serializeBinaryToWriter = function (message, writer) { var f = undefined; }; @@ -416,41 +416,41 @@ proto.EmptyRequest.serializeBinaryToWriter = function (message, writer) { /** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ proto.WorkerRequest.repeatedFields_ = [2]; if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ proto.WorkerRequest.prototype.toObject = function (opt_includeInstance) { return proto.WorkerRequest.toObject(opt_includeInstance, this); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.WorkerRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.WorkerRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ proto.WorkerRequest.toObject = function (includeInstance, msg) { var f,obj = { action: jspb.Message.getFieldWithDefault(msg, 1, ""), @@ -466,10 +466,10 @@ if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.WorkerRequest} - */ + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.WorkerRequest} + */ proto.WorkerRequest.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.WorkerRequest(); @@ -478,12 +478,12 @@ proto.WorkerRequest.deserializeBinary = function (bytes) { /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.WorkerRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.WorkerRequest} - */ + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.WorkerRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.WorkerRequest} + */ proto.WorkerRequest.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { @@ -509,9 +509,9 @@ proto.WorkerRequest.deserializeBinaryFromReader = function (msg, reader) { /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ proto.WorkerRequest.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.WorkerRequest.serializeBinaryToWriter(this, writer); @@ -520,12 +520,12 @@ proto.WorkerRequest.prototype.serializeBinary = function () { /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.WorkerRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.WorkerRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ proto.WorkerRequest.serializeBinaryToWriter = function (message, writer) { var f = undefined; f = message.getAction(); @@ -546,55 +546,55 @@ proto.WorkerRequest.serializeBinaryToWriter = function (message, writer) { /** - * optional string action = 1; - * @return {string} - */ + * optional string action = 1; + * @return {string} + */ proto.WorkerRequest.prototype.getAction = function () { return (/** @type {string} */jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {string} value - * @return {!proto.WorkerRequest} returns this - */ + * @param {string} value + * @return {!proto.WorkerRequest} returns this + */ proto.WorkerRequest.prototype.setAction = function (value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** - * repeated string args = 2; - * @return {!Array} - */ + * repeated string args = 2; + * @return {!Array} + */ proto.WorkerRequest.prototype.getArgsList = function () { return (/** @type {!Array} */jspb.Message.getRepeatedField(this, 2)); }; /** - * @param {!Array} value - * @return {!proto.WorkerRequest} returns this - */ + * @param {!Array} value + * @return {!proto.WorkerRequest} returns this + */ proto.WorkerRequest.prototype.setArgsList = function (value) { return jspb.Message.setField(this, 2, value || []); }; /** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.WorkerRequest} returns this - */ + * @param {string} value + * @param {number=} opt_index + * @return {!proto.WorkerRequest} returns this + */ proto.WorkerRequest.prototype.addArgs = function (value, opt_index) { return jspb.Message.addToRepeatedField(this, 2, value, opt_index); }; /** - * Clears the list making it empty but non-null. - * @return {!proto.WorkerRequest} returns this - */ + * Clears the list making it empty but non-null. + * @return {!proto.WorkerRequest} returns this + */ proto.WorkerRequest.prototype.clearArgsList = function () { return this.setArgsList([]); }; @@ -605,31 +605,31 @@ proto.WorkerRequest.prototype.clearArgsList = function () { if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ proto.WorkerResponse.prototype.toObject = function (opt_includeInstance) { return proto.WorkerResponse.toObject(opt_includeInstance, this); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.WorkerResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.WorkerResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ proto.WorkerResponse.toObject = function (includeInstance, msg) { var f,obj = { result: (f = msg.getResult()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) }; @@ -644,10 +644,10 @@ if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.WorkerResponse} - */ + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.WorkerResponse} + */ proto.WorkerResponse.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.WorkerResponse(); @@ -656,12 +656,12 @@ proto.WorkerResponse.deserializeBinary = function (bytes) { /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.WorkerResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.WorkerResponse} - */ + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.WorkerResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.WorkerResponse} + */ proto.WorkerResponse.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { @@ -684,9 +684,9 @@ proto.WorkerResponse.deserializeBinaryFromReader = function (msg, reader) { /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ proto.WorkerResponse.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.WorkerResponse.serializeBinaryToWriter(this, writer); @@ -695,12 +695,12 @@ proto.WorkerResponse.prototype.serializeBinary = function () { /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.WorkerResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.WorkerResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ proto.WorkerResponse.serializeBinaryToWriter = function (message, writer) { var f = undefined; f = message.getResult(); @@ -715,9 +715,9 @@ proto.WorkerResponse.serializeBinaryToWriter = function (message, writer) { /** - * optional google.protobuf.Struct result = 1; - * @return {?proto.google.protobuf.Struct} - */ + * optional google.protobuf.Struct result = 1; + * @return {?proto.google.protobuf.Struct} + */ proto.WorkerResponse.prototype.getResult = function () { return (/** @type{?proto.google.protobuf.Struct} */ jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 1)); @@ -725,27 +725,27 @@ proto.WorkerResponse.prototype.getResult = function () { /** - * @param {?proto.google.protobuf.Struct|undefined} value - * @return {!proto.WorkerResponse} returns this - */ + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.WorkerResponse} returns this +*/ proto.WorkerResponse.prototype.setResult = function (value) { return jspb.Message.setWrapperField(this, 1, value); }; /** - * Clears the message field making it undefined. - * @return {!proto.WorkerResponse} returns this - */ + * Clears the message field making it undefined. + * @return {!proto.WorkerResponse} returns this + */ proto.WorkerResponse.prototype.clearResult = function () { return this.setResult(undefined); }; /** - * Returns whether this field is set. - * @return {boolean} - */ + * Returns whether this field is set. + * @return {boolean} + */ proto.WorkerResponse.prototype.hasResult = function () { return jspb.Message.getField(this, 1) != null; }; @@ -756,31 +756,31 @@ proto.WorkerResponse.prototype.hasResult = function () { if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ proto.EventRequest.prototype.toObject = function (opt_includeInstance) { return proto.EventRequest.toObject(opt_includeInstance, this); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.EventRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.EventRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ proto.EventRequest.toObject = function (includeInstance, msg) { var f,obj = { event: jspb.Message.getFieldWithDefault(msg, 1, ""), @@ -796,10 +796,10 @@ if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.EventRequest} - */ + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.EventRequest} + */ proto.EventRequest.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.EventRequest(); @@ -808,12 +808,12 @@ proto.EventRequest.deserializeBinary = function (bytes) { /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.EventRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.EventRequest} - */ + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.EventRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.EventRequest} + */ proto.EventRequest.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { @@ -840,9 +840,9 @@ proto.EventRequest.deserializeBinaryFromReader = function (msg, reader) { /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ proto.EventRequest.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.EventRequest.serializeBinaryToWriter(this, writer); @@ -851,12 +851,12 @@ proto.EventRequest.prototype.serializeBinary = function () { /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.EventRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.EventRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ proto.EventRequest.serializeBinaryToWriter = function (message, writer) { var f = undefined; f = message.getEvent(); @@ -878,27 +878,27 @@ proto.EventRequest.serializeBinaryToWriter = function (message, writer) { /** - * optional string event = 1; - * @return {string} - */ + * optional string event = 1; + * @return {string} + */ proto.EventRequest.prototype.getEvent = function () { return (/** @type {string} */jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {string} value - * @return {!proto.EventRequest} returns this - */ + * @param {string} value + * @return {!proto.EventRequest} returns this + */ proto.EventRequest.prototype.setEvent = function (value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** - * optional google.protobuf.Struct data = 2; - * @return {?proto.google.protobuf.Struct} - */ + * optional google.protobuf.Struct data = 2; + * @return {?proto.google.protobuf.Struct} + */ proto.EventRequest.prototype.getData = function () { return (/** @type{?proto.google.protobuf.Struct} */ jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); @@ -906,27 +906,27 @@ proto.EventRequest.prototype.getData = function () { /** - * @param {?proto.google.protobuf.Struct|undefined} value - * @return {!proto.EventRequest} returns this - */ + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.EventRequest} returns this +*/ proto.EventRequest.prototype.setData = function (value) { return jspb.Message.setWrapperField(this, 2, value); }; /** - * Clears the message field making it undefined. - * @return {!proto.EventRequest} returns this - */ + * Clears the message field making it undefined. + * @return {!proto.EventRequest} returns this + */ proto.EventRequest.prototype.clearData = function () { return this.setData(undefined); }; /** - * Returns whether this field is set. - * @return {boolean} - */ + * Returns whether this field is set. + * @return {boolean} + */ proto.EventRequest.prototype.hasData = function () { return jspb.Message.getField(this, 2) != null; }; @@ -937,31 +937,31 @@ proto.EventRequest.prototype.hasData = function () { if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ proto.EventResponse.prototype.toObject = function (opt_includeInstance) { return proto.EventResponse.toObject(opt_includeInstance, this); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.EventResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.EventResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ proto.EventResponse.toObject = function (includeInstance, msg) { var f,obj = { event: jspb.Message.getFieldWithDefault(msg, 1, ""), @@ -977,10 +977,10 @@ if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.EventResponse} - */ + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.EventResponse} + */ proto.EventResponse.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.EventResponse(); @@ -989,12 +989,12 @@ proto.EventResponse.deserializeBinary = function (bytes) { /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.EventResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.EventResponse} - */ + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.EventResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.EventResponse} + */ proto.EventResponse.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { @@ -1021,9 +1021,9 @@ proto.EventResponse.deserializeBinaryFromReader = function (msg, reader) { /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ proto.EventResponse.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.EventResponse.serializeBinaryToWriter(this, writer); @@ -1032,12 +1032,12 @@ proto.EventResponse.prototype.serializeBinary = function () { /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.EventResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.EventResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ proto.EventResponse.serializeBinaryToWriter = function (message, writer) { var f = undefined; f = message.getEvent(); @@ -1059,27 +1059,27 @@ proto.EventResponse.serializeBinaryToWriter = function (message, writer) { /** - * optional string event = 1; - * @return {string} - */ + * optional string event = 1; + * @return {string} + */ proto.EventResponse.prototype.getEvent = function () { return (/** @type {string} */jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {string} value - * @return {!proto.EventResponse} returns this - */ + * @param {string} value + * @return {!proto.EventResponse} returns this + */ proto.EventResponse.prototype.setEvent = function (value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** - * optional google.protobuf.Struct data = 2; - * @return {?proto.google.protobuf.Struct} - */ + * optional google.protobuf.Struct data = 2; + * @return {?proto.google.protobuf.Struct} + */ proto.EventResponse.prototype.getData = function () { return (/** @type{?proto.google.protobuf.Struct} */ jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); @@ -1087,27 +1087,27 @@ proto.EventResponse.prototype.getData = function () { /** - * @param {?proto.google.protobuf.Struct|undefined} value - * @return {!proto.EventResponse} returns this - */ + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.EventResponse} returns this +*/ proto.EventResponse.prototype.setData = function (value) { return jspb.Message.setWrapperField(this, 2, value); }; /** - * Clears the message field making it undefined. - * @return {!proto.EventResponse} returns this - */ + * Clears the message field making it undefined. + * @return {!proto.EventResponse} returns this + */ proto.EventResponse.prototype.clearData = function () { return this.setData(undefined); }; /** - * Returns whether this field is set. - * @return {boolean} - */ + * Returns whether this field is set. + * @return {boolean} + */ proto.EventResponse.prototype.hasData = function () { return jspb.Message.getField(this, 2) != null; }; @@ -1118,31 +1118,31 @@ proto.EventResponse.prototype.hasData = function () { if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ proto.JoinRequest.prototype.toObject = function (opt_includeInstance) { return proto.JoinRequest.toObject(opt_includeInstance, this); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.JoinRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.JoinRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ proto.JoinRequest.toObject = function (includeInstance, msg) { var f,obj = { user: jspb.Message.getFieldWithDefault(msg, 1, "") }; @@ -1157,10 +1157,10 @@ if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.JoinRequest} - */ + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.JoinRequest} + */ proto.JoinRequest.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.JoinRequest(); @@ -1169,12 +1169,12 @@ proto.JoinRequest.deserializeBinary = function (bytes) { /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.JoinRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.JoinRequest} - */ + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.JoinRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.JoinRequest} + */ proto.JoinRequest.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { @@ -1196,9 +1196,9 @@ proto.JoinRequest.deserializeBinaryFromReader = function (msg, reader) { /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ proto.JoinRequest.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.JoinRequest.serializeBinaryToWriter(this, writer); @@ -1207,12 +1207,12 @@ proto.JoinRequest.prototype.serializeBinary = function () { /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.JoinRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.JoinRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ proto.JoinRequest.serializeBinaryToWriter = function (message, writer) { var f = undefined; f = message.getUser(); @@ -1226,18 +1226,18 @@ proto.JoinRequest.serializeBinaryToWriter = function (message, writer) { /** - * optional string user = 1; - * @return {string} - */ + * optional string user = 1; + * @return {string} + */ proto.JoinRequest.prototype.getUser = function () { return (/** @type {string} */jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {string} value - * @return {!proto.JoinRequest} returns this - */ + * @param {string} value + * @return {!proto.JoinRequest} returns this + */ proto.JoinRequest.prototype.setUser = function (value) { return jspb.Message.setProto3StringField(this, 1, value); }; @@ -1248,31 +1248,31 @@ proto.JoinRequest.prototype.setUser = function (value) { if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ proto.InfoRequest.prototype.toObject = function (opt_includeInstance) { return proto.InfoRequest.toObject(opt_includeInstance, this); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.InfoRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.InfoRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ proto.InfoRequest.toObject = function (includeInstance, msg) { var f,obj = {}; @@ -1287,10 +1287,10 @@ if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.InfoRequest} - */ + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.InfoRequest} + */ proto.InfoRequest.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.InfoRequest(); @@ -1299,12 +1299,12 @@ proto.InfoRequest.deserializeBinary = function (bytes) { /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.InfoRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.InfoRequest} - */ + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.InfoRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.InfoRequest} + */ proto.InfoRequest.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { @@ -1322,9 +1322,9 @@ proto.InfoRequest.deserializeBinaryFromReader = function (msg, reader) { /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ proto.InfoRequest.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.InfoRequest.serializeBinaryToWriter(this, writer); @@ -1333,12 +1333,12 @@ proto.InfoRequest.prototype.serializeBinary = function () { /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.InfoRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.InfoRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ proto.InfoRequest.serializeBinaryToWriter = function (message, writer) { var f = undefined; }; @@ -1346,41 +1346,41 @@ proto.InfoRequest.serializeBinaryToWriter = function (message, writer) { /** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ proto.InfoResponse.repeatedFields_ = [2]; if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ proto.InfoResponse.prototype.toObject = function (opt_includeInstance) { return proto.InfoResponse.toObject(opt_includeInstance, this); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.InfoResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.InfoResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ proto.InfoResponse.toObject = function (includeInstance, msg) { var f,obj = { name: jspb.Message.getFieldWithDefault(msg, 1, ""), @@ -1396,10 +1396,10 @@ if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.InfoResponse} - */ + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.InfoResponse} + */ proto.InfoResponse.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.InfoResponse(); @@ -1408,12 +1408,12 @@ proto.InfoResponse.deserializeBinary = function (bytes) { /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.InfoResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.InfoResponse} - */ + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.InfoResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.InfoResponse} + */ proto.InfoResponse.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { @@ -1439,9 +1439,9 @@ proto.InfoResponse.deserializeBinaryFromReader = function (msg, reader) { /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ proto.InfoResponse.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.InfoResponse.serializeBinaryToWriter(this, writer); @@ -1450,12 +1450,12 @@ proto.InfoResponse.prototype.serializeBinary = function () { /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.InfoResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.InfoResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ proto.InfoResponse.serializeBinaryToWriter = function (message, writer) { var f = undefined; f = message.getName(); @@ -1476,55 +1476,55 @@ proto.InfoResponse.serializeBinaryToWriter = function (message, writer) { /** - * optional string name = 1; - * @return {string} - */ + * optional string name = 1; + * @return {string} + */ proto.InfoResponse.prototype.getName = function () { return (/** @type {string} */jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {string} value - * @return {!proto.InfoResponse} returns this - */ + * @param {string} value + * @return {!proto.InfoResponse} returns this + */ proto.InfoResponse.prototype.setName = function (value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** - * repeated string protos = 2; - * @return {!Array} - */ + * repeated string protos = 2; + * @return {!Array} + */ proto.InfoResponse.prototype.getProtosList = function () { return (/** @type {!Array} */jspb.Message.getRepeatedField(this, 2)); }; /** - * @param {!Array} value - * @return {!proto.InfoResponse} returns this - */ + * @param {!Array} value + * @return {!proto.InfoResponse} returns this + */ proto.InfoResponse.prototype.setProtosList = function (value) { return jspb.Message.setField(this, 2, value || []); }; /** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.InfoResponse} returns this - */ + * @param {string} value + * @param {number=} opt_index + * @return {!proto.InfoResponse} returns this + */ proto.InfoResponse.prototype.addProtos = function (value, opt_index) { return jspb.Message.addToRepeatedField(this, 2, value, opt_index); }; /** - * Clears the list making it empty but non-null. - * @return {!proto.InfoResponse} returns this - */ + * Clears the list making it empty but non-null. + * @return {!proto.InfoResponse} returns this + */ proto.InfoResponse.prototype.clearProtosList = function () { return this.setProtosList([]); }; diff --git a/dist/services/classes/Address.js b/dist/services/classes/Address.js index 62bdeae9..069c86e9 100644 --- a/dist/services/classes/Address.js +++ b/dist/services/classes/Address.js @@ -248,8 +248,8 @@ function getDeployedCode(tx, address) { } /** - * Address data proxy - */ + * Address data proxy + */ function createAddressData({ address, isNative, name }) { const type = isNative ? _types.addrTypes.CONTRACT : _types.addrTypes.ADDRESS; const dataHandler = { diff --git a/dist/services/classes/BcStats.js b/dist/services/classes/BcStats.js index 42d500c6..033e874e 100644 --- a/dist/services/classes/BcStats.js +++ b/dist/services/classes/BcStats.js @@ -1,6 +1,8 @@ "use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.BcStats = void 0;var _BlocksBase = require("../../lib/BlocksBase"); var _getCirculatingSupply = _interopRequireDefault(require("../../api/lib/getCirculatingSupply")); -var _getActiveAccounts = _interopRequireDefault(require("../../api/lib/getActiveAccounts"));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} +var _getActiveAccounts = _interopRequireDefault(require("../../api/lib/getActiveAccounts")); +var _rskContractParser = require("rsk-contract-parser"); +var _utils = require("../../lib/utils");function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} class BcStats extends _BlocksBase.BlocksBase { constructor(db, options) { @@ -20,6 +22,19 @@ class BcStats extends _BlocksBase.BlocksBase { } } + async bridgeCall(method, params = []) { + try { + const { nod3, initConfig } = this; + const address = initConfig.nativeContracts.bridge; + const abi = _rskContractParser.abi.bridge; + const contract = (0, _rskContractParser.Contract)(abi, { address, nod3 }); + const res = await contract.call(method, params); + return res; + } catch (err) { + this.log.debug(err); + } + } + async getStats(blockHash, blockNumber) { try { if (undefined === blockHash || undefined === blockNumber) { @@ -31,8 +46,12 @@ class BcStats extends _BlocksBase.BlocksBase { const hashrate = await this.nod3.eth.netHashrate(); const circulating = await this.getCirculating(); let activeAccounts = await (0, _getActiveAccounts.default)(this.collections); + let lockingCap = await this.bridgeCall('getLockingCap'); + // lockingCap = lockingCap.toString() + const bridge = (0, _utils.serialize)({ lockingCap }); const timestamp = Date.now(); - return Object.assign({}, { circulating, activeAccounts, hashrate, timestamp, blockHash, blockNumber }); + const res = Object.assign({}, { circulating, activeAccounts, hashrate, timestamp, blockHash, blockNumber, bridge }); + return res; } catch (err) { this.log.error(err); return Promise.reject(err); diff --git a/dist/services/classes/Tx.js b/dist/services/classes/Tx.js index 8538c506..23f0d854 100644 --- a/dist/services/classes/Tx.js +++ b/dist/services/classes/Tx.js @@ -176,8 +176,8 @@ class Tx extends _BcThing.BcThing { let contract = await Addr.getContract(); /* When a contract logs an event in the same block that self-destructs, - the contract has no code in that block. - */ + the contract has no code in that block. + */ if (!contract) { let { block } = addressOptions; let { number } = block; diff --git a/dist/services/userEvents/userEventsService.js b/dist/services/userEvents/userEventsService.js index e3651f80..b6943a0c 100644 --- a/dist/services/userEvents/userEventsService.js +++ b/dist/services/userEvents/userEventsService.js @@ -7,7 +7,7 @@ var _utils = require("../../lib/utils"); var _ContractVerifierModule = _interopRequireDefault(require("./ContractVerifierModule")); var _types = require("../../lib/types");function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /* import { RequestCache } from './RequestCache' - import AddressModule from './AddressModule' */ +import AddressModule from './AddressModule' */ const log = (0, _Logger.default)('UserRequests', _config.default.blocks.log); const verifierConfig = _config.default.api.contractVerifier; diff --git a/package-lock.json b/package-lock.json index f596300e..6fdf35c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "rsk-explorer-api", - "version": "1.1.6", + "version": "1.1.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 037c6863..faf583af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rsk-explorer-api", - "version": "1.1.6", + "version": "1.1.7", "description": "", "main": "index.js", "scripts": { diff --git a/public/swagger.json b/public/swagger.json index 4f9c9f5b..1374e61d 100644 --- a/public/swagger.json +++ b/public/swagger.json @@ -1,7 +1,7 @@ { "info": { "title": "rsk-explorer-api", - "version": "1.1.6", + "version": "1.1.7", "description": "explorer API Documentation" }, "swagger": "2.0", @@ -610,7 +610,7 @@ } } }, - "/api?module=contractVerifier&action=getVersificationResult": { + "/api?module=contractVerifier&action=getVerificationResult": { "get": { "description": "Gets the result of source code verification", "tags": [