Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.

Kiln Connect SDK

Overview

Welcome to the Python Kiln Connect SDK which provides facilities around Staking using the Kiln API. It is composed of three parts:

  • API layer which facilities usage of the Kiln API,
  • Integration layer which provides facilities around the Kiln API,
  • CLI which showcases the two previous parts.

The SDK is typically used as follows: a KilnConnect instance is created from a KilnConfig, the SDK then provides access to different parts:

  • accounts for Kiln Accounts facilities
  • eth for Ethereum facilities
  • xtz for Tezos facilities

Optionally, the SDK can be configured with multiple integrations (similar to the concept of modules), which can be referred later via their name.

For example, here we create a KilnConnect object from a config initialized from the environment. This config has a Fireblocks integration called fireblocks (configured with a specific vault account and API key), we then stake on Ethereum using the fireblocks integration.

import kiln_connect

config = kiln_connect.KilnConfig.from_env()
kc = kiln_connect.KilnConnect(config)

kc.eth.stake(integration='fireblocks', account_id='...', wallet='...', amount_wei=32000000000000000000)

The following integrations are currently supported:

Configuration

There are two ways to configure the SDK, either manually by creating a KilnConfig object or by using the environment. For simplicity, we recommend using the environment to start with, and then switch to KilnConfig as your usage becomes more specific.

Via Environment

Kiln Connect can be configured from the environment by using the helper KilnConfig.from_env(), as follows:

import kiln_connect

def example():
    with kiln_connect.KilnConnect(kiln_connect.KilnConfig.from_env()) as kc:
       pass

This helper builds a KilnConfig by looking at the following environment variables:

Variable Name Description Example Misc
KILN_ENV Environment to use devnet, testnet, mainnet Required
KILN_API_URL Kiln Endpoint to target https://api.testnet.kiln.fi Required
KILN_API_TOKEN Kiln API token kiln_... Required
FIREBLOCKS_API_KEY API key for Fireblocks Integration 123e4567-e89b-12d3-a456-426614174000 Optional
FIREBLOCKS_RAW_KEY_PATH Path to PEM key for Fireblocks Integration ~/.fireblocks.pem Optional
FIREBLOCKS_VAULT_ACCOUNT_ID Vault Account ID for Fireblocks Integration 7 Optional

Via KilnConfig

The KilnConfig required to initialize the API is defined as follows:

class KilnConfig:
    """Configuration of the Kiln Connect SDK.
    """
    kiln_base_url: str                     # https://api.testnet.kiln.fi/
    kiln_api_token: str                    # kiln_...
    integrations: list[IntegrationConfig]  # optional list of integration configs

class IntegrationConfig:
    """Configuration of a Kiln integration.
    """
    name: str                              # user-defined name of the integration (i.e: "")
    provider: str                          # type of the integration (i.e: "fireblocks")
    parameters: dict                       # python dict

For example:

import kiln_connect

config = kiln_connect.KilnConfig(
    kiln_base_url='https://api.testnet.kiln.fi',
    kiln_api_token='kiln_...',

    integrations=[
       # Fireblocks Integration to stake on ETH_TEST3 (goerli)
       # from vault account 7 using raw key present in file
       # ~/.fireblocks.pem.
       kiln_connect.IntegrationConfig(
         name='fireblocks-testnet',
         provider='fireblocks',
         parameters={
           'api_token': '...',
           'raw_key_path': '~/.fireblocks.pem',
           'vault_account_id': 7,
           'assets': {
              'eth': 'ETH_TEST3',
           }
         }
       )
    ]
)

Fireblocks

Here is the expected configuration for the optional Fireblocks integration:

{
   'api_token': '<Fireblocks API token>',
   'raw_key_path': '<Fireblocks raw key path>',
   'vault_account_id': <Fireblocks Vault Account ID>,
   'assets': {
      'eth': 'ETH_TEST3',
   },
}

Where assets is a dictionnary used to know which asset to use whenever staking on a given protocol. The following protocols are supported:

  • eth (available via KilnConnect.eth.stake)

Usage

The simplest way to start using the SDK is to look at examples implemented in the CLI; it is kept simple to showcase the SDK.

API facilities:

Integrations facilities:

Metadata

Release files for kiln-connect 1.0.0.dev8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kiln-connect 1.0.0.dev8
File Size Uploaded Provenance
kiln_connect-1.0.0.dev8.tar.gz 207.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for kiln-connect 1.0.0.dev8
File Interpreter ABI Platform
kiln_connect-1.0.0.dev8-py3-none-any.whl Python 3 none any Details

Total release size: 1.5 MB

Release files / kiln_connect-1.0.0.dev8.tar.gz

Download URL kiln_connect-1.0.0.dev8.tar.gz
Size 207.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cf2cc920a2c433b84fa863ba78bf744c759303fbd59ed8dded8be9f9a8432863
BLAKE2b-256 checksum
How to use checksums
7620cec533d0dcc1e6535d2f7ccdf11d8f7a8c8e39b757c56575c87d00d61d8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.3 Linux/6.1.34-1-lts

Release files / kiln_connect-1.0.0.dev8-py3-none-any.whl

Download URL kiln_connect-1.0.0.dev8-py3-none-any.whl
Size 1.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
ed7a12b17dddbc3c6fc2852f2d821467559558cd42c0483a7ca6ceab554c8309
BLAKE2b-256 checksum
How to use checksums
3133cdd259a63b2356f36359eef3231f4c38e7ea69cae425e8d2e4dc6fa053ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.3 Linux/6.1.34-1-lts

Security for kiln-connect 1.0.0.dev8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page