For the complete documentation index, see llms.txt. This page is also available as Markdown.

Getting Started

Getting Started

This guide walks you through integrating the Hinkal iOS SDK into your app.

New to the SDK? Start with the Installation guide, then follow the steps below.

Prerequisites

  • The SDK added to your project (Installation)

  • A wallet your app can sign with (EVM, Solana, or Tron)

  • A chain id and token address to work with

Overview

  1. Implement a host wallet so the SDK can sign without holding the key.

  2. Create a client and connect - this derives the shielded identity.

  3. Call operations: deposit, transfer, withdraw, swap.

Basic Setup

Import the SDK

import Hinkal

Create a client

Handle errors

The framework is generated by gomobile, so throwing calls take an NSError out-parameter rather than Swift throws. A small rethrow helper turns that into idiomatic try (this is the pattern the demo app uses):

Every SDK call below is wrapped with call { ... error: &$0 }.

Connecting a Wallet

Implement MobileHostWalletProtocol so the SDK can read the address and request signatures. The key stays in your wallet. Its methods use an error: NSErrorPointer out-parameter (set it on failure).

Connect - the wallet signs a session message and the SDK derives the shielded identity:

For a headless connect use client.connect(withPrivateKey: key, chainID64: chainId, error: &$0).

Core Operations

Check Balance

Deposit Tokens

Private Transfer

Withdraw Tokens

Swap Tokens

Last updated