otterscan/src/api/address-resolver/address-resolver.ts

18 lines
401 B
TypeScript
Raw Normal View History

2021-10-31 08:10:42 +00:00
import React from "react";
2021-10-31 00:06:11 +00:00
import { BaseProvider } from "@ethersproject/providers";
export interface IAddressResolver<T> {
2021-10-31 00:06:11 +00:00
resolveAddress(
provider: BaseProvider,
address: string
): Promise<T | undefined>;
2021-10-31 00:06:11 +00:00
}
2021-10-31 08:10:42 +00:00
2021-10-31 22:51:11 +00:00
export type ResolvedAddressRenderer<T> = (
chainId: number,
2021-10-31 08:10:42 +00:00
address: string,
2021-10-31 22:51:11 +00:00
resolvedAddress: T,
2021-10-31 08:10:42 +00:00
linkable: boolean,
dontOverrideColors: boolean
) => React.ReactElement;