import React from 'react'; import { ChainId } from '../utils/constants'; import { Token } from '../utils/token'; import { AggregatorQuote } from '../types'; export interface ConfigOptions { /** * An identifying name for your project consisting of letters and hyphens without spaces. e.g. 'polyswap'. * If not provided 'polyswap-whitelabel' will be used. */ marketer?: string; /** * 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 recipient address by chain. If provided, the affiliate fee will be sent to this address. * This will override the affiliateFeeRecipient based on the chain id. * If not provided for a chain, the affiliateFeeRecipient will be used. */ affiliateFeeRecipientByChains?: { [chainId: number]: 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.Polygon (137) will be used. * @default 137 */ 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[]; /** * If set to false then Wallet Connect is hidden from connection modal. */ showWalletConnect?: boolean; /** * If set to true then the swap route card will be shown below the swap cards. */ showSwapRouteCard?: boolean; /** * If set to true then the price comparison card will be shown below the swap cards. */ showPriceComparisonCard?: boolean; /** * If set to true then the token info card will be shown next the swap cards. */ showTokenInfoCard?: boolean; /** * If set true, the error boundary will be disabled. */ disableErrorBoundary?: boolean; /** * If set true, the gas config button will be hidden. */ hideGasConfigButton?: boolean; /** * If set true, the buy fiat button will be hidden. */ hideBuyFiatButton?: boolean; /** * If set true, the transactions button will be hidden. */ hideTransactionsButton?: boolean; /** * If set true, the connection info button will be hidden. */ hideConnectionInfoButton?: boolean; } export interface ChainConfig { chainId: ChainId | null; allowedChainIds: Set; isReady: boolean; } export declare const ConfigProvider: ({ children, options }: { children?: React.ReactNode; } & { options: ConfigOptions; }) => import("react/jsx-runtime").JSX.Element; export declare const useConfig: () => [ConfigOptions, React.Dispatch>]; export declare const useChainConfig: () => [ChainConfig, React.Dispatch>]; //# sourceMappingURL=ConfigProviders.d.ts.map