UNPKG

@celo-tools/celo-ethers-wrapper

Version:

A minimal wrapper to make Ethers.JS compatible with the Celo network.

27 lines (25 loc) 1.35 kB
import { BigNumberish } from "ethers"; import { CeloTransaction, CeloTransactionCip64, CeloTransactionCip66 } from "../transactions"; export declare function isEmpty(value: string | BigNumberish | undefined | null): boolean; export declare function isPresent(value: string | BigNumberish | undefined | null): boolean; export declare function isCIP64(tx: CeloTransaction): tx is CeloTransactionCip64; export declare function isCIP66(tx: CeloTransaction): tx is CeloTransactionCip66; export declare function concatHex(values: string[]): `0x${string}`; export declare function omit<T extends Object, K extends (keyof T)[]>(object: T, ...keys: K): { [Key in keyof T as Key extends K ? never : Key]: T[Key]; }; export declare function adjustForGasInflation(gas: bigint): bigint; interface ConversionParams { amountInCelo: bigint; ratioCELO: bigint; ratioTOKEN: bigint; } /** * * @param param0 @ConversionParams * ratioTOKEN will come from the first position (or numerator) of tuple returned from SortedOracles.medianRate * ratioCELO will come from the second position (or denominator) of tuple returned from SortedOracles.medianRate * @returns amount in token equal in value to the amountInCelo given. */ export declare function convertFromCeloToToken({ amountInCelo, ratioCELO, ratioTOKEN, }: ConversionParams): bigint; export {};