API ReferenceUser docs

Get started

There are a few setup steps needed to start using the Kiln Connect SDK.

1. Install the SDK

The Kiln Connect SDK is only available in TS/JS for now, if you have other programming language requirements, please contact the support.

npm install @kilnfi/sdk
yarn add @kilnfi/sdk

2. Retrieve your Kiln API key

🔑

Access your API Key

Use Kiln Dashboard to create, edit, delete, and roll API keys.

  • To access your API keys, in the application section of the dashboard, to see the step by step process please follow this user guide.

3. Set up Fireblocks (required to sign transactions)

In the case that you would like to craft and sign transactions with your Fireblocks vault, you will need to setup the following in Fireblocks:

The raw signing feature is required on all protocols except on EVM compatible protocols (ETH, MATIC). Make sure that it is enabled in your workspace in case you wish to stake on other protocols. You can ask the Fireblocks support for information.

Create an API user using the Fireblocks tutorial here with the Editor role (minimum privilege to initiate transactions on the workspace). This might require that you contact your Fireblocks support.

Generate the CSR certificate and make sure you store it somewhere safe.

Get the API key of the user by clicking on "Copy API key" of the user in the workspace members list

Get the vault account id you want to stake with by clicking on it in your Fireblocks workspace and check the URL. For example the vault id of https://console.fireblocks.io/v2/accounts/vault/4 is '4'.

👍

Your are in control

With the Kiln Connect SDK, you remain entirely in control of what is sent for signing to your Fireblocks workspace. You can verify the content of the transactions crafted with this SDK before signing it. Note that the entire signing workflow is done on the SDK end, not on Kiln APIs. Kiln will never have access to your Fireblocks API key or secret key.


4. Configure the SDK

You can now configure the SDK with you Kiln API token.​

import { Kiln } from '@kilnfi/sdk';
const fs = require('fs');

// Fireblocks secret key
const apiSecret = fs.readFileSync(__dirname + '/fireblocks_secret.key', 'utf8');

const k = new Kiln({
  testnet: true, // true when using on testnet networks and Kiln's testnet API
  apiToken: 'kiln_xxx', // Kiln API token
});

5. Find Kiln's validators

When staking on different protocols, you will need to find Kiln's validator addresses if you choose to stake with Kiln.

Addresses on all protocols can be found in the validators docs.

Alternatively, you can also find them in the SDK directly. Here is an example of a stake transaction on our NEAR validator:

import { Kiln, KILN_VALIDATORS } from "@kilnfi/sdk";

const tx = await k.near.craftStakeTx(
      'account_id',
      'wallet_address',
      KILN_VALIDATORS.NEAR.mainnet.KILN,
      1,
);

See more in the Integrate Connect API - Integration Guides.