-
Notifications
You must be signed in to change notification settings - Fork 151
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
added docstring to usecontract and use token balance hooks #216
added docstring to usecontract and use token balance hooks #216
Conversation
🦋 Changeset detectedLatest commit: 3d00718 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -9,6 +9,20 @@ interface Props { | |||
accountAddress: string; | |||
} | |||
|
|||
/** | |||
* @dev Hook to use account token balance |
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.
I think Hook to get the token balance of the account
would be more appropriate
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.
Is this hook going to get used when something like a button saying "usetokenbalance" is clicked?.
@@ -9,6 +9,20 @@ interface Props { | |||
accountAddress: string; | |||
} | |||
|
|||
/** | |||
* @dev Hook to use account token balance | |||
* @param {string} tokenAddress Address of the 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.
@param tokenAddress Address of the token
/** | ||
* @dev Hook to use account token balance | ||
* @param {string} tokenAddress Address of the token | ||
* @param {string} accountAddress Address of the account |
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.
param accountAddress Address of the account
* @param {string} tokenAddress Address of the token | ||
* @param {string} accountAddress Address of the account | ||
* @returns { | ||
* balance {string}: balance in Wei converted to string. |
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.
balance: gives account balance for the token in Wei as a string
* @param {string} accountAddress Address of the account | ||
* @returns { | ||
* balance {string}: balance in Wei converted to string. | ||
* loading {boolean}: True until transaction is undergoing, false when error is caught. |
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.
loading: True until the transaction is executing, false otherwise
@@ -2,6 +2,16 @@ import React from 'react'; | |||
import { Web3Context } from '../Provider'; | |||
import { Contract } from 'ethers'; | |||
|
|||
/** | |||
* @dev Hook to use a contract | |||
* @param {string} address contract address |
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.
@param address contract address
@@ -2,6 +2,16 @@ import React from 'react'; | |||
import { Web3Context } from '../Provider'; | |||
import { Contract } from 'ethers'; | |||
|
|||
/** | |||
* @dev Hook to use a contract |
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.
@dev Hook to get the contract instance from ABI and contract address
/** | ||
* @dev Hook to use a contract | ||
* @param {string} address contract address | ||
* @param {string} accountAddress contract ABI |
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.
@param abi contract ABI
* @param {string} address contract address | ||
* @param {string} accountAddress contract ABI | ||
* @returns { | ||
* contract {string}: Current contract in use |
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.
contract: An instance of the current contract
* @param {string} accountAddress contract ABI | ||
* @returns { | ||
* contract {string}: Current contract in use | ||
* isReady {boolean}: True when contract is set, false otherwise. |
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.
isReady: True when the contract is ready to use, false otherwise.
/** | ||
* @dev Hook to get the token balance of the account | ||
* @param tokenAddress Address of the token | ||
* param accountAddress Address of the account |
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.
@param accountAddress Address of the account
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.
Overall nice, just a minor change is needed. Sorry for not adding the @
in the suggested review.
Hey @Nazeeh21 , sorry my bad I should have checked before commiting the change |
You should remove these files:
Changesets add entries to the |
Hi @with-heart , Thanks for your inputs. I'll make the changes and commit it. |
Yeap that's fine! Usually adding changesets is the last thing I do when making a PR |
Co-authored-by: with-heart <with.heart+git@pm.me>
Co-authored-by: with-heart <with.heart+git@pm.me>
Co-authored-by: with-heart <with.heart+git@pm.me>
Co-authored-by: with-heart <with.heart+git@pm.me>
Hi @with-heart @Nazeeh21 , |
Sure, will review it tomorrow |
Changes LGTM. We'll merge it once @with-heart approves it. |
@allcontributors please add @Redarcher9 for docs! |
I've put up a pull request to add @Redarcher9! 🎉 |
Closes #190
Description
📝 Additional Information