Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape ** to avoid incorrect rendering #304

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/build/massa-web3/utils.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ const gas = BigInt(2000000);
const gas = 2000000n;
```

- Coins/Fees: expressed in BigInt's. Coins/fees do however have a metric system behind them. The smallest unit is 10**-9 Massa. All coins/fees are to be expressed as integers scaled by 10**9 and this way consumed by the network json-rpc protocol. Since gas/fees are to be used as BigInt's web3 adds in a few convenience utils allowing smaller units (e.g. 0.5 Massa) to be expressed.
- Coins/Fees: expressed in BigInt's. Coins/fees do however have a metric system behind them. The smallest unit is 10\*\*-9 Massa. All coins/fees are to be expressed as integers scaled by 10\*\*9 and this way consumed by the network json-rpc protocol. Since gas/fees are to be used as BigInt's web3 adds in a few convenience utils allowing smaller units (e.g. 0.5 Massa) to be expressed.

The util function `fromMAS` and `toMAS` are used exactly for the latter purpose. `fromMAS` receives any amount of type `number | string | BigNumber | bigint and returns a scaled bigint` for ready use. `toMAS` on the contrary converts any amount from `nanoMassa` to `Massa` and returns a `BigNumber` representing the amount as a decimal.
The util function `fromMAS` and `toMAS` are used exactly for the latter purpose. `fromMAS` receives any amount of type `number | string | BigNumber | bigint` and returns a scaled `bigint` for ready to use. `toMAS` on the contrary converts any amount from `nanoMassa` to `Massa` and returns a `BigNumber` representing the amount as a decimal.

Examples:

Expand Down
Loading