# NaiAsset objects

There are three asset types (token types) in Hive's layer 1 protocol: HIVE (liquid hive), VESTS (staked hive), and HBD (hive-backed dollars). All asset amounts are specified as fixed-point numbers to prevent rounding errors (these are especially problematic for financial calculations) . Hive and HBD use 3 digits of precision, VESTS are specified using 6 digits of precision.

Assets can be represented using two formats. The first is the deprecated string format. Here's an example of the deprecated format for 1 Hive token: "1.000 HIVE".

The second format is called Numeric Asset Identifier (NAI). NAI is the recommended format. With NAIs, asset types are specified using numbers rather than strings. NAIs were introduced to simplify supporting user-created asset types in the future.

Here's an example of an NAI asset for 1 hive token: {"amount":"1000","precision":3,"nai":"@@000000021"}.

# Creating NaiAsset objects for each asset type

import { createWaxFoundation } from '@hiveio/wax';

const waxApi = await createWaxFoundation();

// Convert the amount into `NaiAsset` for HIVE, HBD, and VESTS
const hiveAsset = waxApi.hiveSatoshis(1_000); // 1.000 HIVE
const hbdAsset = waxApi.hbdSatoshis(1_000); // 1.000 HBD
const vestsAsset = waxApi.vestsSatoshis(1_000000); // 1.000000 VESTS

console.log(`Hive Asset: ${JSON.stringify(hiveAsset)}`);
console.log(`HBD Asset: ${JSON.stringify(hbdAsset)}`);
console.log(`Vests Asset: ${JSON.stringify(vestsAsset)}`);