Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lanfordcai/ava
Crypto-addresses Validator
https://github.com/lanfordcai/ava
address-validation bitcoin blockchain cryptocurrency
Last synced: 2 months 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 (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T07:15:06.000Z (almost 2 years ago)
- Last Synced: 2024-06-21T17:58:44.442Z (7 months ago)
- Topics: address-validation, bitcoin, blockchain, cryptocurrency
- Language: Go
- Homepage:
- Size: 232 KB
- Stars: 6
- Watchers: 1
- 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 mainimport (
"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).