Documentation ¶
Index ¶
- Constants
- Variables
- func CheckRealEosAccount(accountName, ownerkey, activekey string) (ok bool)
- func CreateNewAccount(creatorName, creatorActivePrivKey, accountName, ownerkey, activekey string, ...) (bool, error)
- func CreateRealEosAccount(accountName string, ownerkey string, activekey string) error
- func DefaultDataDir() string
- func DelegateBW(fromAcctName, fromActivePrivKey, receiverName string, stakeCPU, stakeNet int64, ...) (bool, error)
- func EOSConfigInit()
- func EOSInit()
- func EOS_newUnsignedTransaction(fromAcctName, toAcctName string, amount *big.Int, memo2 string, memo string) (string, *eos.SignedTransaction, error)
- func GenAccountName(pubKeyHex string) string
- func GetAccountNameByPubKey(pubKey string) ([]string, error)
- func GetEosAccount() (acct, owner, active string)
- func GetEosDbDir() string
- func GetHeadBlockID(nodeos string) (chainID string, err error)
- func HexToPubKey(pubKeyHex string) (ecc.PublicKey, error)
- func IsCanonical(rsv []byte) bool
- func MakeSignedTransaction(stx *eos.SignedTransaction, signature ecc.Signature) *eos.SignedTransaction
- func PubKeyToHex(pk string) (pubKeyHex string, _ error)
- func RSVToSignature(rsvStr string) (ecc.Signature, error)
- func SignDigestWithPrivKey(hash, wif string) (ecc.Signature, error)
- func SubmitTransaction(stx *eos.SignedTransaction) string
- type AccountInfo
- type Auth
- type EOSHandler
- func (h *EOSHandler) BuildUnsignedLockinTransaction(fromAddress, toUserKey, toAcctName string, amount *big.Int, jsonstring string) (transaction interface{}, digests []string, err error)
- func (h *EOSHandler) BuildUnsignedTransaction(fromAddress, fromPublicKey, toAcctName string, amount *big.Int, ...) (transaction interface{}, digests []string, err error)
- func (h *EOSHandler) FiltTransaction(blocknumber uint64, filter types.Filter) (txhashes []string, err error)
- func (h *EOSHandler) GetAddressBalance(address string, jsonstring string) (balance types.Balance, err error)
- func (h *EOSHandler) GetDefaultFee() types.Value
- func (h *EOSHandler) GetTransactionInfo(txhash string) (*types.TransactionInfo, error)
- func (h *EOSHandler) IsToken() bool
- func (h *EOSHandler) MakeSignedTransaction(rsv []string, transaction interface{}) (signedTransaction interface{}, err error)
- func (h *EOSHandler) MakeSignedTransactionByJson(rsv []string, txjson string) (signedTransaction interface{}, err error)
- func (h *EOSHandler) PublicKeyToAddress(pubKeyHex string) (acctName string, err error)
- func (h *EOSHandler) SignTransaction(hash []string, privateKey interface{}) (rsv []string, err error)
- func (h *EOSHandler) SubmitTransaction(signedTransaction interface{}) (txhash string, err error)
- func (h *EOSHandler) SubmitTransactionByJson(txjson string) (txhash string, err error)
- type EOSTx
- type EOSTxOutput
- type Key
- type Limit
- type Permission
- type Permissions
- type SubmitTxRes
Constants ¶
View Source
const ALPHABET = "defghijklmnopqrstuvwxyz12345abcdefghijklmnopqrstuvwxyz12345abc"
View Source
const CREATOR_ACCOUNT = "gzx123454321"
View Source
const CREATOR_PRIVKEY = "5JqBVZS4shWHBhcht6bn3ecWDoZXPk3TRSVpsLriQz5J3BKZtqH"
Variables ¶
View Source
var BALANCE_SERVER string
View Source
var EOSRegExpmap map[string]string = map[string]string{
"EOSDCRM": "^d[1-5a-z]{32,33}$",
"EOS": "^([a-z\\d\\.]+)$",
"EOS_NORMAL": "^([1-5a-z]{12})$",
}
View Source
var EOS_DEFAULT_FEE *big.Int
View Source
var InitialCPU = int64(1000)
View Source
var InitialRam = uint32(5000)
View Source
var InitialStakeNet = int64(1000)
Functions ¶
func CheckRealEosAccount ¶
func CreateNewAccount ¶
func CreateNewAccount(creatorName, creatorActivePrivKey, accountName, ownerkey, activekey string, buyram uint32) (bool, error)
创建eos账户 需要一个creator账户, creator要有余额用于购买内存
func CreateRealEosAccount ¶
func DefaultDataDir ¶
func DefaultDataDir() string
DefaultDataDir is the default data directory to use for the databases and other persistence requirements.
func DelegateBW ¶
func DelegateBW(fromAcctName, fromActivePrivKey, receiverName string, stakeCPU, stakeNet int64, transfer bool) (bool, error)
预购cpu和net带宽, 用于帐号执行各种action
func EOSConfigInit ¶
func EOSConfigInit()
func GetAccountNameByPubKey ¶
func GetEosAccount ¶
func GetEosAccount() (acct, owner, active string)
func GetEosDbDir ¶
func GetEosDbDir() string
eos_init---> eos account key: crypto.Keccak256Hash([]byte("eossettings")) value: pubkey+eos account
func GetHeadBlockID ¶
func MakeSignedTransaction ¶
func MakeSignedTransaction(stx *eos.SignedTransaction, signature ecc.Signature) *eos.SignedTransaction
func PubKeyToHex ¶
func SubmitTransaction ¶
func SubmitTransaction(stx *eos.SignedTransaction) string
Types ¶
type AccountInfo ¶
type AccountInfo struct { AccountName string `json:"account_name"` RamQuato uint32 `json:"ram_quato"` NetWeight uint32 `json:"net_weight"` CpuWeight uint32 `json:"cpu_weight"` NetLimit Limit `json:"net_limit"` CpuLimit Limit `json:"cpu_limit"` RamUsage uint32 `json:"ram_usage"` Perms Permissions `json:"permissions"` Error map[string]interface{} `json:"error"` }
type EOSHandler ¶
type EOSHandler struct { }
func NewEOSHandler ¶
func NewEOSHandler() *EOSHandler
func (*EOSHandler) BuildUnsignedLockinTransaction ¶
func (h *EOSHandler) BuildUnsignedLockinTransaction(fromAddress, toUserKey, toAcctName string, amount *big.Int, jsonstring string) (transaction interface{}, digests []string, err error)
构造Lockin交易, 开发用
func (*EOSHandler) BuildUnsignedTransaction ¶
func (h *EOSHandler) BuildUnsignedTransaction(fromAddress, fromPublicKey, toAcctName string, amount *big.Int, jsonstring string, memo string) (transaction interface{}, digests []string, err error)
构造交易
func (*EOSHandler) FiltTransaction ¶
func (*EOSHandler) GetAddressBalance ¶
func (*EOSHandler) GetDefaultFee ¶
func (h *EOSHandler) GetDefaultFee() types.Value
func (*EOSHandler) GetTransactionInfo ¶
func (h *EOSHandler) GetTransactionInfo(txhash string) (*types.TransactionInfo, error)
func (h *EOSHandler) GetTransactionInfo(txhash string) (fromAddress string, txOutputs []types.TxOutput, jsonstring string, confirmed bool, fee types.Value, err error) {
func (*EOSHandler) IsToken ¶
func (h *EOSHandler) IsToken() bool
func (*EOSHandler) MakeSignedTransaction ¶
func (h *EOSHandler) MakeSignedTransaction(rsv []string, transaction interface{}) (signedTransaction interface{}, err error)
func (*EOSHandler) MakeSignedTransactionByJson ¶
func (h *EOSHandler) MakeSignedTransactionByJson(rsv []string, txjson string) (signedTransaction interface{}, err error)
func (*EOSHandler) PublicKeyToAddress ¶
func (h *EOSHandler) PublicKeyToAddress(pubKeyHex string) (acctName string, err error)
用一个大账户存钱,用交易备注区分用户,交易备注是公钥hash+base58
func (*EOSHandler) SignTransaction ¶
func (h *EOSHandler) SignTransaction(hash []string, privateKey interface{}) (rsv []string, err error)
func (*EOSHandler) SubmitTransaction ¶
func (h *EOSHandler) SubmitTransaction(signedTransaction interface{}) (txhash string, err error)
func (*EOSHandler) SubmitTransactionByJson ¶
func (h *EOSHandler) SubmitTransactionByJson(txjson string) (txhash string, err error)
type EOSTx ¶
type EOSTx struct { FromAddress string TxOutputs []EOSTxOutput Fee int64 Confirmed bool }
type EOSTxOutput ¶
func (*EOSTxOutput) ToTxOutput ¶
func (e *EOSTxOutput) ToTxOutput() *types.TxOutput
type Permission ¶
type Permissions ¶
type Permissions []Permission
func (Permissions) Len ¶
func (p Permissions) Len() int
func (Permissions) Less ¶
func (p Permissions) Less(i, j int) bool
func (Permissions) Swap ¶
func (p Permissions) Swap(i, j int)
type SubmitTxRes ¶
type SubmitTxRes struct { Transaction_id string `json:"transaction_id"` Error interface{} `json:"error,omitempty"` }
Click to show internal directories.
Click to hide internal directories.