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
  • Add extensionDependencies to the package.json file of your extension.
  • Use getExtension and Ethcode API exports inside your extension.ts
  • Now you can use the api variable to call ethcode API functions.
  1. API Documentation

Getting started with extension API

Ethcode API is exported as a vscode extension API.

PreviousCreate rental NFTNextwallet

Last updated 2 years ago

Vscode extension developers can use Ethcode API following vscode extension API spec to interact with.

Read more about extension API here - .

Read more about vscode extension development here -

Add extensionDependencies to the package.json file of your extension.

...
"extensionDependencies": [
    "7finney.ethcode"
 ],
...

Use getExtension and Ethcode API exports inside your extension.ts

let ethcodeExtension: any = vscode.extensions.getExtension('7finney.ethcode');
let api = ethcodeExtension.exports;

Now you can use the api variable to call ethcode API functions.

To Check if API is working or not you can hit status API end point.

const status = api.status();               // return OK if ethcode is present
https://code.visualstudio.com/api/references/vscode-api#extensions
https://code.visualstudio.com/api/get-started/your-first-extension