# IT Kamianets Chain Framework: packages

Every package of the IT Kamianets Chain Framework (also called Chain ITKP): what it does, what it builds on in Cosmos SDK, what it depends on, and how to install it. Use this file to choose packages for a new chain.

- Website: https://chain.itkamianets.com
- Source: https://github.com/IT-Kamianets
- This file: https://chain.itkamianets.com/packages.md (generated from the website catalog on every build)

8 packages: 1 core, 4 modules, 2 tooling, 1 clients. 3 constructors, 2 chains.

**Status: the framework is being designed.** Nothing is published yet: no repositories, Go modules or npm packages. Names, commands and APIs may still change.

## What Chain ITKP is

Chain ITKP is built around Cosmos SDK (application framework), CometBFT (consensus), Ignite CLI (scaffolding), Go (modules), Protobuf (module interfaces) and TypeScript (clients). It does not replace any of them: a chain built with it is an ordinary Cosmos SDK application. The framework adds shared conventions, reusable modules, a chain spec, testing helpers, a client SDK and constructors.

## How the framework is built

```text
dependencies       Cosmos SDK, CometBFT, Ignite CLI, CosmJS
core               blockchain-core          conventions
modules            blockchain-<module>      token, later rewards, identity, ibc
tooling            blockchain-chain, blockchain-testing
clients            blockchain-client        TypeScript
constructors       blockchain-constructor-* starter repositories
chains             <chain>-*                owned by each chain; outside this catalog
```

Each layer uses only the layers above it. A chain's own decisions, such as its coin name or supply, never go into framework packages.

## Using packages

**Start a chain from a starter repository.** Clone the Sovereign chain constructor under your chain's name; its AGENTS.md walks you or your AI agent through the first decisions. Full flow: https://chain.itkamianets.com/docs/create-a-chain

**Add a package.** Chain packages: `go get <module path>@latest`. The client: `npm install @itkamianets/blockchain-client`.

**Name your own repositories** `<chain>-<part>`, such as `uag-chain`. A module that a second chain needs moves to the framework as `blockchain-<name>`.

## Packages at a glance

### Core

Shared conventions every other package builds on.

