@openrelay/erc20-balance
v0.1.1
Published
A lit-element that displays the balance of the specified erc20 token
Downloads
1
Readme
layout: widget title: "ERC20 Balance" date: 2018-09-26 08:30:00 -0500 categories: widgets package: erc20-balance code: html: |
<or-web3>
Your MBGN Balance is: <b><or-erc20-balance token="0xdde19c145c1ee51b48f7a28e8df125da0cc440be" round="2"></or-erc20-balance></b>
</or-web3>
npm: "@openrelay/erc20-balance"
The <or-erc20-balance>
element displays the user's balance of a given ERC20
token.
API
HTML Attributes
token
(required) — The token contract to display the balance of.account
[default=web3 default account] — The account to display the balance of.refresh
[default=true] — Whether to refresh the balance on block updates.round
[default=10] — The number of decimal places to display.
JavaScript Properties
value
— ABigNumber
object representing the token balance, adjusted based on the number of decimals for the token (not in base units).balancePromise
— A promise that resolves after this token's balance has been retrieved from the blockchain.