Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/pages/build/onchain-clients.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ To connect to Ink by instantiating a new `ethers.js` `JsonRpcProvider` object wi

The following code snippet demonstrates how to fetch and print the current block number from Ink's testnet:

```javascript
import { ethers } from 'ethers';

const rpcUrl = 'https://rpc-gel-sepolia.inkonchain.com';
const provider = new ethers.JsonRpcProvider(rpcUrl, 763373);

const blockNumber = await provider.getBlockNumber();
console.log(blockNumber);
```

## Viem - Instructions for Connecting to Ink

Viem documentation: [https://viem.sh/docs/introduction](https://viem.sh/docs/introduction)
Expand Down