@bombearn/sdk
Version:
Interaction framework for the yearn protocol
28 lines (27 loc) • 1.45 kB
TypeScript
import { BigNumber } from "@ethersproject/bignumber";
import { ChainId } from "./chain";
import { Address, Integer, Usdc } from "./types";
export declare const ZeroAddress = "0x0000000000000000000000000000000000000000";
export declare const EthAddress = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
export declare const WethAddress = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2";
export declare const YvWethAddress = "0xa258C4606Ca8206D8aA700cE2143D7db854D168c";
export declare const NativeTokenAddress = "0x0000000000000000000000000000000000000000";
export declare function isNativeToken(address: Address): boolean;
export declare function isWethVault(address: Address): boolean;
export declare function getWrapperIfNative(address: Address, chainId: ChainId): Address;
export declare function handleHttpError(response: Response): Promise<Response>;
export declare function usdc(usd: Usdc): Usdc;
export declare function int(value: BigNumber): Integer;
export declare function chunkArray<T>(array: T[], size: number): T[][];
export declare function convertSecondsMillisOrMicrosToMillis(timestamp: string | number): number;
/**
* Merges array b into a by address removing a duplicates from b
*
* @param a higher priority array
* @param b lower priority array
*
* @returns combined arrays by address without duplicates
*/
export declare function mergeByAddress<T extends {
address: Address;
}>(a: T[], b: T[]): T[];