@gamcaplabs/uniswapeasy
Version:
Uniswap V4 Liquidity Provider
229 lines (215 loc) • 5.84 kB
TypeScript
/// <reference types="react" />
import * as react_jsx_runtime from 'react/jsx-runtime';
import { JsonRpcProvider } from '@ethersproject/providers';
import { Provider } from '@web3-react/types';
import { Currency } from '@uniswap/sdk-core';
import { BigNumberish } from 'ethers';
/**
* List of all the networks supported by the Uniswap Interface
*/
declare enum SupportedChainId {
MAINNET = 1,
ROPSTEN = 3,
RINKEBY = 4,
GOERLI = 5,
KOVAN = 42,
ARBITRUM_ONE = 42161,
ARBITRUM_RINKEBY = 421611,
OPTIMISM = 10,
OPTIMISM_GOERLI = 420,
POLYGON = 137,
POLYGON_MUMBAI = 80001,
CELO = 42220,
CELO_ALFAJORES = 44787,
BNB = 56,
BASE = 8453,
ETHEREUM_SEPOLIA = 11155111
}
type JsonRpcConnectionMap = {
[chainId: number]: string | string[] | JsonRpcProvider | JsonRpcProvider[];
};
interface ProviderProps {
defaultChainId?: SupportedChainId;
jsonRpcUrlMap?: JsonRpcConnectionMap;
/**
* If null, no auto-connection (MetaMask or WalletConnect) will be attempted.
* This is appropriate for integrations which wish to control the connected provider.
*/
provider?: Provider | JsonRpcProvider | null;
}
interface Gaps {
xs: string;
sm: string;
md: string;
lg: string;
lgplus: string;
xl: string;
}
type BorderRadius = {
xsmall: number;
small: number;
medium: number;
large: number;
};
interface Attributes {
borderRadius: BorderRadius;
grids: Gaps;
font: {
family: string;
};
}
interface Colors {
surfacesAndElevation: {
pageBackground: string;
elevation1: string;
elevation2: string;
elevation3: string;
};
borders: {
borders: string;
dividers: string;
dividerBlank: string;
};
text: {
primary: string;
secondary: string;
tertiary: string;
color: string;
gain: string;
loss: string;
};
components: {
icon: {
icon: string;
};
button: {
primary: {
background: string;
foreground: string;
hoverAndFocusBackground: string;
hoverAndFocusForeground: string;
disabledBackground: string;
disabledForeground: string;
};
secondary: {
foreground: string;
hoverAndFocusBackground: string;
hoverAndFocusForeground: string;
disabledBorder: string;
disabledForeground: string;
border: string;
hoverAndFocusBorder: string;
background: string;
};
ghost: {
background: string;
hoverAndFocusBackground: string;
hoverAndFocusForeground: string;
disabledBackground: string;
};
};
badge: {
neutralBackground: string;
neutralForeground: string;
alertBackground: string;
alertForeground: string;
};
inputFieldCurrencyField: {
background: string;
border: string;
foreground: string;
typeAndActiveForeground: string;
disabledForeground: string;
filledBackground: string;
filledForeground: string;
};
dropdown: {
background: string;
foreground: string;
hoverForeground: string;
hoverBackground: string;
};
chip: {
background: string;
foreground: string;
};
toggle: {
activeDefaultBackground: string;
activeDefaultForeground: string;
inactiveDefaultBackground: string;
};
tooltip: {
background: string;
foreground: string;
};
textButton: {
primary: {
default: string;
};
tertiary: {
default: string;
};
};
graph: {
main: string;
};
};
}
interface Theme extends Colors, Attributes {
}
declare const tealLight: Colors;
declare const tealDark: Colors;
declare const orangeLight: Colors;
declare const orangeDark: Colors;
declare const defaultTheme: Theme;
interface WidgetProps extends ProviderProps {
theme: Theme;
}
type PoolKey = {
currency0: Currency;
currency1: Currency;
fee: BigNumberish;
tickSpacing: BigNumberish;
hooks: string;
};
interface InputRestrictions {
min?: string;
max?: string;
pattern?: string;
required?: boolean;
}
interface BaseProps {
name: string;
description?: string;
}
interface BaseInputField extends BaseProps {
type: string;
defaultValue?: string;
restrictions?: InputRestrictions;
}
interface Tuple extends BaseProps {
fields: InputField[];
}
type InputField = BaseInputField | Tuple;
type PoolInfo = {
chainId: number;
poolKey: PoolKey;
};
type HookInfo = {
address: string;
name: string;
abbr: string;
desc: string;
inputFields: InputField[];
overrideInputFields?: boolean;
};
type LPWidgetProps = {
poolInfos: PoolInfo[];
hookInfos: HookInfo[];
currencyIconMap: Record<string, string>;
onPoolSelect?: (poolKey: PoolKey) => void;
hookData?: string;
};
type UniswapEasyProps = WidgetProps & LPWidgetProps;
declare function UniswapEasy(props: UniswapEasyProps): react_jsx_runtime.JSX.Element;
export { type Attributes, type BaseInputField, type Colors, type HookInfo, type InputField, type PoolInfo, type PoolKey, type Theme, type Tuple, UniswapEasy, type UniswapEasyProps, defaultTheme, orangeDark, orangeLight, tealDark, tealLight };