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.
- 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.
Before using the scripts, ensure you have the required dependencies installed:
- Node.js
@alephium/web3package
- Go 1.18+
github.com/alephium/go-sdk
git clone https://github.com/yourusername/alephium-balance-checker.git
cd alephium-balance-checker- npm install
- No additional dependencies are needed, as Go modules handle them automatically.
-
To check the balance of an Alephium address, run:
npm run buildnpm start <ALPH_ADDRESS> -
Example:
npm run start 1ANu47GYWwprmQJUgPpBsYb1mDoqxTDyVkCSg2C4NbtDp
-
To check the balance using Go, run:
go run main.go <ALPH_ADDRESS> -
Example:
go run main.go 1ANu47GYWwprmQJUgPpBsYb1mDoqxTDyVkCSg2C4NbtDp
/alephium-balance-checker
│── /TS
│ ├── index.ts # Main script (Typescript)
│ ├── package.json # Dependencies
│── /Go
│ ├── main.go # Main script (Go)
│ ├── go.mod # Go dependencies
│── README.md # DocumentationIf 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).