Skip to content

[docs] Empty example section in onchain-clients.mdx - fill in or remove? #669

Description

@callumweb3

Context

src/pages/build/onchain-clients.mdx, lines ~38-40:

### Example: Fetching the Current Block Number

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

## Viem - Instructions for Connecting to Ink

The section promises a snippet but provides none.

Given the current situation, I have reached two conclusions:

  1. Sections 1 and 3 of the file already contain examples demonstrating how to retrieve the block:
  • Ethers.js, step 3: const blockNumber = await provider.getBlockNumber();
  • Viem, step 3: const blockNumber = await client.getBlockNumber();

This section might therefore be redundant, so I submitted a PR to remove it: #668

  1. If removal is not an acceptable option—even considering the existing examples—I prepared an alternative and added a code block with a working (and tested) example: docs(onchain-clients): add working Ethers.js example to block number section #667

I opened both PRs so you can pick one - happy to close
the other (or you can close it directly).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions