You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+83-7Lines changed: 83 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -374,10 +374,26 @@ Output:
374
374
…
375
375
}</pre>
376
376
## 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>
378
386
379
387
## 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>
381
397
382
398
## keys
383
399
Returns the keys of an object as array.
@@ -415,7 +431,15 @@ loadVars
415
431
```
416
432
417
433
## 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>
419
443
420
444
## now
421
445
Returns the current date in milliseconds.
@@ -429,16 +453,68 @@ Output:
429
453
<pre>1691869299389</pre>
430
454
431
455
## parseAbiParams
432
-
TODO
456
+
Parses human-readable <ahref="https://viem.sh/docs/glossary/types.html#abiparameter"target="_blank">ABI parameters</a> into AbiParameters. Re-exported from <ahref="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
433
477
434
478
## 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
436
491
437
492
## 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
439
506
440
507
## 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`
0 commit comments