Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cointypes []string = []string{"ALL", "ETH"} //tmp only left ETH
only main net coins var Cointypes []string = []string{"ALL","BTC","ETH","XRP","EOS","USDT","ATOM","BCH","TRX","BNB","EVT1","ERC20BNB","ERC20GUSD","ERC20MKR","ERC20HT","ERC20RMBT","EVT1001","BEP2GZX_754"} var Cointypes []string = []string{"ALL","BTC","ETH","ATOM","BCH","TRX","BNB","ERC20BNB","ERC20GUSD","ERC20MKR","ERC20HT","ERC20RMBT","BEP2GZX_754"} //tmp delete EOS XRP EVT1 EVT1001 USDT
View Source
var RegExpmap map[string]string = map[string]string{
"BTC": "^(1|3|m|n|2)[a-zA-Z\\d]{25,33}$",
"USDT": "^(1|3|m|n|2)[a-zA-Z\\d]{25,33}$",
"BCH": "^(bchtest:)?(p|q)[0-9a-z]{41}$",
"TRX": "",
"ETH": "^(0x)?[0-9a-fA-F]{40}$",
"XRP": "^r[1-9a-km-zA-HJ-NP-Z]{32,33}$",
"EOSDCRM": "^d[1-5a-z]{32,33}$",
"EOS": "^([a-z\\d\\.]+)$",
"EOS_NORMAL": "^([1-5a-z]{12})$",
"ATOM": "^cosmos1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}$",
"EVT": "^EVT[a-zA-Z\\d]{50}$",
"BNB": "^(t)?(bnb1)[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}$",
}
Functions ¶
func GetMainNetCoin ¶
func IsCoinSupported ¶
Types ¶
type AddressValidator ¶
type AddressValidator struct {
Exp string
}
func NewAddressValidator ¶
func NewAddressValidator(cointype string) *AddressValidator
func NewDcrmAddressValidator ¶
func NewDcrmAddressValidator(cointype string) *AddressValidator
func (*AddressValidator) IsValidAddress ¶
func (v *AddressValidator) IsValidAddress(address string) bool
type CryptocoinHandler ¶
type CryptocoinHandler interface { // 公钥to dcrm地址 PublicKeyToAddress(pubKeyHex string) (address string, err error) // 构造未签名交易 BuildUnsignedTransaction(fromAddress, fromPublicKey, toAddress string, amount *big.Int, jsonstring string) (transaction interface{}, digests []string, err error) // 构造签名交易 MakeSignedTransaction(rsv []string, transaction interface{}) (signedTransaction interface{}, err error) // 提交交易 SubmitTransaction(signedTransaction interface{}) (txhash string, err error) // 根据交易hash查交易信息 // fromAddress 交易发起方地址 // txOutputs 交易输出切片, txOutputs[i].ToAddress 第i条交易接收方地址, txOutputs[i].Amount 第i条交易转账金额 GetTransactionInfo(txhash string) (fromAddress string, txOutputs []types.TxOutput, jsonstring string, confirmed bool, fee types.Value, err error) // 账户查账户余额 GetAddressBalance(address string, jsonstring string) (balance types.Balance, err error) // 默认交易费用 GetDefaultFee() types.Value // 是coin还是token IsToken() bool }
func NewCryptocoinHandler ¶
func NewCryptocoinHandler(coinType string) (txHandler CryptocoinHandler)
Directories ¶
Path | Synopsis |
---|---|
Package helpers provides convenience functions to simplify wallet code.
|
Package helpers provides convenience functions to simplify wallet code. |
提供api的节点地址
|
提供api的节点地址 |
abi
Package abi implements the Ethereum ABI (Application Binary Interface).
|
Package abi implements the Ethereum ABI (Application Binary Interface). |
sha3
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
|
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202. |
Click to show internal directories.
Click to hide internal directories.