Avail node API reference
BEFORE WE START
- The Avail node supports an extensive list of extrinsics and various other types of calls that you can try out in our explorer (opens in a new tab).
- This API reference currently documents only the most widely used extrinsics, but will be iterated upon to eventually be an exhaustive resource for the Avail node API.
Setting up the dev environment
-
Make sure
Node-js
is installed on your system. You can refer to Node-js docs (opens in a new tab) for the same. -
Create a new Node-js project by running
npm init -y
in a directory of your choice, and create a new file namedyour-file-name.ts
-
To install the
avail-js-sdk
run the following command in the terminal:
npm install avail-js-sdk@0.3.0
- Make sure to install the
ts-node
package if you haven't already:
npm i -g ts-node
- Create a
tsconfig.json
file in the root of your project and populate it:
{
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"outDir": "build",
"declaration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"noUnusedParameters": true
},
"exclude": ["node_modules", "build"]
}