https://github.com/lanfordcai/ava
Crypto-addresses Validator
https://github.com/lanfordcai/ava
address-validation bitcoin blockchain cryptocurrency
Last synced: about 1 year ago
JSON representation
Crypto-addresses Validator
- Host: GitHub
- URL: https://github.com/lanfordcai/ava
- Owner: LanfordCai
- License: mit
- Created: 2018-12-16T08:45:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T07:15:06.000Z (over 3 years ago)
- Last Synced: 2025-04-09T02:04:25.098Z (about 1 year ago)
- Topics: address-validation, bitcoin, blockchain, cryptocurrency
- Language: Go
- Homepage:
- Size: 232 KB
- Stars: 6
- Watchers: 0
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ava
Cryptocurrency Addresses Validator
### Installation
Install the package using
```go
$ go get github.com/LanfordCai/ava/validator
```
### Usage
To use the package import it in your `*.go` code
```go
import "github.com/LanfordCai/ava/validator"
```
### Example
***Validate a `Bitcoin` address***
```go
package main
import (
"fmt"
"github.com/LanfordCai/ava/validator"
)
func main() {
v := &validator.Bitcoin{}
addr := "19JeUHUvw23fwKeK1zZD4moKyxj1xn4Kxi"
result := v.ValidateAddress(addr, validator.Mainnet)
fmt.Printf("Address is valid?: %t\n", result.IsValid)
fmt.Printf("Address type: %s\n", result.Type)
// Address is valid?: true
// Address type: P2PKH
}
```
### **License**
The **ava** is an open-source software licensed under the [MIT License](LICENSE).