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

Quickstart

Integrate private token transfers into your iOS app in a few minutes.

This quickstart gets you running fast with minimal explanation. For a detailed walkthrough see iOS Getting Started; for the full method list see iOS API Reference.

Installation

Add the SDK with Swift Package Manager. In Xcode: File → Add Package Dependencies…, then enter:

https://github.com/Hinkal-Protocol/hinkal-sdk

Select version 0.1.1 and add the Hinkal library to your target. SPM downloads and verifies the prebuilt binary automatically. Full detail in Installation.

import Hinkal

Quick Example

1. Implement the host wallet

class WalletHost: NSObject, MobileHostWalletProtocol {
    let wallet: YourWalletImplementation

    func address(_ error: NSErrorPointer) -> String { wallet.address }
    func chainID() -> Int64 { wallet.chainId }
    func personalSign(_ message: String?, error: NSErrorPointer) -> String {
        wallet.personalSign(message ?? "")
    }
    func sendTransaction(_ toHex: String?, dataHex: String?, valueDec: String?,
                         gasLimit: Int64, error: NSErrorPointer) -> String {
        wallet.sendTransaction(toHex ?? "", dataHex ?? "", valueDec ?? "", gasLimit)
    }
    func switchChain(_ chainID: Int64) throws { try wallet.switchChain(chainID) }
}

2. Connect and use the SDK

Throwing calls take an NSError out-parameter (the framework is generated by gomobile). Wrap them with a small rethrow helper:

SwiftUI Example

Last updated