ConnectedAPIHandler

class ConnectedAPIHandler(networkConfig: NetworkConfig, val walletAddresses: WalletAddresses, balanceProvider: BalanceProvider? = null, signDataFn: suspend (String, SignDataOptions) -> SignatureResult? = null, submitTransactionFn: suspend (String) -> Unit? = null, makeTransferFn: suspend (List<DesiredOutput>, Boolean) -> String? = null, balanceUnsealedFn: suspend (String, Boolean) -> String? = null, balanceSealedFn: suspend (String, Boolean) -> String? = null, makeIntentFn: suspend (List<DesiredInput>, List<DesiredOutput>, IntentOptions) -> String? = null, getTxHistoryFn: suspend (Int, Int) -> List<HistoryEntry>? = null)

Implements all 16 ConnectedAPI methods (15 WalletConnectedAPI + hintUsage).

Pure business logic — delegates to existing Kuira services. No networking, no Android UI. Transport layers wrap this class.

Source of truth: @midnight-ntwrk/dapp-connector-api/src/api.ts

Constructors

Link copied to clipboard
constructor(networkConfig: NetworkConfig, walletAddresses: WalletAddresses, balanceProvider: BalanceProvider? = null, signDataFn: suspend (String, SignDataOptions) -> SignatureResult? = null, submitTransactionFn: suspend (String) -> Unit? = null, makeTransferFn: suspend (List<DesiredOutput>, Boolean) -> String? = null, balanceUnsealedFn: suspend (String, Boolean) -> String? = null, balanceSealedFn: suspend (String, Boolean) -> String? = null, makeIntentFn: suspend (List<DesiredInput>, List<DesiredOutput>, IntentOptions) -> String? = null, getTxHistoryFn: suspend (Int, Int) -> List<HistoryEntry>? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard
suspend fun balanceSealedTransaction(tx: String, payFees: Boolean = true): String
Link copied to clipboard
suspend fun balanceUnsealedTransaction(tx: String, payFees: Boolean = true): String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
suspend fun getTxHistory(pageNumber: Int, pageSize: Int): List<HistoryEntry>
Link copied to clipboard
Link copied to clipboard
fun hintUsage(methodNames: List<String>)
Link copied to clipboard
suspend fun makeIntent(desiredInputs: List<DesiredInput>, desiredOutputs: List<DesiredOutput>, options: IntentOptions): String
Link copied to clipboard
suspend fun makeTransfer(desiredOutputs: List<DesiredOutput>, payFees: Boolean = true): String
Link copied to clipboard
suspend fun signData(data: String, options: SignDataOptions): SignatureResult
Link copied to clipboard
suspend fun submitTransaction(tx: String)