Ethcode docs
Search
⌃K

contract

extension developers can use contract API to interact with project contract files, compiled ABIs, parameters set for inputs and deployment addresses.

contract.list() => string[]

```
/**
* Returns a list of the compiled contracts loaded in ethcode.
*
* @returns {string[]} - array of contract names.
*/
```

contract.abi() => Promise<ContractABI[] | JsonFragment[] | undefined>

```
/**
* Returns the ABI for the specified contract in ethcode.
*
* @param {string} name - Name of the contract for which to retrieve the ABI.
* @returns {Promise<readonly ContractABI[] | readonly JsonFragment[] | undefined>} - ABI of the specified contract, `undefined` if the ABI cannot be retrieved.
*/
```

contract.getContractAddress() => Promise<string | undefined>

```
/**
* Returns the address of the specified contract in ethcode.
*
* @param {string} name - Name of the contract for which to retrieve the address.
* @returns {Promise<string | undefined>} - The address of the specified deployed contract, or undefined if the address cannot be retrieved.
*/
```

contract.getFunctionInput() => Promise<object | undefined>

```
/**
* Returns the function input JSON for the specified contract in ethcode.
*
* @param {string} name - Name of the contract for which to retrieve the function input.
* @returns {Promise<object | undefined>} - The function input JSON for the specified contract, or undefined if the input cannot be retrieved.
*/
```

contract.getConstructorInput() => Promise<object | undefined>

```
/**
* Returns the constructor input file for the specified contract in ethcode .
*
* @param {string} name - Name of the contract for which to retrieve the constructor input.
* @returns {Promise<object | undefined>} - The constructor input object for the specified contract, or undefined if the input cannot be retrieved.
*/
```