@funkit/connect
Version:
Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.
31 lines (30 loc) • 847 B
TypeScript
import { type FlagKey } from '@funkit/utils';
export declare const MATCH_ALL = "*";
export type MatchAll = typeof MATCH_ALL;
export interface TokenWhitelist {
[chainId: string | MatchAll]: string[] | [MatchAll] | MatchAll;
}
/**
* Helper to check if a token is whitelisted for a given flag
* Expects a flag value to be a JSON string of the following format (see {@link TokenWhitelist}):
* ```json
* {
* "137": ["0xaf88d065e77c8cC2239327C5EDb3A432268e5831"],
* "8453": ["0xaf88d065e77c8cC2239327C5EDb3A432268e5831"]
* }
* ```
* Does also support wildcard entries, for example:
* ```json
* {
* "137": ["*"],
* "8453": "*",
* }
* ```
* or even:
* ```json
* {
* "*": "*"
* }
* ```
*/
export declare const useIsTokenWhitelisted: <T extends FlagKey>(flagKey: T) => (chainId: string, tokenAddress: string) => boolean;