Balance decimals plugin.
Thist plugin allows you to use 1 DOT
, 1 UNIT
etc.
Install dependency from NPM:
yarn add @redspot/decimals
And add the following statement to your redspot.config.ts
:
import '@redspot/decimals'
DOT
is the default tokenDecimals of chain.UNIT
is the smallest unit of value.
Use for gasLimit:
const contract = await contractFactory.deployed('new', '10000', {
gasLimit: '1 DOT',
value: '10000'
});
Transfer:
import { network } from 'redspot';
const { api } = network;
async function run() {
await api.isReady;
api.tx.balances.transfer(address, '1 DOT')
}