Skip to content

Commit

Permalink
Merge pull request #360 from dominant-strategies/example-project
Browse files Browse the repository at this point in the history
feat: add example project highlighting basic functionality
  • Loading branch information
alejoacosta74 authored Nov 19, 2024
2 parents d49e5e7 + 372ec3e commit 0d66692
Show file tree
Hide file tree
Showing 6 changed files with 947 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/example-project/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
56 changes: 56 additions & 0 deletions examples/example-project/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Quai Network Example Project

This project demonstrates basic wallet and transaction operations using the Quai Network JavaScript SDK.

## Features

- Generates HD wallets from mnemonics
- Creates zone-specific addresses
- Fetches blockchain data
- Constructs, signs, and verifies transactions
- Demonstrates protocol expansion number queries

## Prerequisites

- Node.js (v14 or later)
- npm or yarn
- Access to Quai Network RPC endpoint

## Installation

```bash
npm install
# or
yarn install
```

## Usage

```bash
npm start
# or
yarn start
```

The script will:
1. Generate a new random wallet
2. Create a Cyprus1 zone address
3. Fetch latest block data
4. Create and verify a test transaction

## Code Structure

- `index.ts`: Main script demonstrating Quai Network SDK usage
- Uses TypeScript for type safety
- Implements error handling for network operations

## Important Notes

- This is a demonstration project - do not use generated keys in production
- Transactions are constructed but not broadcast to the network
- Replace hardcoded addresses with your own test addresses

## Resources

- [Quai Network Docs](https://docs.quai.network)
- [quais SDK Reference](https://github.com/dominant-strategies/quais-6.js)
Loading

0 comments on commit 0d66692

Please sign in to comment.