import React from 'react'; import { ChainId } from '../utils/constants'; import { Token } from '../utils/token'; import { AggregatorQuote } from '../types'; export interface ConfigOptions { /** * The affiliate fee recipient address. If provided, the affiliate fee will be sent to this address. * Note that this requires that the affiliateFee parameter is also specified */ affiliateFeeRecipient?: string; /** * The affiliate fee in percentage (between 0% - 2%). If provided, the affiliate fee will be sent to the affiliateFeeRecipient. * Note that this requires that the affiliateFeeRecipient parameter is also specified */ affiliateFee?: string | number; /** * Default chain id to use. If not provided ChainId.BSC (56) will be used. * @default 56 */ chainId?: ChainId; /** * The chain ids to use. If not provided, all chains are used. * @default all */ allowedChainIds?: ChainId[]; /** * Chains specific configuration. * Can be used to set a default input or output token for any chain */ defaultSelectedTokenByChains?: { [chainId: number]: { defaultInputToken?: string; defaultOutputToken?: string; }; }; /** * The default slippage to use for swaps in percentage * @default 0.5% */ defaultSlippage?: string | number; /** * Disable auto wallet connect on page load * @default false default auto connect */ disabledAutoConnect?: boolean; /** * Event listener for when chain network change */ onChainChange?: (newChainId: ChainId, oldChainId: ChainId) => void; /** * Event listener for wallet account change. * This can be triggered by user connecting their wallet, change account, or disconnecting wallet. */ onAccountChange?: (newAccount: string, oldAccount: string) => void; /** * Event listener for when different tokens are selected. */ onTokenSelect?: (inputToken: Token, outputToken: Token) => void; /** * Event listener for succesfull swaps. */ onSuccessSwap?: (quote: AggregatorQuote) => void; /** * Disable persist selected chain * @default false */ disabledPersistSelectedChain?: boolean; /** * By default the selected tokens are cached, so that when a user switch chain and then switch back the tokens selected previously will be automatically selected. * If set to True default to defaultSelectedTokenByChains. * @default false */ disabledPersistSelectedToken?: boolean; /** * These tokens will be added to the token lists. * Use this if your token, or other tokens you want to integrate are not in our list yet. * If you do not add the token the user will still be able to find it by pasting the address. */ predefinedTokens?: Token[]; /** * The token symbols that will be hidden from the token lists. If not provided, no tokens will be hidden. */ hideTokens?: string[]; /** * The token symbols that will be shown in the token lists. If not provided, all tokens will be shown. */ showTokens?: string[]; } export interface ChainConfig { chainId: ChainId | null; allowedChainIds: Set; } export declare const ConfigProvider: ({ children, options }: { children?: React.ReactNode; } & { options: ConfigOptions; }) => JSX.Element; export declare const useConfig: () => [ConfigOptions, React.Dispatch>]; export declare const useChainConfig: () => [ChainConfig, React.Dispatch>]; //# sourceMappingURL=ConfigProviders.d.ts.map