You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
453 B
17 lines
453 B
import { gweiUnits } from '../../constants/unit.js';
|
|
import { parseUnits } from './parseUnits.js';
|
|
/**
|
|
* Converts a string representation of gwei to numerical wei.
|
|
*
|
|
* - Docs: https://viem.sh/docs/utilities/parseGwei
|
|
*
|
|
* @example
|
|
* import { parseGwei } from 'viem'
|
|
*
|
|
* parseGwei('420')
|
|
* // 420000000000n
|
|
*/
|
|
export function parseGwei(ether, unit = 'wei') {
|
|
return parseUnits(ether, gweiUnits[unit]);
|
|
}
|
|
//# sourceMappingURL=parseGwei.js.map
|