-
Notifications
You must be signed in to change notification settings - Fork 0
/
getBestBlockHash.js
executable file
·59 lines (56 loc) · 1.53 KB
/
getBestBlockHash.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
* @param {Object} coreAPI
* @return {getBestBlockHash}
*/
const getBestBlockHashFactory = (coreAPI) => {
/**
* Layer 1 endpoint
* Returns block hash of the chaintip
* @typedef getBestBlockHash
* @return {Promise<string>} - latest block hash
*/
async function getBestBlockHash() {
return coreAPI.getBestBlockHash();
}
return getBestBlockHash;
};
/* eslint-disable max-len */
/**
* @swagger
* /getBestBlockHash:
* post:
* operationId: getBestBlockHash
* deprecated: false
* summary: getBestBlockHash
* description: Returns block hash of the chaintip
* tags:
* - L1
* responses:
* 200:
* description: Successful response. Promise (string) containing the latest block hash.
* requestBody:
* content:
* application/json:
* schema:
* type: object
* required:
* - method
* - id
* - jsonrpc
* properties:
* method:
* type: string
* default: getBestBlockHash
* description: Method name
* id:
* type: integer
* default: 1
* format: int32
* description: Request ID
* jsonrpc:
* type: string
* default: '2.0'
* description: JSON-RPC Version (2.0)
*/
/* eslint-enable max-len */
module.exports = getBestBlockHashFactory;