Skip to content

ghst111/test-uphold

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Alephium Balance Checker

This project provides a simple way to check the balance of an Alephium address using both Node.js and Go. The implementation uses the Alephium Web3 SDK and the Alephium OpenAPI client.

🚀 Features

  • Fetches the balance of a given Alephium address.
  • Converts the balance from its smallest unit to a human-readable format (ALPH).
  • Handles errors and missing arguments gracefully.
  • Supports both Typescript and Go implementations.

📌 Prerequisites

Before using the scripts, ensure you have the required dependencies installed:

For Typescript

  • Node.js
  • @alephium/web3 package

For Go

  • Go 1.18+
  • github.com/alephium/go-sdk

📥 Installation

Clone the repository

git clone https://github.com/yourusername/alephium-balance-checker.git
cd alephium-balance-checker

📌 Install dependencies

For Typescript

  • npm install

For Typescript

  • No additional dependencies are needed, as Go modules handle them automatically.

🔥 Usage

For Typescript

  • To check the balance of an Alephium address, run: npm run build npm start <ALPH_ADDRESS>

  • Example:

    npm run start 1ANu47GYWwprmQJUgPpBsYb1mDoqxTDyVkCSg2C4NbtDp

For Go

  • To check the balance using Go, run:

    go run main.go <ALPH_ADDRESS>

  • Example:

    go run main.go 1ANu47GYWwprmQJUgPpBsYb1mDoqxTDyVkCSg2C4NbtDp

🛠 Project Structure

    /alephium-balance-checker
    │── /TS
    │   ├── index.ts            # Main script (Typescript)
    │   ├── package.json        # Dependencies
    │── /Go
    │   ├── main.go             # Main script (Go)
    │   ├── go.mod              # Go dependencies
    │── README.md               # Documentation

🐛 Error Handling

If you encounter errors:

  • Ensure the provided address is correct.
  • Check for API availability or network issues.
  • Verify dependencies are installed properly (npm install for Node.js).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published