Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Conversation

@Spacesai1or
Copy link
Contributor

@Spacesai1or Spacesai1or commented Jul 15, 2022

Adds documentation for web3_eth.ts and rpc_method_wrappers.ts RPC functions

Non-RPC functions such as:

  • detectTransactionType
  • formatTransaction
  • isAccessList
  • isAccessListEntry
  • isBaseTransaction
  • isTransaction1559Unsigned
  • isTransaction2930Unsigned
  • isTransactionCall
  • isTransactionlegacyUnsigned
  • isTransactionWithSender
  • prepareTransactionForSigning
  • transactionBuilder
  • validateChainInfo
  • validateCustomChainInfo
  • validateFeeMarketGas
  • validateGas
  • validateLegacyGas
  • validateTransacitonCall
  • validateTransactionForSigning
  • validateTransactionWithSender

are exported, but not currently manually documented

closes #4973

@jdevcs jdevcs added the 4.x 4.0 related label Jul 15, 2022
Copy link
Contributor

@Muhammad-Altabba Muhammad-Altabba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!
However, I suggest using await in the sample coding snippits.

Rashann247NFT referenced this pull request Jul 22, 2022
The application binary interface link used to point to https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI when it should point to https://docs.soliditylang.org/en/develop/abi-spec.html

Co-authored-by: Junaid <86780488+jdevcs@users.noreply.github.com>
@Spacesai1or Spacesai1or marked this pull request as ready for review July 26, 2022 09:46
}

/**
* @param block The {@link BlockNumberOrTag} (defaults to {@link Web3Eth.defaultBlock}) or block hash of the desired block.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its desc :

Suggested change
* @param block The {@link BlockNumberOrTag} (defaults to {@link Web3Eth.defaultBlock}) or block hash of the desired block.
* Returns a block matching the block number, block hash or block tag.
*
* @param block The {@link BlockNumberOrTag} (defaults to {@link Web3Eth.defaultBlock}) or block hash of the desired block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

block is the name of the first parameter of this method, referring to the block identifier that's being requested

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thats correct. I suggested to add description before block param.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented via this commit

import { NUMBER_DATA_FORMAT } from './constants';

/**
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add some note in documentation like:
All these functions are available in web3Eth class and normal users should use from there. These RPC wrapper functions are used internally in web3Eth class and are also available for advance users of lib if they want.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no single place to add that disclaimer, but we did talk about linking to the Web3Eth methods for each rpc_method_wrapper method

Copy link
Contributor

@jdevcs jdevcs Jul 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are multiple places / rpc functions, you are right, but we can add this note at top (may be before first wrapper function only or at top section?) like one of:
image
https://docusaurus.io/docs/next/markdown-features/admonitions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made an issue to track this

* @returns The [data](https://ethereum.org/en/developers/docs/transactions/#the-data-field) at the provided `address`.
*
* ```ts
* web3.eth.getCode("0x033456732123ffff2342342dd12342434324234234fd234fd23fd4f23d4234").then(console.log);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly functions in Web3Eth class are only returning results of wrappers by passing context, so Could you check if possible, can we use inherit doc feature https://typedoc.org/tags/inheritDoc/ for copying doc from Web3Eth class functions into these wrappers in rendered doc? and add additional @ param web3Context in these functions.

This will help us for avoiding duplicate effort for maintaining doc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would definitely be an improvement over the duplicated docs, however, I cannot get @inheritdoc to work. Additionally, I don't think the code example would be inherited based off what's listed here:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made an issue to track this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like @remarks should maybe solve the code example being copied

Spacesai1or and others added 2 commits July 26, 2022 21:44
Co-authored-by: Alex  <alex.luu@mail.utoronto.ca>
Co-authored-by: Junaid <86780488+jdevcs@users.noreply.github.com>
@jdevcs
Copy link
Contributor

jdevcs commented Jul 28, 2022

Good work Wyatt for lifting Eth package

@render
Copy link

render bot commented Jul 28, 2022

@Spacesai1or Spacesai1or merged commit 76153fc into 4.x Jul 29, 2022
@Spacesai1or Spacesai1or deleted the wyatt/4.x/4973-web3-eth-docs branch July 29, 2022 00:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

4.x 4.0 related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants