WalletValidator

錢包地址檢查器,包含了 mainnet / testnet

Installation

Add this line to your application's Gemfile:

gem "wallet_validator", git: "https://gitlab.gitlab.cc/rubygems/wallet_validator"

And then execute:

$ bundle install

Or install it yourself as:

$ gem install wallet_validator

Usage

可以透過直接啟動設定預設值

WalletValidator.configure do |config|
  config.chain = "testnet"
end

或是第三個參數為 is_testnet,預設為 false,也就是預設為主鏈錢包格式檢查

mainnet

WalletValidator.valid?("BTC", "12QeMLzSrB8XH8FvEzPMVoRxVAzTr5XM2y")

如果需要檢查 testnet 請使用

WalletValidator.valid?("BTC", "2N3oefVeg6stiTb5Kh3ozCSkaqmx91FDbsm", true)

Contributing

Bug reports and pull requests are welcome on GitHub at https://gitlab.gitlab.cc/rubygems/wallet_validator.