Skip to content

Commit 1d82858

Browse files
committed
finish commands
1 parent 9f73b95 commit 1d82858

File tree

1 file changed

+59
-9
lines changed

1 file changed

+59
-9
lines changed

README.md

Lines changed: 59 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -517,31 +517,81 @@ Params:
517517
- object: Object to get the property from
518518

519519
## readContract
520-
TODO
520+
Calls a read-only function on a contract, returning data.
521+
522+
Usage:
523+
```bash
524+
readContract address=0x… abi=$abiJson functionName=balanceOf [chainId=id] [args=$args]
525+
```
526+
527+
Params:
528+
address: Address of the contract
529+
abi: Contract's Abi as JSON. See [loadJson](#loadjson) command to import this file into a variable
530+
functionName: A function to extract from the ABI and call
531+
[chainId]: Forces a specific chain id for the request
532+
[args]: List of arguments to pass to the function
521533

522534
## set
523-
TODO
535+
Can be used to set a variable.
536+
537+
Usage:
538+
```bash
539+
set value > varName
540+
```
524541

525542
## supportedChains
526-
TODO
543+
Returns an array of supported chains.
544+
545+
Usage:
546+
```bash
547+
supportedChains
548+
```
549+
550+
Output:
551+
<pre>[{
552+
id: 11155111,
553+
network: "sepolia",
554+
name: "Sepolia",
555+
nativeCurrency: {
556+
name: "Sepolia Ether",
557+
symbol: "SEP",
558+
decimals: 18
559+
},
560+
rpcUrls: {…},
561+
blockExplorers: {…},
562+
563+
}, {…}, …]</pre>
527564

528565
## switchNetwork
529-
TODO
566+
Switches to a different chain. Chain must be supported. You can list the supported chain ids by typing `supportedChains | fromProperty id`
530567

531568
## toBigint
532-
TODO
569+
Converts a string to a BigInt.
533570

534571
## toBoolean
535-
TODO
572+
Converts a string to a Boolean.
536573

537574
## toHex
538-
TODO
575+
Encodes a string, number, boolean or byte array to a hex value value.
576+
577+
Usage:
578+
```bash
579+
toHex 420 # 0x1a4
580+
toHex "Hello world" # 0x48656c6c6f20776f726c642e
581+
toHex true # 0x1
582+
```
539583

540584
## toNumber
541-
TODO
585+
Converts a string to a Number.
542586

543587
## toRlp
544-
TODO
588+
Encodes a hex value or byte array into a <a href="https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/">Recursive-Length Prefix (RLP)</a> encoded value.
589+
590+
Usage:
591+
```bash
592+
toRlp 0x123456789 # 0x850123456789
593+
toRlp ["0x7f", "0x7f", "0x8081e8"] # 0xc67f7f838081e8
594+
```
545595

546596
## transactionReceipt
547597
Waits for a transaction to be mined, and returns the receipt.

0 commit comments

Comments
 (0)