Skip to main content

Utilities

NEAR => yoctoNEAR​

// converts NEAR amount into yoctoNEAR (10^-24)

const { utils } = nearAPI;
const amountInYocto = utils.format.parseNearAmount("1");

Function parseNearAmount

YoctoNEAR => NEAR​

// converts yoctoNEAR (10^-24) amount into NEAR

const { utils } = nearAPI;
const amountInNEAR = utils.format.formatNearAmount("1000000000000000000000000");

Function formatNearAmount

Was this page helpful?