Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add example project highlighting basic functionality #360

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading