Documentation Index
Fetch the complete documentation index at: https://initialabs-develop.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
For most of the following examples in this section, we will be assuming that the guides on each page are implemented as separate functions and files under a single project directory. To set up your project, follow the steps below.
Create Directory
First, we need to create a directory to store our project files.mkdir initia-js-quickstart && cd initia-js-quickstart
Initialize Project
Next, we need to initialize our project.npm init && npm add -D typescript @types/node ts-node && npx tsc --init && mkdir src && echo 'async function example() { console.log("Running example!")}; example()' > src/quickstart.ts
Install InitiaJS
Now we need to install InitiaJS.npm add @initia/initia.js
Test Installation
Once we have installed InitiaJS, we can test our installation. First, we will replace the contents of src/quickstart.ts with the following code.import { LCDClient, Coin } from '@initia/initia.js';
const lcdUrl = 'https://lcd.testnet.initia.xyz';
const lcd: LCDClient = new LCDClient(lcdUrl, {});
(async () => {
const chainId = await lcd.tendermint.chainId();
console.log(chainId);
})();
Next, we will run the script.npx ts-node src/quickstart.ts
If you get initiation-2 as the output, then your installation was successful!