UNPKG

locklift

Version:

Node JS framework for working with Ever contracts. Inspired by Truffle and Hardhat. Helps you to build, test, run and maintain your smart contracts.

91 lines (90 loc) 2.86 kB
/// <reference types="mocha" /> import { ProviderRpcClient } from "everscale-inpage-provider"; import type { ConnectionData, Ed25519KeyPair } from "everscale-standalone-client"; import { ConnectionProperties } from "everscale-standalone-client/nodejs"; import { Giver } from "../factory"; import Joi from "joi"; import { MessageProperties } from "everscale-standalone-client/client"; export declare enum ConfigState { EXTERNAL = 0, INTERNAL = 1 } export declare const LOCKLIFT_NETWORK_NAME = "locklift"; type LockliftNetworkName = typeof LOCKLIFT_NETWORK_NAME; export interface LockliftConfig<T extends ConfigState = ConfigState.EXTERNAL> { compiler: { includesPath?: string; externalContracts?: ExternalContracts; externalContractsArtifacts?: ExternalContracts; compilerParams?: Array<string>; } & ({ path: string; } | { version: string; }); linker?: { path: string; lib: string; } | { version: string; }; networks: Networks<T>; mocha: Mocha.MochaOptions & { tsconfig?: string; }; } export type KeysConfig = { path?: string; phrase?: string; amount: number; }; export type ForkContractsConfig = Array<{ abi: { path: string; }; } & ({ codeHash: string | { deriveAddress: string; }; } | { address: string; })>; export type ForkSource = { type: "live"; connection: ConnectionProperties; } | { type: "block"; block: number; }; export type Networks<T extends ConfigState = ConfigState.EXTERNAL> = Record<"local" | string, NetworkValue<T>> & { [key in LockliftNetworkName]: NetworkValue<T, LockliftNetworkName>; }; export interface NetworkValue<T extends ConfigState = ConfigState.EXTERNAL, P extends string = ""> { giver: T extends ConfigState.EXTERNAL ? P extends LockliftNetworkName ? GiverConfig | undefined : GiverConfig : GiverConfig; keys: T extends ConfigState.EXTERNAL ? KeysConfig : Required<KeysConfig>; connection: T extends ConfigState.EXTERNAL ? ConnectionProperties : ConnectionData; fork?: { source: ForkSource; contracts: ForkContractsConfig; }; blockchainConfig?: "EVER" | "TON" | { custom: string; } | undefined; clientConfig?: { message?: MessageProperties; initInput?: any | Promise<any>; }; } export type ExternalContracts = Record<string, Array<string>>; export type GiverConfig = { address: string; giverFactory?: (ever: ProviderRpcClient, keyPair: Ed25519KeyPair, address: string) => Giver; } & ({ key: string; } | { phrase: string; accountId: number; }); export declare const JoiConfig: Joi.ObjectSchema<LockliftConfig<ConfigState.EXTERNAL>>; export declare function loadConfig(configPath: string): LockliftConfig<ConfigState.INTERNAL>; export {};