@keplr-ewallet/ewallet-sdk-eth
Version:
28 lines (27 loc) • 1.15 kB
TypeScript
import type { Hex, Address, ByteArray, AddEthereumChainParameter as Chain } from "viem";
export declare const publicKeyToEthereumAddress: (publicKey: Hex | ByteArray) => Address;
export declare const isValidChainId: (chainId: unknown) => chainId is string;
export declare const isValidUrl: (url: string) => boolean;
export declare const validateChainIdFormat: (chainId: string) => {
isValid: boolean;
decimalValue?: number;
error?: string;
};
export declare const validateRpcUrls: (rpcUrls: readonly string[]) => {
isValid: boolean;
error?: string;
};
export declare const validateBlockExplorerUrls: (blockExplorerUrls?: readonly string[]) => {
isValid: boolean;
error?: string;
};
export declare const validateNativeCurrencySymbol: (symbol: string) => {
isValid: boolean;
error?: string;
};
export declare const validateChain: (chain: Chain, addedChains: readonly Chain[]) => {
isValid: boolean;
error?: string;
errorType?: "DUPLICATE_CHAIN" | "INVALID_CHAIN_ID" | "INVALID_RPC_URLS" | "INVALID_BLOCK_EXPLORER_URLS" | "INVALID_NATIVE_CURRENCY" | "CURRENCY_SYMBOL_MISMATCH";
errorData?: any;
};