-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: add missing chains * chore: fix manualRelayToDestChain (#281) * chore: fix evm event retrieval should not require useWindowEthereum * chore: fix tests * chore: update version to 0.13.6-alpha.1 * chore: add registry-url for release-alpha action * chore: set default to useWindowEthereum in execute function * chore: update filecoin calibration testnet chain id * chore: update filecoin rpc * chore: add retry for fetchBatchData * 0.13.6-alpha.2 * chore: addressing bignumber issue with estimateGasFee (#283) * chore: addressing bignumber issue with estimateGasFee * chore: change gasLimit type to BigNumberish * 0.13.6-alpha.3 * chore: adding polygon evm * 0.13.6-alpha.4 * Chore/fix manual relay to dest chain (#284) * chore: fix evm event retrieval should not require useWindowEthereum * chore: fix tests * chore: update version to 0.13.6-alpha.1 * chore: add registry-url for release-alpha action * chore: set default to useWindowEthereum in execute function * chore: update filecoin calibration testnet chain id * chore: update filecoin rpc * chore: add retry for fetchBatchData * chore: add fallback for getEventIndex * chore: adding updated chains --------- Co-authored-by: npty <[email protected]> * chore: adding updated chains (#288) * chore: support specify dest chain log index (#285) * chore: allow user to pass destChain and eventIndex * chore: same thing for addGas * chore: adding optional parameter for log index to recovery methods (#287) * chore: adding optional parameter for log index to recovery methods * chore: code cleanup * chore: fix test --------- Co-authored-by: Canh Trinh <[email protected]> Co-authored-by: Canh Trinh <[email protected]> * chore: update v0.13.6 changelog * chore: fix for fractional component exceeds decimals * 0.13.6-alpha.5 * chore: add mantle testnet/mainnet configs * 0.13.6-alpha.6 * chore: remove unused parameter * chore: fix test * feat(AXE-1171): add srcTxLogIndex and srcTxIndex to execute method params * 0.13.6-alpha.7 * chore(AXE-1171): fix test * chore: update changelog * 0.13.6 --------- Co-authored-by: npty <[email protected]> Co-authored-by: npty <[email protected]>
- Loading branch information
1 parent
3d30bc5
commit c763d1c
Showing
17 changed files
with
247 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { BigNumber } from "ethers"; | ||
import { parseUnits } from "ethers/lib/utils"; | ||
|
||
export class BigNumberUtils { | ||
public static multiplyToGetWei(bn: BigNumber | string, number: string, units: number): BigNumber { | ||
if (number.toString().split(".")[1].length <= units) { | ||
return BigNumber.from(bn).mul(parseUnits(number, units)); | ||
} else { | ||
const multiplier = Math.pow(10, units); | ||
return BigNumber.from(bn) | ||
.mul(parseUnits((Number(number) * multiplier).toString(), units)) | ||
.div(multiplier); | ||
} | ||
} | ||
|
||
public static divideToGetWei(bn: BigNumber | string, number: string, units: number): BigNumber { | ||
return BigNumber.from(bn).div(parseUnits(number, units)); | ||
} | ||
} |
Oops, something went wrong.