mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-30 17:48:05 +03:00
feat: update ethers@6
fix: bigint errors fix: TS errors fix: gasLimit fetch fix: review comments fix: contracts errors chore: bump rc version fix: revert wrong fix fix: ts config fix: ts config fix: ts config feat: update signer
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { BigNumber } from 'bignumber.js';
|
||||
import type { ethers } from 'ethers';
|
||||
|
||||
/**
|
||||
* Converts normalized blockchain ("machine-readable") number to denormalized ("human-readable") number.
|
||||
@@ -7,8 +6,8 @@ import type { ethers } from 'ethers';
|
||||
* @param decimals Blockchain asset precision
|
||||
* @returns BigNumber
|
||||
*/
|
||||
export default function denormalizeNumber(input: ethers.BigNumber, decimals: BigNumber.Value) {
|
||||
const decimalsBN = new BigNumber(decimals);
|
||||
export default function denormalizeNumber(input: bigint, decimals: bigint) {
|
||||
const decimalsBN = new BigNumber(decimals.toString());
|
||||
if (!decimalsBN.isInteger()) throw new Error(`Decimals '${decimalsBN.toString()}' is not an integer`);
|
||||
return new BigNumber(input.toString()).div(new BigNumber(10).pow(decimalsBN));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user