@leofcoin/endpoints 0.2.16 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/exports/api.md +36 -0
- package/exports/http.js +5 -1
- package/exports/ws.js +5 -0
- package/package.json +1 -1
package/exports/api.md
CHANGED
|
@@ -212,4 +212,40 @@ await client.nativeCalls()
|
|
|
212
212
|
```js
|
|
213
213
|
await client.participating()
|
|
214
214
|
```
|
|
215
|
+
<br>
|
|
216
|
+
|
|
217
|
+
#### [network()](https://remote.leofcoin.org/network)
|
|
218
|
+
```js
|
|
219
|
+
await client.network()
|
|
220
|
+
```
|
|
221
|
+
<br>
|
|
222
|
+
|
|
223
|
+
#### [networkStats()](https://remote.leofcoin.org/networkStats)
|
|
224
|
+
```js
|
|
225
|
+
await client.networkStats()
|
|
226
|
+
```
|
|
227
|
+
<br>
|
|
228
|
+
|
|
229
|
+
#### [networkStats()](https://remote.leofcoin.org/networkStats)
|
|
230
|
+
```js
|
|
231
|
+
await client.networkStats()
|
|
232
|
+
```
|
|
233
|
+
<br>
|
|
234
|
+
|
|
235
|
+
#### [lastBlock()](https://remote.leofcoin.org/lastBlock)
|
|
236
|
+
```js
|
|
237
|
+
await client.lastBlock()
|
|
238
|
+
```
|
|
239
|
+
<br>
|
|
240
|
+
|
|
241
|
+
#### [blockHashMap()](https://remote.leofcoin.org/blockHashMap)
|
|
242
|
+
```js
|
|
243
|
+
await client.blockHashMap()
|
|
244
|
+
```
|
|
245
|
+
<br>
|
|
246
|
+
|
|
247
|
+
#### [bootstrap()](https://remote.leofcoin.org/bootstrap)
|
|
248
|
+
```js
|
|
249
|
+
await client.bootstrap()
|
|
250
|
+
```
|
|
215
251
|
<br>
|
package/exports/http.js
CHANGED
|
@@ -176,8 +176,12 @@ export default (chain, port, networkVersion) => {
|
|
|
176
176
|
}
|
|
177
177
|
})
|
|
178
178
|
|
|
179
|
+
router.get('/lastBlock', async ctx => ctx.body = chain.lastBlock)
|
|
180
|
+
|
|
181
|
+
router.get('/blockHashMap', async ctx => ctx.body = chain.blockHashMap)
|
|
182
|
+
|
|
179
183
|
router.get('/bootstrap', async ctx => {
|
|
180
|
-
ctx.body = (await shared.bootstrap()).map(value => value.toString())
|
|
184
|
+
ctx.body = (await shared.bootstrap()).map(value => Array.from(value.toString()))
|
|
181
185
|
})
|
|
182
186
|
|
|
183
187
|
// todo finish ...
|
package/exports/ws.js
CHANGED
|
@@ -101,6 +101,11 @@ export default (chain, port, networkVersion) => {
|
|
|
101
101
|
send(error)
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
|
+
|
|
105
|
+
lastBlock: async ctx => ctx.body = chain.lastBlock,
|
|
106
|
+
|
|
107
|
+
blockHashMap: async ctx => ctx.body = chain.blockHashMap,
|
|
108
|
+
|
|
104
109
|
bootstrap: async ({send}) => {
|
|
105
110
|
send(await shared.bootstrap())
|
|
106
111
|
}
|