@unstoppabledomains/resolution
Version:
Domain Resolution for blockchain domains
31 lines (30 loc) • 1.51 kB
TypeScript
import { CryptoRecords, NamingServiceName } from '../types/publicTypes';
import { UnsSupportedNetwork } from '../types';
declare type Providers = 'infura' | 'alchemy';
export declare function getLibAgent(): string;
export declare function signedInfuraLink(infura: string, network?: string): string;
export declare function signedLink(key: string, network?: UnsSupportedNetwork, provider?: Providers): string;
export declare function hexToBytes(hexString: string): number[];
export declare function isNullAddress(key: string | null | undefined): key is undefined | null;
export declare function constructRecords(keys: string[], values: undefined | (string | undefined)[] | CryptoRecords): CryptoRecords;
export declare const findNamingServiceName: (domain: string) => Promise<NamingServiceName | null>;
export declare const EthereumNetworks: {
readonly mainnet: 1;
readonly sepolia: 11155111;
readonly 'polygon-mainnet': 137;
readonly 'polygon-amoy': 80002;
readonly 'base-mainnet': 8453;
readonly 'base-sepolia': 84532;
};
export declare const EthereumNetworksInverted: Record<number, string>;
export declare const wrapResult: <T>(func: () => T) => Promise<WrappedResult<T>>;
export declare const unwrapResult: <T>(wrappedResult: WrappedResult<T>) => UnwrapPromise<T>;
export declare type WrappedResult<T> = {
result: UnwrapPromise<T>;
error: null;
} | {
result: null;
error: Error;
};
export declare type UnwrapPromise<T> = T extends Promise<infer U> ? U : T;
export {};