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

API Reference

Complete API reference for the Hinkal Android SDK.

The SDK exposes free functions as static methods on Mobile, and a stateful surface through two classes: Client (connection and session) and Hinkal (operations), in the io.hinkal.mobile package. Data crosses the boundary as JSON strings and primitives; native methods declare throws Exception.

Client

The entry point. Create it, connect a wallet, then obtain the operations handle.

newClient

fun newClient(): Client

Creates a client with default configuration. Use newClientWithConfig(configJSON) to pass a JSON config.

connect

fun connect(host: HostWallet): String

Runs the session handshake: the wallet signs a message that unlocks the shielded account. Returns the connected wallet address.

connectSolana / connectTron

fun connectSolana(host: HostSolanaSigner, chainID: Long): String
fun connectTron(host: HostTronSigner, chainID: Long): String

Connect a Solana or Tron wallet.

connectWithPrivateKey

fun connectWithPrivateKey(privateKeyHex: String, chainID64: Long): String

Headless EVM connect for tests and backends. Also connectWithSolanaPrivateKey(...), connectWithTronPrivateKey(...).

hinkal

Returns the operations handle for deposits, transfers, and the rest.

disconnect

Clears the session.

getFeeStructureJSON

Builds a fee structure for an operation. Pass the result as feeStructureJSON to a spend.

calculateTotalFee / calculateWithdrawalAmount

Fee math helpers.

getGasTokenSymbols

Returns the gas token symbols for a chain.

Hinkal

Obtained from client.hinkal(). All amounts are base units (wei); token and amount lists are JSON-array strings.

Deposits

deposit

Public to private. Signed and broadcast through your host wallet. Returns the transaction hash (or tx data when returnTxData is true).

depositForOther

Deposit into another user's shielded balance. recipientInfo is their recipient-info string (from getRecipientInfo).

depositSolana / depositSolanaForOther

Solana deposit variants (single token).

prooflessDeposit

Deposit that defers proof generation (scheduled deposit-and-withdraw flows). See also prooflessDepositWithPublicFee(...).

Withdrawals & Transfers

withdraw

Private to public, via a Hinkal relayer. Returns the transaction hash.

transfer

Private to private (to another Hinkal user's shielded balance). recipient is a Hinkal private address.

withdrawStuckUtxos

Recovers UTXOs left stuck by an interrupted deposit-and-withdraw.

Swaps

swap / swapSolana

Swap one token for another inside the shielded balance. Quote first with getEvmSwapPrices(...) / getSolanaSwapPrices(...).

getEvmSwapPrices / getSolanaSwapPrices

Returns a swap quote (JSON) including the swapData you pass into swap.

Cross-chain

bridgePrivateToPrivate

Moves shielded value from one chain to another (private to private).

depositAndWithdraw / depositAndBridge / nearDepositAndBridge

Public-to-public and cross-chain routes. scheduleTimeSec schedules the second leg; poll checkSendTransactionStatus(...).

Claimables & status

claimUtxo / fetchClaimableUtxos

List and claim claimable UTXOs (gift-style transfers).

checkSendTransactionStatus

Polls the status of a scheduled send.

emporiumOp

Executes an arbitrary contract call through the private account (advanced).

waitForTransaction

Waits for a transaction to reach the given confirmations, up to timeoutSec.

Balances & identity

getTotalBalance

Shielded balance per token (JSON). Pass resetCache = true to re-scan after a fund-moving operation.

getStuckShieldedBalances

Funds stuck in unspendable UTXOs. Recover with withdrawStuckUtxos.

getRecipientInfo / getShieldedPublicKey / getSolanaPublicKey

Identity accessors. getRecipientInfo returns the Hinkal private address to share for incoming private transfers.

getSupportedChains

Supported chains for the connected identity (JSON).

initUserKeysWithSignature / initUserKeysFromSeedPhrases

Derive the shielded identity from a signature or from seed phrases.

HostWallet

The interface your app implements so the SDK can sign without holding the key.

For Solana and Tron, implement HostSolanaSigner (publicKey, signMessage(ByteArray), signTransaction(ByteArray)) or HostTronSigner (address, signMessage(String), signTxHash(ByteArray)).

Module Functions

Static methods on Mobile.

Amounts

Human to wei and back; amountWithPrecision formats to a fixed number of decimals.

Tokens

Token catalog, resolution, and aggregated swap quotes. DEX-specific helpers: getOneInchQuoteJSON, getOdosQuoteJSON, getOKXQuoteJSON, getUniswapQuoteJSON, getExternalSwapAddress.

Chains

Chain predicates (return Boolean):

Bridge quotes

Quotes and destination lists for cross-chain bridging.

Addresses & keys

Validate private addresses and derive keys / stealth-address structures from a signature.

Last updated