Getting started with extension API

Ethcode API is exported as a vscode extension API.

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

Read more about extension API here - https://code.visualstudio.com/api/references/vscode-api#extensions.

Read more about vscode extension development here - https://code.visualstudio.com/api/get-started/your-first-extension

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

Last updated