Skip to content

Commit

Permalink
Renames variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-then committed Jan 30, 2025
1 parent 6932803 commit 99f4682
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ npm install @rsksmart/rsk-precompiled-abis@<version>
```js

const ethers = require('ethers');
const precompiledAbi = require('@rsksmart/rsk-precompiled-abis');
const precompiledAbis = require('@rsksmart/rsk-precompiled-abis');
const networkUrl = 'https://public-node.rsk.co/';

const provider = new ethers.JsonRpcProvider(networkUrl);
const bridge = new ethers.Contract(precompiledAbi.bridge.address, precompiledAbi.bridge.abi, provider);
const bridge = new ethers.Contract(precompiledAbis.bridge.address, precompiledAbis.bridge.abi, provider);

bridge.getBtcBlockchainBestChainHeight().then(console.log);

Expand All @@ -46,7 +46,7 @@ That would print something like: `881524n`.
```js
const { createPublicClient, http } = require("viem");
const { mainnet } = require("viem/chains");
const precompiledAbi = require('@rsksmart/rsk-precompiled-abis');
const precompiledAbis = require('@rsksmart/rsk-precompiled-abis');
const networkUrl = 'https://public-node.rsk.co/';

const client = createPublicClient({
Expand All @@ -57,8 +57,8 @@ const client = createPublicClient({
const getBlockchainHeight = async () => {
try {
const height = await client.readContract({
address: precompiledAbi.bridge.address,
abi: precompiledAbi.bridge.abi,
address: precompiledAbis.bridge.address,
abi: precompiledAbis.bridge.abi,
functionName: "getBtcBlockchainBestChainHeight",
});
console.log("btcBlockchainBestChainHeight:", height);
Expand Down

0 comments on commit 99f4682

Please sign in to comment.