npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kilnfi/sdk

v4.2.29

Published

JavaScript sdk for Kiln API

Readme

Description

Kiln SDK is a wrapper around the Kiln Connect API, which allows you to craft staking transactions as well getting real time and historical data about your stakes.

On top of that, the SDK provides a way to sign your transactions with Fireblocks using their Contract call and Raw Signing features.

Installation

You can install the JS SDK with your favorite package manager:

bun install @kilnfi/sdk

Setup

In order to use this sdk, you will need a kiln api token. Please contact [email protected] to get one.

Example: Stake 1 NEAR using Fireblocks raw signing

import { Kiln, KILN_VALIDATORS } from '@kilnfi/sdk';
import type { FireblocksIntegration } from '@kilnfi/sdk/fireblocks.ts';
import { loadEnv } from './env.ts';
import { parseUnits } from "viem";

const k = new Kiln({
  baseUrl: 'https://api.kiln.fi/v1',
  apiToken: process.env.KILN_API_TOKEN,
});

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

const vault: FireblocksIntegration = {
  config: {
    apiKey: process.env.FIREBLOCKS_API_KEY,
    secretKey: apiSecret,
    basePath: 'https://api.fireblocks.io/v1',
  },
  vaultId: process.env.FIREBLOCKS_VAULT_ID,
};

//
// Craft the transaction
//
console.log('Crafting transaction...');
const txRequest = await k.client.POST('/near/transaction/stake', {
  body: {
    account_id: kilnAccountId,
    wallet: 'c36b1a5da2e60d1fd5d3a6b46f7399eb26571457f3272f3c978bc9527ad2335f',
    pool_id: KILN_VALIDATORS.NEAR.mainnet.KILN,
    amount_yocto: parseUnits('1', 24).toString(),
  },
});
if (txRequest.error) {
  console.log('Failed to craft transaction:', txRequest);
  process.exit(1);
} else {
  console.log('Crafted transaction:', txRequest.data);
}
console.log('\n\n\n');

//
// Sign the transaction
//
console.log('Signing transaction...');
const signRequest = await (async () => {
  try {
    // @ts-ignore
    return await k.fireblocks.signNearTx(vault, txRequest.data.data, "NEAR_TEST");
  } catch (err) {
    console.log('Failed to sign transaction:', err);
    process.exit(1);
  }
})();
console.log('Signed transaction:', signRequest);
console.log('\n\n\n');

//
// Broadcast the transaction
//
console.log('Broadcasting transaction...');
const broadcastedRequest = await k.client.POST('/near/transaction/broadcast', {
  body: {
    signed_tx_serialized: signRequest.signed_tx.data.signed_tx_serialized,
  },
});
if (broadcastedRequest.error) {
  console.log('Failed to broadcast transaction:', broadcastedRequest);
  process.exit(1);
} else {
  console.log('Broadcasted transaction:', broadcastedRequest.data);
}

Find complete examples in the examples directory.

License

This package is open-sourced software licensed under the BUSL-1.1 license.