Getting Started
Getting Started
This guide walks you through integrating the Hinkal iOS SDK into your app.
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
Implement a host wallet so the SDK can sign without holding the key.
Create a client and connect - this derives the shielded identity.
Call operations: deposit, transfer, withdraw, swap.
Basic Setup
Import the SDK
import HinkalCreate 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