Skip to content

Latest commit

 

History

History
36 lines (21 loc) · 1 KB

rmm-sdk.weitowei.md

File metadata and controls

36 lines (21 loc) · 1 KB

Home > @primitivefi/rmm-sdk > weiToWei

weiToWei() function

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;

Parameters

Parameter Type Description
wei string
decimals number

Returns:

Wei

wei but as a Wei instance.

Remarks

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.