Ethcode docs
  • Introduction
  • Installation
    • How to install?
  • Configurations
    • Extension Settings
    • Set transaction gas strategy
  • How to Use?
    • Account
    • Initialize Ethcode
    • Compiling contracts
    • Add ABI into Ethcode
    • Deploy contract to network
    • Calling contracts
    • Create rental NFT
  • API Documentation
    • Getting started with extension API
    • wallet
    • contract
    • provider
    • events
    • status
  • Help and support
    • Support
Powered by GitBook
On this page
  • contract.list() => string[]
  • contract.abi() => Promise<ContractABI[] | JsonFragment[] | undefined>
  • contract.getContractAddress() => Promise<string | undefined>
  • contract.getFunctionInput() => Promise<object | undefined>
  • contract.getConstructorInput() => Promise<object | undefined>
  1. API Documentation

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.
*/
```
PreviouswalletNextprovider

Last updated 2 years ago