create-typink CLI

create-typink CLI

The create-typink CLI tool helps developers quickly scaffold a new ink! or Solidity dApp project using Typink & Dedot. It provides an interactive experience to select contract types, templates, and networks, automatically setting up a complete Next.js application with pre-deployed example contracts.

Quick Start

# npm
npx create-typink@latest

# pnpm
pnpm create typink@latest

# yarn
yarn create typink@latest

# bun
bunx create-typink@latest

The CLI will guide you through an interactive setup process to configure your project.

Contract Types & Templates

create-typink supports four contract types across two different pallets:

Contract Type
Pallet
Technology
Template
Example Contract

Ink! v6

pallet-revive

PolkaVM

inkv6-nextjs

Flipper

Ink! v6 (Sol ABI)

pallet-revive

PolkaVM

inkv6-sol-nextjs

Flipper

Solidity

pallet-revive

PolkaVM

sol-nextjs

Storage

Ink! v5

pallet-contracts

WASM

inkv5-nextjs

Greeter

Template Features

All templates are built with Next.js and include:

  • TypinkProvider configuration with wallet connector

  • Pre-deployed example contract with working interactions

  • TypeScript bindings for the example contract

  • UI components demonstrating contract queries and transactions

  • Ready-to-use setup for immediate development

Options

Option
Alias
Type
Description

--name <project-name>

-n

String

Specify the project name. Must be a valid npm package name.

--template <template-name>

-t

String

Choose a template: inkv6-nextjs, inkv6-sol-nextjs, sol-nextjs, inkv5-nextjs.

--networks <network-names>

-N

String[]

Select supported networks (multiple values allowed). Networks must match the template's pallet type.

--skip-install

--skip

Boolean

Skip automatic package installation.

--no-git

Boolean

Skip git initialization.

--help

-h

Boolean

Show help message.

Notes

  • Project Name Validation: The project name must be a valid npm package name (lowercase, no spaces, etc.)

  • Network Compatibility: Selected networks must be compatible with the chosen template:

    • inkv5-nextjs β†’ pallet-contracts networks only

    • inkv6-nextjs, inkv6-sol-nextjs, sol-nextjs β†’ pallet-revive networks only

  • Multiple Networks: You can select multiple networks using multiple -N flags or by selecting multiple in interactive mode

Interactive Mode

When you run npx create-typink@latest without options, the CLI guides you through an interactive setup:

1. Project Name

? Project name: (my-typink-app)

Enter a valid npm package name for your project.

2. Contract Type Selection

? Select contract type:
❯ Ink! v6 (PolkaVM, pallet-revive)
  Ink! v6 using Sol ABI (PolkaVM, pallet-revive)
  Solidity (PolkaVM, pallet-revive)
  Ink! v5 (WASM, pallet-contracts)

Choose the contract type you want to work with. This determines which template and networks are available.

3. Network Selection

? Select supported networks: (Press <space> to select, <a> to toggle all)
❯◉ Pop Testnet
 β—― Aleph Zero Testnet
 β—― Aleph Zero
 β—― Astar

Select one or more networks for your dApp. Available networks depend on the chosen contract type.

Generated Project Structure

After running the CLI, your project will have the following structure:

my-typink-app/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                   # Next.js app directory
β”‚   β”œβ”€β”€ components/            # React components
β”‚   β”‚   β”œβ”€β”€ shared/           # Shared UI components
β”‚   β”‚   └── [example]-board.tsx  # Example contract interactions
β”‚   β”œβ”€β”€ contracts/            # Contract-related files
β”‚   β”‚   β”œβ”€β”€ deployments.ts    # Contract deployment addresses
β”‚   β”‚   └── types/           # Generated TypeScript bindings
β”‚   β”œβ”€β”€ lib/                  # Utility functions
β”‚   └── providers/            # React context providers
β”œβ”€β”€ public/                   # Static assets
β”œβ”€β”€ .gitignore
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ next.config.ts
└── README.md

Key Files

  • src/contracts/deployments.ts: Contains contract deployment information for selected networks

  • src/contracts/types/: TypeScript bindings for type-safe contract interactions

  • src/components/: Example components showing how to interact with contracts

  • src/providers/: TypinkProvider configuration with wallet connector setup

Last updated

Was this helpful?