How to use the icon-sdk-js.IconAmount.of function in icon-sdk-js

To help you get started, we’ve selected a few icon-sdk-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github icon-project / icon-sdk-js / quickstart / example / js / IcxTransactionExample.js View on Github external
async getWalletBalance() {
        const balanceA = await this.iconService.getBalance(MockData.WALLET_ADDRESS_1).execute();
        const balanceB = await this.iconService.getBalance(MockData.WALLET_ADDRESS_2).execute();
        document.getElementById('I02-1').innerHTML = `<b>${IconAmount.of(balanceA, IconAmount.Unit.LOOP).convertUnit(IconAmount.Unit.ICX)}`;
        document.getElementById('I02-2').innerHTML = `<b>${IconAmount.of(balanceB, IconAmount.Unit.LOOP).convertUnit(IconAmount.Unit.ICX)}`;
    }
</b></b>