Skip to content

Commit 9f73b95

Browse files
committed
wip
1 parent 672b70c commit 9f73b95

File tree

1 file changed

+83
-7
lines changed

1 file changed

+83
-7
lines changed

README.md

Lines changed: 83 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,26 @@ Output:
374374
375375
}</pre>
376376
## isoDate
377-
TODO
377+
Returns the current date in ISO format.
378+
379+
Usage:
380+
```bash
381+
isoDate
382+
```
383+
384+
Output:
385+
<pre>2023-08-12T19:42:10.598Z</pre>
378386

379387
## keccak256
380-
TODO
388+
Calculates the <a href="https://en.wikipedia.org/wiki/SHA-3"target="_blank">Keccak256</a> hash of a byte array or hex value.
389+
390+
Usage:
391+
```bash
392+
keccak256 0x123
393+
```
394+
395+
Output:
396+
<pre>0x667d3611…</pre>
381397

382398
## keys
383399
Returns the keys of an object as array.
@@ -415,7 +431,15 @@ loadVars
415431
```
416432

417433
## log
418-
TODO
434+
Logs a value in the console.
435+
436+
Usage:
437+
```bash
438+
log value
439+
```
440+
441+
Console:
442+
<pre>value</pre>
419443

420444
## now
421445
Returns the current date in milliseconds.
@@ -429,16 +453,68 @@ Output:
429453
<pre>1691869299389</pre>
430454

431455
## parseAbiParams
432-
TODO
456+
Parses human-readable <a href="https://viem.sh/docs/glossary/types.html#abiparameter" target="_blank">ABI parameters</a> into AbiParameters. Re-exported from <a href="https://abitype.dev/api/human#parseabiparameters-1" target="_blank">ABIType</a>
457+
458+
Usage:
459+
```bash
460+
parseAbiParams "address from, address to, uint256 amount"
461+
```
462+
463+
Output:
464+
<pre>[{
465+
type: "address",
466+
name: "from"
467+
}, {
468+
type: "address",
469+
name: "to"
470+
}, {
471+
type: "uint256",
472+
name: "amount"
473+
}]</pre>
474+
475+
Params:
476+
- params: Human-readable ABI parameters as string
433477

434478
## parseEther
435-
TODO
479+
Converts a string representation of ether to numerical wei.
480+
481+
Usage:
482+
```bash
483+
parseEther 420
484+
```
485+
486+
Output:
487+
<pre>420000000000000000000n</pre>
488+
489+
Params:
490+
- value: String representation of ether
436491

437492
## parseUnits
438-
TODO
493+
Multiplies a string representation of a number by a given exponent of base 10.
494+
495+
Usage:
496+
```bash
497+
parseUnits 420 9
498+
```
499+
500+
Output:
501+
<pre>420000000000n</pre>
502+
503+
Params:
504+
- value: String representation of a number
505+
- decimals: Exponent of base 10
439506

440507
## property
441-
TODO
508+
Returns the value of a property in an object.
509+
510+
Usage:
511+
```bash
512+
property pathToProp $object
513+
```
514+
515+
Params:
516+
- pathToProp: Path to the property to get. Example: `prop1.prop2.prop3`
517+
- object: Object to get the property from
442518

443519
## readContract
444520
TODO

0 commit comments

Comments
 (0)