Documentation ¶
Index ¶
- Variables
- func DecodeTransferData(data []byte) (toAddress string, transferAmount *big.Int, err error)
- func ERC20Init()
- func GetLastBlock() *big.Int
- func RegisterTokenGetter(callback func(tokentype string) string)
- type ERC20Handler
- func (h *ERC20Handler) BuildUnsignedTransaction(fromAddress, fromPublicKey, toAddress string, amount *big.Int, ...) (transaction interface{}, digests []string, err error)
- func (h *ERC20Handler) GetAddressBalance(address string, jsonstring string) (balance ctypes.Balance, err error)
- func (h *ERC20Handler) GetDefaultFee() ctypes.Value
- func (h *ERC20Handler) GetTransactionInfo(txhash string) (fromAddress string, txOutputs []ctypes.TxOutput, jsonstring string, ...)
- func (h *ERC20Handler) IsToken() bool
- func (h *ERC20Handler) MakeSignedTransaction(rsv []string, transaction interface{}) (signedTransaction interface{}, err error)
- func (h *ERC20Handler) PublicKeyToAddress(pubKeyHex string) (address string, err error)
- func (h *ERC20Handler) SignTransaction(hash []string, privateKey interface{}) (rsv []string, err error)
- func (h *ERC20Handler) SubmitTransaction(signedTransaction interface{}) (ret string, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ERC20_DEFAULT_FEE, _ = new(big.Int).SetString("10000000000000000", 10)
View Source
var GetToken func(tokentype string) string
返回合约地址或空
View Source
var Tokens map[string]string = map[string]string{
"ERC20GUSD": "0x28a79f9b0fe54a39a0ff4c10feeefa832eeceb78",
"ERC20BNB": "0x7f30B414A814a6326d38535CA8eb7b9A62Bceae2",
"ERC20MKR": "0x2c111ede2538400F39368f3A3F22A9ac90A496c7",
"ERC20HT": "0x3C3d51f6BE72B265fe5a5C6326648C4E204c8B9a",
"ERC20BNT": "0x14D5913C8396d43aB979D4B29F2102c1C65E18Db",
"ERC20RMBT": "0x72778a05fc72dd56d5b5a6bac2f045a2a1eb78f2",
}
Functions ¶
func DecodeTransferData ¶
func GetLastBlock ¶
func RegisterTokenGetter ¶
Types ¶
type ERC20Handler ¶
type ERC20Handler struct {
TokenType string
}
func NewERC20Handler ¶
func NewERC20Handler() *ERC20Handler
func NewERC20TokenHandler ¶
func NewERC20TokenHandler(tokenType string) *ERC20Handler
func (*ERC20Handler) BuildUnsignedTransaction ¶
func (h *ERC20Handler) BuildUnsignedTransaction(fromAddress, fromPublicKey, toAddress string, amount *big.Int, jsonstring string) (transaction interface{}, digests []string, err error)
jsonstring '{"gasPrice":8000000000,"gasLimit":50000,"tokenType":"BNB"}'
func (*ERC20Handler) GetAddressBalance ¶
func (h *ERC20Handler) GetAddressBalance(address string, jsonstring string) (balance ctypes.Balance, err error)
jsonstring:'{"tokenType":"BNB"}'
func (*ERC20Handler) GetDefaultFee ¶
func (h *ERC20Handler) GetDefaultFee() ctypes.Value
func (*ERC20Handler) GetTransactionInfo ¶
func (*ERC20Handler) IsToken ¶
func (h *ERC20Handler) IsToken() bool
func (*ERC20Handler) MakeSignedTransaction ¶
func (h *ERC20Handler) MakeSignedTransaction(rsv []string, transaction interface{}) (signedTransaction interface{}, err error)
func (*ERC20Handler) PublicKeyToAddress ¶
func (h *ERC20Handler) PublicKeyToAddress(pubKeyHex string) (address string, err error)
func (*ERC20Handler) SignTransaction ¶
func (h *ERC20Handler) SignTransaction(hash []string, privateKey interface{}) (rsv []string, err error)
func (*ERC20Handler) SubmitTransaction ¶
func (h *ERC20Handler) SubmitTransaction(signedTransaction interface{}) (ret string, err error)
Click to show internal directories.
Click to hide internal directories.