Optional
base: number | "hex"Optional
endian: EndiannessOptional
endian: EndiannessStatic
BNStatic
wordcompare numbers and return -1 (a < b)
, 0 (a == b)
, or 1 (a > b)
depending on the comparison result
a equals b
Protected
froma greater than b
a greater than or equals b
shift right (unimplemented https://github.com/indutny/bn.js/blob/master/lib/bn.js#L2086)
a less than b
a less than or equals b
Optional
endian: EndiannessOptional
length: numberconvert to an instance of type
, which must behave like an Array
Optional
endian: EndiannessOptional
length: numbercompare numbers and return -1 (a < b)
, 0 (a == b)
, or 1 (a > b)
depending on the comparison result
Static
fromStatic
isBNStatic
maxStatic
minStatic
montcreate a reduction context with the Montgomery trick.
Static
parseConvert human readable NEAR amount string to a NEAR object.
string representation of NEAR tokens amount
new NEAR object wrapping the parsed amount
NEAR.parse('1') // => NEAR<'1000000000000000000000000'> (1e24 yoctoNEAR; 1 NEAR)
NEAR.parse('1,000') // => NEAR<'1000000000000000000000000000'> (1e27 yoctoNEAR; 1,000 NEAR)
NEAR.parse('1 mN') // => NEAR<'1000000000000000000000'> (1e21 yoctoNEAR; 0.001 NEAR)
NEAR.parse('1 nN') // => NEAR<'1000000000000000'> (1e15 yoctoNEAR; 0.000000001 NEAR)
Static
redcreate a reduction context
Generated using TypeDoc
Description
absolute value