Skip to content

Klesia TypeScript SDK

Klesia has a TypeScript SDK to interact with the JSON-RPC API. The SDK provides type-safe interfaces and properties auto-completion.

Installation

$ npm install @mina-js/klesia-sdk

Nightly builds

$ npm install https://pkg.pr.new/palladians/mina-js/@mina-js/klesia-sdk@main

Client Options

  • network: The network to connect to. One of: mainnet, devnet, zeko-devnet.
  • customUrl: A custom URL to connect to in case of self-hosted RPCs.
  • throwable: If true, the client will throw an error if the response contains an error. Default is true.

Usage

import { createClient } from '@mina-js/klesia-sdk'
 
const client = createClient({ network: 'devnet' })
 
const { result } = await client.request<'mina_getTransactionCount'>({
  method: 'mina_getTransactionCount',
  params: ['B62qkYa1o6Mj6uTTjDQCob7FYZspuhkm4RRQhgJg9j4koEBWiSrTQrS']
})

Methods

Refer to the RPC Methods page for a complete list of methods available on Klesia.