UNPKG

@simbachain/web3-suites

Version:

common code for web3 suite plugins. Code in this repo can be used for truffle or hardhat, but is designed to be applicable to future web3 suite plugins as well.

157 lines 4.68 kB
import { SimbaConfig } from "../lib"; export interface ASTAndOtherInfo { ast: Record<any, any>; source?: Record<any, any>; compiler?: string; language?: string; isLib?: boolean; contractName?: string; contractSourceName?: string; } /** * determines filename, whether on mac or windows machine * @param filePath * @returns */ export declare function WindowsOrMacFileName(filePath: string): string | undefined; /** * used to retrieve lists of applications and organisations, mainly * @param config * @param url * @returns */ export declare const getList: (config: SimbaConfig, url?: string) => Promise<Record<any, any> | void>; /** * choose SIMBA org from list * @param config * @param url * @returns */ export declare const chooseOrganisationFromList: (config: SimbaConfig, url?: string) => Promise<any>; /** * select SIMBA organisation from name * @param config * @param orgName * @returns */ export declare function chooseOrganisationFromName(config: SimbaConfig, orgName: string): Promise<any>; /** * Used for Hardhat, which stores AST separately from ABI * @param location * @returns */ export declare function parseBuildInfoJsonName(location: string): string; /** * Used for Hardhat, which stores AST separately from ABI * @param contractName * @param contractSourceName * @returns */ export declare function buildInfoJsonName(contractName: string, contractSourceName: string): Promise<string>; /** * Mainly used to determine if a contract is a library, contract, interface, etc. * @param ast * @returns */ export declare function getASTNodes(ast: any): Array<Record<any, any>>; /** * returns type of contract (library, contract, interface) * @param ast * @returns */ export declare function getContractKind(contractName: string, ast: any): string; /** * determines if a contract is a library * @param ast * @returns */ export declare function isLibrary(contractName: string, ast: any): boolean; /** * Used for Hardhat, which stores AST separately from ABI * @param contractName * @param contractSourceName * @param _buildInfoJsonName * @returns */ export declare function astAndOtherInfo(contractName: string, contractSourceName?: string, _buildInfoJsonName?: string): Promise<ASTAndOtherInfo>; /** * Used for Hardhat, which stores AST separately from ABI * @param contractName * @param contractSourceName * @returns */ export declare function getASTAndOtherInfo(contractName: string, contractSourceName?: string): Promise<ASTAndOtherInfo | Error>; /** * Used for Hardhat, which stores AST separately from ABI * This actually writes the AST to the build file containing the ABI * @param contractName * @param contractSourceName * @returns */ export declare function writeAndReturnASTAndOtherInfo(contractName: string, contractSourceName: string): Promise<ASTAndOtherInfo>; /** * Used for Hardhat, which stores AST separately from ABI * @returns */ export declare function getABIForPrimaryContract(): Promise<any>; /** * choose SIMBA application from application name * @param config * @param id * @returns */ export declare function chooseApplicationFromName(config: SimbaConfig, appName: string): Promise<any>; /** * select a name for a new SIMBA app * @param config * @returns **/ export declare function selectNewApplicationName(config: SimbaConfig): Promise<any>; /** * choose SIMBA app from list * @param config * @param url * @returns */ export declare function chooseApplicationFromList(config: SimbaConfig, url?: string): Promise<any>; /** * fetch available blockchains * @param config * @param url * @returns */ export declare function getBlockchains(config: SimbaConfig, url?: string): Promise<any>; /** * fetch available storages * @param config * @param url * @returns */ export declare function getStorages(config: SimbaConfig, url?: string): Promise<any>; /** * gets field from primary contract (in simba.json) ABI * @param name * @returns */ export declare function getFieldFromPrimaryContractABI(name: string): Promise<any>; /** * get constructor for primary contract * @returns */ export declare function primaryContractConstructor(): Promise<any>; /** * aids in specifying types when asking user to input values * @returns */ export declare function primaryConstructorInputs(): Promise<{ type: any; name: any; }[]>; /** * tells us whether a contract's constructor has params * We use this function so we know whether to prompt the * user to specify the method they want to use to provide param values * @returns */ export declare function primaryConstructorRequiresArgs(): Promise<boolean>; //# sourceMappingURL=api.d.ts.map