UNPKG

@smartinvoicexyz/constants

Version:

Unified source for configs and constants used across the Smart Invoice protocol.

59 lines (58 loc) 2.37 kB
import { Address, Chain, Hex } from 'viem'; export declare const INVOICE_VERSION = "smart-invoice-v0.1.0"; export type KnownResolverType = 'lexdao' | 'kleros' | 'smart-invoice' | 'custom'; type ResolverWithoutAddress = { id: KnownResolverType; name: string; logoUrl: string; disclaimer?: string; termsUrl: string; }; type Tokens = { [key: string]: { decimals: number; address: Hex; }; }; export type Resolver = { address: Address; } & ResolverWithoutAddress; export type NetworkConfig = { SUBGRAPH: string; SUBGRAPH_HEALTH_THRESHOLD: number; WRAPPED_NATIVE_TOKEN: Address; INVOICE_FACTORY: Address; RESOLVERS: Partial<Record<KnownResolverType, Resolver>>; TOKENS?: Tokens; ZAP_ADDRESS?: Hex; DAO_ADDRESS?: Hex; TREASURY_ADDRESS?: Hex; SPOILS_MANAGER?: Hex; }; export type KlerosCourtData = { id: number; name: string; link: string; jurors_drawn: number; reward: string; safe_address: Address; }; export declare const KLEROS_GOOGLE_FORM = "https://forms.gle/K3oMAzAb32G5SbpM9"; export declare const KLEROS_COURTS: Array<KlerosCourtData>; export declare const getGoldskySubgraphUrl: (subgraph: string) => string; export declare const getGraphStudioSubgraphUrl: (subgraph: string) => string; declare const chains: readonly [Chain, ...Chain[]]; export declare const SUPPORTED_CHAIN_IDS: number[]; export type SupportedChainId = (typeof SUPPORTED_CHAIN_IDS)[number]; export type SupportedChain = (typeof chains)[number]; export declare const SUPPORTED_CHAINS: [SupportedChain, ...SupportedChain[]]; export declare const NETWORK_CONFIG: Record<SupportedChainId, NetworkConfig>; export declare const IPFS_ENDPOINT = "https://gateway.pinata.cloud"; export declare const ARWEAVE_ENDPOINT = "https://arweave.net"; export declare function isSupportedChainId(chainId: number | undefined): chainId is SupportedChainId; export declare const graphUrls: (chainId: SupportedChainId) => string; export declare const resolvers: (chainId: SupportedChainId) => Array<KnownResolverType>; export declare const resolverInfo: (chainId: SupportedChainId) => Partial<Record<KnownResolverType, Resolver>>; export declare const wrappedNativeToken: (chainId: SupportedChainId) => `0x${string}`; export declare const invoiceFactory: (chainId: SupportedChainId) => `0x${string}`; export {};