Variables
Const MAX_GAS
MAX_GAS: BN = ...
Const ONE_TGAS
ONE_TGAS: BN = ...
Functions
bnToApproximateDecimal
- bnToApproximateDecimal(v: BN, decimals: number, precision?: number): number
Parameters
v: BN
decimals: number
Optional precision: number
Returns number
bnToFixed
- bnToFixed(num: BN, decimals: number, precision?: number): string
Parameters
num: BN
decimals: number
Optional precision: number
Returns string
decimalToBn
- decimalToBn(price: number, decimals: number): BN
Parameters
price: number
decimals: number
Returns BN
denomination
- denomination(decimals: number): BN
floorToBn
- floorToBn(v: BN, closest: BN): BN
floorToDecimals
- floorToDecimals(v: BN, decimals: number): BN
functionCallWithOutcome
- functionCallWithOutcome<T>(account: Account, params: FunctionCallOptions): Promise<{ executionOutcome: FinalExecutionOutcome; response: T }>
Type Parameters
Parameters
account: Account
params: FunctionCallOptions
Returns Promise<{ executionOutcome: FinalExecutionOutcome; response: T }>
roundDownTo
- roundDownTo(v: BN, nearest: BN): BN
tgasAmount
- tgasAmount(tgas: number): BN
toDecimalPaddedString
- toDecimalPaddedString(val: string, decimals?: number): string
Parameters
val: string
Optional decimals: number
Returns string
Analogous to Number.toFixed() for BN values. Example
bnToFixed(new BN(123), 2, 5) === '1.23000'; // true