| Package | What it does | Release | Depends on |
|---|---|---|---|
| [`blockchain-core`](#blockchain-core) | Shared conventions for every chain and module: address prefixes, native coin metadata, upgrade registration and the supported Cosmos SDK versions. | first release | - |

### Modules

Cosmos SDK modules compiled into a chain binary.

| Package | What it does | Release | Depends on |
|---|---|---|---|
| [`blockchain-token`](#blockchain-token) | A Cosmos SDK module for additional tokens on an existing chain: create a denom, mint, burn, set metadata, cap the supply and hand over or renounce control. | first release | `blockchain-core` |
| [`blockchain-rewards`](#blockchain-rewards) | Reusable reward programs: pools funded with any coin or token and paid out to recipients by rules, on a schedule. | after the first release | `blockchain-core` |
| [`blockchain-identity`](#blockchain-identity) | Identity and permissions: named roles for accounts that other modules check, such as who may create tokens on a chain. | after the first release | `blockchain-core` |
| [`blockchain-ibc`](#blockchain-ibc) | Interchain communication: IBC wiring for chains built with the framework, token transfers to other chains and relayer configuration. | after the first release | `blockchain-core` |

### Tooling

Chain configuration and testing for developers. Never part of a running node.

| Package | What it does | Release | Depends on |
|---|---|---|---|
| [`blockchain-chain`](#blockchain-chain) | Chain creation and configuration: one chain spec file for the chain ID, address prefix, native coin, accounts and module parameters, applied to Ignite and genesis. | first release | `blockchain-core` |
| [`blockchain-testing`](#blockchain-testing) | Testing for chains and modules: keeper fixtures, in-process test networks, funded accounts, genesis checks and upgrade tests. | first release | `blockchain-core` |

### Clients

Libraries applications use to talk to a chain.

| Package | What it does | Release | Depends on |
|---|---|---|---|
| [`blockchain-client`](#blockchain-client) | The TypeScript client SDK for applications: connect to a chain, read balances and tokens, build and sign messages, and give wallets the chain info. | first release | - |

## Constructors

A constructor is a starter repository, not a visual builder. Ignite CLI does the scaffolding underneath.

### Sovereign chain

The starter repository for an independent Cosmos SDK chain: the chain code with CometBFT consensus, a native coin and standard modules, blockchain-token for additional tokens and a chain spec. The same repository holds the chain's website in /docs, with a block explorer, and a kit for running validator nodes. Binaries are released on GitHub, the way Unity projects are.

| | |
|---|---|
| Kind | An independent Cosmos SDK blockchain with its own coin |
| Status | planned |
| Built with it | UAG, wCoin |
| Starts with | [`blockchain-core`](#blockchain-core), [`blockchain-chain`](#blockchain-chain), [`blockchain-token`](#blockchain-token), [`blockchain-testing`](#blockchain-testing) |
| Adds when needed | [`blockchain-client`](#blockchain-client), [`blockchain-rewards`](#blockchain-rewards), [`blockchain-identity`](#blockchain-identity), [`blockchain-ibc`](#blockchain-ibc) |
| Cosmos SDK modules | auth, bank, staking, distribution, slashing, mint, gov, upgrade, consensus, authz, feegrant |
| From 3D ITKP | - |
| Starter repository | https://github.com/IT-Kamianets/blockchain-constructor-chain |
| Page | https://chain.itkamianets.com/constructors/chain |

### dApp

The starter repository for a decentralized application: an Angular app, prerendered like the ITKP sites, that is already connected to a chain built with the framework. It connects a wallet, shows balances and tokens, and sends transactions through blockchain-client. It has no product of its own: it becomes a shop, a marketplace, a coin exchange page, a game front end or anything else that uses the chain.

| | |
|---|---|
| Kind | An Angular app connected to a chain |
| Status | planned |
| Built with it | - |
| Starts with | [`blockchain-client`](#blockchain-client) |
| Adds when needed | - |
| Cosmos SDK modules | - |
| From 3D ITKP | - |
| Starter repository | https://github.com/IT-Kamianets/blockchain-constructor-dapp |
| Page | https://chain.itkamianets.com/constructors/dapp |

### Unity dApp

The starter repository for a game whose currency or items live on a chain built with the framework. It is a Unity project on the IT Kamianets 3D Engine: it starts from one of the 3D ITKP game constructors for the camera style and adds the chain connection: the player's account, balances, and items as tokens that can be traded in a dApp.

| | |
|---|---|
| Kind | A Unity game connected to a chain, built on 3D ITKP |
| Status | planned |
| Built with it | - |
| Starts with | - |
| Adds when needed | - |
| Cosmos SDK modules | - |
| From 3D ITKP | 3D ITKP game constructors: the camera and controls the game starts from: Character View, Top-Down, Isometric, Side View, Fixed Camera or God / Free Camera; 3d-unity-core, 3d-unity-account: the 3D ITKP base and player accounts; 3d-unity-chain: planned name of the 3D ITKP package that reads the chain from C# and sends transactions; it does not exist yet |
| Starter repository | https://github.com/IT-Kamianets/blockchain-constructor-unity |
| Page | https://chain.itkamianets.com/constructors/unity |

## Chains

Independent blockchains built with the framework. They are separate products; their repositories live outside this catalog.

### UAG

UAG is a separate product: an independent blockchain with its own validators and native coin, built on Cosmos SDK and CometBFT from the Sovereign chain constructor. Accounts on UAG can issue additional tokens with blockchain-token, and applications connect to it through blockchain-client.

| | |
|---|---|
| Status | planned |
| Constructor | Sovereign chain |
| Framework packages | [`blockchain-core`](#blockchain-core), [`blockchain-chain`](#blockchain-chain), [`blockchain-token`](#blockchain-token), [`blockchain-testing`](#blockchain-testing), [`blockchain-client`](#blockchain-client) |
| Own repositories (planned names) | `uag-chain` |
| Decided by the chain | Native coin name, units and initial supply; Validator set and staking parameters; Who may create tokens and the creation fee; Launch date of the public testnet |
| Page | https://chain.itkamianets.com/chains/uag |

### wCoin

wCoin is a separate product: an independent blockchain with its own validators and native coin, built on Cosmos SDK and CometBFT from the Sovereign chain constructor. Accounts on wCoin can issue additional tokens with blockchain-token, and applications connect to it through blockchain-client.

| | |
|---|---|
| Status | planned |
| Constructor | Sovereign chain |
| Framework packages | [`blockchain-core`](#blockchain-core), [`blockchain-chain`](#blockchain-chain), [`blockchain-token`](#blockchain-token), [`blockchain-testing`](#blockchain-testing), [`blockchain-client`](#blockchain-client) |
| Own repositories (planned names) | `wcoin-chain` |
| Decided by the chain | Native coin name, units and initial supply; Validator set and staking parameters; Who may create tokens and the creation fee; Launch date of the public testnet |
| Page | https://chain.itkamianets.com/chains/wcoin |

## Core

Shared conventions every other package builds on.

### blockchain-core

Shared conventions for every chain and module: address prefixes, native coin metadata, upgrade registration and the supported Cosmos SDK versions.

| | |
|---|---|
| Go module | `github.com/IT-Kamianets/blockchain-core` |
| Status | planned, first release |
| Depends on | nothing in the framework |
| Used by | [`blockchain-chain`](#blockchain-chain), [`blockchain-token`](#blockchain-token), [`blockchain-testing`](#blockchain-testing), [`blockchain-rewards`](#blockchain-rewards), [`blockchain-identity`](#blockchain-identity), [`blockchain-ibc`](#blockchain-ibc) |
| Repository | https://github.com/IT-Kamianets/blockchain-core |
| Page | https://chain.itkamianets.com/packages/blockchain-core |

**Purpose.** Every chain built with the framework makes the same early decisions: the address prefix, the native coin and its units, where module code and protobuf files live, who may change parameters, and how upgrades are registered. blockchain-core writes these decisions down once, as a small Go library and a set of conventions, so chains and modules agree with each other. It wraps Cosmos SDK APIs and never replaces them: the application itself is still a normal Cosmos SDK app.

**Builds on:**

- Cosmos SDK: app wiring, the bank module's denom metadata, x/upgrade
- Protobuf and buf for module interfaces

**Usage.** Import it in the chain's app package. Call SetAddressPrefixes once at startup, describe the native coin with NativeCoin to get consistent bank metadata, and register upgrade handlers through RegisterUpgrade. Framework modules use the same helpers, so a module never guesses the chain's denom or prefix.

**Will include:**

- Address prefixes: one call sets the account, validator and consensus Bech32 prefixes.
- Native coin: base denom, display denom and exponent in one place, converted to bank denom metadata and used for amounts.
- Upgrades: a small registry of named upgrade handlers and store changes for x/upgrade.
- Module conventions: x/<name> layout, protobuf package itkamianets.<name>.v1, the governance module as the default authority.
- Compatibility table: the Cosmos SDK, CometBFT and Ignite CLI versions each release is tested with.

**API (planned names):**

| Member | What it does |
|---|---|
| `SetAddressPrefixes(prefix string)` | Sets the account, validator and consensus Bech32 prefixes from one value, such as demo. |
| `NativeCoin{Base, Display, Exponent}` | Describes the native coin; Metadata() returns the bank denom metadata and Parse("1.5") returns the amount in base units. |
| `RegisterUpgrade(app, Upgrade{Name, Handler, StoreUpgrades})` | Registers a named software upgrade with x/upgrade, with its migrations and store changes. |
| `DefaultAuthority()` | Returns the governance module account address, the default authority for parameter changes. |

**Example:**

```go
import core "github.com/IT-Kamianets/blockchain-core"

var Coin = core.NativeCoin{Base: "udemo", Display: "demo", Exponent: 6}

func init() {
	core.SetAddressPrefixes("demo")
}
```

**Install:**

```text
go get github.com/IT-Kamianets/blockchain-core@latest
```

Requirements:

- Go 1.23 or later; the exact minimum follows the pinned Cosmos SDK release
- A Cosmos SDK application, usually created by a constructor

## Modules

Cosmos SDK modules compiled into a chain binary.

### blockchain-token

A Cosmos SDK module for additional tokens on an existing chain: create a denom, mint, burn, set metadata, cap the supply and hand over or renounce control.

| | |
|---|---|
| Go module | `github.com/IT-Kamianets/blockchain-token` |
| Status | planned, first release |
| Depends on | [`blockchain-core`](#blockchain-core) |
| Used by | nothing in the framework |
| Repository | https://github.com/IT-Kamianets/blockchain-token |
| Page | https://chain.itkamianets.com/packages/blockchain-token |

**Purpose.** The native coin pays fees and secures the chain through staking. Projects often need more assets on the same chain: points, stable units, project tokens. blockchain-token lets an account create such a token, called a denom, and control its supply. Balances and transfers stay in the Cosmos SDK bank module, so every wallet, explorer and later IBC transfer treats these tokens like any other coin. The module follows the tokenfactory design known from the Cosmos ecosystem; where a maintained tokenfactory implementation covers a need, the package configures it rather than copying it.

**Builds on:**

- Cosmos SDK x/bank: balances, transfers, supply and denom metadata
- The tokenfactory design: denoms named factory/{creator}/{subdenom}

**Usage.** Add the module to the chain's app wiring; the chain constructor already does. Governance sets the parameters, such as the fee for creating a denom. An account sends MsgCreateDenom and becomes the token's admin; the admin mints, burns, edits metadata, and can pass control to another account or renounce it to fix the supply forever.

**Will include:**

- Create a denom under the creator's address, with display metadata: name, symbol, units and exponent.
- Mint and burn by the token's admin; transfers are ordinary bank sends.
- Optional supply cap set at creation, checked on every mint.
- Change the admin, or renounce it so nobody can mint again.
- Governance parameters: denom creation fee and whether creating denoms is open to everyone or to allowed accounts.
- Events and queries for wallets and explorers: denoms by creator, admin, supply cap.

**API (planned names):**

| Member | What it does |
|---|---|
| `MsgCreateDenom{creator, subdenom, metadata, max_supply}` | Creates factory/{creator}/{subdenom}; the creator becomes the admin. max_supply is optional. |
| `MsgMint{admin, amount, recipient}` | Mints new tokens to a recipient, within the supply cap. |
| `MsgBurn{admin, amount}` | Burns tokens from the admin's own balance. |
| `MsgChangeAdmin{admin, denom, new_admin}` | Passes control to another account; an empty new_admin renounces it. |
| `MsgSetDenomMetadata{admin, metadata}` | Updates the display name, symbol and units in the bank module. |
| `Query/DenomsFromCreator` | Lists the denoms an account has created. |

**Example:**

```sh
# planned CLI; demod is the chain binary
demod tx token create-denom points \
  --symbol PTS --exponent 0 --max-supply 1000000 \
  --from alice

demod tx token mint 1000factory/demo1.../points demo1bob... --from alice
```

**Install:**

```text
go get github.com/IT-Kamianets/blockchain-token@latest
```

Requirements:

- A Cosmos SDK chain built with blockchain-core
- The bank module with a token module account that may mint and burn

### blockchain-rewards

Reusable reward programs: pools funded with any coin or token and paid out to recipients by rules, on a schedule.

| | |
|---|---|
| Go module | `github.com/IT-Kamianets/blockchain-rewards` |
| Status | planned, after the first release |
| Depends on | [`blockchain-core`](#blockchain-core) |
| Used by | nothing in the framework |
| Repository | https://github.com/IT-Kamianets/blockchain-rewards |
| Page | https://chain.itkamianets.com/packages/blockchain-rewards |

**Purpose.** Staking rewards already come from the Cosmos SDK distribution module, and blockchain-rewards does not touch them. It is for application rewards: paying users for activity, liquidity or participation from a funded pool. Each program has a budget, a schedule and a rule for who receives how much, and pays through the bank module. It is outside the first release, and its design starts when UAG or wCoin needs it.

**Builds on:**

- Cosmos SDK x/bank and module accounts
- Epoch hooks for scheduled payouts, where the Cosmos SDK version provides them

**Usage.** Planned: an authority creates a reward program with a budget and a schedule, funds its pool, and other modules or an off-chain service report the weights that decide each payout.

**Will include:**

- Reward programs with a budget, a start, an end and a payout interval.
- Pools in the native coin or in tokens from blockchain-token.
- Weights reported by another module through a keeper interface, or by an allowed account.
- Unspent budget returned to the funder when a program ends.

**API (planned names):**

| Member | What it does |
|---|---|
| `MsgCreateProgram{authority, budget, schedule}` | Planned: creates a reward program with its pool. |
| `MsgReportWeights{reporter, program, weights}` | Planned: sets who receives how much in the next payout. |

**Install:**

```text
go get github.com/IT-Kamianets/blockchain-rewards@latest
```

Requirements:

- A Cosmos SDK chain built with blockchain-core

### blockchain-identity

Identity and permissions: named roles for accounts that other modules check, such as who may create tokens on a chain.

| | |
|---|---|
| Go module | `github.com/IT-Kamianets/blockchain-identity` |
| Status | planned, after the first release |
| Depends on | [`blockchain-core`](#blockchain-core) |
| Used by | nothing in the framework |
| Repository | https://github.com/IT-Kamianets/blockchain-identity |
| Page | https://chain.itkamianets.com/packages/blockchain-identity |

**Purpose.** Some chains need to limit actions to known accounts: token issuers, operators of a service, members of a council. The Cosmos SDK already has authz for delegating a message to another account and group for decisions by several accounts. blockchain-identity adds named roles on top of them, which any module can check through one keeper interface, and an optional public profile per account. It is outside the first release.

**Builds on:**

- Cosmos SDK x/authz for delegated permissions
- Cosmos SDK x/group for decisions by several accounts

**Usage.** Planned: governance or a group defines roles and grants them to accounts; modules call HasRole before a restricted action.

**Will include:**

- Roles defined by governance or by a group.
- Grant and revoke roles, with an optional expiry.
- One keeper interface for every module: HasRole(account, role).
- Optional public profile per account.

**API (planned names):**

| Member | What it does |
|---|---|
| `MsgGrantRole{authority, account, role, expires}` | Planned: gives an account a role. |
| `keeper.HasRole(ctx, account, role)` | Planned: the check other modules call. |

**Install:**

```text
go get github.com/IT-Kamianets/blockchain-identity@latest
```

Requirements:

- A Cosmos SDK chain built with blockchain-core

### blockchain-ibc

Interchain communication: IBC wiring for chains built with the framework, token transfers to other chains and relayer configuration.

| | |
|---|---|
| Go module | `github.com/IT-Kamianets/blockchain-ibc` |
| Status | planned, after the first release |
| Depends on | [`blockchain-core`](#blockchain-core) |
| Used by | nothing in the framework |
| Repository | https://github.com/IT-Kamianets/blockchain-ibc |
| Page | https://chain.itkamianets.com/packages/blockchain-ibc |

**Purpose.** IBC connects independent Cosmos chains so they can move tokens and messages between them. ibc-go implements the protocol; blockchain-ibc is the framework's part: adding ibc-go to a chain built from the constructor in a tested way, the ICS-20 token transfer setup, relayer configuration and the checks to run before opening a channel. It is planned after UAG and wCoin run their own testnets, and the architecture keeps room for it: tokens live in the bank module, so they can be transferred over IBC without changes.

**Builds on:**

- ibc-go: IBC core, the 07-tendermint light client and ICS-20 transfer
- A relayer such as Hermes or the Go relayer

**Usage.** Planned: add the IBC wiring to the app, set up the transfer module, configure a relayer between two chains and open a transfer channel.

**Will include:**

- Tested ibc-go wiring for the chain constructor.
- ICS-20 transfers of the native coin and of tokens from blockchain-token.
- Relayer configuration from two chain specs.
- A checklist for opening a channel on a public network.

**Install:**

```text
go get github.com/IT-Kamianets/blockchain-ibc@latest
```

Requirements:

- A Cosmos SDK chain built with blockchain-core
- A relayer for each connection

## Tooling

Chain configuration and testing for developers. Never part of a running node.

### blockchain-chain

Chain creation and configuration: one chain spec file for the chain ID, address prefix, native coin, accounts and module parameters, applied to Ignite and genesis.

| | |
|---|---|
| Go module | `github.com/IT-Kamianets/blockchain-chain` |
| Status | planned, first release |
| Depends on | [`blockchain-core`](#blockchain-core) |
| Used by | nothing in the framework |
| Repository | https://github.com/IT-Kamianets/blockchain-chain |
| Page | https://chain.itkamianets.com/packages/blockchain-chain |

**Purpose.** A Cosmos SDK chain keeps its configuration in many places: the address prefix in Go code, the native denom in the bank, staking, mint and gov sections of genesis, accounts and validators in the Ignite config, minimum gas prices in app.toml. A mistake in one of them, such as a staking denom that does not match the bank metadata, shows up only when the chain starts. blockchain-chain keeps all of it in one chain spec file, checks it, and writes the Ignite config and the genesis sections from it. Ignite still scaffolds and runs the chain.

**Builds on:**

- Ignite CLI: scaffolding, config.yml and chain serve
- Cosmos SDK genesis of the auth, bank, staking, mint and gov modules

**Usage.** Describe the chain in chain.yaml at the root of its repository. Run blockchain-chain validate in CI, blockchain-chain ignite to write config.yml for local development, and blockchain-chain genesis to apply the spec to a genesis file for a testnet or mainnet launch.

**Will include:**

- One chain spec: chain ID, name, address prefix, native coin, genesis accounts, development validators and module parameters.
- Validation: the native denom is the same in bank metadata, staking, mint and gov; amounts and addresses are well formed.
- Network profiles: local, testnet and mainnet values in the same file, such as a short governance voting period only for local.
- Writes the Ignite config.yml for local development.
- Applies the spec to a genesis file, so a launch genesis is reproducible.

**API (planned names):**

| Member | What it does |
|---|---|
| `blockchain-chain validate` | Checks chain.yaml and exits with an error that names the field to fix. |
| `blockchain-chain ignite --network local` | Writes the Ignite config.yml: accounts, validators and genesis overrides from the spec. |
| `blockchain-chain genesis --network testnet genesis.json` | Applies the spec to an exported genesis file: denom metadata, module parameters and accounts. |
| `chainspec.Load(path)` | Reads a chain spec in Go, for tests and custom tools. |

**Example:**

```yaml
# chain.yaml (planned format)
name: Demo
chain_id: demo-local-1
address_prefix: demo
native_coin:
  base: udemo
  display: demo
  exponent: 6
accounts:
  - name: alice
    coins: 1000000000udemo
networks:
  local:
    gov:
      voting_period: 60s
```

**Install:**

```text
go get github.com/IT-Kamianets/blockchain-chain@latest
```

Requirements:

- Go 1.23 or later
- Ignite CLI for local development
- A chain created from the chain constructor, or an existing Cosmos SDK chain

### blockchain-testing

Testing for chains and modules: keeper fixtures, in-process test networks, funded accounts, genesis checks and upgrade tests.

| | |
|---|---|
| Go module | `github.com/IT-Kamianets/blockchain-testing` |
| Status | planned, first release |
| Depends on | [`blockchain-core`](#blockchain-core) |
| Used by | nothing in the framework |
| Repository | https://github.com/IT-Kamianets/blockchain-testing |
| Page | https://chain.itkamianets.com/packages/blockchain-testing |

**Purpose.** A chain moves real value, so every module change needs tests at three levels: the keeper alone, the whole application, and a running network. The Cosmos SDK ships the pieces, such as its integration test framework and in-process test network; blockchain-testing puts them together for chains built with the framework, reads the chain spec, and adds the checks every chain needs, such as genesis validation and a rehearsal of each software upgrade.

**Builds on:**

- Cosmos SDK testutil: the integration test framework and testutil/network
- Go's testing package

**Usage.** Use it from Go tests in a chain or module repository. NewApp builds the application in memory with the modules you list, Fund gives test accounts coins, and Network starts validators in the test process. For upgrades, UpgradeTest starts the chain from the old version, passes the upgrade proposal and checks the state after the migration.

**Will include:**

- Keeper fixtures: one module with its real dependencies, in memory.
- Application tests: the full app from the chain spec, funded accounts, sending messages and reading events.
- In-process networks with several validators for CLI and gRPC tests.
- Genesis checks: export, validate and import the chain state.
- Upgrade rehearsal: from the old version through a governance proposal to the new handler.
- A local multi-validator network in Docker for manual testing.

**API (planned names):**

| Member | What it does |
|---|---|
| `NewApp(t, Options{Spec, Modules})` | Builds the application in memory for one test. |
| `app.Fund(address, coins)` | Gives a test account coins through the bank module. |
| `app.Deliver(msgs...)` | Runs messages in a block and returns the result and events. |
| `Network(t, validators)` | Starts an in-process network with RPC, REST and gRPC. |
| `UpgradeTest(t, From, To, UpgradeName)` | Rehearses a software upgrade and returns the migrated state. |

**Example:**

```go
func TestMintRespectsCap(t *testing.T) {
	app := chaintest.NewApp(t, chaintest.Options{Spec: "../chain.yaml"})
	alice := app.Account("alice")

	app.Deliver(token.NewMsgCreateDenom(alice, "points", 100))
	_, err := app.Deliver(token.NewMsgMint(alice, "101factory/"+alice.String()+"/points", alice))
	require.ErrorIs(t, err, token.ErrSupplyCap)
}
```

**Install:**

```text
go get github.com/IT-Kamianets/blockchain-testing@latest
```

Requirements:

- Go 1.23 or later
- Docker, only for the multi-validator local network

## Clients

Libraries applications use to talk to a chain.

### blockchain-client

The TypeScript client SDK for applications: connect to a chain, read balances and tokens, build and sign messages, and give wallets the chain info.

| | |
|---|---|
| npm | `@itkamianets/blockchain-client` |
| Status | planned, first release |
| Depends on | nothing in the framework |
| Used by | nothing in the framework |
| Repository | https://github.com/IT-Kamianets/blockchain-client |
| Page | https://chain.itkamianets.com/packages/blockchain-client |

**Purpose.** Web, mobile and server applications talk to a chain over CometBFT RPC, REST and gRPC, sign transactions with a wallet, and need types for every module message. CosmJS already does the connecting and signing. blockchain-client adds what is specific to chains built with the framework: generated types for the framework modules, short helpers for common tasks such as creating a token, amounts shown in display units from the chain's metadata, and chain info that wallets such as Keplr accept.

**Builds on:**

- CosmJS: connection, accounts and signing
- Protobuf code generation with buf from the modules' .proto files

**Usage.** Create a client with the chain's RPC address and chain info. Read-only calls work without a signer; for transactions pass a signer from a wallet or from a mnemonic on a server. Module helpers such as client.token.createDenom build the message, estimate the fee and broadcast it.

**Will include:**

- Connect over CometBFT RPC, with REST and gRPC-web where the node exposes them.
- Generated TypeScript types for the framework modules, versioned with them.
- Token helpers: create, mint, burn, change admin, list denoms.
- Amounts: convert between base and display units with the bank metadata.
- Chain info for wallets, from the same chain spec as the chain.
- ESM, tree-shakable, for browsers and Node.js.

**API (planned names):**

| Member | What it does |
|---|---|
| `createChainClient({ rpc, chain, signer? })` | Connects to a chain; without a signer only queries are available. |
| `client.balances(address)` | Returns every balance of an address, with display amounts. |
| `client.token.createDenom({ subdenom, metadata, maxSupply })` | Builds, signs and broadcasts MsgCreateDenom. |
| `toDisplay(coin, metadata) / toBase(amount, metadata)` | Converts between base units such as udemo and display units such as demo. |
| `walletChainInfo(spec)` | Returns the chain info a wallet needs to add the chain. |

**Example:**

```ts
import { createChainClient } from '@itkamianets/blockchain-client';

const client = await createChainClient({
  rpc: 'http://localhost:26657',
  chain: chainInfo,
  signer,
});

const denom = await client.token.createDenom({
  subdenom: 'points',
  metadata: { symbol: 'PTS', exponent: 0 },
  maxSupply: '1000000',
});
```

**Install:**

```text
npm install @itkamianets/blockchain-client
```

Requirements:

- Node.js 24 LTS or a modern browser
- A wallet or a signer from CosmJS for transactions
