# Docs ## Docs - [Accounts](/docs/accounts): Accounts represent the key material used to sign transactions. The SDK supports two account types: **local accounts** (private key available in-process) and **JSON-RPC accounts** (signing delegated to a browser extension wallet). - [Composing and Signing a ](/docs/e2e-example) - [Error Handling](/docs/errors): All errors thrown by the SDK extend `BaseError`, which provides a structured error chain and a `walk()` method for traversing nested causes. - [Getting Started](/docs/getting-started): Start interacting with Kontor in just a few lines of code - [decodeWitParameter](/docs/wit/decode-wit-parameter): `decodeWitParameter` is a low level helper for decoding wave expressions into strings. Rather, than rely on a WIT specification ( e.g. `nativeContract` ) for serialization, it accepts a type parameter explicitly. - [getWitItem](/docs/wit/get-wit-item): `getWitItem` is useful for accessing a specific definitin in a contract `WIT`. - [parseRawWit](/docs/wit/parse-raw-wit): `parseRawWit` extracts WIT signature strings from a raw multi-line WIT document — the format returned by [`getContract`](/docs/actions/kontor-indexer/get-contract). The result is an array of signature strings that can be passed directly to [`parseWit`](/docs/wit/parse-wit). - [parseWit](/docs/wit/parse-wit): `parseWit` is a crucial helper for parsing a WIT into a data structure that the SDK can understand. - [WIT & Wave Syntax](/docs/wit/syntax): WIT (WebAssembly Interface Types) defines the type system for Kontor contract interfaces. Wave is the text encoding used to serialize values in function calls. - [Chain](/docs/types/chain): A `Chain` defines the network configuration for a Bitcoin-based Kontor deployment. The SDK ships with `signet` as the built-in chain. - [Decimal](/docs/types/decimal): The `kontor-sdk` encodes decimal values as a tuple of `[ bigint, number ]`, where `bigint` encodes the significant digits, and `number` encodes the scale (i.e. number of digits to the right of the decimal point). - [Option](/docs/types/option): TS representations of the `WIT` `option` type have the following signature: - [Result](/docs/types/result): TS representations of the `WIT` `result` type have the following signature: - [Decode Function Result](/docs/contract/decode-function-result): `decodeFunctionResult` parses the raw wave expression of function calls into more user friendly types. - [Encode Function Data](/docs/contract/encode-function-data): `encodeFunctionData` is useful for serializing contract call data into a raw wave expression. - [Contract Instance](/docs/contract/instance): Instead of calling `viewContract` and `procContract` directly, you can create a contract instance which takes the WIT and `contractAddress`, resulting in a more terse syntax at the contract callsite. - [Introduction to Clients](/docs/clients/introduction): The `kontor-sdk` exposes two clients for interfacing with Kontor: - [Kontor Indexer Client](/docs/clients/kontor-indexer): The indexer client is an interface to a Kontor Indexer. It allows users to interface with smart contract data and compose transactions via [Kontor Indexer Actions](/docs/actions/kontor-indexer/introduction). - [With ](/docs/clients/kontor-indexer): The indexer client can also be configured with a `webSocket` transport to enable web socket dependent actions. - [Kontor Wallet Client](/docs/clients/kontor-wallet): The wallet client is an interface to the necessary cryptographic operations that mediate transacting on the Kontor network via [Kontor Wallet Actions](/docs/actions/kontor-wallet/introduction) such as [signCommit](/docs/actions/kontor-wallet/sign-commit) and [signReveal](/docs/actions/kontor-wallet/sign-reveal). - [Introduction to Kontor Wallet Actions](/docs/actions/kontor-wallet/introduction): Kontor Wallet Actions require access to the user's private key. These actions are exposed via the [Kontor Wallet Client](/docs/clients/kontor-wallet). - [buildComposeQuery](/docs/actions/kontor-indexer/build-compose-query): `buildComposeQuery` is a utility action that constructs a compose query object from an instruction, UTXOs, and fee rate. This is a lower-level building block that creates the query structure needed for composition. - [buildInstructionQuery](/docs/actions/kontor-indexer/build-instruction-query): `buildInstructionQuery` is a low-level helper for constructing contract calls from raw wave expressions. - [composeTransaction](/docs/actions/kontor-indexer/compose-transaction): `composeTransaction` is a low-level action that passes a raw wave expression to the Kontor composer (together with other required arguments). It has no knowledge of a contract `WIT` specification. Accordingly, the response is not parsed. - [getIndexerStatus](/docs/actions/kontor-indexer/get-indexer-status): `getIndexerStatus` retrieves the current status and health information of the Kontor indexer. - [getLatestBlock](/docs/actions/kontor-indexer/get-latest-block): `getLatestBlock` retrieves information about the most recent block in the blockchain. - [getResult](/docs/actions/kontor-indexer/get-result): `getResult` retrieves the execution result of a Kontor transaction by its result ID. - [getTransaction](/docs/actions/kontor-indexer/get-transaction): `getTransaction` retrieves detailed information about a specific transaction by its transaction ID. - [inspectTransaction](/docs/actions/kontor-indexer/inspect-transaction): `inspectTransaction` returns a list of Kontor operations for a given transaction ID. - [Introduction to Kontor Indexer Actions](/docs/actions/kontor-indexer/introduction): A Kontor Indexer Action is an action that maps to a indexer http endpoint exposed by a Kontor Indexer. They do not depend on any cryptographic operations that would require the user's private key. - [listBlockTransactions](/docs/actions/kontor-indexer/list-block-transactions): `listBlockTransactions` retrieves all transactions contained in a specific block. - [listBlocks](/docs/actions/kontor-indexer/list-blocks): `listBlocks` retrieves a paginated list of blocks from the blockchain. - [listContracts](/docs/actions/kontor-indexer/list-contracts): `listContracts` retrieves a list of deployed Kontor contracts. - [listResults](/docs/actions/kontor-indexer/list-results): `listResults` retrieves a paginated list of Kontor transaction execution results. - [listTransactions](/docs/actions/kontor-indexer/list-transactions): `listTransactions` retrieves a paginated list of transactions from the blockchain. - [procContract](/docs/actions/kontor-indexer/proc-contract): The `procContract` enables a user to construct Kontor transactions in a type-safe manner. - [simulateContract](/docs/actions/kontor-indexer/simulate-contract): `simulateContract` simulates a type-safe contract function call without executing it on-chain. Unlike `simulateTransaction` which works with raw transaction hex, `simulateContract` uses WIT specifications to provide type-safe function calls and returns. - [simulateTransaction](/docs/actions/kontor-indexer/simulate-transaction): `simulateTransaction` simulates the execution of a raw Kontor transaction without broadcasting it to the network. - [viewContractRaw](/docs/actions/kontor-indexer/view-contract-raw): `viewContractRaw` is a low-level action that passes a raw wave expression to the contract view endpoint. It has no knowledge of a contract `WIT` specification. Accordingly, the response is not parsed. - [viewContract](/docs/actions/kontor-indexer/view-contract): The `viewContract` action makes it possible to query contract state in a fully type-safe manner. - [watchEvents](/docs/actions/kontor-indexer/watch-events): `watchEvents` subscribes to real-time Kontor indexer events via WebSocket connection. This enables applications to receive live updates about blockchain activity. It requires configuring the indexer client with `webSocket` transport.