Quick start guide to get up and running with abikit and generate multi-language SDKs from your smart contracts

Getting Started

Welcome to abikit! This guide will help you get up and running with abikit to generate multi-language SDKs from your smart contracts.

What is abikit?

abikit is a powerful tool that automatically generates type-safe SDKs in multiple languages (TypeScript, Python) from your smart contract artifacts. It supports both Foundry and Hardhat projects and creates fully-typed, production-ready SDKs.

Quick Start

1. Install abikit

The easiest way to install abikit is using our installer script:

curl -L https://abikit.ahloop.com/install | bash

Then restart your terminal or source your shell profile:

# For bash
source ~/.bashrc

# For zsh  
source ~/.zshenv

2. Initialize Your Project

Navigate to your Foundry or Hardhat project and run:

# Build your contracts first
forge build

# Initialize abikit configuration
abikit init

This creates a contracts.yaml file with all your discovered contracts.

3. Configure Generation

Edit the generated contracts.yaml file to add your target languages:

generation:
  targets:
    - language: ts
      outDir: ./sdk/typescript
      options:
        transport: viem
        packageName: my-contracts
    
    - language: python
      outDir: ./sdk/python
      options:
        packageName: my_contracts

4. Generate SDKs

Run the build command to generate your SDKs:

abikit build

This creates fully-typed SDKs in your specified output directories.

Example Workflow

Here's a complete example of using abikit with a Foundry project:

# 1. Create a new Foundry project
forge init my-contracts
cd my-contracts

# 2. Build contracts
forge build

# 3. Install abikit
curl -L https://abikit.ahloop.com/install | bash
source ~/.bashrc

# 4. Initialize configuration
abikit init

# 5. Edit contracts.yaml to add targets
vim contracts.yaml

# 6. Generate SDKs
abikit build

# 7. Use your generated SDKs
cd sdk/typescript
npm install

What's Generated

abikit generates:

  • TypeScript SDKs with viem or ethers.js support and complete contract implementations
  • Python SDKs with web3.py integration and Pydantic type safety
  • Type definitions for all contract functions and events
  • Event watchers with full log retrieval and parsing capabilities
  • Custom error decoders for better error handling and debugging
  • Function selectors and static mappings for contract interactions
  • Configuration management with network support and runtime configuration
  • Factory helpers for contract deployment
  • CREATE2 helpers for deterministic addresses

Generator Architecture (v0.2.3+)

abikit now uses modular generators for improved maintainability and extensibility:

  • Artifact Caching: Copy artifacts to local artifacts/ folder for faster builds and offline development
  • TypeScript Generator: Splits generation into 10+ focused modules handling config, contracts, interfaces, types, signatures, errors, events, and utilities
  • Python Generator: Applies the same modular structure with Python-specific implementations
  • Factory Pattern: Easy to extend with new language targets or custom generators
  • Better Error Handling: Improved error recovery and validation throughout the generation pipeline

Next Steps

Need Help?