-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate docs as markdown #169
Conversation
WalkthroughWalkthroughThe recent updates to the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Client as ZetaChainClient
participant Network as ZetaChain Network
User->>Client: deposit({amount, chain, ...})
Client->>Network: process deposit transaction
Network-->>Client: return transaction details
Client-->>User: provide transaction confirmation
sequenceDiagram
participant User
participant Client as ZetaChainClient
participant Network as ZetaChain Network
User->>Client: withdraw({amount, recipient, zrc20})
Client->>Network: process withdrawal transaction
Network-->>Client: return transaction details
Client-->>User: provide transaction confirmation
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 16
Outside diff range, codebase verification and nitpick comments (7)
docs/TypeAlias.ZetaChainClientParams.md (1)
1-9
: Clarify the type alias definition.The type alias
ZetaChainClientParams
is described as a combination ofZetaChainClientParamsBase
and multipleobject
types. Consider clarifying what theseobject
types represent or if they are placeholders for future expansion. This will enhance the understanding of the type alias for developers.docs/Function.prepareParams.md (1)
5-11
: Enhance parameter descriptions.The parameters
types
andargs
are described as arrays of strings and any type, respectively. Consider providing additional context or examples to clarify how these parameters are used within the function. This will aid developers in understanding the function's purpose and usage.docs/Function.getFees.md (1)
5-11
: Clarifygas
parameter type.The
gas
parameter is described asNumber
. Consider specifying whether this is an integer or a floating-point number, and provide any constraints or expected ranges for this value. This will help developers use the function correctly.docs/Function.trackCCTX.md (1)
13-13
: Consider specifying a more precise type foremitter
.The
emitter
parameter is currently typed asany
, which may lead to potential type safety issues. If possible, specify a more precise type to enhance clarity and maintainability.docs/Function.getZRC20FromERC20.md (1)
19-19
: Consider specifying a more precise return type.The return type is currently
any
, which may reduce type safety. If possible, specify a more precise return type to improve clarity and maintainability.docs/Function.getRefundFee.md (1)
25-29
: Consider specifying more precise types foramount
anddecimals
.The types for
amount
anddecimals
are currentlyany
, which may lead to potential type safety issues. If possible, specify more precise types to enhance clarity and maintainability.docs/Class.ZetaChainClient.md (1)
9-11
: Clarify constructor documentation.The constructor documentation provides a basic overview of how to initialize a
ZetaChainClient
instance. Ensure that all necessary parameters and their types are clearly documented to help users understand how to properly instantiate the class. Consider adding more details about theparams
object if applicable.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
Files selected for processing (26)
- docs/Class.ZetaChainClient.md (1 hunks)
- docs/Function.deposit.md (1 hunks)
- docs/Function.getBalances.md (1 hunks)
- docs/Function.getChainId.md (1 hunks)
- docs/Function.getEndpoint.md (1 hunks)
- docs/Function.getFees.md (1 hunks)
- docs/Function.getForeignCoins.md (1 hunks)
- docs/Function.getHardhatConfig.md (1 hunks)
- docs/Function.getPools.md (1 hunks)
- docs/Function.getQuote.md (1 hunks)
- docs/Function.getRefundFee.md (1 hunks)
- docs/Function.getSupportedChains.md (1 hunks)
- docs/Function.getWithdrawFeeInInputToken.md (1 hunks)
- docs/Function.getZRC20FromERC20.md (1 hunks)
- docs/Function.getZRC20GasToken.md (1 hunks)
- docs/Function.prepareData.md (1 hunks)
- docs/Function.prepareParams.md (1 hunks)
- docs/Function.sendZeta.md (1 hunks)
- docs/Function.trackCCTX.md (1 hunks)
- docs/Function.withdraw.md (1 hunks)
- docs/Interface.TokenBalance.md (1 hunks)
- docs/Interface.ZetaChainClientParamsBase.md (1 hunks)
- docs/TypeAlias.ZetaChainClientParams.md (1 hunks)
- docs/index.md (1 hunks)
- package.json (4 hunks)
- typedoc.json (1 hunks)
Files skipped from review due to trivial changes (6)
- docs/Function.getForeignCoins.md
- docs/Function.getPools.md
- docs/Function.getSupportedChains.md
- docs/Function.getZRC20GasToken.md
- docs/Function.prepareData.md
- typedoc.json
Additional context used
LanguageTool
docs/Function.getChainId.md
[grammar] ~17-~17: The singular proper name ‘Chain’ must be used with a third-person or a past tense verb.
Context: ...• chainNameOrAlias:string
Chain label like goerli_testnet ## Returnsnull
...(HE_VERB_AGR)
docs/Function.getWithdrawFeeInInputToken.md
[grammar] ~7-~7: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ...:Promise
<object
> Calculates the withdraw fee in the input ZRC20 token for a give...(PREPOSITION_VERB)
[grammar] ~25-~25: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ...<object
> - An object containing the withdraw fee amount and its decimals. ### amoun...(PREPOSITION_VERB)
docs/Function.withdraw.md
[grammar] ~7-~7: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ...ions):
Promise\<
any`> Initiates a withdraw transaction of a ZRC-20 token from Zeta...(PREPOSITION_VERB)
[misspelling] ~22-~22: This word is normally spelled with a hyphen.
Context: ...**:string
Amount to be withdrawn in human readable form. • options.recipient: `string...(EN_COMPOUNDS_HUMAN_READABLE)
docs/Function.sendZeta.md
[misspelling] ~22-~22: This word is normally spelled with a hyphen.
Context: ...gAmount of ZETA tokens to be sent in human readable form. • **options.chain**:
string` S...(EN_COMPOUNDS_HUMAN_READABLE)
docs/Function.deposit.md
[misspelling] ~22-~22: This word is normally spelled with a hyphen.
Context: ...**:string
Amount to be deposited in human readable form. For example, 1.5 ETH is "1.5". •...(EN_COMPOUNDS_HUMAN_READABLE)
[duplication] ~39-~39: Possible typo: you repeated a word
Context: ... into therecipient
contract and call with with the message as an argument. • **option...(ENGLISH_WORD_REPEAT_RULE)
docs/index.md
[duplication] ~32-~32: Possible typo: you repeated a word
Context: ...`` ## Installing tasks To install all the the tasks into a Hardhat template, add the ...(ENGLISH_WORD_REPEAT_RULE)
docs/Class.ZetaChainClient.md
[misspelling] ~100-~100: This word is normally spelled with a hyphen.
Context: ...**:string
Amount to be deposited in human readable form. For example, 1.5 ETH is "1.5". •...(EN_COMPOUNDS_HUMAN_READABLE)
[duplication] ~117-~117: Possible typo: you repeated a word
Context: ... into therecipient
contract and call with with the message as an argument. • **option...(ENGLISH_WORD_REPEAT_RULE)
[grammar] ~178-~178: The singular proper name ‘Chain’ must be used with a third-person or a past tense verb.
Context: ...• chainNameOrAlias:string
Chain label like goerli_testnet #### Returns `nul...(HE_VERB_AGR)
[grammar] ~362-~362: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ...>Promise
<object
> Calculates the withdraw fee in the input ZRC20 token for a give...(PREPOSITION_VERB)
[grammar] ~380-~380: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ...<object
> - An object containing the withdraw fee amount and its decimals. ##### amo...(PREPOSITION_VERB)
[misspelling] ~481-~481: This word is normally spelled with a hyphen.
Context: ...gAmount of ZETA tokens to be sent in human readable form. • **options.chain**:
string` S...(EN_COMPOUNDS_HUMAN_READABLE)
[grammar] ~562-~562: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ...ns) =>
Promise\<
any`> Initiates a withdraw transaction of a ZRC-20 token from Zeta...(PREPOSITION_VERB)
[misspelling] ~577-~577: This word is normally spelled with a hyphen.
Context: ...**:string
Amount to be withdrawn in human readable form. • options.recipient: `string...(EN_COMPOUNDS_HUMAN_READABLE)
Markdownlint
docs/index.md
26-26: null
Fenced code blocks should have a language specified(MD040, fenced-code-language)
69-69: null
Fenced code blocks should have a language specified(MD040, fenced-code-language)
73-73: null
Fenced code blocks should have a language specified(MD040, fenced-code-language)
Additional comments not posted (10)
docs/Function.getBalances.md (1)
1-27
: Documentation is clear and well-structured.The documentation for
getBalances
is comprehensive and adheres to good documentation practices. It provides clear descriptions of parameters and return types.docs/Function.getQuote.md (1)
1-37
: Documentation is clear and well-structured.The documentation for
getQuote
is comprehensive and adheres to good documentation practices. It provides clear descriptions of parameters and return types.docs/Function.getHardhatConfig.md (1)
1-65
: Documentation looks good!The documentation is clear, concise, and well-structured. No issues found.
docs/Interface.TokenBalance.md (1)
1-103
: Documentation is well-structured and clear.The documentation for the
TokenBalance
interface is comprehensive and well-organized.package.json (3)
31-31
: Consolidate documentation script.The
docs
script now usesrimraf
to clean thedocs
directory before generating new documentation withtypedoc
. This change ensures that outdated files are removed, preventing potential conflicts or outdated references in the documentation. This is a good practice for maintaining clean and up-to-date documentation.
79-81
: Update and add Typedoc dependencies.The
typedoc
version has been updated to^0.26.5
, and two new plugins,typedoc-plugin-frontmatter
andtypedoc-plugin-markdown
, have been added. These changes likely enhance the documentation generation process, allowing for better formatting and integration with markdown. Ensure that these plugin versions are compatible with your project setup.
97-97
: Downgrade@zetachain/protocol-contracts
dependency.The version of
@zetachain/protocol-contracts
has been downgraded from^9.0.0
to8.0.0-rc1
. This change might be due to compatibility or stability issues with the newer version. Verify that this downgrade does not introduce any breaking changes or affect the functionality of your project.docs/Class.ZetaChainClient.md (3)
19-26
: Example with Ethers.js wallet.The example demonstrates initializing the client with an Ethers.js wallet. This is a helpful addition for users familiar with Ethers.js. Ensure that environment variables like
MNEMONIC
are securely managed and documented elsewhere in the project's setup guide.
37-50
: Custom RPC endpoint example.The example shows how to use a custom RPC endpoint, which is valuable for users needing to connect to specific networks. Ensure that the placeholder
${process.env.KEY}
is clearly explained in the documentation, so users know how to replace it with their actual API key.
481-481
: Use hyphen in 'human-readable'.The term "human readable" should be hyphenated to "human-readable" for grammatical correctness.
Also applies to: 577-577
Tools
LanguageTool
[misspelling] ~481-~481: This word is normally spelled with a hyphen.
Context: ...gAmount of ZETA tokens to be sent in human readable form. • **options.chain**:
string` S...(EN_COMPOUNDS_HUMAN_READABLE)
Initiates a withdraw transaction of a ZRC-20 token from ZetaChain to a | ||
connected chain as a native gas or ERC-20 token. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the grammatical error.
The word "withdraw" should be replaced with "withdrawal" to correctly use the noun form.
- Initiates a withdraw transaction of a ZRC-20 token from ZetaChain to a
+ Initiates a withdrawal transaction of a ZRC-20 token from ZetaChain to a
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Initiates a withdraw transaction of a ZRC-20 token from ZetaChain to a | |
connected chain as a native gas or ERC-20 token. | |
Initiates a withdrawal transaction of a ZRC-20 token from ZetaChain to a | |
connected chain as a native gas or ERC-20 token. |
Tools
LanguageTool
[grammar] ~7-~7: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ...ions):
Promise\<
any`> Initiates a withdraw transaction of a ZRC-20 token from Zeta...(PREPOSITION_VERB)
|
||
• **options.amount**: `string` | ||
|
||
Amount to be withdrawn in human readable form. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a hyphen for clarity.
The phrase "human readable" is typically hyphenated as "human-readable."
- Amount to be withdrawn in human readable form.
+ Amount to be withdrawn in human-readable form.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Amount to be withdrawn in human readable form. | |
Amount to be withdrawn in human-readable form. |
Tools
LanguageTool
[misspelling] ~22-~22: This word is normally spelled with a hyphen.
Context: ...**:string
Amount to be withdrawn in human readable form. • options.recipient: `string...(EN_COMPOUNDS_HUMAN_READABLE)
|
||
• **options.amount**: `string` | ||
|
||
Amount of ZETA tokens to be sent in human readable form. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a hyphen for clarity.
The phrase "human readable" is typically hyphenated as "human-readable."
- Amount of ZETA tokens to be sent in human readable form.
+ Amount of ZETA tokens to be sent in human-readable form.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Amount of ZETA tokens to be sent in human readable form. | |
Amount of ZETA tokens to be sent in human-readable form. |
Tools
LanguageTool
[misspelling] ~22-~22: This word is normally spelled with a hyphen.
Context: ...gAmount of ZETA tokens to be sent in human readable form. • **options.chain**:
string` S...(EN_COMPOUNDS_HUMAN_READABLE)
|
||
> **getWithdrawFeeInInputToken**(`this`, `inputZRC20`, `outputZRC20`): `Promise`\<`object`\> | ||
|
||
Calculates the withdraw fee in the input ZRC20 token for a given output ZRC20 token. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct grammatical usage of "withdraw".
The word "withdraw" is used as a noun; consider replacing it with "withdrawal" for grammatical accuracy.
- Calculates the withdraw fee in the input ZRC20 token for a given output ZRC20 token.
+ Calculates the withdrawal fee in the input ZRC20 token for a given output ZRC20 token.
- An object containing the withdraw fee amount and its decimals.
+ An object containing the withdrawal fee amount and its decimals.
Also applies to: 25-25
Tools
LanguageTool
[grammar] ~7-~7: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ...:Promise
<object
> Calculates the withdraw fee in the input ZRC20 token for a give...(PREPOSITION_VERB)
|
||
# Function: getEndpoint() | ||
|
||
> **getEndpoint**(`this`, `type`, `network`): `any` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enhance parameter and return type descriptions.
The parameter types any
for type
and network
, as well as the return type any
, are too generic. Consider specifying more precise types to improve clarity and usability of the documentation.
|
||
> **getWithdrawFeeInInputToken**: (`this`, `inputZRC20`, `outputZRC20`) => `Promise`\<`object`\> | ||
|
||
Calculates the withdraw fee in the input ZRC20 token for a given output ZRC20 token. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct usage of 'withdraw' to 'withdrawal'.
The word "withdraw" should be replaced with "withdrawal" when used as a noun to maintain grammatical correctness in the context of fee descriptions and transaction types.
- Calculates the withdraw fee in the input ZRC20 token for a given output ZRC20 token.
+ Calculates the withdrawal fee in the input ZRC20 token for a given output ZRC20 token.
Also applies to: 380-380, 562-562
Tools
LanguageTool
[grammar] ~362-~362: The word ‘withdraw’ is not a noun. Did you mean “withdrawal”?
Context: ...>Promise
<object
> Calculates the withdraw fee in the input ZRC20 token for a give...(PREPOSITION_VERB)
Initiates a deposit transaction of native gas or ERC-20 assets as ZRC-20 from | ||
a connected chain to ZetaChain. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix repetition in deposit method description.
The phrase "call with with the message" contains a repeated word. Correcting this to "call with the message" will enhance readability and professionalism.
- tokens into the `recipient` contract and call with with the message as an argument.
+ tokens into the `recipient` contract and call with the message as an argument.
Committable suggestion was skipped due to low confidence.
|
||
## Installing tasks | ||
|
||
To install all the the tasks into a Hardhat template, add the following import |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the repeated word: "the".
There is a repetition of the word "the" which should be corrected.
- To install all the the tasks into a Hardhat template,
+ To install all the tasks into a Hardhat template,
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
To install all the the tasks into a Hardhat template, add the following import | |
To install all the tasks into a Hardhat template, add the following import |
Tools
LanguageTool
[duplication] ~32-~32: Possible typo: you repeated a word
Context: ...`` ## Installing tasks To install all the the tasks into a Hardhat template, add the ...(ENGLISH_WORD_REPEAT_RULE)
|
||
• **chainNameOrAlias**: `string` | ||
|
||
Chain label like goerli_testnet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar correction for chain label description.
The sentence "Chain label like goerli_testnet" should be corrected for grammatical accuracy. Consider rephrasing to "A chain label, such as goerli_testnet."
- Chain label like goerli_testnet
+ A chain label, such as goerli_testnet.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Chain label like goerli_testnet | |
A chain label, such as goerli_testnet. |
Tools
LanguageTool
[grammar] ~178-~178: The singular proper name ‘Chain’ must be used with a third-person or a past tense verb.
Context: ...• chainNameOrAlias:string
Chain label like goerli_testnet #### Returns `nul...(HE_VERB_AGR)
Amount to be deposited in human readable form. For | ||
example, 1.5 ETH is "1.5". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use hyphen in 'human-readable'.
The term "human readable" should be hyphenated to "human-readable" for grammatical correctness.
- Amount to be deposited in human readable form.
+ Amount to be deposited in human-readable form.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Amount to be deposited in human readable form. For | |
example, 1.5 ETH is "1.5". | |
Amount to be deposited in human-readable form. For | |
example, 1.5 ETH is "1.5". |
Tools
LanguageTool
[misspelling] ~100-~100: This word is normally spelled with a hyphen.
Context: ...**:string
Amount to be deposited in human readable form. For example, 1.5 ETH is "1.5". •...(EN_COMPOUNDS_HUMAN_READABLE)
@andresaiello @zeta-chain/fullstack please, review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary by CodeRabbit
New Features
ZetaChainClient
, including methods for deposits, withdrawals, balance retrieval, and cross-chain transfers.getQuote
,getFees
, andsendZeta
to facilitate various transaction operations within the ZetaChain ecosystem.Bug Fixes
Documentation
Chores