Hinkal Mobile SDK

IOS SDK

Native Swift SDK for privacy-preserving transactions on iOS.

The Hinkal iOS SDK is the Hinkal Go core compiled to a native Hinkal.xcframework with gomobile. It exposes Swift APIs for private deposits, withdrawals, transfers, swaps, and bridging. Signing stays in your app - you implement a host wallet, and the private key never leaves the device wallet.

Features

  • Native Swift framework - no JavaScript bridge, no WebView
  • Deposit, withdraw, transfer, swap, and bridge from the private balance
  • Wallet-agnostic - implement MobileHostWalletProtocol once for any EVM signer (or MobileHostSolanaSignerProtocol / MobileHostTronSignerProtocol)
  • JSON-string boundary, so one call can batch multiple tokens, amounts, and recipients
  • Identical core to the Android SDK - same proofs, same network protocol

Installation

Add the SDK with Swift Package Manager - point Xcode at https://github.com/Hinkal-Protocol/hinkal-sdk. SPM downloads and checksum-verifies the prebuilt Hinkal.xcframework binary automatically. See the installation guide for full details.

import Hinkal

Quick Example

import Hinkal

guard let client = MobileNewClient(), let hinkal = client.hinkal() else { return }
let address = try call { client.connect(WalletHost(wallet: yourWallet), error: &$0) }

let wei = try call { MobileAmountToWei(chainId, tokenAddress, "1.0", &$0) }
let result = try call {
    hinkal.deposit(chainId, tokenAddrsJSON: "[\"\(tokenAddress)\"]",
                   amountsWeiJSON: "[\"\(wei)\"]", preEstimateGas: true, returnTxData: false, error: &$0)
}
print("Deposit tx:", result)

Throwing calls take an NSError out-parameter; the call helper (see Getting Started) rethrows it as a Swift try.

Core Operations

MethodPurpose
depositPublic to private
withdrawPrivate to public
transferPrivate to private
swapPrivate swap
bridgePrivateToPrivatePrivate to private across chains
getTotalBalanceShielded balance
getRecipientInfoPrivate address for the identity

Documentation

Getting Started

Guides

Advanced

Reference

Requirements

  • iOS 16.0+
  • Swift 5.7+
  • Xcode 15+ (Swift Package Manager is bundled)

Related

  • Android SDK - the same SDK for Android
  • Quickstart - fast integration