ethers.js/packages/bignumber/lib/bignumber.d.ts

36 lines
1.3 KiB
TypeScript
Raw Permalink Normal View History

2019-05-14 18:48:48 -04:00
import { Bytes, Hexable } from "@ethersproject/bytes";
export declare type BigNumberish = BigNumber | Bytes | string | number;
2019-06-11 17:57:04 -04:00
export declare function isBigNumberish(value: any): value is BigNumberish;
2019-05-14 18:48:48 -04:00
export declare class BigNumber implements Hexable {
readonly _hex: string;
2019-06-11 17:57:04 -04:00
readonly _isBigNumber: boolean;
2019-05-14 18:48:48 -04:00
constructor(constructorGuard: any, hex: string);
fromTwos(value: number): BigNumber;
toTwos(value: number): BigNumber;
abs(): BigNumber;
add(other: BigNumberish): BigNumber;
sub(other: BigNumberish): BigNumber;
div(other: BigNumberish): BigNumber;
mul(other: BigNumberish): BigNumber;
mod(other: BigNumberish): BigNumber;
pow(other: BigNumberish): BigNumber;
2020-04-15 18:28:04 -04:00
and(other: BigNumberish): BigNumber;
or(other: BigNumberish): BigNumber;
xor(other: BigNumberish): BigNumber;
mask(value: number): BigNumber;
shl(value: number): BigNumber;
shr(value: number): BigNumber;
2019-05-14 18:48:48 -04:00
eq(other: BigNumberish): boolean;
lt(other: BigNumberish): boolean;
lte(other: BigNumberish): boolean;
gt(other: BigNumberish): boolean;
gte(other: BigNumberish): boolean;
2020-04-15 18:28:04 -04:00
isNegative(): boolean;
2019-05-14 18:48:48 -04:00
isZero(): boolean;
toNumber(): number;
toString(): string;
toHexString(): string;
static from(value: any): BigNumber;
static isBigNumber(value: any): value is BigNumber;
}