Documentation
¶
Index ¶
- Constants
- Variables
- func CreateNewAccount(creatorName, creatorActivePrivKey, accountName, ownerkey, activekey string, ...) (bool, error)
- func DelegateBW(fromAcctName, fromActivePrivKey, receiverName string, stakeCPU, stakeNet int64, ...) (bool, error)
- func EOSConfigInit()
- func EOSInit()
- func EOS_newUnsignedTransaction(fromAcctName, toAcctName string, amount *big.Int, memo string) (string, *eos.SignedTransaction, error)
- func GenAccountName(pubKeyHex string) string
- func GetAccountNameByPubKey(pubKey string) ([]string, error)
- 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 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) GetAddressBalance(address string, jsonstring string) (balance types.Balance, err error)
- func (h *EOSHandler) GetDefaultFee() types.Value
- func (h *EOSHandler) GetTransactionInfo(txhash string) (fromAddress string, txOutputs []types.TxOutput, jsonstring string, ...)
- func (h *EOSHandler) IsToken() bool
- func (h *EOSHandler) MakeSignedTransaction(rsv []string, transaction interface{}) (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)
- type EOSTx
- type EOSTxOutput
- 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 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 CreateNewAccount ¶
func CreateNewAccount(creatorName, creatorActivePrivKey, accountName, ownerkey, activekey string, buyram uint32) (bool, error)
创建eos账户 需要一个creator账户, creator要有余额用于购买内存
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 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 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) (transaction interface{}, digests []string, err error)
构造交易
func (*EOSHandler) GetAddressBalance ¶
func (*EOSHandler) GetDefaultFee ¶
func (h *EOSHandler) GetDefaultFee() types.Value
func (*EOSHandler) GetTransactionInfo ¶
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) 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)
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 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.