Skip to content

Commit 672b70c

Browse files
committed
wip
1 parent f8f1524 commit 672b70c

File tree

1 file changed

+112
-19
lines changed

1 file changed

+112
-19
lines changed

README.md

+112-19
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ Usage:
8484
balance [address=0x…] [chainId=id] [formatUnits=units] [token=0x…]
8585
```
8686

87+
Output
88+
<pre>0.256 ETH</pre>
89+
8790
Params:
8891
- [address]: Address of balance to get back. Defaults to connected wallet
8992
- [chainId]: Chain id to get the balance from
9093
- [formatUnits]: Units for formatting output. Values: `ether` | `gwei` | `wei`
9194
- [token]: ERC20 contract address
9295

93-
Output
94-
<pre>0.256 ETH</pre>
95-
9696
## balanceDetails
9797
Returns details about balance and token.
9898

@@ -168,6 +168,23 @@ Usage:
168168
contractEvents abi=$abiJson [chainId=id] [address=0x…] [eventName=Transfer] [fromBlock=0] [toBlock=latest]
169169
```
170170

171+
Output:
172+
<pre>[{
173+
address: "0x…",
174+
topics: […],
175+
data: "0x…",
176+
blockNumber: 123,
177+
transactionHash: "0x…",
178+
transactionIndex: 1,
179+
blockHash: "0x…",
180+
…,
181+
args: {
182+
msgHash: "0x…",
183+
message: {…}
184+
},
185+
eventName: "MessageSent"
186+
}, …]</pre>
187+
171188
Params:
172189
- abi: Contract's Abi as JSON. See [loadJson](#loadJson) command to import this file into a variable
173190
- [chainId]: Forces a specific chain id for the request
@@ -176,11 +193,6 @@ Params:
176193
- [fromBlock]: Block number to start the filter from
177194
- [toBlock]: Block number to end the filter at
178195

179-
Output:
180-
<pre>{
181-
182-
}</pre>
183-
184196
## date
185197
Returns the current date in a human readable format.
186198

@@ -228,28 +240,109 @@ Output (in variable `result`):
228240
}</pre>
229241

230242
## encodeAbiParams
231-
TODO
243+
Generates ABI encoded data using the <a href="https://docs.soliditylang.org/en/latest/abi-spec.html" target="_blank">ABI specification</a>, given a set of ABI parameters (inputs/outputs) and their corresponding values.
244+
245+
Usage:
246+
```bash
247+
encodeAbiParams $abiParams $values
248+
```
249+
250+
Params:
251+
- abiParams: Array of ABI parameters (inputs/outputs). Example: `[{ "name": "amount", "type": "uint256" }]`
252+
- values: Array of values to encode. Example: `[ 123456 ]`
232253

233254
## encodePacked
234-
TODO
255+
Generates <a href="https://docs.soliditylang.org/en/v0.8.18/abi-spec.html#non-standard-packed-mode" target="_blank">ABI non-standard packed encoded data</a> given a set of solidity types compatible with packed encoding.
256+
257+
Usage:
258+
```bash
259+
encodePacked $listOfTypes $listOfValues
260+
```
261+
262+
Params:
263+
- listOfTypes: List of solidity types compatible with packed encoding. Example: `['address', 'string', 'bytes16[]']`
264+
- listOfValues: List of values to encode. Example: `['0x123…', 'Hello world', ['0x123…', '0x456…']]`
235265

236266
## eval
237-
TODO
267+
Evaluates a JavaScript expression between double quotation.
268+
269+
Usage:
270+
```bash
271+
eval expression
272+
eval "2 + 2" # outputs 4
273+
eval "[1, 2, 3]" # outputs the array
274+
eval "({name: 'Fran', age: 44})" # outputs the object
275+
eval expression > varName # Sends the result to a variable for later use
276+
```
238277

239278
## findInSerialize
240-
TODO
279+
Finds objects where the serilized version includes the string passed as parameter.
280+
281+
Usage:
282+
```bash
283+
findInSerialize stringToFind $objects
284+
```
285+
286+
Params:
287+
- stringToFind: String to find in the array of objects
288+
- objects: Array of objects to search in
241289

242290
## formatEther
243-
TODO
291+
Converts numerical wei to a string representation of ether.
292+
293+
Usage:
294+
```bash
295+
formatEther 1000000000000000000
296+
```
297+
298+
Output:
299+
<pre>1</pre>
300+
301+
Params:
302+
- value: The wei value
244303

245304
## formatUnits
246-
TODO
305+
Divides a number by a given exponent of base 10, and formats it into a string representation of the number.
306+
307+
Usage:
308+
```bash
309+
formatUnits 420000000000 9
310+
```
311+
312+
Output:
313+
<pre>420</pre>
314+
315+
Params:
316+
- value: BigNumber to format as a string, number or bigint
317+
- decimals: Exponent of base 10
247318

248319
## fromProperty
249-
TODO
320+
Returns an array with the values of a property in an array of objects.
321+
322+
Usage:
323+
```bash
324+
fromProperty pathToProp $objects
325+
```
326+
327+
Params:
328+
- pathToProp: Path to the property to get. Example: `prop1.prop2.prop3`
329+
- objects: Array of objects to get the property from
250330

251331
## getProof
252-
TODO
332+
Returns the account and storage values, including the Merkle proof, of the specified account.
333+
334+
Usage:
335+
```bash
336+
getProof address=0x… storageKeys=["0x…"] block=0x…
337+
```
338+
339+
Output:
340+
<pre>TODO</pre>
341+
342+
Params:
343+
- address: The address of the account for which the balance is to be checked
344+
- storageKeys: An array of storage-keys that should be proofed and included
345+
- block: A hexadecimal block number, or the string `latest` or `earliest`
253346

254347
## help
255348
Shows available commands or help about a specific command.
@@ -382,9 +475,6 @@ Usage:
382475
transactionReceipt $txHash
383476
```
384477

385-
Params:
386-
- txHash: Transaction hash to wait for. Example
387-
388478
Output:
389479
<pre>{
390480
blockHash: "0x…"
@@ -399,6 +489,9 @@ Output:
399489
400490
}</pre>
401491

492+
Params:
493+
- txHash: Transaction hash to wait for. Example
494+
402495
## values
403496
Returns the values of an object as array.
404497

0 commit comments

Comments
 (0)