Algokit Examples Gallery

Typescript Hello World

Codespace

Creator Algorand Foundation

Source

algokit init example typescript-smart-contract

This template provides a beta template for developing and deploying Algorand TypeScript smart contracts.

Features

Smart Contract Example

Welcome to your new AlgoKit project! This is an example of a Smart Contract.

Pre-requisites

These pre-requisites already come configured in the Github codespace, but you must have a github account to launch a codespace.

Initial Setup

  1. Open the example in a Github Codespace
    Click the CodeSpace button above to launch the project in a Codespace. This will launch a VM using your Github profile. This will automatically install the latest Algokit and run Localnet. The example comes pre-configured with a .env file that points to Localnet.

  2. Bootstrap Environment
    You need to install all the dependencies in order to launch the example. The Algokit CLI comes equipped with a command that installs the dependencies in each of your projects.

   # Install dependencies for contracts and frontend projects
   algokit project bootstrap all
   # Install dependencies for projects that use npm
   algokit project bootstrap npm
   # Install dependencies for projects that use python via poetry
   algokit project bootstrap poetry

Development Workflow

Command Line

Project Features

Smart Contract Generation

Debugging Support

Tools & Technologies

Project Structure

The workspace uses a projects directory as the default location for new projects. Each sub-project contains its own README with specific setup instructions.

Additional Resources

import { Contract } from '@algorandfoundation/algorand-typescript'

export class HelloWorld extends Contract {
  public hello(name: string): string {
    return `${this.getHello()} ${name}`
  }

private getHello() {
    return 'Hello'
  }
}