Home > @primitivefi/rmm-sdk > weiToWei
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Gets a Wei class from a wei string value.
Signature:
export declare function weiToWei(wei: string, decimals?: number): Wei;
Parameter | Type | Description |
---|---|---|
wei | string | |
decimals | number |
Returns:
Wei
wei
but as a Wei instance.
This converts the wei value by using the parseWei function, which multiplies it by 10^decimals. Therefore, to get the actual string as a Wei class we have to divided it down by the same scalar.
wei Raw wei value as a string to convert into a Wei class. decimals Decimal places of wei value, since its an integer in the EVM.