Skip to content

Commit 1b15e7b

Browse files
docs: add examples for defineChain usage (#3308)
Co-authored-by: Joaquim Verges <joaquim.verges@gmail.com>
1 parent a4086c6 commit 1b15e7b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/thirdweb/src/chains/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ const CUSTOM_CHAIN_MAP = new Map<number, Chain>();
1717
* @param options The options for the chain.
1818
* @returns The defined chain.
1919
* @example
20+
* Just pass the chain ID to connect to:
21+
* ```ts
22+
* const chain = defineChain(1);
23+
* ```
24+
* Or pass your own RPC or custom values:
2025
* ```ts
2126
* const chain = defineChain({
2227
* id: 1,
28+
* rpc: "https://my-rpc.com",
2329
* nativeCurrency: {
2430
* name: "Ether",
2531
* symbol: "ETH",

0 commit comments

Comments
 (0)