mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-17 19:35:11 +03:00
fix denormolized wallet balance error
This commit is contained in:
@@ -87,6 +87,10 @@ export function generateCalls(calls: BytesLike[]) {
|
||||
}
|
||||
|
||||
export async function exchangeToNativeDecimals(token: AddressLike, amount: BigNumberish, provider: ethers.JsonRpcProvider) {
|
||||
return await toNativeDecimals(token, amount, provider) / (BigInt(10) ** 8n)
|
||||
}
|
||||
|
||||
export async function toNativeDecimals(token: AddressLike, amount: BigNumberish, provider: ethers.JsonRpcProvider) {
|
||||
token = await token
|
||||
if (typeof token !== "string") token = await token.getAddress()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user