@leofcoin/endpoints 0.2.2 → 0.2.3

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 CHANGED
@@ -1,4 +1,4 @@
1
- #### selectAccount(address: `string`)
1
+ #### [selectAccount(address: `string`)](https://remote.leofcoin.org/select-account?address=)
2
2
  `address`: desired address
3
3
  > set default account to given address
4
4
  ```js
@@ -6,14 +6,14 @@ await client.selectAccount(address)
6
6
  ```
7
7
  <br>
8
8
 
9
- #### getBlock(index: `number`)
9
+ #### [getBlock(index: `number`)](https://remote.leofcoin.org/getblock?index=0)
10
10
  `index`: index of the block to fetch<br>
11
11
  ```js
12
12
  await client.getBlock(10)
13
13
  ```
14
14
  <br>
15
15
 
16
- #### blocks(amount)
16
+ #### [blocks(amount)](https://remote.leofcoin.org/blocks)
17
17
  `amount`: the amount to slice
18
18
  ```js
19
19
  await client.blocks(-25)
@@ -32,7 +32,7 @@ await client.createTransactionFrom(from, to, method, parameters, nonce)
32
32
  ```
33
33
  <br>
34
34
 
35
- #### lookup(name: `string`)
35
+ #### [lookup(name: `string`)](https://remote.leofcoin.org/lookup?name=ArtOnlineContractFactory)
36
36
  `name`: name of the contract to lookup the address and owner of
37
37
  ```js
38
38
  await client.lookup('contractName')
@@ -75,26 +75,26 @@ const tx = await client.deployContract(code, params)
75
75
  ```
76
76
  <br>
77
77
 
78
- #### accounts()
78
+ #### [accounts()](https://remote.leofcoin.org/accounts)
79
79
  ```js
80
80
  await client.accounts()
81
81
  ```
82
82
  <br>
83
83
 
84
- #### hasTransactionToHandle()
84
+ #### [hasTransactionToHandle()](https://remote.leofcoin.org/hasTransactionToHandle)
85
85
  ```js
86
86
  await client.hasTransactionToHandle()
87
87
  ```
88
88
  <br>
89
89
 
90
- #### balances()
90
+ #### [balances()](https://remote.leofcoin.org/balances)
91
91
  > returns all balances
92
92
  ```js
93
93
  await client.balances()
94
94
  ```
95
95
  <br>
96
96
 
97
- #### balancOf(address: `string`, format: `boolean`)
97
+ #### [balancOf(address: `string`, format: `boolean`)](https://remote.leofcoin.org/balanceOf?address=YTqxKshWH4Qo7KprGYxQVCNYutedaE6YGoUdUPnUdFUVBPrTzgsrP&format=true)
98
98
  `address`: The address to check<br>
99
99
  `format`: Wether or not to format<br>
100
100
  > returns the balance of given address as BigNumber or string (when format is true)
@@ -103,85 +103,85 @@ await client.balanceOf(address, true)
103
103
  ```
104
104
  <br>
105
105
 
106
- #### selectedAccount()
106
+ #### [selectedAccount()](https://remote.leofcoin.org/selectedAccount)
107
107
  ```js
108
108
  await client.selectedAccount()
109
109
  ```
110
110
  <br>
111
111
 
112
- #### peerId()
112
+ #### [peerId()](https://remote.leofcoin.org/peerId)
113
113
  ```js
114
114
  await client.peerId()
115
115
  ```
116
116
  <br>
117
117
 
118
- #### peers()
118
+ #### [peers()](https://remote.leofcoin.org/peers)
119
119
  ```js
120
120
  await client.peers()
121
121
  ```
122
122
  <br>
123
123
 
124
- #### validators()
124
+ #### [validators()](https://remote.leofcoin.org/validators)
125
125
  ```js
126
126
  await client.validators()
127
127
  ```
128
128
  <br>
129
129
 
130
- #### nativeBurns()
130
+ #### [nativeBurns()](https://remote.leofcoin.org/nativeBurns)
131
131
  ```js
132
132
  await client.nativeBurns()
133
133
  ```
134
134
  <br>
135
135
 
136
- #### contracts()
136
+ #### [contracts()](https://remote.leofcoin.org/contracts)
137
137
  ```js
138
138
  await client.contracts()
139
139
  ```
140
140
  <br>
141
141
 
142
- #### nativeMints()
142
+ #### [nativeMints()](https://remote.leofcoin.org/nativeMints)
143
143
  ```js
144
144
  await client.nativeMints()
145
145
  ```
146
146
  <br>
147
147
 
148
- #### nativeToken()
148
+ #### [nativeToken()](https://remote.leofcoin.org/nativeToken)
149
149
  ```js
150
150
  await client.nativeToken()
151
151
  ```
152
152
  <br>
153
153
 
154
- #### nativeTransfers()
154
+ #### [nativeTransfers()](https://remote.leofcoin.org/nativeTransfers)
155
155
  ```js
156
156
  await client. nativeTransfers()
157
157
  ```
158
158
  <br>
159
159
 
160
- #### totalSize()
160
+ #### [totalSize()](https://remote.leofcoin.org/totalSize)
161
161
  ```js
162
162
  await client.totalSize()
163
163
  ```
164
164
  <br>
165
165
 
166
- #### totalTransactions()
166
+ #### [totalTransactions()](https://remote.leofcoin.org/totalTransactions)
167
167
  ```js
168
168
  await client.totalTransactions()
169
169
  ```
170
170
  <br>
171
171
 
172
- #### totalBlocks()
172
+ #### [totalBlocks()](https://remote.leofcoin.org/totalBlocks)
173
173
  ```js
174
174
  await client.totalBlocks()
175
175
  ```
176
176
  <br>
177
177
 
178
- #### nativeCalls()
178
+ #### [nativeCalls()](https://remote.leofcoin.org/nativeCalls)
179
179
  ```js
180
180
  await client.nativeCalls()
181
181
  ```
182
182
  <br>
183
183
 
184
- #### participating()
184
+ #### [participating()](https://remote.leofcoin.org/participating)
185
185
  ```js
186
186
  await client.participating()
187
187
  ```
package/exports/http.js CHANGED
@@ -27,7 +27,7 @@ export default (chain, port, networkVersion) => {
27
27
 
28
28
  router.get('balanceOf', async ctx => {
29
29
  const balance = (await chain.balances)[ctx.query.address]
30
- ctx.body = format ? formatUnits(balance) : balance
30
+ ctx.body = ctx.query.format ? formatUnits(balance) : balance
31
31
  })
32
32
 
33
33
  router.get('/selectedAccount', ctx => ctx.body = peernet.selectedAccount)
@@ -71,9 +71,9 @@ export default (chain, port, networkVersion) => {
71
71
  ctx.body = chain.validators
72
72
  )
73
73
 
74
- router.get('/lookup', ctx =>
75
- ctx.body = chain.lookup(ctx.query.name)
76
- )
74
+ router.get('/lookup', async ctx => {
75
+ ctx.body = await chain.lookup(ctx.query.name)
76
+ })
77
77
 
78
78
  router.get('/staticCall', async ctx =>
79
79
  ctx.body = await chain.staticCall(ctx.query.contract, ctx.query.method, ctx.query.params)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/endpoints",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {