Documentation ¶
Index ¶
- Constants
- Variables
- func AccountCreateFromSeed(mncode string) string
- func AccountCreateStr(password string) string
- func AccountRecoverStr(mncode, password string) string
- func AcutionAd(articleHash, privatekey, coinsType, coinAmount, qscchainid string) string
- func AddressStoreKey(addr Address) []byte
- func Advertisers(amount, privatekey, cointype, isDeposit, qscchainid string) string
- func AdvertisersFalse(privatekey, coinsType, coinAmount, qscchainid string) string
- func AdvertisersTrue(privatekey, coinsType, coinAmount, qscchainid string) string
- func AesDecrypt(keystring, cryptoText string) string
- func AesEncrypt(keystring, text string) string
- func BroadcastTransferTxToQSC(txb string, broadcastModes string) string
- func CommHandler(funcName, privatekey, argstr, qscchainid string) string
- func Extract(amount, privatekey, cointype, qscchainid string) string
- func GetTx(tx string) string
- func Int2Byte(in int64) []byte
- func JQInvestAd(QOSchainId, QSCchainId, articleHash, coins, privatekey string) string
- func LocalTxGen(fromStr, toStr, coinstr, chainid, privkey string, nonce int64) []byte
- func NewParseCoins(str string) (BigInt, QSCs, error)
- func PubAddrRetrievalStr(s string) string
- func QOSCommitResultCheck(txhash, height string) string
- func QOSQueryAccountGet(addr string) string
- func QSCCreateSignedTransfer(addrto, coinstr, privkey, chainid string) (string, error)
- func QSCKVStoreGetQuery(k string) string
- func QSCKVStoreSetPost(k, v, privkey, chain string) (result string)
- func QSCQueryAccountGet(addr string) string
- func QSCtransferSendStr(addrto, coinstr, privkey, chainid string) string
- func Query(path string, key common.HexBytes) (res []byte, err error)
- func RPCCQSCQueryAccountGet(addr string) string
- func RegisterAmino(cdc *amino.Codec)
- func RegisterCodec(cdc *amino.Codec)
- func SetBlockchainEntrance(qstarshost, qmoonhost string)
- func TransferRecordsQuery(chainid, addr, cointype, offset, limit string) string
- type AccountKeyOut
- type Address
- type AdvertisersTx
- type AuctionTx
- type BaseAccount
- type BaseCoin
- type BaseCoins
- type BigInt
- func (i BigInt) Add(i2 BigInt) (res BigInt)
- func (i BigInt) Int64() int64
- func (bi BigInt) IsNil() bool
- func (i BigInt) MarshalAmino() (string, error)
- func (i BigInt) MarshalJSON() ([]byte, error)
- func (i BigInt) NilToZero() BigInt
- func (i BigInt) String() string
- func (i *BigInt) UnmarshalAmino(text string) error
- func (i *BigInt) UnmarshalJSON(bz []byte) error
- type Codec
- type Coin
- type Coins
- type CoinsTx
- type ExtractTx
- type ITx
- type Int
- type InvestTx
- type JianQianTx
- type PrivkeyAmino
- type PubAddrRetrieval
- type PubkeyAmino
- type QOSAccount
- type QSC
- type QSCs
- type ResultCreateAccount
- type ResultInvest
- type Signature
- type TransItem
- type TransItems
- type TxStd
- type TxTransfer
Constants ¶
const ( // Bech32 prefixes //Bech32PrefixAccPub = "cosmosaccpub" AccountResultType = "local" DenomQOS = "qos" PREF_ADD = "address" )
const ( AccountMapperName = "acc" // 用户获取账户存储的store的键名 MaxGas = 20000 )
const ( ResultCodeSuccess = "0" ResultCodeQstarsTimeout = "-2" ResultCodeQOSTimeout = "-1" ResultCodeInternalError = "500" )
Variables ¶
var ( Shost string Mhost string QSCAccounturl string QOSAccounturl string Accounturl string KVurl string QResulturl string TRurl string RPC rpcclient.Client )
IP initialization
Functions ¶
func AccountCreateFromSeed ¶
add new function for Account Creation with seed input
func AccountCreateStr ¶
convert the output to json string format
func AccountRecoverStr ¶
func AcutionAd ¶
AcutionAd 竞拍广告 articleHash //广告位标识 privatekey //用户私钥 coinsType //竞拍币种 coinAmount //竞拍数量 qscchainid //chainid
func Advertisers ¶
广告商押金或赎回
func AdvertisersFalse ¶
AdvertisersFalse 成为非广告商 赎回押金 privatekey //用户私钥 coinsType //押金币种 coinAmount //押金数量 qscchainid //chainid
func AdvertisersTrue ¶
AdvertisersTrue 成为广告商 privatekey //用户私钥 coinsType //押金币种 coinAmount //押金数量 qscchainid //chainid
func AesDecrypt ¶
func AesEncrypt ¶
func BroadcastTransferTxToQSC ¶
BroadcastTransferTxToQSC 提交到联盟链上
func CommHandler ¶
func JQInvestAd ¶
func LocalTxGen ¶
Local Tx generation
func NewParseCoins ¶
NewParseCoins Parse QOS and QSCs from string str example : 100qos,100qstar
func PubAddrRetrievalStr ¶
func QOSCommitResultCheck ¶
QOSCommitResultCheck for QOSCommitResultCheck Restful interface
func QOSQueryAccountGet ¶
QOSQueryAccountGet for QOS account query function
func QSCCreateSignedTransfer ¶
func QSCKVStoreGetQuery ¶
func QSCKVStoreSetPost ¶
func QSCQueryAccountGet ¶
func QSCtransferSendStr ¶
QSCtransferSendStr only need the following arguments, it`s enough!
func RPCCQSCQueryAccountGet ¶
func RegisterAmino ¶
func RegisterAmino(cdc *amino.Codec)
RegisterAmino registers all crypto related types in the given (amino) codec.
func RegisterCodec ¶
func RegisterCodec(cdc *amino.Codec)
func SetBlockchainEntrance ¶
func SetBlockchainEntrance(qstarshost, qmoonhost string)
SetBlockchainEntrance set Block Chain entrance hosts for both Qstars and Qmoon
func TransferRecordsQuery ¶
Types ¶
type AccountKeyOut ¶
type AccountKeyOut struct { PubKey string `json:"pubKey"` PrivKey string `json:"privKey"` Addr string `json:"addr"` Mnemonic string `json:"mnemonic"` Type string `json:"type"` Denom string `json:"denom"` }
new account result with field of Denom
type Address ¶
type Address []byte
func (Address) MarshalJSON ¶
func (*Address) UnmarshalJSON ¶
UnmarshalJSON 将Bech32编码的地址Json进行UnMarshal
type AdvertisersTx ¶
type AdvertisersTx struct {
Tx *CoinsTx
}
func (AdvertisersTx) GetSignData ¶
func (tx AdvertisersTx) GetSignData() (ret []byte)
type AuctionTx ¶
type AuctionTx struct { ArticleHash string // 文章hash Address Address //qos地址 CoinsType string //币种 CoinAmount BigInt //数量 Gas BigInt }
func (AuctionTx) GetSignData ¶
type BaseAccount ¶
type BaseAccount struct { AccountAddress Address `json:"account_address"` // account address Publickey ed25519local.PubKey `json:"public_key"` // public key Nonce int64 `json:"nonce"` // identifies tx_status of an account }
type BigInt ¶
type BigInt struct {
// contains filtered or unexported fields
}
func (BigInt) MarshalAmino ¶
MarshalAmino defines custom encoding scheme
func (BigInt) MarshalJSON ¶
MarshalJSON defines custom encoding scheme
func (*BigInt) UnmarshalAmino ¶
UnmarshalAmino defines custom decoding scheme
func (*BigInt) UnmarshalJSON ¶
UnmarshalJSON defines custom decoding scheme
type Int ¶
type Int struct {
// contains filtered or unexported fields
}
type InvestTx ¶
type InvestTx struct { Address Address `json:"address"` // 投资者地址 Invest BigInt `json:"investad"` // 投资金额 ArticleHash []byte `json:"articleHash"` // 文章hash Gas BigInt // contains filtered or unexported fields }
func (InvestTx) GetSignData ¶
type JianQianTx ¶
type JianQianTx struct { FuncName string //方法名 路由用 Address []Address //签名者地址 Args []string //参数列表 Gas BigInt }
func (JianQianTx) GetSignData ¶
func (it JianQianTx) GetSignData() (ret []byte)
type PrivkeyAmino ¶
type PubAddrRetrieval ¶
type PubkeyAmino ¶
type QOSAccount ¶
type QOSAccount struct { BaseAccount `json:"base_account"` QOS BigInt `json:"qos"` // coins in public chain QSCs QSCs `json:"qscs"` // varied QSCs }
func RpcQueryAccount ¶
func RpcQueryAccount(addr Address) (*QOSAccount, error)
type ResultCreateAccount ¶
type ResultCreateAccount struct { PubKey string `json:"pubKey"` PrivKey string `json:"privKey"` Addr string `json:"addr"` Mnemonic string `json:"mnemonic"` Type string `json:"type"` Denom string `json:"denom"` }
func AccountCreate ¶
func AccountCreate(password string) *ResultCreateAccount
type ResultInvest ¶
type ResultInvest struct { Code string `json:"code"` Height int64 `json:"height"` Hash string `json:"hash,omitempty"` Reason string `json:"reason,omitempty"` Result json.RawMessage `json:"result,omitempty"` }
func InternalError ¶
func InternalError(reason string) ResultInvest
func NewErrorResult ¶
func NewErrorResult(code string, height int64, hash string, reason string) ResultInvest
func (ResultInvest) Marshal ¶
func (ri ResultInvest) Marshal() string
type Signature ¶
type Signature struct { Pubkey ed25519local.PubKey `json:"pubkey"` //可选 Signature []byte `json:"signature"` //签名内容 Nonce int64 `json:"nonce"` //nonce的值 }
type TransItems ¶
type TransItems []TransItem
func ParseTransItem ¶
func ParseTransItem(str string) (TransItems, error)
ParseTransItem Parse flags from string, Senders, eg: Arya,10qos,100qstar. multiple users separated by ';'
type TxStd ¶
type TxStd struct { ITx ITx `json:"itx"` //ITx接口,将被具体Tx结构实例化 Signature []Signature `json:"sigature"` //签名数组 ChainID string `json:"chainid"` //ChainID: 执行ITx.exec方法的链ID MaxGas BigInt `json:"maxgas"` //Gas消耗的最大值 }
func (*TxStd) BuildSignatureBytes ¶
func (*TxStd) GetSignData ¶
type TxTransfer ¶
type TxTransfer struct { Senders TransItems `json:"senders"` // 发送集合 Receivers TransItems `json:"receivers"` // 接收集合 }