Skip to content

Latest commit

 

History

History
161 lines (112 loc) · 5.26 KB

File metadata and controls

161 lines (112 loc) · 5.26 KB

Aleo Dev Toolkit

The Aleo Dev Toolkit is a monorepo containing a suite of libraries and tools designed to simplify the integration of Aleo wallets and blockchain functionality into your applications. Below is the structure of the repository and a brief explanation of each component.

Getting Started

To get started, clone the repository and install dependencies:

git clone https://github.com/provablehq/aleo-dev-toolkit.git
cd aleo-dev-toolkit
pnpm install

Explore the examples/ directory for sample projects or refer to the docs/ directory for detailed documentation.

For wallet adapter documentation, see the Wallet Adapter README.

Build

To build all packages (will not build example apps):

pnpm build

This will use Turborepo to build all packages in the correct dependency order.

Running Examples

To run both example applications simultaneously:

pnpm examples:dev

To run individual example applications:

# Run the React app example (wallet adapter)
pnpm adapter-app:dev

# Run the React app with hooks example
pnpm hooks-app:dev

Example Applications

  • examples/react-app/ - A React application demonstrating wallet adapter integration with UI components
  • examples/react-app-hooks/ - A React application showcasing the use of Aleo hooks for chain data

Clean

To clean all built files:

pnpm clean

Development

This project uses pnpm, Turborepo, and Changesets for monorepo management and package publishing.

Working with packages

Each package is located in the packages/ directory. You can work on them individually:

cd packages/aleo-types
pnpm dev

Adding a changeset

When you're ready to publish changes, you need to create a changeset:

pnpm changeset

This will prompt you to select the packages that have changed and the type of version change (major, minor, patch). It will also ask for a description of the changes.

Publishing packages

To publish packages, run:

pnpm publish-packages

This will:

  1. Build all packages
  2. Run linters and tests
  3. Apply changesets to update versions
  4. Publish packages to npm

Repository Structure

aleo-dev-toolkit/                          (Monorepo Root)
├─ packages/
│   ├─ aleo-hooks/                        (React hooks for Aleo chain data)
│   │
│   ├─ aleo-types/                        (Common types for Aleo)
│   │
│   ├─ aleo-wallet-standard/              (Wallet Standard Interfaces & Types)
│   │
│   ├─ aleo-wallet-adaptor/               (Wallet adapter package)
│   │   ├─ core/                          (Core wallet adapter logic and utilities)
│   │   ├─ react/                         (React integration for wallet adapter)
│   │   ├─ react-ui/                      (UI components for wallet adapter integration)
│   │   ├─ wallets/                       (Wallet adapter implementations)
│   │   │   ├─ shield/                    (ShieldWallet adapter)
│   │   │   ├─ fox/                       (FoxWallet adapter)
│   │   │   ├─ leo/                       (LeoWallet adapter)
│   │   │   ├─ puzzle/                    (PuzzleWallet adapter)
│   │   │   └─ soter/                     (SoterWallet adapter)
│   │   └─ docs/                          (Wallet adapter documentation)
│   │
├─ examples/
│   ├─ react-app/                         (Example React application using wallet adapter)
│
├─ .changeset/                            (Changeset configuration for versioning and publishing)
├─ turbo.json                             (Turborepo configuration)
├─ package.json                           (Root package configuration for workspaces)
└─ README.md                              (High-level introduction and quick start)

Key Components

  1. @provablehq/aleo-types
    Common types for the Aleo ecosystem, including Account, Transaction, and Network.

  2. @provablehq/aleo-wallet-standard
    Defines the standard interfaces and types for Aleo wallet integration, including chain constants, wallet interfaces, and feature definitions.

  3. @provablehq/aleo-wallet-adaptor-core
    Provides core wallet adapter logic, including base classes, error handling, and transaction utilities.

  4. @provablehq/aleo-wallet-adaptor-leo
    Implements the wallet adapter for LeoWallet, handling wallet-specific logic such as connection and transaction requests.

  5. @provablehq/aleo-wallet-adaptor-react
    Offers React integration for the wallet adapter, including context providers and hooks for managing wallet state.

  6. @provablehq/aleo-wallet-adaptor-react-ui
    Contains reusable UI components for wallet integration, such as connect buttons and modals.

  7. @provablehq/aleo-hooks
    Provides React hooks for accessing and managing Aleo chain data and state.

  8. examples/
    Example projects demonstrating how to use the toolkit in real-world applications.

  9. docs/
    Documentation and specifications, including the Aleo Wallet Standard specification.