0.1.1 • Published 7 years ago
@openrelay/erc20-balance v0.1.1
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.accountdefault=web3 default account — The account to display the balance of.refreshdefault=true — Whether to refresh the balance on block updates.rounddefault=10 — The number of decimal places to display.
JavaScript Properties
value— ABigNumberobject 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.