qlcchain

package module
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2021 License: MIT Imports: 16 Imported by: 8

README

QLC Chain Golang SDK

Actions Status codecov GoDoc

QLC Chain Golang API

Example

func main() {
    //client, err := qlcchain.NewQLCClient("http://127.0.0.1:19735")
    client, err := qlcchain.NewQLCClient("ws://127.0.0.1:19736")
    if err != nil || client == nil {
        fmt.Println(err)
        return
    }

    addr, err := client.Ledger.Accounts(20, 0)
    if err != nil {
        fmt.Println(err)
        return
    }

    for idx, val := range addr {
        fmt.Println(idx, "==>", val.String())
    }

    fmt.Println(client.Version())

    // Output:
    // 0 ==> qlc_13117gep55b5xpa7nbaz71s1ykz36bfqc6bieyzycif3ceykg4dtsmo19867
    // 1 ==> qlc_14hshh15cduhhgcus9oqcbptw1qa3iwma4nujow3cuow5ni4df16gtirkb35
    // 2 ==> qlc_18mbwzt7kjks1ydzk53hw6xropyz3mb4dgwq75tyzy4pcuc4mso1635mfdfz
    // 3 ==> qlc_1b1dm6g17a5xrb8wtkas6pn4xz4m6uiq4nahxckhrob876t4oh8scawbhx8s
    // 4 ==> qlc_1dzyqpd7h8ag9mamthxq695s38f71i8icjm6yn7y98rinasukhcb9tkbaqx9
    // 5 ==> qlc_1gnggt8b6cwro3b4z9gootipykqd6x5gucfd7exsi4xqkryiijciegfhon4u
    // 6 ==> qlc_1kk5xst583y8hpn9c48ruizs5cxprdeptw6s5wm6ezz6i1h5srpz3mnjgxao
    // 7 ==> qlc_1mnw9gbzdaxz7sz18pyjcffiqaocxnunfdtu1u3fc4wjkib97rp1wcdw6ato
    // 8 ==> qlc_1p11fp649uuan5ib9rpprd1dad3ue9qcqban1y8kwagdu56eea44nhq8do8o
    // 9 ==> qlc_1pr8ojutnibmj4ej5aptng546hnqc4webd89tb4b31jz4tyqqots5ne6p553
    // 10 ==> qlc_1s6rb1wr74r747b8k6wx6m8swgppef46ccnixy1zgtejhfosxaro15x1s8ab
    // 11 ==> qlc_1u1d7mgo8hq5nad8jwesw6azfk53a31ge5minwxdfk8t1fqknypqgk8mi3z7
    // 12 ==> qlc_1wyei6waj76k4b38prdubc19sr8dync5pz996cwufiy8ksxz6oshudred7q6
    // 13 ==> qlc_1zbo3axuh166w4tno77hqye3n1nx5kehzhn8z71xixig7b5ggfxfyfi7f3er
    // 14 ==> qlc_34yujh9i5kewnoqjs1s1fyj67u5tkifew4bc1gec4ftwktwgzbhkpjc7t4ge
    // 15 ==> qlc_35ejpaokgu514segi1frsiekhpepbznhybe737qq1peczn4yb9hyic9uipbe
    // 16 ==> qlc_361j3uiqdkjrzirttrpu9pn7eeussymty4rz4gifs9ijdx1p46xnpu3je7sy
    // 17 ==> qlc_38um9p7z54koeu84cqsgmtjhdnf99jrkyzmh1rnky98wmt46ogboedahnsda
    // 18 ==> qlc_3947hepb6ipq1m8b1jdbi6h7te3epqiakeb1j59ppwmi7wnj5optopsdgo5g
    // 19 ==> qlc_39grwmri6nwwdfyjqpyumexm4px758ssg7njonfk8qqaxyrhn6kqjocn8scy
}

License

MIT Copyright (c) 2019 QLC Chain

Documentation

Index

Constants

View Source
const BUILDTIME = "2019-06-18_19:44:24"
View Source
const GITREV = "9436e5b"
View Source
const VERSION = "1.0.0"

Variables

This section is empty.

Functions

func AssetStatusNames added in v1.3.5

func AssetStatusNames() []string

AssetStatusNames returns a list of possible string values of AssetStatus.

func ContractStatusNames added in v1.3.5

func ContractStatusNames() []string

ContractStatusNames returns a list of possible string values of ContractStatus.

func DLRStatusNames added in v1.3.5

func DLRStatusNames() []string

DLRStatusNames returns a list of possible string values of DLRStatus.

func DoDSettleBillingTypeNames added in v1.4.0

func DoDSettleBillingTypeNames() []string

DoDSettleBillingTypeNames returns a list of possible string values of DoDSettleBillingType.

func DoDSettleBillingUnitNames added in v1.4.0

func DoDSettleBillingUnitNames() []string

DoDSettleBillingUnitNames returns a list of possible string values of DoDSettleBillingUnit.

func DoDSettleContractStateNames added in v1.4.0

func DoDSettleContractStateNames() []string

DoDSettleContractStateNames returns a list of possible string values of DoDSettleContractState.

func DoDSettleOrderStateNames added in v1.4.0

func DoDSettleOrderStateNames() []string

DoDSettleOrderStateNames returns a list of possible string values of DoDSettleOrderState.

func DoDSettleOrderTypeNames added in v1.4.0

func DoDSettleOrderTypeNames() []string

DoDSettleOrderTypeNames returns a list of possible string values of DoDSettleOrderType.

func DoDSettlePaymentTypeNames added in v1.4.0

func DoDSettlePaymentTypeNames() []string

DoDSettlePaymentTypeNames returns a list of possible string values of DoDSettlePaymentType.

func DoDSettleResponseActionNames added in v1.4.0

func DoDSettleResponseActionNames() []string

DoDSettleResponseActionNames returns a list of possible string values of DoDSettleResponseAction.

func DoDSettleServiceClassNames added in v1.4.0

func DoDSettleServiceClassNames() []string

DoDSettleServiceClassNames returns a list of possible string values of DoDSettleServiceClass.

func SLATypeNames added in v1.3.5

func SLATypeNames() []string

SLATypeNames returns a list of possible string values of SLAType.

func SendingStatusNames added in v1.3.5

func SendingStatusNames() []string

SendingStatusNames returns a list of possible string values of SendingStatus.

func SettlementStatusNames added in v1.3.5

func SettlementStatusNames() []string

SettlementStatusNames returns a list of possible string values of SettlementStatus.

func SignatureFunc added in v1.2.4

func SignatureFunc(account *types.Account, hash types.Hash) (types.Signature, error)

Types

type APIAccount added in v1.2.4

type APIAccount struct {
	Address        types.Address   `json:"account"`
	CoinBalance    *types.Balance  `json:"coinBalance,omitempty"`
	CoinVote       *types.Balance  `json:"vote,omitempty"`
	CoinNetwork    *types.Balance  `json:"network,omitempty"`
	CoinStorage    *types.Balance  `json:"storage,omitempty"`
	CoinOracle     *types.Balance  `json:"oracle,omitempty"`
	Representative *types.Address  `json:"representative,omitempty"`
	Tokens         []*APITokenMeta `json:"tokens"`
}

type APIAccountBalance added in v1.2.4

type APIAccountBalance struct {
	Address types.Address `json:"address"`
	Balance types.Balance `json:"balance"`
}

type APIAccountsBalance added in v1.2.4

type APIAccountsBalance struct {
	Balance types.Balance  `json:"balance"`
	Vote    *types.Balance `json:"vote,omitempty"`
	Network *types.Balance `json:"network,omitempty"`
	Storage *types.Balance `json:"storage,omitempty"`
	Oracle  *types.Balance `json:"oracle,omitempty"`
	Pending types.Balance  `json:"pending"`
}

type APIAsset added in v1.3.5

type APIAsset struct {
	Asset
	AssetID types.Hash `json:"assetID"`
}

type APIBalance added in v1.2.4

type APIBalance struct {
	*big.Float
}

func (*APIBalance) MarshalText added in v1.2.4

func (b *APIBalance) MarshalText() ([]byte, error)

func (*APIBalance) String added in v1.2.4

func (b *APIBalance) String() string

type APIBlock added in v1.2.4

type APIBlock struct {
	*types.StateBlock
	TokenName string        `json:"tokenName"`
	Amount    types.Balance `json:"amount"`
	Hash      types.Hash    `json:"hash"`

	PovConfirmHeight uint64 `json:"povConfirmHeight"`
	PovConfirmCount  uint64 `json:"povConfirmCount"`
}

type APIDestroyInfo added in v1.3.0

type APIDestroyInfo struct {
	Owner     types.Address `json:"owner"`
	Previous  types.Hash    `json:"previous"`
	Token     types.Hash    `json:"token"`
	Amount    *big.Int      `json:"amount"`
	TimeStamp int64         `json:"timestamp"`
}

type APIDestroyParam added in v1.3.0

type APIDestroyParam struct {
	Owner    types.Address   `json:"owner"`
	Previous types.Hash      `json:"previous"`
	Token    types.Hash      `json:"token"`
	Amount   *big.Int        `json:"amount"`
	Sign     types.Signature `json:"signature"`
}

func (*APIDestroyParam) Signature added in v1.3.0

func (param *APIDestroyParam) Signature(acc *types.Account) (types.Signature, error)

func (*APIDestroyParam) Verify added in v1.3.0

func (param *APIDestroyParam) Verify(c *rpc.Client) (bool, error)

Verify destroy params

type APIPending added in v1.2.4

type APIPending struct {
	*types.PendingKey
	*types.PendingInfo
	TokenName string          `json:"tokenName"`
	Timestamp int64           `json:"timestamp"`
	BlockType types.BlockType `json:"blockType"`
}

type APIRepresentative added in v1.2.4

type APIRepresentative struct {
	Address types.Address `json:"address"`
	Balance types.Balance `json:"balance"`
	Vote    types.Balance `json:"vote"`
	Network types.Balance `json:"network"`
	Storage types.Balance `json:"storage"`
	Oracle  types.Balance `json:"oracle"`
	Total   types.Balance `json:"total"`
}

type APISendBlockPara added in v1.2.4

type APISendBlockPara struct {
	From      types.Address `json:"from"`
	TokenName string        `json:"tokenName"`
	To        types.Address `json:"to"`
	Amount    types.Balance `json:"amount"`
	Sender    string        `json:"sender"`
	Receiver  string        `json:"receiver"`
	Message   types.Hash    `json:"message"`
}

type APITokenMeta added in v1.2.4

type APITokenMeta struct {
	*types.TokenMeta
	TokenName string        `json:"tokenName"`
	Pending   types.Balance `json:"pending"`
}

type AccountApi added in v1.2.4

type AccountApi struct {
	// contains filtered or unexported fields
}

func NewAccountAPI added in v1.3.0

func NewAccountAPI(c *QLCClient) *AccountApi

NewAccountAPI creates account module for client

func (*AccountApi) Create added in v1.2.4

func (a *AccountApi) Create(seedStr string, index uint32) (map[string]string, error)

Create gets account by index from seed

func (*AccountApi) ForPublicKey added in v1.2.4

func (a *AccountApi) ForPublicKey(pubStr string) (types.Address, error)

ForPublicKey returns address for public key

func (*AccountApi) NewSeed added in v1.2.4

func (a *AccountApi) NewSeed() (string, error)

NewSeed generates new seed

func (*AccountApi) PublicKey added in v1.2.4

func (a *AccountApi) PublicKey(addr types.Address) string

PublicKey returns public key for address

func (*AccountApi) Validate added in v1.2.4

func (a *AccountApi) Validate(addr string) bool

Validate accepts a address string and checks if it's valid.

type ApiTokenInfo added in v1.2.4

type ApiTokenInfo struct {
	types.TokenInfo
}

type Asset added in v1.3.5

type Asset struct {
	Mcc         uint64 `json:"mcc"`
	Mnc         uint64 `json:"mnc"`
	TotalAmount uint64 `json:"totalAmount"`
	SLAs        []*SLA `json:"sla,omitempty"`
}

type AssetParam added in v1.3.5

type AssetParam struct {
	Owner     Contractor    `json:"owner"`
	Assets    []*APIAsset   `json:"assets"`
	SignDate  int64         `json:"signDate"`
	StartDate int64         `json:"startDate"`
	EndDate   int64         `json:"endDate"`
	Status    AssetStatus   `json:"status"`
	Address   types.Address `json:"address"`
}

type AssetStatus added in v1.3.5

type AssetStatus int
const (
	// AssetStatusDeactivated is a AssetStatus of type Deactivated
	AssetStatusDeactivated AssetStatus = iota
	// AssetStatusActivated is a AssetStatus of type Activated
	AssetStatusActivated
)

func ParseAssetStatus added in v1.3.5

func ParseAssetStatus(name string) (AssetStatus, error)

ParseAssetStatus attempts to convert a string to a AssetStatus

func (AssetStatus) MarshalText added in v1.3.5

func (x AssetStatus) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (AssetStatus) String added in v1.3.5

func (x AssetStatus) String() string

String implements the Stringer interface.

func (*AssetStatus) UnmarshalText added in v1.3.5

func (x *AssetStatus) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type BlockSubscription added in v1.3.1

type BlockSubscription struct {
	// contains filtered or unexported fields
}

type CDRParam added in v1.3.5

type CDRParam struct {
	Index         uint64        `json:"index" validate:"min=1"`
	SmsDt         int64         `json:"smsDt" validate:"min=1"`
	Account       string        `json:"account"`
	Sender        string        `json:"sender" validate:"nonzero"`
	Customer      string        `json:"customer"`
	Destination   string        `json:"destination" validate:"nonzero"`
	SendingStatus SendingStatus `json:"sendingStatus" `
	DlrStatus     DLRStatus     `json:"dlrStatus"`
	PreStop       string        `json:"preStop" `
	NextStop      string        `json:"nextStop" `
}

func (*CDRParam) ToHash added in v1.3.5

func (z *CDRParam) ToHash() (types.Hash, error)

type CDRStatus added in v1.3.5

type CDRStatus struct {
	Address *types.Address        `json:"contractAddress"`
	Params  map[string][]CDRParam `json:"params"`
	Status  SettlementStatus      `json:"status"`
}

type CompareRecord added in v1.3.5

type CompareRecord struct {
	PartyA MatchingRecord `json:"partyA"`
	PartyB MatchingRecord `json:"partyB"`
}

type Compensation added in v1.3.5

type Compensation struct {
	Low  float32 `msg:"l" json:"low"`
	High float32 `msg:"h" json:"high"`
	Rate float32 `msg:"r" json:"rate"`
}

type ContractApi added in v1.2.4

type ContractApi struct {
	// contains filtered or unexported fields
}

func NewContractAPI added in v1.3.0

func NewContractAPI(c *QLCClient) *ContractApi

NewContractAPI creates contract module for client

func (*ContractApi) ContractAddressList added in v1.3.0

func (c *ContractApi) ContractAddressList() []types.Address

ContractAddressList return all contract addresses

func (*ContractApi) GenerateRewardBlock added in v1.4.0

func (c *ContractApi) GenerateRewardBlock(para *ContractRewardBlockPara) (*types.StateBlock, error)

GenerateRewardBlock return new generated ContractReward block

func (*ContractApi) GenerateSendBlock added in v1.4.0

func (c *ContractApi) GenerateSendBlock(para *ContractSendBlockPara) (*types.StateBlock, error)

GenerateSendBlock return new generated ContractSend block

func (*ContractApi) GetAbiByContractAddress added in v1.3.0

func (c *ContractApi) GetAbiByContractAddress(address types.Address) (string, error)

GetAbiByContractAddress return contract abi by contract address

func (*ContractApi) PackChainContractData added in v1.4.0

func (c *ContractApi) PackChainContractData(contractAddress types.Address, methodName string, params []string) ([]byte, error)

PackChainContractData pack the given method name to conform the ABI for chain contract.

func (*ContractApi) PackContractData added in v1.2.4

func (c *ContractApi) PackContractData(abiStr string, methodName string, params []string) ([]byte, error)

PackContractData parse a ABI interface and pack the given method name to conform the ABI.

type ContractPrivacyParam added in v1.4.0

type ContractPrivacyParam struct {
	PrivateFrom    string   `json:"privateFrom"`
	PrivateFor     []string `json:"privateFor"`
	PrivateGroupID string   `json:"privateGroupID"`
}

type ContractRewardBlockPara added in v1.4.0

type ContractRewardBlockPara struct {
	SendHash types.Hash `json:"sendHash"`
}

type ContractSendBlockPara added in v1.4.0

type ContractSendBlockPara struct {
	Address   types.Address `json:"address"`
	TokenName string        `json:"tokenName"`
	To        types.Address `json:"to"`
	Amount    types.Balance `json:"amount"`
	Data      []byte        `json:"data"`

	PrivateFrom    string   `json:"privateFrom,omitempty"`
	PrivateFor     []string `json:"privateFor,omitempty"`
	PrivateGroupID string   `json:"privateGroupID,omitempty"`
	EnclaveKey     []byte   `json:"enclaveKey,omitempty"`
}

type ContractService added in v1.3.5

type ContractService struct {
	ServiceId   string  `json:"serviceId" validate:"nonzero"`
	Mcc         uint64  `json:"mcc"`
	Mnc         uint64  `json:"mnc"`
	TotalAmount uint64  `json:"totalAmount" validate:"min=1"`
	UnitPrice   float64 `son:"unitPrice" validate:"nonzero"`
	Currency    string  `json:"currency" validate:"nonzero"`
}

type ContractStatus added in v1.3.5

type ContractStatus int
const (
	// ContractStatusActiveStage1 is a ContractStatus of type ActiveStage1
	ContractStatusActiveStage1 ContractStatus = iota
	// ContractStatusActivated is a ContractStatus of type Activated
	ContractStatusActivated
	// ContractStatusDestroyStage1 is a ContractStatus of type DestroyStage1
	ContractStatusDestroyStage1
	// ContractStatusDestroyed is a ContractStatus of type Destroyed
	ContractStatusDestroyed
	// ContractStatusRejected is a ContractStatus of type Rejected
	ContractStatusRejected
)

func ParseContractStatus added in v1.3.5

func ParseContractStatus(name string) (ContractStatus, error)

ParseContractStatus attempts to convert a string to a ContractStatus

func (ContractStatus) MarshalText added in v1.3.5

func (x ContractStatus) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (ContractStatus) String added in v1.3.5

func (x ContractStatus) String() string

String implements the Stringer interface.

func (*ContractStatus) UnmarshalText added in v1.3.5

func (x *ContractStatus) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type Contractor added in v1.3.5

type Contractor struct {
	Address types.Address `json:"address"`
	Name    string        `json:"name"`
}

type CreateContractParam added in v1.3.5

type CreateContractParam struct {
	PartyA    Contractor        `json:"partyA"`
	PartyB    Contractor        `json:"partyB"`
	Services  []ContractService `json:"services"`
	StartDate int64             `json:"startDate"`
	EndDate   int64             `json:"endDate"`
}

type DLRStatus added in v1.3.5

type DLRStatus int
const (
	// DLRStatusDelivered is a DLRStatus of type Delivered
	DLRStatusDelivered DLRStatus = iota
	// DLRStatusRejected is a DLRStatus of type Rejected
	DLRStatusRejected
	// DLRStatusUnknown is a DLRStatus of type Unknown
	DLRStatusUnknown
	// DLRStatusUndelivered is a DLRStatus of type Undelivered
	DLRStatusUndelivered
	// DLRStatusEmpty is a DLRStatus of type Empty
	DLRStatusEmpty
)

func ParseDLRStatus added in v1.3.5

func ParseDLRStatus(name string) (DLRStatus, error)

ParseDLRStatus attempts to convert a string to a DLRStatus

func (DLRStatus) MarshalText added in v1.3.5

func (x DLRStatus) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (DLRStatus) String added in v1.3.5

func (x DLRStatus) String() string

String implements the Stringer interface.

func (*DLRStatus) UnmarshalText added in v1.3.5

func (x *DLRStatus) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type DebugApi added in v1.3.0

type DebugApi struct {
	// contains filtered or unexported fields
}

func NewDebugAPI added in v1.3.0

func NewDebugAPI(c *QLCClient) *DebugApi

func (*DebugApi) BlockCacheCount added in v1.3.0

func (l *DebugApi) BlockCacheCount() (map[string]uint64, error)
func (l *DebugApi) BlockLink(hash types.Hash) (map[string]types.Hash, error)

type DestroyApi added in v1.3.0

type DestroyApi struct {
	// contains filtered or unexported fields
}

func NewDestroyAPI added in v1.3.0

func NewDestroyAPI(c *QLCClient) *DestroyApi

NewDestroyAPI creates destroy module for client

func (*DestroyApi) GetDestroyInfoDetail added in v1.3.0

func (b *DestroyApi) GetDestroyInfoDetail(addr *types.Address) ([]*APIDestroyInfo, error)

GetDestroyInfoDetail returns detail info of qgas destroyed

func (*DestroyApi) GetRewardsBlock added in v1.3.0

func (b *DestroyApi) GetRewardsBlock(send *types.Hash) (*types.StateBlock, error)

GetRewardBlock returns contract reward block by destory contract send

func (*DestroyApi) GetSendBlock added in v1.3.0

func (b *DestroyApi) GetSendBlock(param *APIDestroyParam, sign SignatureParam) (*types.StateBlock, error)

GetSendBlock returns destory contract send block by destory parameters

func (*DestroyApi) GetTotalDestroyInfo added in v1.3.0

func (b *DestroyApi) GetTotalDestroyInfo(addr *types.Address) (types.Balance, error)

GetTotalDestroyInfo returns total amount of qgas destroyed

type DoDAccount added in v1.4.0

type DoDAccount struct {
	Account     types.Address `msg:"-" json:"account"`
	AccountName string        `msg:"-" json:"accountName"`
	AccountInfo string        `msg:"ai" json:"accountInfo"`
	AccountType string        `msg:"at" json:"accountType"`
	UUID        string        `msg:"uu" json:"uuid"`
	Connections []string      `msg:"cs" json:"connections"`
}

type DoDBillingAPI added in v1.4.0

type DoDBillingAPI struct {
	// contains filtered or unexported fields
}

func NewDoDBillingApi added in v1.4.0

func NewDoDBillingApi(c *QLCClient) *DoDBillingAPI

func (*DoDBillingAPI) GetDodBillingSetAccountBlock added in v1.4.0

func (s *DoDBillingAPI) GetDodBillingSetAccountBlock(param *DoDAccount, sign Signature) (*types.StateBlock, error)

func (*DoDBillingAPI) GetDodBillingSetServiceBlock added in v1.4.0

func (s *DoDBillingAPI) GetDodBillingSetServiceBlock(param *DoDAccount, sign Signature) (*types.StateBlock, error)

type DoDConnection added in v1.4.0

type DoDConnection struct {
	Account         types.Address `json:"account"`
	AccountName     string        `json:"accountName"`
	ConnectionID    string        `json:"connectionID"`
	ServiceType     string        `json:"serviceType"`
	ChargeType      string        `json:"chargeType"`
	PaidRule        string        `json:"paidRule"`
	BuyMode         string        `json:"buyMode"`
	Location        string        `json:"location"`
	StartTime       uint64        `json:"startTime"`
	EndTime         uint64        `json:"endTime"`
	Price           float64       `json:"price"`
	Unit            string        `json:"unit"`
	Currency        string        `json:"currency"`
	Balance         float64       `json:"balance"`
	TempStartTime   uint64        `json:"tempStartTime"`
	TempEndTime     uint64        `json:"tempEndTime"`
	TempPrice       float64       `json:"tempPrice"`
	TempBandwidth   string        `json:"tempBandwidth"`
	Bandwidth       string        `json:"bandwidth"`
	Quota           float64       `json:"quota"`
	UsageLimitation float64       `json:"usageLimitation"`
	MinBandwidth    string        `json:"minBandwidth"`
	ExpireTime      uint64        `json:"expireTime"`
}

need to split the params according to different services

type DoDPendingRequestRsp added in v1.4.0

type DoDPendingRequestRsp struct {
	Hash  types.Hash          `json:"hash"`
	Order *DoDSettleOrderInfo `json:"order"`
}

type DoDPendingResourceCheckInfo added in v1.4.0

type DoDPendingResourceCheckInfo struct {
	SendHash   types.Hash              `json:"sendHash"`
	OrderId    string                  `json:"orderId"`
	InternalId types.Hash              `json:"internalId"`
	Products   []*DoDSettleProductInfo `json:"products"`
}

type DoDPlacingOrderInfo added in v1.4.0

type DoDPlacingOrderInfo struct {
	InternalId types.Hash          `json:"internalId"`
	OrderInfo  *DoDSettleOrderInfo `json:"orderInfo"`
}

type DoDPlacingOrderResp added in v1.4.0

type DoDPlacingOrderResp struct {
	TotalOrders int                    `json:"totalOrders"`
	OrderList   []*DoDPlacingOrderInfo `json:"orderList"`
}

type DoDSettleBillingType added in v1.4.0

type DoDSettleBillingType int

ENUM( null PAYG DOD )

const (
	// DoDSettleBillingTypeNull is a DoDSettleBillingType of type Null
	DoDSettleBillingTypeNull DoDSettleBillingType = iota
	// DoDSettleBillingTypePAYG is a DoDSettleBillingType of type PAYG
	DoDSettleBillingTypePAYG
	// DoDSettleBillingTypeDOD is a DoDSettleBillingType of type DOD
	DoDSettleBillingTypeDOD
)

func ParseDoDSettleBillingType added in v1.4.0

func ParseDoDSettleBillingType(name string) (DoDSettleBillingType, error)

ParseDoDSettleBillingType attempts to convert a string to a DoDSettleBillingType

func (DoDSettleBillingType) MarshalText added in v1.4.0

func (x DoDSettleBillingType) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (DoDSettleBillingType) String added in v1.4.0

func (x DoDSettleBillingType) String() string

String implements the Stringer interface.

func (*DoDSettleBillingType) UnmarshalText added in v1.4.0

func (x *DoDSettleBillingType) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type DoDSettleBillingUnit added in v1.4.0

type DoDSettleBillingUnit int

ENUM( null year month week day hour minute second )

const (
	// DoDSettleBillingUnitNull is a DoDSettleBillingUnit of type Null
	DoDSettleBillingUnitNull DoDSettleBillingUnit = iota
	// DoDSettleBillingUnitYear is a DoDSettleBillingUnit of type Year
	DoDSettleBillingUnitYear
	// DoDSettleBillingUnitMonth is a DoDSettleBillingUnit of type Month
	DoDSettleBillingUnitMonth
	// DoDSettleBillingUnitWeek is a DoDSettleBillingUnit of type Week
	DoDSettleBillingUnitWeek
	// DoDSettleBillingUnitDay is a DoDSettleBillingUnit of type Day
	DoDSettleBillingUnitDay
	// DoDSettleBillingUnitHour is a DoDSettleBillingUnit of type Hour
	DoDSettleBillingUnitHour
	// DoDSettleBillingUnitMinute is a DoDSettleBillingUnit of type Minute
	DoDSettleBillingUnitMinute
	// DoDSettleBillingUnitSecond is a DoDSettleBillingUnit of type Second
	DoDSettleBillingUnitSecond
)

func ParseDoDSettleBillingUnit added in v1.4.0

func ParseDoDSettleBillingUnit(name string) (DoDSettleBillingUnit, error)

ParseDoDSettleBillingUnit attempts to convert a string to a DoDSettleBillingUnit

func (DoDSettleBillingUnit) MarshalText added in v1.4.0

func (x DoDSettleBillingUnit) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (DoDSettleBillingUnit) String added in v1.4.0

func (x DoDSettleBillingUnit) String() string

String implements the Stringer interface.

func (*DoDSettleBillingUnit) UnmarshalText added in v1.4.0

func (x *DoDSettleBillingUnit) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type DoDSettleBuyerInvoice added in v1.4.0

type DoDSettleBuyerInvoice struct {
	OrderCount           int                            `json:"orderCount"`
	TotalConnectionCount int                            `json:"totalConnectionCount"`
	TotalAmount          float64                        `json:"totalAmount"`
	Currency             string                         `json:"currency"`
	StartTime            int64                          `json:"startTime"`
	EndTime              int64                          `json:"endTime"`
	Buyer                *DoDSettleUser                 `json:"buyer"`
	Seller               *DoDSettleUser                 `json:"seller"`
	Orders               []*DoDSettleInvoiceOrderDetail `json:"orders"`
}

type DoDSettleChangeConnectionParam added in v1.4.0

type DoDSettleChangeConnectionParam struct {
	ProductId string `json:"productId" msg:"p"`
	DoDSettleConnectionDynamicParam
}

type DoDSettleChangeOrderParam added in v1.4.0

type DoDSettleChangeOrderParam struct {
	ContractPrivacyParam
	Buyer       *DoDSettleUser                    `json:"buyer" msg:"b"`
	Seller      *DoDSettleUser                    `json:"seller" msg:"s"`
	Connections []*DoDSettleChangeConnectionParam `json:"connections" msg:"c"`
}

type DoDSettleConnectionDynamicParam added in v1.4.0

type DoDSettleConnectionDynamicParam struct {
	OrderId        string                `json:"orderId,omitempty" msg:"oi"`
	InternalId     string                `json:"internalId,omitempty" msg:"-"`
	ItemId         string                `json:"itemId,omitempty" msg:"ii"`
	OrderItemId    string                `json:"orderItemId,omitempty" msg:"oii"`
	QuoteId        string                `json:"quoteId,omitempty" msg:"q"`
	QuoteItemId    string                `json:"quoteItemId,omitempty" msg:"qi"`
	ConnectionName string                `json:"connectionName,omitempty" msg:"cn"`
	PaymentType    DoDSettlePaymentType  `json:"paymentType,omitempty" msg:"pt"`
	BillingType    DoDSettleBillingType  `json:"billingType,omitempty" msg:"bt"`
	Currency       string                `json:"currency,omitempty" msg:"cr"`
	ServiceClass   DoDSettleServiceClass `json:"serviceClass,omitempty" msg:"scs"`
	Bandwidth      string                `json:"bandwidth,omitempty" msg:"bw"`
	BillingUnit    DoDSettleBillingUnit  `json:"billingUnit,omitempty" msg:"bu"`
	Price          float64               `json:"price,omitempty" msg:"p"`
	Addition       float64               `json:"addition" msg:"ad"`
	StartTime      int64                 `json:"startTime" msg:"st"`
	StartTimeStr   string                `json:"startTimeStr,omitempty" msg:"-"`
	EndTime        int64                 `json:"endTime" msg:"et"`
	EndTimeStr     string                `json:"endTimeStr,omitempty" msg:"-"`
}

type DoDSettleConnectionInfo added in v1.4.0

type DoDSettleConnectionInfo struct {
	DoDSettleConnectionStaticParam
	Active     *DoDSettleConnectionDynamicParam   `json:"active" msg:"ac"`
	Done       []*DoDSettleConnectionDynamicParam `json:"done" msg:"do"`
	Disconnect *DoDSettleDisconnectInfo           `json:"disconnect" msg:"dis"`
	Track      []*DoDSettleConnectionLifeTrack    `json:"track" msg:"t"`
}

type DoDSettleConnectionLifeTrack added in v1.4.0

type DoDSettleConnectionLifeTrack struct {
	OrderType DoDSettleOrderType               `json:"orderType,omitempty" msg:"ot"`
	OrderId   string                           `json:"orderId,omitempty" msg:"oi"`
	Time      int64                            `json:"time,omitempty" msg:"t"`
	Changed   *DoDSettleConnectionDynamicParam `json:"changed,omitempty" msg:"c"`
}

type DoDSettleConnectionParam added in v1.4.0

type DoDSettleConnectionParam struct {
	DoDSettleConnectionStaticParam
	DoDSettleConnectionDynamicParam
}

type DoDSettleConnectionStaticParam added in v1.4.0

type DoDSettleConnectionStaticParam struct {
	BuyerProductId    string `json:"buyerProductId,omitempty" msg:"bp"`
	ProductOfferingId string `json:"productOfferingId,omitempty" msg:"po"`
	ProductId         string `json:"productId,omitempty" msg:"pi"`
	SrcCompanyName    string `json:"srcCompanyName,omitempty" msg:"scn"`
	SrcRegion         string `json:"srcRegion,omitempty" msg:"sr"`
	SrcCity           string `json:"srcCity,omitempty" msg:"sc"`
	SrcDataCenter     string `json:"srcDataCenter,omitempty" msg:"sdc"`
	SrcPort           string `json:"srcPort,omitempty" msg:"sp"`
	DstCompanyName    string `json:"dstCompanyName,omitempty" msg:"dcn"`
	DstRegion         string `json:"dstRegion,omitempty" msg:"dr"`
	DstCity           string `json:"dstCity,omitempty" msg:"dc"`
	DstDataCenter     string `json:"dstDataCenter,omitempty" msg:"ddc"`
	DstPort           string `json:"dstPort,omitempty" msg:"dp"`
}

type DoDSettleContractState added in v1.4.0

type DoDSettleContractState int

ENUM( null request confirmed rejected )

const (
	// DoDSettleContractStateNull is a DoDSettleContractState of type Null
	DoDSettleContractStateNull DoDSettleContractState = iota
	// DoDSettleContractStateRequest is a DoDSettleContractState of type Request
	DoDSettleContractStateRequest
	// DoDSettleContractStateConfirmed is a DoDSettleContractState of type Confirmed
	DoDSettleContractStateConfirmed
	// DoDSettleContractStateRejected is a DoDSettleContractState of type Rejected
	DoDSettleContractStateRejected
)

func ParseDoDSettleContractState added in v1.4.0

func ParseDoDSettleContractState(name string) (DoDSettleContractState, error)

ParseDoDSettleContractState attempts to convert a string to a DoDSettleContractState

func (DoDSettleContractState) MarshalText added in v1.4.0

func (x DoDSettleContractState) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (DoDSettleContractState) String added in v1.4.0

func (x DoDSettleContractState) String() string

String implements the Stringer interface.

func (*DoDSettleContractState) UnmarshalText added in v1.4.0

func (x *DoDSettleContractState) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type DoDSettleCreateOrderParam added in v1.4.0

type DoDSettleCreateOrderParam struct {
	ContractPrivacyParam
	Buyer       *DoDSettleUser              `json:"buyer" msg:"b"`
	Seller      *DoDSettleUser              `json:"seller" msg:"s"`
	Connections []*DoDSettleConnectionParam `json:"connections,omitempty" msg:"c"`
}

type DoDSettleDisconnectInfo added in v1.4.0

type DoDSettleDisconnectInfo struct {
	OrderId      string  `json:"orderId,omitempty" msg:"oi"`
	OrderItemId  string  `json:"orderItemId,omitempty" msg:"oii"`
	QuoteId      string  `json:"quoteId,omitempty" msg:"q"`
	QuoteItemId  string  `json:"quoteItemId,omitempty" msg:"qi"`
	Price        float64 `json:"price,omitempty" msg:"p"`
	Currency     string  `json:"currency,omitempty" msg:"cr"`
	DisconnectAt int64   `json:"disconnectAt,omitempty" msg:"d"`
}

type DoDSettleInvoiceConnDetail added in v1.4.0

type DoDSettleInvoiceConnDetail struct {
	ConnectionAmount float64 `json:"connectionAmount"`
	DoDSettleConnectionStaticParam
	Usage []*DoDSettleInvoiceConnDynamic `json:"usage"`
}

type DoDSettleInvoiceConnDynamic added in v1.4.0

type DoDSettleInvoiceConnDynamic struct {
	DoDSettleConnectionDynamicParam
	InvoiceStartTime    int64              `json:"invoiceStartTime,omitempty"`
	InvoiceStartTimeStr string             `json:"invoiceStartTimeStr,omitempty"`
	InvoiceEndTime      int64              `json:"invoiceEndTime,omitempty"`
	InvoiceEndTimeStr   string             `json:"invoiceEndTimeStr,omitempty"`
	InvoiceUnitCount    int                `json:"invoiceUnitCount,omitempty"`
	OrderType           DoDSettleOrderType `json:"orderType,omitempty"`
	Amount              float64            `json:"amount"`
}

type DoDSettleInvoiceOrderDetail added in v1.4.0

type DoDSettleInvoiceOrderDetail struct {
	OrderId         string                        `json:"orderId"`
	ConnectionCount int                           `json:"connectionCount"`
	OrderAmount     float64                       `json:"orderAmount"`
	Connections     []*DoDSettleInvoiceConnDetail `json:"connections"`
}

type DoDSettleOrder added in v1.4.0

type DoDSettleOrder struct {
	Seller  types.Address `json:"seller" msg:"s,extension"`
	OrderId string        `json:"orderId,omitempty" msg:"o"`
}

type DoDSettleOrderInfo added in v1.4.0

type DoDSettleOrderInfo struct {
	Buyer         *DoDSettleUser              `json:"buyer" msg:"b"`
	Seller        *DoDSettleUser              `json:"seller" msg:"s"`
	OrderId       string                      `json:"orderId,omitempty" msg:"oi"`
	InternalId    string                      `json:"internalId,omitempty" msg:"i"`
	OrderType     DoDSettleOrderType          `json:"orderType,omitempty" msg:"ot"`
	OrderState    DoDSettleOrderState         `json:"orderState" msg:"os"`
	ContractState DoDSettleContractState      `json:"contractState" msg:"cs"`
	Connections   []*DoDSettleConnectionParam `json:"connections" msg:"c"`
	Track         []*DoDSettleOrderLifeTrack  `json:"track" msg:"t"`
}

type DoDSettleOrderInvoice added in v1.4.0

type DoDSettleOrderInvoice struct {
	TotalConnectionCount int                          `json:"totalConnectionCount"`
	TotalAmount          float64                      `json:"totalAmount"`
	Currency             string                       `json:"currency"`
	StartTime            int64                        `json:"startTime"`
	EndTime              int64                        `json:"endTime"`
	Buyer                *DoDSettleUser               `json:"buyer"`
	Seller               *DoDSettleUser               `json:"seller"`
	Order                *DoDSettleInvoiceOrderDetail `json:"order"`
}

type DoDSettleOrderItem added in v1.4.0

type DoDSettleOrderItem struct {
	ItemId      string `json:"itemId" msg:"i"`
	OrderItemId string `json:"orderItemId" msg:"o"`
}

type DoDSettleOrderLifeTrack added in v1.4.0

type DoDSettleOrderLifeTrack struct {
	ContractState DoDSettleContractState `json:"contractState" msg:"cs"`
	OrderState    DoDSettleOrderState    `json:"orderState" msg:"os"`
	Reason        string                 `json:"reason,omitempty" msg:"r"`
	Time          int64                  `json:"time" msg:"t"`
	Hash          types.Hash             `json:"hash" msg:"h,extension"`
}

type DoDSettleOrderState added in v1.4.0

type DoDSettleOrderState int

ENUM( null success complete fail )

const (
	// DoDSettleOrderStateNull is a DoDSettleOrderState of type Null
	DoDSettleOrderStateNull DoDSettleOrderState = iota
	// DoDSettleOrderStateSuccess is a DoDSettleOrderState of type Success
	DoDSettleOrderStateSuccess
	// DoDSettleOrderStateComplete is a DoDSettleOrderState of type Complete
	DoDSettleOrderStateComplete
	// DoDSettleOrderStateFail is a DoDSettleOrderState of type Fail
	DoDSettleOrderStateFail
)

func ParseDoDSettleOrderState added in v1.4.0

func ParseDoDSettleOrderState(name string) (DoDSettleOrderState, error)

ParseDoDSettleOrderState attempts to convert a string to a DoDSettleOrderState

func (DoDSettleOrderState) MarshalText added in v1.4.0

func (x DoDSettleOrderState) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (DoDSettleOrderState) String added in v1.4.0

func (x DoDSettleOrderState) String() string

String implements the Stringer interface.

func (*DoDSettleOrderState) UnmarshalText added in v1.4.0

func (x *DoDSettleOrderState) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type DoDSettleOrderType added in v1.4.0

type DoDSettleOrderType int

ENUM( null create change terminate )

const (
	// DoDSettleOrderTypeNull is a DoDSettleOrderType of type Null
	DoDSettleOrderTypeNull DoDSettleOrderType = iota
	// DoDSettleOrderTypeCreate is a DoDSettleOrderType of type Create
	DoDSettleOrderTypeCreate
	// DoDSettleOrderTypeChange is a DoDSettleOrderType of type Change
	DoDSettleOrderTypeChange
	// DoDSettleOrderTypeTerminate is a DoDSettleOrderType of type Terminate
	DoDSettleOrderTypeTerminate
)

func ParseDoDSettleOrderType added in v1.4.0

func ParseDoDSettleOrderType(name string) (DoDSettleOrderType, error)

ParseDoDSettleOrderType attempts to convert a string to a DoDSettleOrderType

func (DoDSettleOrderType) MarshalText added in v1.4.0

func (x DoDSettleOrderType) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (DoDSettleOrderType) String added in v1.4.0

func (x DoDSettleOrderType) String() string

String implements the Stringer interface.

func (*DoDSettleOrderType) UnmarshalText added in v1.4.0

func (x *DoDSettleOrderType) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type DoDSettlePaymentType added in v1.4.0

type DoDSettlePaymentType int

ENUM( null invoice stableCoin )

const (
	// DoDSettlePaymentTypeNull is a DoDSettlePaymentType of type Null
	DoDSettlePaymentTypeNull DoDSettlePaymentType = iota
	// DoDSettlePaymentTypeInvoice is a DoDSettlePaymentType of type Invoice
	DoDSettlePaymentTypeInvoice
	// DoDSettlePaymentTypeStableCoin is a DoDSettlePaymentType of type StableCoin
	DoDSettlePaymentTypeStableCoin
)

func ParseDoDSettlePaymentType added in v1.4.0

func ParseDoDSettlePaymentType(name string) (DoDSettlePaymentType, error)

ParseDoDSettlePaymentType attempts to convert a string to a DoDSettlePaymentType

func (DoDSettlePaymentType) MarshalText added in v1.4.0

func (x DoDSettlePaymentType) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (DoDSettlePaymentType) String added in v1.4.0

func (x DoDSettlePaymentType) String() string

String implements the Stringer interface.

func (*DoDSettlePaymentType) UnmarshalText added in v1.4.0

func (x *DoDSettlePaymentType) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type DoDSettleProduct added in v1.4.0

type DoDSettleProduct struct {
	Seller    types.Address `json:"seller" msg:"s,extension"`
	ProductId string        `json:"productId,omitempty" msg:"p"`
}

type DoDSettleProductInfo added in v1.4.0

type DoDSettleProductInfo struct {
	OrderItemId string `json:"orderItemId" msg:"oii"`
	ProductId   string `json:"productId" msg:"pi"`
	Active      bool   `json:"active" msg:"a"`
}

type DoDSettleProductInvoice added in v1.4.0

type DoDSettleProductInvoice struct {
	TotalAmount float64                     `json:"totalAmount"`
	Currency    string                      `json:"currency"`
	StartTime   int64                       `json:"startTime"`
	EndTime     int64                       `json:"endTime"`
	Buyer       *DoDSettleUser              `json:"buyer"`
	Seller      *DoDSettleUser              `json:"seller"`
	Connection  *DoDSettleInvoiceConnDetail `json:"connection"`
}

type DoDSettleProductWithActiveInfo added in v1.4.0

type DoDSettleProductWithActiveInfo struct {
	ProductId string `json:"productId"`
	Active    bool   `json:"active"`
}

type DoDSettleResponseAction added in v1.4.0

type DoDSettleResponseAction int

ENUM( null confirm reject )

const (
	// DoDSettleResponseActionNull is a DoDSettleResponseAction of type Null
	DoDSettleResponseActionNull DoDSettleResponseAction = iota
	// DoDSettleResponseActionConfirm is a DoDSettleResponseAction of type Confirm
	DoDSettleResponseActionConfirm
	// DoDSettleResponseActionReject is a DoDSettleResponseAction of type Reject
	DoDSettleResponseActionReject
)

func ParseDoDSettleResponseAction added in v1.4.0

func ParseDoDSettleResponseAction(name string) (DoDSettleResponseAction, error)

ParseDoDSettleResponseAction attempts to convert a string to a DoDSettleResponseAction

func (DoDSettleResponseAction) MarshalText added in v1.4.0

func (x DoDSettleResponseAction) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (DoDSettleResponseAction) String added in v1.4.0

func (x DoDSettleResponseAction) String() string

String implements the Stringer interface.

func (*DoDSettleResponseAction) UnmarshalText added in v1.4.0

func (x *DoDSettleResponseAction) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type DoDSettleResponseParam added in v1.4.0

type DoDSettleResponseParam struct {
	ContractPrivacyParam
	RequestHash types.Hash              `json:"requestHash" msg:"-"`
	Action      DoDSettleResponseAction `json:"action" msg:"c"`
}

type DoDSettleServiceClass added in v1.4.0

type DoDSettleServiceClass int

ENUM( null gold silver bronze )

const (
	// DoDSettleServiceClassNull is a DoDSettleServiceClass of type Null
	DoDSettleServiceClassNull DoDSettleServiceClass = iota
	// DoDSettleServiceClassGold is a DoDSettleServiceClass of type Gold
	DoDSettleServiceClassGold
	// DoDSettleServiceClassSilver is a DoDSettleServiceClass of type Silver
	DoDSettleServiceClassSilver
	// DoDSettleServiceClassBronze is a DoDSettleServiceClass of type Bronze
	DoDSettleServiceClassBronze
)

func ParseDoDSettleServiceClass added in v1.4.0

func ParseDoDSettleServiceClass(name string) (DoDSettleServiceClass, error)

ParseDoDSettleServiceClass attempts to convert a string to a DoDSettleServiceClass

func (DoDSettleServiceClass) MarshalText added in v1.4.0

func (x DoDSettleServiceClass) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (DoDSettleServiceClass) String added in v1.4.0

func (x DoDSettleServiceClass) String() string

String implements the Stringer interface.

func (*DoDSettleServiceClass) UnmarshalText added in v1.4.0

func (x *DoDSettleServiceClass) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type DoDSettleTerminateOrderParam added in v1.4.0

type DoDSettleTerminateOrderParam struct {
	ContractPrivacyParam
	Buyer       *DoDSettleUser                    `json:"buyer" msg:"b"`
	Seller      *DoDSettleUser                    `json:"seller" msg:"s"`
	Connections []*DoDSettleChangeConnectionParam `json:"connections" msg:"c"`
}

type DoDSettleUpdateOrderInfoParam added in v1.4.0

type DoDSettleUpdateOrderInfoParam struct {
	ContractPrivacyParam
	Buyer       types.Address         `json:"buyer" msg:"-"`
	InternalId  types.Hash            `json:"internalId,omitempty" msg:"i,extension"`
	OrderId     string                `json:"orderId,omitempty" msg:"oi"`
	OrderItemId []*DoDSettleOrderItem `json:"orderItemId" msg:"oii"`
	Status      DoDSettleOrderState   `json:"status,omitempty" msg:"s"`
	FailReason  string                `json:"failReason,omitempty" msg:"fr"`
}

type DoDSettleUpdateProductInfoParam added in v1.4.0

type DoDSettleUpdateProductInfoParam struct {
	ContractPrivacyParam
	Address     types.Address           `json:"address" msg:"-"`
	OrderId     string                  `json:"orderId" msg:"oi"`
	ProductInfo []*DoDSettleProductInfo `json:"productInfo" msg:"p"`
}

type DoDSettleUser added in v1.4.0

type DoDSettleUser struct {
	Address types.Address `json:"address" msg:"a,extension"`
	Name    string        `json:"name" msg:"n"`
}

type DoDSettlementAPI added in v1.4.0

type DoDSettlementAPI struct {
	// contains filtered or unexported fields
}

func NewDoDSettlementAPI added in v1.4.0

func NewDoDSettlementAPI(c *QLCClient) *DoDSettlementAPI

func (*DoDSettlementAPI) GenerateInvoiceByBuyer added in v1.4.0

func (s *DoDSettlementAPI) GenerateInvoiceByBuyer(seller, buyer types.Address, start, end int64, flight, split bool) (*DoDSettleBuyerInvoice, error)

func (*DoDSettlementAPI) GenerateInvoiceByOrderId added in v1.4.0

func (s *DoDSettlementAPI) GenerateInvoiceByOrderId(seller types.Address, orderId string, start, end int64, flight, split bool) (*DoDSettleOrderInvoice, error)

func (*DoDSettlementAPI) GenerateInvoiceByProductId added in v1.4.0

func (s *DoDSettlementAPI) GenerateInvoiceByProductId(seller types.Address, productId string, start, end int64, flight, split bool) (*DoDSettleProductInvoice, error)

func (*DoDSettlementAPI) GetChangeOrderBlock added in v1.4.0

func (s *DoDSettlementAPI) GetChangeOrderBlock(param *DoDSettleChangeOrderParam, sign Signature) (*types.StateBlock, error)

func (*DoDSettlementAPI) GetChangeOrderRewardBlock added in v1.4.0

func (s *DoDSettlementAPI) GetChangeOrderRewardBlock(param *DoDSettleResponseParam, sign Signature) (*types.StateBlock, error)

func (*DoDSettlementAPI) GetCreateOrderBlock added in v1.4.0

func (s *DoDSettlementAPI) GetCreateOrderBlock(param *DoDSettleCreateOrderParam, sign Signature) (*types.StateBlock, error)

func (*DoDSettlementAPI) GetCreateOrderRewardBlock added in v1.4.0

func (s *DoDSettlementAPI) GetCreateOrderRewardBlock(param *DoDSettleResponseParam, sign Signature) (*types.StateBlock, error)

func (*DoDSettlementAPI) GetInternalIdByOrderId added in v1.4.0

func (s *DoDSettlementAPI) GetInternalIdByOrderId(seller types.Address, orderId string) (types.Hash, error)

func (*DoDSettlementAPI) GetOrderCountByAddress added in v1.4.0

func (s *DoDSettlementAPI) GetOrderCountByAddress(address types.Address) int

func (*DoDSettlementAPI) GetOrderCountByAddressAndSeller added in v1.4.0

func (s *DoDSettlementAPI) GetOrderCountByAddressAndSeller(address, seller types.Address) int

func (*DoDSettlementAPI) GetOrderIdListByAddress added in v1.4.0

func (s *DoDSettlementAPI) GetOrderIdListByAddress(address types.Address) ([]*DoDSettleOrder, error)

func (*DoDSettlementAPI) GetOrderIdListByAddressAndSeller added in v1.4.0

func (s *DoDSettlementAPI) GetOrderIdListByAddressAndSeller(address, seller types.Address) ([]*DoDSettleOrder, error)

func (*DoDSettlementAPI) GetOrderInfoByAddress added in v1.4.0

func (s *DoDSettlementAPI) GetOrderInfoByAddress(address types.Address, count, offset int) (*DoDSettlementOrderInfoResp, error)

func (*DoDSettlementAPI) GetOrderInfoByAddressAndSeller added in v1.4.0

func (s *DoDSettlementAPI) GetOrderInfoByAddressAndSeller(address, seller types.Address, count, offset int) (*DoDSettlementOrderInfoResp, error)

func (*DoDSettlementAPI) GetOrderInfoByInternalId added in v1.4.0

func (s *DoDSettlementAPI) GetOrderInfoByInternalId(internalId string) (*DoDSettleOrderInfo, error)

func (*DoDSettlementAPI) GetOrderInfoBySellerAndOrderId added in v1.4.0

func (s *DoDSettlementAPI) GetOrderInfoBySellerAndOrderId(seller types.Address, orderId string) (*DoDSettleOrderInfo, error)

func (*DoDSettlementAPI) GetPendingRequest added in v1.4.0

func (s *DoDSettlementAPI) GetPendingRequest(address types.Address) ([]*DoDPendingRequestRsp, error)

func (*DoDSettlementAPI) GetPendingResourceCheck added in v1.4.0

func (s *DoDSettlementAPI) GetPendingResourceCheck(address types.Address) ([]*DoDPendingResourceCheckInfo, error)

func (*DoDSettlementAPI) GetPlacingOrder added in v1.4.0

func (s *DoDSettlementAPI) GetPlacingOrder(buyer, seller types.Address, count, offset int) (*DoDPlacingOrderResp, error)

func (*DoDSettlementAPI) GetProductCountByAddress added in v1.4.0

func (s *DoDSettlementAPI) GetProductCountByAddress(address types.Address) int

func (*DoDSettlementAPI) GetProductCountByAddressAndSeller added in v1.4.0

func (s *DoDSettlementAPI) GetProductCountByAddressAndSeller(address, seller types.Address) int

func (*DoDSettlementAPI) GetProductIdListByAddress added in v1.4.0

func (s *DoDSettlementAPI) GetProductIdListByAddress(address types.Address) ([]*DoDSettleProduct, error)

func (*DoDSettlementAPI) GetProductIdListByAddressAndSeller added in v1.4.0

func (s *DoDSettlementAPI) GetProductIdListByAddressAndSeller(address, seller types.Address) ([]*DoDSettleOrder, error)

func (*DoDSettlementAPI) GetProductInfoByAddress added in v1.4.0

func (s *DoDSettlementAPI) GetProductInfoByAddress(address types.Address, count, offset int) (*DoDSettlementProductInfoResp, error)

func (*DoDSettlementAPI) GetProductInfoByAddressAndSeller added in v1.4.0

func (s *DoDSettlementAPI) GetProductInfoByAddressAndSeller(address, seller types.Address, count, offset int) (*DoDSettlementProductInfoResp, error)

func (*DoDSettlementAPI) GetProductInfoBySellerAndProductId added in v1.4.0

func (s *DoDSettlementAPI) GetProductInfoBySellerAndProductId(seller types.Address, productId string) (*DoDSettleConnectionInfo, error)

func (*DoDSettlementAPI) GetTerminateOrderBlock added in v1.4.0

func (s *DoDSettlementAPI) GetTerminateOrderBlock(param *DoDSettleTerminateOrderParam, sign Signature) (*types.StateBlock, error)

func (*DoDSettlementAPI) GetTerminateOrderRewardBlock added in v1.4.0

func (s *DoDSettlementAPI) GetTerminateOrderRewardBlock(param *DoDSettleResponseParam, sign Signature) (*types.StateBlock, error)

func (*DoDSettlementAPI) GetUpdateOrderInfoBlock added in v1.4.0

func (s *DoDSettlementAPI) GetUpdateOrderInfoBlock(param *DoDSettleUpdateOrderInfoParam, sign Signature) (*types.StateBlock, error)

func (*DoDSettlementAPI) GetUpdateOrderInfoRewardBlock added in v1.4.0

func (s *DoDSettlementAPI) GetUpdateOrderInfoRewardBlock(param *DoDSettleResponseParam, sign Signature) (*types.StateBlock, error)

func (*DoDSettlementAPI) GetUpdateProductInfoBlock added in v1.4.0

func (s *DoDSettlementAPI) GetUpdateProductInfoBlock(param *DoDSettleUpdateProductInfoParam, sign Signature) (*types.StateBlock, error)

func (*DoDSettlementAPI) GetUpdateProductInfoRewardBlock added in v1.4.0

func (s *DoDSettlementAPI) GetUpdateProductInfoRewardBlock(param *DoDSettleResponseParam, sign Signature) (*types.StateBlock, error)

type DoDSettlementOrderInfoResp added in v1.4.0

type DoDSettlementOrderInfoResp struct {
	OrderInfo   []*DoDSettleOrderInfo `json:"orderInfo"`
	TotalOrders int                   `json:"totalOrders"`
}

type DoDSettlementProductInfoResp added in v1.4.0

type DoDSettlementProductInfoResp struct {
	ProductInfo   []*DoDSettleConnectionInfo `json:"productInfo"`
	TotalProducts int                        `json:"totalProducts"`
}

type InvoiceRecord added in v1.3.5

type InvoiceRecord struct {
	Address                  types.Address `json:"contractAddress"`
	StartDate                int64         `json:"startDate"`
	EndDate                  int64         `json:"endDate"`
	Customer                 string        `json:"customer"`
	CustomerSr               string        `json:"customerSr"`
	Country                  string        `json:"country"`
	Operator                 string        `json:"operator"`
	ServiceId                string        `json:"serviceId"`
	MCC                      uint64        `json:"mcc"`
	MNC                      uint64        `json:"mnc"`
	Currency                 string        `json:"currency"`
	UnitPrice                float64       `json:"unitPrice"`
	SumOfBillableSMSCustomer uint64        `json:"sumOfBillableSMSCustomer"`
	SumOfTOTPrice            float64       `json:"sumOfTOTPrice"`
}

type LedgerApi added in v1.2.4

type LedgerApi struct {
	// contains filtered or unexported fields
}

func NewLedgerAPI added in v1.3.0

func NewLedgerAPI(url string, c *QLCClient) *LedgerApi

NewLedgerAPI creates ledger module for client

func (*LedgerApi) AccountBlocksCount added in v1.2.4

func (l *LedgerApi) AccountBlocksCount(address types.Address) (int64, error)

AccountBlocksCount returns number of blocks for a specific account of chain

func (*LedgerApi) AccountHistoryTopn added in v1.2.4

func (l *LedgerApi) AccountHistoryTopn(address types.Address, count int, offset int) ([]*APIBlock, error)

AccountHistoryTopn returns blocks list for a specific account of chain count is number of blocks to return, and offset is index of block where to start

func (*LedgerApi) AccountInfo added in v1.2.4

func (l *LedgerApi) AccountInfo(address types.Address) (*APIAccount, error)

AccountInfo returns account detail info, include each token meta for the account If account not found, will return error

func (*LedgerApi) AccountRepresentative added in v1.2.4

func (l *LedgerApi) AccountRepresentative(address types.Address) (types.Address, error)

AccountRepresentative returns the representative address for account If account not found, will return error

func (*LedgerApi) AccountVotingWeight added in v1.2.4

func (l *LedgerApi) AccountVotingWeight(address types.Address) (types.Balance, error)

AccountVotingWeight returns the voting weight for account If account not found, will return error

func (*LedgerApi) Accounts added in v1.2.4

func (l *LedgerApi) Accounts(count int, offset int) ([]types.Address, error)

Accounts returns accounts list of chain count is number of accounts to return, and offset is index of account where to start

func (*LedgerApi) AccountsBalance added in v1.2.4

func (l *LedgerApi) AccountsBalance(addresses []types.Address) (map[types.Address]map[string]*APIAccountsBalance, error)

AccountsBalance returns balance and pending(amount that has not yet been received) for each account

func (*LedgerApi) AccountsCount added in v1.2.4

func (l *LedgerApi) AccountsCount() (uint64, error)

AccountsCount returns total number of accounts of chain

func (*LedgerApi) AccountsFrontiers added in v1.2.4

func (l *LedgerApi) AccountsFrontiers(addresses []types.Address) (map[types.Address]map[string]types.Hash, error)

AccountsFrontiers returns frontier info for each token of account

func (*LedgerApi) AccountsPending added in v1.2.4

func (l *LedgerApi) AccountsPending(addresses []types.Address, n int) (map[types.Address][]*APIPending, error)

AccountsPending returns pending info list for each account maximum number of pending for each account return is n, and if n set to -1, will return all pending for each account

func (*LedgerApi) AllGenesisBlocks added in v1.3.5

func (l *LedgerApi) AllGenesisBlocks() ([]*types.StateBlock, error)

func (*LedgerApi) BalanceChange added in v1.3.0

func (l *LedgerApi) BalanceChange(ch chan *types.AccountMeta, address types.Address) (*Subscribe, error)

BalanceChange support publish/subscription, ch is AccountMeta channel, once the balance of a account change, set the newest account info to channel

func (*LedgerApi) BlockAccount added in v1.2.4

func (l *LedgerApi) BlockAccount(hash types.Hash) (types.Address, error)

BlockAccount accepts a block hash, and returns account of block owner

func (*LedgerApi) BlockConfirmedStatus added in v1.2.4

func (l *LedgerApi) BlockConfirmedStatus(hash types.Hash) (bool, error)

Return block confirmed status, if block confirmed,return `true`,otherwise return `false`

func (*LedgerApi) BlockHash added in v1.2.4

func (l *LedgerApi) BlockHash(block types.StateBlock) types.Hash

BlockHash return hash of block

func (*LedgerApi) BlockInfo added in v1.2.4

func (l *LedgerApi) BlockInfo(hash types.Hash) (*APIBlock, error)

BlockInfo accepts a block hash, and returns block info for the hash

func (*LedgerApi) BlockSubscription added in v1.3.1

func (l *LedgerApi) BlockSubscription(address types.Address) (*BlockSubscription, error)

func (*LedgerApi) Blocks added in v1.2.4

func (l *LedgerApi) Blocks(count int, offset int) ([]*APIBlock, error)

Blocks returns blocks list of chain count is number of blocks to return, and offset is index of block where to start

func (*LedgerApi) BlocksCount added in v1.2.4

func (l *LedgerApi) BlocksCount() (map[string]uint64, error)

BlocksCount returns the number of blocks(include smartcontract block) and unchecked blocks of chain

func (*LedgerApi) BlocksCountByType added in v1.2.4

func (l *LedgerApi) BlocksCountByType() (map[string]uint64, error)

BlocksCountByType returns number of blocks by type of chain

func (*LedgerApi) BlocksInfo added in v1.2.4

func (l *LedgerApi) BlocksInfo(hash []types.Hash) ([]*APIBlock, error)

BlocksInfo accepts blocks hash list, and returns block info for each hash

func (*LedgerApi) Chain added in v1.2.4

func (l *LedgerApi) Chain(hash types.Hash, n int) ([]types.Hash, error)

Chain returns a consecutive block hash list for a specific hash maximum number of blocks hash to return is n, and if n set to -1, will return blocks hash to the open block

func (*LedgerApi) ChainToken added in v1.3.5

func (l *LedgerApi) ChainToken() (*types.Hash, error)

func (*LedgerApi) ConfirmedAccountInfo added in v1.2.4

func (l *LedgerApi) ConfirmedAccountInfo(address types.Address) (*APIAccount, error)

Return confirmed account detail info , include each token in the account

func (*LedgerApi) Delegators added in v1.2.4

func (l *LedgerApi) Delegators(hash types.Address) ([]*APIAccountBalance, error)

Delegators accepts a representative account, and returns its delegator and each delegator's balance

func (*LedgerApi) DelegatorsCount added in v1.2.4

func (l *LedgerApi) DelegatorsCount(hash types.Address) (int64, error)

DelegatorsCount gets number of delegators for specific representative account

func (*LedgerApi) GasAddress added in v1.3.5

func (l *LedgerApi) GasAddress() (*types.Address, error)

func (*LedgerApi) GasBlock added in v1.3.5

func (l *LedgerApi) GasBlock() (*types.StateBlock, error)

func (*LedgerApi) GasBlockHash added in v1.3.5

func (l *LedgerApi) GasBlockHash() (*types.Hash, error)

func (*LedgerApi) GasMintageBlock added in v1.3.5

func (l *LedgerApi) GasMintageBlock() (*types.StateBlock, error)

func (*LedgerApi) GasToken added in v1.3.5

func (l *LedgerApi) GasToken() (*types.Hash, error)

func (*LedgerApi) GenerateAndProcessChangeBlock added in v1.3.1

func (l *LedgerApi) GenerateAndProcessChangeBlock(account, representative types.Address, sign Signature) (types.Hash, error)

func (*LedgerApi) GenerateAndProcessReceiveBlock added in v1.3.1

func (l *LedgerApi) GenerateAndProcessReceiveBlock(txBlock *types.StateBlock, sign Signature) (types.Hash, error)

func (*LedgerApi) GenerateAndProcessReceiveBlockByHash added in v1.3.1

func (l *LedgerApi) GenerateAndProcessReceiveBlockByHash(txHash types.Hash, sign Signature) (types.Hash, error)

func (*LedgerApi) GenerateAndProcessSendBlock added in v1.3.1

func (l *LedgerApi) GenerateAndProcessSendBlock(para *APISendBlockPara, sign Signature) (types.Hash, error)

func (*LedgerApi) GenerateChangeBlock added in v1.2.4

func (l *LedgerApi) GenerateChangeBlock(account, representative types.Address, sign Signature) (*types.StateBlock, error)

GenerateChangeBlock returns change block by account and new representative address, sign is a function to sign the block

func (*LedgerApi) GenerateReceiveBlock added in v1.2.4

func (l *LedgerApi) GenerateReceiveBlock(txBlock *types.StateBlock, sign Signature) (*types.StateBlock, error)

GenerateReceiveBlock returns receive block by send block, sign is a function to sign the block

func (*LedgerApi) GenerateReceiveBlockByHash added in v1.2.4

func (l *LedgerApi) GenerateReceiveBlockByHash(txHash types.Hash, sign Signature) (*types.StateBlock, error)

GenerateReceiveBlockByHash returns receive block by send block hash, sign is a function to sign the block

func (*LedgerApi) GenerateSendBlock added in v1.2.4

func (l *LedgerApi) GenerateSendBlock(para *APISendBlockPara, sign Signature) (*types.StateBlock, error)

GenerateSendBlock returns send block by transaction parameter, sign is a function to sign the block

func (*LedgerApi) GenesisAddress added in v1.3.5

func (l *LedgerApi) GenesisAddress() (*types.Address, error)

func (*LedgerApi) GenesisBlock added in v1.3.5

func (l *LedgerApi) GenesisBlock() (*types.StateBlock, error)

func (*LedgerApi) GenesisBlockHash added in v1.3.5

func (l *LedgerApi) GenesisBlockHash() (*types.Hash, error)

func (*LedgerApi) GenesisMintageBlock added in v1.3.5

func (l *LedgerApi) GenesisMintageBlock() (*types.StateBlock, error)

func (*LedgerApi) GenesisMintageHash added in v1.3.5

func (l *LedgerApi) GenesisMintageHash() (*types.Hash, error)

func (*LedgerApi) IsGenesisBlock added in v1.3.5

func (l *LedgerApi) IsGenesisBlock() (*bool, error)

func (*LedgerApi) IsGenesisToken added in v1.3.5

func (l *LedgerApi) IsGenesisToken() (*bool, error)

func (*LedgerApi) NewAccountBlock added in v1.3.1

func (l *LedgerApi) NewAccountBlock(ch chan *types.StateBlock, address types.Address) (*Subscribe, error)

NewAccountBlock support publish/subscription, ch is StateBlock channel, once there is new account block stored to the chain, set the block to channel

func (*LedgerApi) NewBlock added in v1.3.0

func (l *LedgerApi) NewBlock(ch chan *types.StateBlock) (*Subscribe, error)

NewBlock support publish/subscription, ch is StateBlock channel, once there is new block stored to the chain, set the block to channel

func (*LedgerApi) NewPending added in v1.3.0

func (l *LedgerApi) NewPending(ch chan *APIPending, address types.Address) (*Subscribe, error)

NewPending support publish/subscription, ch is APIPending channel, once there is a pending transaction of a account, set the pending info to channel

func (*LedgerApi) Pending added in v1.2.4

func (l *LedgerApi) Pending(address types.Address, hash types.Hash) (*APIPending, error)

Pending return pending info by account and token hash, if pending not found, return error

func (*LedgerApi) Pendings added in v1.2.4

func (l *LedgerApi) Pendings() ([]*APIPending, error)

Pendings returns pending transaction list on chain

func (*LedgerApi) Performance added in v1.2.4

func (l *LedgerApi) Performance() ([]*types.PerformanceTime, error)

Performance returns performance time

func (*LedgerApi) Process added in v1.2.4

func (l *LedgerApi) Process(block *types.StateBlock) (types.Hash, error)

Process checks block base info , updates info of chain for the block ,and broadcasts block

func (*LedgerApi) Representatives added in v1.2.4

func (l *LedgerApi) Representatives(sorting bool) ([]*APIRepresentative, error)

Representatives returns pairs of representative and its voting weight of chain if set sorting false , will return representatives randomly, if set true, will sorting representative balance in descending order

func (*LedgerApi) Stop added in v1.3.1

func (l *LedgerApi) Stop()

func (*LedgerApi) TokenInfoById added in v1.2.4

func (l *LedgerApi) TokenInfoById(tokenId types.Hash) (*ApiTokenInfo, error)

TokenInfoById returns token info by token id

func (*LedgerApi) TokenInfoByName added in v1.2.4

func (l *LedgerApi) TokenInfoByName(tokenName string) (*ApiTokenInfo, error)

TokenInfoById returns token info by token name

func (*LedgerApi) TokenMeta added in v1.2.4

func (l *LedgerApi) TokenMeta(hash types.Hash, address types.Address) (*APITokenMeta, error)

TokenMeta return tokenmeta info by account and token hash

func (*LedgerApi) Tokens added in v1.2.4

func (l *LedgerApi) Tokens() ([]*types.TokenInfo, error)

Tokens return all token info of chain

func (*LedgerApi) TransactionsCount added in v1.2.4

func (l *LedgerApi) TransactionsCount() (map[string]uint64, error)

TransactionsCount returns the number of blocks(not include smartcontract block) and unchecked blocks of chain

func (*LedgerApi) Unsubscribe added in v1.3.0

func (l *LedgerApi) Unsubscribe(subscribe *Subscribe) error

Unsubscribe close a pub-sub connection

type MatchingRecord added in v1.3.5

type MatchingRecord struct {
	Orphan   SummaryRecord `json:"orphan"`
	Matching SummaryRecord `json:"matching"`
}

type MinerApi added in v1.3.0

type MinerApi struct {
	// contains filtered or unexported fields
}

func NewMinerAPI added in v1.3.0

func NewMinerAPI(c *QLCClient) *MinerApi

NewMinerAPI creates miner module for client

func (*MinerApi) GetAvailRewardInfo added in v1.3.0

func (m *MinerApi) GetAvailRewardInfo(coinbase types.Address) (*MinerAvailRewardInfo, error)

MinerAvailRewardInfo returns miner available reward info

func (*MinerApi) GetRewardData added in v1.4.0

func (m *MinerApi) GetRewardData(param *RewardParam) ([]byte, error)

func (*MinerApi) GetRewardHistory added in v1.3.0

func (m *MinerApi) GetRewardHistory(coinbase types.Address) (*MinerHistoryRewardInfo, error)

GetRewardHistory returns miner history reward info

func (*MinerApi) GetRewardRecvBlock added in v1.3.0

func (m *MinerApi) GetRewardRecvBlock(input *types.StateBlock) (*types.StateBlock, error)

GetRewardSendBlock returns miner contract reward block

func (*MinerApi) GetRewardRecvBlockBySendHash added in v1.3.0

func (m *MinerApi) GetRewardRecvBlockBySendHash(sendHash types.Hash) (*types.StateBlock, error)

GetRewardRecvBlockBySendHash returns miner contract reward block

func (*MinerApi) GetRewardSendBlock added in v1.3.0

func (m *MinerApi) GetRewardSendBlock(param *RewardParam) (*types.StateBlock, error)

GetRewardSendBlock returns miner contract send block

func (*MinerApi) UnpackRewardData added in v1.4.0

func (m *MinerApi) UnpackRewardData(data []byte) (*RewardParam, error)

type MinerAvailRewardInfo added in v1.3.0

type MinerAvailRewardInfo struct {
	LastEndHeight     uint64        `json:"lastEndHeight"`
	LatestBlockHeight uint64        `json:"latestBlockHeight"`
	NodeRewardHeight  uint64        `json:"nodeRewardHeight"`
	AvailStartHeight  uint64        `json:"availStartHeight"`
	AvailEndHeight    uint64        `json:"availEndHeight"`
	AvailRewardBlocks uint64        `json:"availRewardBlocks"`
	AvailRewardAmount types.Balance `json:"availRewardAmount"`
	NeedCallReward    bool          `json:"needCallReward"`
}

type MinerHistoryRewardInfo added in v1.3.0

type MinerHistoryRewardInfo struct {
	LastEndHeight  uint64        `json:"lastEndHeight"`
	RewardBlocks   uint64        `json:"rewardBlocks"`
	RewardAmount   types.Balance `json:"rewardAmount"`
	LastRewardTime int64         `json:"lastRewardTime"`
}

type MintageApi added in v1.2.4

type MintageApi struct {
	// contains filtered or unexported fields
}

func NewMintageAPI added in v1.3.0

func NewMintageAPI(c *QLCClient) *MintageApi

NewMintageAPI creates mintage module for client

func (*MintageApi) GetMintageBlock added in v1.2.4

func (m *MintageApi) GetMintageBlock(param *MintageParams) (*types.StateBlock, error)

GetMintageBlock returns mintage block by mintage parameters

func (*MintageApi) GetMintageData added in v1.2.4

func (m *MintageApi) GetMintageData(param *MintageParams) ([]byte, error)

GetMintageData returns mintage data by mintage parameters

func (*MintageApi) GetRewardBlock added in v1.2.4

func (m *MintageApi) GetRewardBlock(input *types.StateBlock) (*types.StateBlock, error)

GetRewardBlock returns reward block by mintage block

func (*MintageApi) GetWithdrawMintageBlock added in v1.2.4

func (m *MintageApi) GetWithdrawMintageBlock(param *WithdrawParams) (*types.StateBlock, error)

GetWithdrawMintageBlock returns withdraw mintage block by withdraw parameters

func (*MintageApi) GetWithdrawMintageData added in v1.2.4

func (m *MintageApi) GetWithdrawMintageData(tokenId types.Hash) ([]byte, error)

GetWithdrawMintageData returns withdraw mintage data by token id

func (*MintageApi) GetWithdrawRewardBlock added in v1.2.4

func (m *MintageApi) GetWithdrawRewardBlock(input *types.StateBlock) (*types.StateBlock, error)

GetWithdrawRewardBlock returns withdraw mintage block by mintage block

func (*MintageApi) ParseTokenInfo added in v1.3.2

func (m *MintageApi) ParseTokenInfo(data []byte) (*types.TokenInfo, error)

type MintageParams added in v1.2.4

type MintageParams struct {
	SelfAddr    types.Address `json:"selfAddr"`
	PrevHash    types.Hash    `json:"prevHash"`
	TokenName   string        `json:"tokenName"`
	TokenSymbol string        `json:"tokenSymbol"`
	TotalSupply string        `json:"totalSupply"`
	Decimals    uint8         `json:"decimals"`
	Beneficial  types.Address `json:"beneficial"`
	NEP5TxId    string        `json:"nep5TxId"`
}

type MultiPartySummaryResult added in v1.3.5

type MultiPartySummaryResult struct {
	Contracts []*SettlementContract     `json:"contracts"`
	Records   map[string]*CompareRecord `json:"records"`
	Total     *CompareRecord            `json:"total"`
}

type NEP5PledgeInfo added in v1.2.4

type NEP5PledgeInfo struct {
	PType         string
	Amount        *big.Int
	WithdrawTime  string
	Beneficial    types.Address
	PledgeAddress types.Address
	NEP5TxId      string
}

type NetApi added in v1.2.4

type NetApi struct {
	// contains filtered or unexported fields
}

func NewNetAPI added in v1.3.0

func NewNetAPI(c *QLCClient) *NetApi

NewNetAPI creates net module for client

func (*NetApi) OnlineRepresentatives added in v1.2.4

func (q *NetApi) OnlineRepresentatives() ([]types.Address, error)

OnlineRepresentatives returns representatives that online at this moment

type PledgeApi added in v1.2.4

type PledgeApi struct {
	// contains filtered or unexported fields
}

func NewPledgeAPI added in v1.3.0

func NewPledgeAPI(c *QLCClient) *PledgeApi

NewPledgeAPI creates pledge module for client

func (*PledgeApi) GetPledgeBlock added in v1.2.4

func (p *PledgeApi) GetPledgeBlock(param *PledgeParam) (*types.StateBlock, error)

GetPledgeBlock returns pledge block by pledge parameters

func (*PledgeApi) GetPledgeData added in v1.2.4

func (p *PledgeApi) GetPledgeData(param *PledgeParam) ([]byte, error)

GetMintageData returns pledge data by pledge parameters

func (*PledgeApi) GetPledgeInfoWithNEP5TxId added in v1.2.4

func (p *PledgeApi) GetPledgeInfoWithNEP5TxId(param *WithdrawPledgeParam) (*NEP5PledgeInfo, error)

func (*PledgeApi) GetPledgeRewordBlock added in v1.2.4

func (p *PledgeApi) GetPledgeRewordBlock(input *types.StateBlock) (*types.StateBlock, error)

GetPledgeRewordBlock returns pledge reward block by pledge block

func (*PledgeApi) GetTotalPledgeAmount added in v1.2.4

func (p *PledgeApi) GetTotalPledgeAmount() (*big.Int, error)

func (*PledgeApi) GetWithdrawPledgeBlock added in v1.2.4

func (p *PledgeApi) GetWithdrawPledgeBlock(param *WithdrawPledgeParam) (*types.StateBlock, error)

GetWithdrawPledgeBlock returns withdraw pledge block by withdraw parameters

func (*PledgeApi) GetWithdrawPledgeData added in v1.2.4

func (p *PledgeApi) GetWithdrawPledgeData(param *WithdrawPledgeParam) ([]byte, error)

GetWithdrawPledgeData returns withdraw pledge data by withdraw parameters

func (*PledgeApi) GetWithdrawRewardBlock added in v1.2.4

func (p *PledgeApi) GetWithdrawRewardBlock(input *types.StateBlock) (*types.StateBlock, error)

GetWithdrawRewardBlock returns withdraw reward block by pledge block

func (*PledgeApi) ParsePledgeInfo added in v1.3.2

func (p *PledgeApi) ParsePledgeInfo(data []byte) (*PledgeInfo, error)

func (*PledgeApi) SearchAllPledgeInfo added in v1.2.4

func (p *PledgeApi) SearchAllPledgeInfo() ([]*NEP5PledgeInfo, error)

func (*PledgeApi) SearchPledgeInfo added in v1.2.4

func (p *PledgeApi) SearchPledgeInfo(param *WithdrawPledgeParam) ([]*NEP5PledgeInfo, error)

type PledgeInfo added in v1.3.2

type PledgeInfo struct {
	PType         uint8
	Amount        *big.Int
	WithdrawTime  int64
	Beneficial    types.Address
	PledgeAddress types.Address
	NEP5TxId      string
}

type PledgeParam added in v1.2.4

type PledgeParam struct {
	Beneficial    types.Address
	PledgeAddress types.Address
	Amount        types.Balance
	PType         string
	NEP5TxId      string
}

type PovApi added in v1.3.0

type PovApi struct {
	// contains filtered or unexported fields
}

func NewPovAPI added in v1.3.0

func NewPovAPI(url string, c *QLCClient) *PovApi

NewPovAPI creates pov module for client

func (*PovApi) BatchGetHeadersByHeight added in v1.3.0

func (p *PovApi) BatchGetHeadersByHeight(height uint64, count uint64, asc bool) (*PovApiBatchHeader, error)

BatchGetHeadersByHeight returns a lots of pov headers info by range

func (*PovApi) GetAccountStateByBlockHash added in v1.3.0

func (p *PovApi) GetAccountStateByBlockHash(address types.Address, blockHash types.Hash) (*PovApiState, error)

GetAccountStateByBlockHash returns pov account state by block hash

func (*PovApi) GetAccountStateByBlockHeight added in v1.3.0

func (p *PovApi) GetAccountStateByBlockHeight(address types.Address, height uint64) (*PovApiState, error)

GetAccountStateByBlockHeight returns pov account state by block height

func (*PovApi) GetBlockByHash added in v1.3.0

func (p *PovApi) GetBlockByHash(blockHash types.Hash, txOffset uint32, txLimit uint32) (*PovApiBlock, error)

GetBlockByHash returns pov block info by hash

func (*PovApi) GetBlockByHeight added in v1.3.0

func (p *PovApi) GetBlockByHeight(height uint64, txOffset uint32, txLimit uint32) (*PovApiBlock, error)

GetBlockByHeight returns pov block info by height

func (*PovApi) GetDiffDayStat added in v1.3.1

func (p *PovApi) GetDiffDayStat(dayIndex int) (*types.PovDiffDayStat, error)

GetDiffDayStat returns pov difficulty day statistic

func (*PovApi) GetDiffDayStatByHeight added in v1.3.1

func (p *PovApi) GetDiffDayStatByHeight(height uint64) (*types.PovDiffDayStat, error)

GetDiffDayStatByHeight returns pov difficulty day statistic

func (*PovApi) GetFittestHeader added in v1.3.0

func (p *PovApi) GetFittestHeader(gap uint64) (*PovApiHeader, error)

GetFittestHeader returns fittest pov header info If node is in pov syncing, will return error

func (*PovApi) GetHashInfo added in v1.3.0

func (p *PovApi) GetHashInfo(height uint64, lookup uint64) (*PovApiHashInfo, error)

GetHashInfo returns pov network hash info

func (*PovApi) GetHeaderByHash added in v1.3.0

func (p *PovApi) GetHeaderByHash(blockHash types.Hash) (*PovApiHeader, error)

GetHeaderByHash returns pov header info by hash

func (*PovApi) GetHeaderByHeight added in v1.3.0

func (p *PovApi) GetHeaderByHeight(height uint64) (*PovApiHeader, error)

GetHeaderByHeight returns pov header info by height

func (*PovApi) GetLastNHourInfo added in v1.3.0

func (p *PovApi) GetLastNHourInfo(endHeight uint64, timeSpan uint32) (*PovApiGetLastNHourInfo, error)

GetLastNHourInfo returns pov last n hour statistic

func (*PovApi) GetLatestAccountState added in v1.3.0

func (p *PovApi) GetLatestAccountState(address types.Address) (*PovApiState, error)

GetLatestAccountState returns pov account state in latest block

func (*PovApi) GetLatestBlock added in v1.3.0

func (p *PovApi) GetLatestBlock(txOffset uint32, txLimit uint32) (*PovApiBlock, error)

GetLatestBlock returns latest pov block info

func (*PovApi) GetLatestHeader added in v1.3.0

func (p *PovApi) GetLatestHeader() (*PovApiHeader, error)

GetLatestHeader returns latest pov header info

func (*PovApi) GetMinerDayStat added in v1.3.1

func (p *PovApi) GetMinerDayStat(dayIndex int) (*types.PovMinerDayStat, error)

GetMinerDayStat returns pov miner day statistic

func (*PovApi) GetMinerDayStatByHeight added in v1.3.1

func (p *PovApi) GetMinerDayStatByHeight(height uint64) (*types.PovMinerDayStat, error)

GetMinerDayStatByHeight returns pov miner day statistic

func (*PovApi) GetMinerStats added in v1.3.0

func (p *PovApi) GetMinerStats(addrs []types.Address) (*PovMinerStats, error)

GetMinerStats returns pov miner statistic

func (*PovApi) GetMiningInfo added in v1.3.0

func (p *PovApi) GetMiningInfo() (*PovApiGetMiningInfo, error)

GetMiningInfo returns pov mining info

func (*PovApi) GetPovStatus added in v1.3.2

func (p *PovApi) GetPovStatus() (*PovApiStatus, error)

GetFittestHeader returns fittest pov header info If node is in pov syncing, will return error

func (*PovApi) GetRepStats added in v1.3.0

func (p *PovApi) GetRepStats(addrs []types.Address) (*PovRepStats, error)

GetRepStats returns pov rep statistic

func (*PovApi) GetTransaction added in v1.3.0

func (p *PovApi) GetTransaction(txHash types.Hash) (*PovApiTxLookup, error)

GetTransaction returns pov tx lookup info by tx hash

func (*PovApi) GetTransactionByBlockHashAndIndex added in v1.3.0

func (p *PovApi) GetTransactionByBlockHashAndIndex(blockHash types.Hash, index uint32) (*PovApiTxLookup, error)

GetTransactionByBlockHashAndIndex returns pov tx lookup info by block hash and tx index

func (*PovApi) GetTransactionByBlockHeightAndIndex added in v1.3.0

func (p *PovApi) GetTransactionByBlockHeightAndIndex(height uint64, index uint32) (*PovApiTxLookup, error)

GetTransactionByBlockHeightAndIndex returns pov tx lookup info by block height and tx index

func (*PovApi) GetWork added in v1.3.0

func (p *PovApi) GetWork(minerAddr types.Address, algoName string) (*PovApiGetWork, error)

GetWork returns pov next block work info If node is in pov syncing, will return error

func (*PovApi) SubmitWork added in v1.3.0

func (p *PovApi) SubmitWork(work *PovApiSubmitWork) error

SubmitWork sumbits new block work to node If node is in pov syncing, will return error

func (*PovApi) SubscribeNewBlock added in v1.3.1

func (p *PovApi) SubscribeNewBlock(ch chan *PovApiHeader) (*Subscribe, error)

NewBlock support publish/subscription, ch is PovApiHeader channel, once there is new block stored to the chain, set the block to channel

func (*PovApi) Unsubscribe added in v1.3.0

func (p *PovApi) Unsubscribe(subscribe *Subscribe) error

Unsubscribe close a pub-sub connection

type PovApiBatchHeader added in v1.3.0

type PovApiBatchHeader struct {
	Count   int             `json:"count"`
	Headers []*PovApiHeader `json:"headers"`
}

type PovApiBlock added in v1.3.0

type PovApiBlock struct {
	*types.PovBlock
	AlgoName       string  `json:"algoName"`
	AlgoEfficiency uint    `json:"algoEfficiency"`
	NormBits       uint32  `json:"normBits"`
	NormDifficulty float64 `json:"normDifficulty"`
	AlgoDifficulty float64 `json:"algoDifficulty"`
}

type PovApiGetLastNHourInfo added in v1.3.0

type PovApiGetLastNHourInfo struct {
	MaxTxPerBlock uint32
	MinTxPerBlock uint32
	AvgTxPerBlock uint32

	MaxTxPerHour uint32
	MinTxPerHour uint32
	AvgTxPerHour uint32

	MaxBlockPerHour uint32
	MinBlockPerHour uint32
	AvgBlockPerHour uint32

	AllBlockNum uint32
	AllTxNum    uint32

	Sha256dBlockNum uint32
	X11BlockNum     uint32
	ScryptBlockNum  uint32
	AuxBlockNum     uint32

	HourItemList []*PovApiGetLastNHourItem
}

type PovApiGetLastNHourItem added in v1.3.0

type PovApiGetLastNHourItem struct {
	Hour uint32

	AllBlockNum    uint32
	AllTxNum       uint32
	AllMinerReward types.Balance
	AllRepReward   types.Balance

	Sha256dBlockNum uint32
	X11BlockNum     uint32
	ScryptBlockNum  uint32
	AuxBlockNum     uint32

	MaxTxPerBlock uint32
	MinTxPerBlock uint32
	AvgTxPerBlock uint32
}

type PovApiGetMiningInfo added in v1.3.0

type PovApiGetMiningInfo struct {
	SyncState          int               `json:"syncState"`
	CurrentBlockHeight uint64            `json:"currentBlockHeight"`
	CurrentBlockHash   types.Hash        `json:"currentBlockHash"`
	CurrentBlockSize   uint32            `json:"currentBlockSize"`
	CurrentBlockTx     uint32            `json:"currentBlockTx"`
	CurrentBlockAlgo   types.PovAlgoType `json:"currentBlockAlgo"`
	PooledTx           uint32            `json:"pooledTx"`
	Difficulty         float64           `json:"difficulty"`
	HashInfo           *PovApiHashInfo   `json:"hashInfo"`
}

type PovApiGetWork added in v1.3.0

type PovApiGetWork struct {
	WorkHash      types.Hash     `json:"workHash"`
	Version       uint32         `json:"version"`
	Previous      types.Hash     `json:"previous"`
	Bits          uint32         `json:"bits"`
	Height        uint64         `json:"height"`
	MinTime       uint32         `json:"minTime"`
	MerkleBranch  []*types.Hash  `json:"merkleBranch"`
	CoinBaseData1 types.HexBytes `json:"coinbaseData1"`
	CoinBaseData2 types.HexBytes `json:"coinbaseData2"`
}

type PovApiHashInfo added in v1.3.0

type PovApiHashInfo struct {
	ChainHashPS   uint64 `json:"chainHashPS"`
	Sha256dHashPS uint64 `json:"sha256dHashPS"`
	ScryptHashPS  uint64 `json:"scryptHashPS"`
	X11HashPS     uint64 `json:"x11HashPS"`
}

type PovApiHeader added in v1.3.0

type PovApiHeader struct {
	*types.PovHeader
	AlgoName       string  `json:"algoName"`
	AlgoEfficiency uint    `json:"algoEfficiency"`
	NormBits       uint32  `json:"normBits"`
	NormDifficulty float64 `json:"normDifficulty"`
	AlgoDifficulty float64 `json:"algoDifficulty"`
}

type PovApiState added in v1.3.0

type PovApiState struct {
	AccountState *types.PovAccountState `json:"accountState"`
	RepState     *types.PovRepState     `json:"repState"`
}

type PovApiStatus added in v1.3.2

type PovApiStatus struct {
	PovEnabled   bool   `json:"povEnabled"`
	SyncState    int    `json:"syncState"`
	SyncStateStr string `json:"syncStateStr"`
}

type PovApiSubmitWork added in v1.3.0

type PovApiSubmitWork struct {
	WorkHash  types.Hash `json:"workHash"`
	BlockHash types.Hash `json:"blockHash"`

	MerkleRoot    types.Hash     `json:"merkleRoot"`
	Timestamp     uint32         `json:"timestamp"`
	Nonce         uint32         `json:"nonce"`
	CoinbaseExtra types.HexBytes `json:"coinbaseExtra"`
	CoinbaseHash  types.Hash     `json:"coinbaseHash"`

	AuxPow *types.PovAuxHeader `json:"auxPow"`
}

type PovApiTxLookup added in v1.3.0

type PovApiTxLookup struct {
	TxHash   types.Hash         `json:"txHash"`
	TxLookup *types.PovTxLookup `json:"txLookup"`

	CoinbaseTx *types.PovCoinBaseTx `json:"coinbaseTx"`
	AccountTx  *types.StateBlock    `json:"accountTx"`
}

type PovMinerStatItem added in v1.3.0

type PovMinerStatItem struct {
	MainBlockNum       uint32        `json:"mainBlockNum"`
	MainRewardAmount   types.Balance `json:"mainRewardAmount"`
	StableBlockNum     uint32        `json:"stableBlockNum"`
	StableRewardAmount types.Balance `json:"stableRewardAmount"`
	FirstBlockTime     time.Time     `json:"firstBlockTime"`
	LastBlockTime      time.Time     `json:"lastBlockTime"`
	FirstBlockHeight   uint64        `json:"firstBlockHeight"`
	LastBlockHeight    uint64        `json:"lastBlockHeight"`
	IsHourOnline       bool          `json:"isHourOnline"`
	IsDayOnline        bool          `json:"isDayOnline"`
}

type PovMinerStats added in v1.3.0

type PovMinerStats struct {
	MinerCount      int `json:"minerCount"`
	HourOnlineCount int `json:"hourOnlineCount"`
	DayOnlineCount  int `json:"dayOnlineCount"`

	MinerStats map[types.Address]*PovMinerStatItem `json:"minerStats"`

	TotalBlockNum     uint32 `json:"totalBlockNum"`
	LatestBlockHeight uint64 `json:"latestBlockHeight"`
}

type PovRepStatItem added in v1.3.5

type PovRepStatItem struct {
	MainBlockNum       uint32        `json:"mainBlockNum"`
	MainRewardAmount   types.Balance `json:"mainRewardAmount"`
	MainOnlinePeriod   uint32        `json:"mainOnlinePeriod"`
	StableBlockNum     uint32        `json:"stableBlockNum"`
	StableRewardAmount types.Balance `json:"stableRewardAmount"`
	StableOnlinePeriod uint32        `json:"stableOnlinePeriod"`
	LastOnlineTime     time.Time     `json:"lastOnlineTime"`
	LastOnlineHeight   uint64        `json:"lastOnlineHeight"`
	IsOnline           bool          `json:"isOnline"`
}

type PovRepStats added in v1.3.0

type PovRepStats struct {
	RepCount          uint32                            `json:"repCount"`
	RepStats          map[types.Address]*PovRepStatItem `json:"repStats"`
	TotalBlockNum     uint32                            `json:"totalBlockNum"`
	TotalPeriod       uint32                            `json:"totalPeriod"`
	TotalRewardAmount types.Balance                     `json:"totalRewardAmount"`
	LatestBlockHeight uint64                            `json:"latestBlockHeight"`
}

type PrivacyApi added in v1.4.0

type PrivacyApi struct {
	// contains filtered or unexported fields
}

func NewPrivacyAPI added in v1.4.0

func NewPrivacyAPI(c *QLCClient) *PrivacyApi

NewPrivacyAPI creates privacy module for client

func (*PrivacyApi) DistributeRawPayload added in v1.4.0

func (p *PrivacyApi) DistributeRawPayload(param *PrivacyDistributeParam) ([]byte, error)

DistributeRawPayload push private raw data to parties

func (*PrivacyApi) GetBlockPrivatePayload added in v1.4.0

func (p *PrivacyApi) GetBlockPrivatePayload(blockHash types.Hash) ([]byte, error)

GetBlockPrivatePayload return private raw data by block hash

func (*PrivacyApi) GetDemoKV added in v1.4.0

func (p *PrivacyApi) GetDemoKV(key []byte) ([]byte, error)

GetDemoKV returns KV in PrivacyKV contract (just for demo in testnet)

func (*PrivacyApi) GetRawPayload added in v1.4.0

func (p *PrivacyApi) GetRawPayload(enclaveKey []byte) ([]byte, error)

GetRawPayload return private raw data by enclave key

type PrivacyDistributeParam added in v1.4.0

type PrivacyDistributeParam struct {
	RawPayload     []byte   `json:"rawPayload"`
	PrivateFrom    string   `json:"privateFrom"`
	PrivateFor     []string `json:"privateFor"`
	PrivateGroupID string   `json:"privateGroupID"`
}

type QGasPledgeParam added in v1.5.0

type QGasPledgeParam struct {
	FromAddress types.Address
	Amount      types.Balance
	ToAddress   types.Address
}

type QGasSwapApi added in v1.5.0

type QGasSwapApi struct {
	// contains filtered or unexported fields
}

func NewQGasSwapAPI added in v1.5.0

func NewQGasSwapAPI(c *QLCClient) *QGasSwapApi

QGasSwapApi creates QGasSwap module for client

func (*QGasSwapApi) GetAllSwapInfos added in v1.5.0

func (q *QGasSwapApi) GetAllSwapInfos(count int, offset int, isPledge *bool) ([]*QGasSwapInfo, error)

func (*QGasSwapApi) GetPledgeRewardBlock added in v1.5.0

func (q *QGasSwapApi) GetPledgeRewardBlock(sendHash types.Hash) (*types.StateBlock, error)

func (*QGasSwapApi) GetPledgeSendBlock added in v1.5.0

func (q *QGasSwapApi) GetPledgeSendBlock(param *QGasPledgeParam) (*types.StateBlock, error)

func (*QGasSwapApi) GetSwapAmountByAddress added in v1.5.0

func (q *QGasSwapApi) GetSwapAmountByAddress(addr types.Address) (map[string]*big.Int, error)

func (*QGasSwapApi) GetSwapInfosByAddress added in v1.5.0

func (q *QGasSwapApi) GetSwapInfosByAddress(addr types.Address, count int, offset int, isPledge *bool) ([]*QGasSwapInfo, error)

func (*QGasSwapApi) GetWithdrawRewardBlock added in v1.5.0

func (q *QGasSwapApi) GetWithdrawRewardBlock(sendHash types.Hash) (*types.StateBlock, error)

func (*QGasSwapApi) GetWithdrawSendBlock added in v1.5.0

func (q *QGasSwapApi) GetWithdrawSendBlock(param *QGasWithdrawParam) (*types.StateBlock, error)

func (*QGasSwapApi) ParseWithdrawParam added in v1.5.0

func (q *QGasSwapApi) ParseWithdrawParam(data []byte) (*QGasWithdrawParam, error)

type QGasSwapInfo added in v1.5.0

type QGasSwapInfo struct {
	SwapType    string
	FromAddress types.Address
	Amount      types.Balance
	ToAddress   types.Address
	SendHash    types.Hash
	RewardHash  types.Hash
	LinkHash    types.Hash
	Time        string
}

type QGasWithdrawParam added in v1.5.0

type QGasWithdrawParam struct {
	ToAddress   types.Address
	Amount      types.Balance
	FromAddress types.Address
	LinkHash    types.Hash
}

type QLCClient

type QLCClient struct {
	Account       *AccountApi
	Contract      *ContractApi
	Ledger        *LedgerApi
	Mintage       *MintageApi
	Pledge        *PledgeApi
	Rewards       *RewardsApi
	Network       *NetApi
	Util          *UtilApi
	Destroy       *DestroyApi
	Debug         *DebugApi
	Pov           *PovApi
	Miner         *MinerApi
	Rep           *RepApi
	Settlement    *SettlementAPI
	Privacy       *PrivacyApi
	DoDBilling    *DoDBillingAPI
	DoDSettlement *DoDSettlementAPI
	QGasSwap      *QGasSwapApi
	// contains filtered or unexported fields
}

func NewQLCClient

func NewQLCClient(endpoint string) (*QLCClient, error)

NewQLCClient creates a new client

func (*QLCClient) Close added in v1.1.2

func (c *QLCClient) Close() error

func (*QLCClient) Version

func (c *QLCClient) Version() string

Version returns version for sdk

type RegisterAssetParam added in v1.3.5

type RegisterAssetParam struct {
	Owner     Contractor `json:"owner"`
	Assets    []*Asset   `json:"assets"`
	StartDate int64      `json:"startDate"`
	EndDate   int64      `json:"endDate"`
	Status    string     `json:"status"`
}

type RepApi added in v1.3.0

type RepApi struct {
	// contains filtered or unexported fields
}

func NewRepAPI added in v1.3.0

func NewRepAPI(c *QLCClient) *RepApi

NewRepAPI creates representative module for client

func (*RepApi) GetAvailRewardInfo added in v1.3.0

func (r *RepApi) GetAvailRewardInfo(account types.Address) (*RepAvailRewardInfo, error)

GetAvailRewardInfo returns representative available reward info

func (*RepApi) GetRewardHistory added in v1.3.0

func (r *RepApi) GetRewardHistory(account types.Address) (*RepHistoryRewardInfo, error)

GetRewardHistory returns representative history reward info

func (*RepApi) GetRewardRecvBlock added in v1.3.0

func (r *RepApi) GetRewardRecvBlock(input *types.StateBlock) (*types.StateBlock, error)

GetRewardSendBlock returns representative contract reward block

func (*RepApi) GetRewardRecvBlockBySendHash added in v1.3.0

func (r *RepApi) GetRewardRecvBlockBySendHash(sendHash types.Hash) (*types.StateBlock, error)

GetRewardRecvBlockBySendHash returns representative contract reward block

func (*RepApi) GetRewardSendBlock added in v1.3.0

func (r *RepApi) GetRewardSendBlock(param *RepRewardParam) (*types.StateBlock, error)

GetRewardSendBlock returns representative contract send block

type RepAvailRewardInfo added in v1.3.0

type RepAvailRewardInfo struct {
	LastEndHeight     uint64        `json:"lastEndHeight"`
	LatestBlockHeight uint64        `json:"latestBlockHeight"`
	NodeRewardHeight  uint64        `json:"nodeRewardHeight"`
	AvailStartHeight  uint64        `json:"availStartHeight"`
	AvailEndHeight    uint64        `json:"availEndHeight"`
	AvailRewardBlocks uint64        `json:"availRewardBlocks"`
	AvailRewardAmount types.Balance `json:"availRewardAmount"`
	NeedCallReward    bool          `json:"needCallReward"`
}

type RepHistoryRewardInfo added in v1.3.0

type RepHistoryRewardInfo struct {
	LastEndHeight  uint64        `json:"lastEndHeight"`
	RewardBlocks   uint64        `json:"rewardBlocks"`
	RewardAmount   types.Balance `json:"rewardAmount"`
	LastRewardTime int64         `json:"lastRewardTime"`
}

type RepRewardParam added in v1.3.0

type RepRewardParam struct {
	Account      types.Address `json:"account"`
	Beneficial   types.Address `json:"beneficial"`
	StartHeight  uint64        `json:"startHeight"`
	EndHeight    uint64        `json:"endHeight"`
	RewardBlocks uint64        `json:"rewardBlocks"`
	RewardAmount *big.Int      `json:"rewardAmount"`
}

type RewardParam added in v1.3.0

type RewardParam struct {
	Coinbase     types.Address `json:"coinbase"`
	Beneficial   types.Address `json:"beneficial"`
	StartHeight  uint64        `json:"startHeight"`
	EndHeight    uint64        `json:"endHeight"`
	RewardBlocks uint64        `json:"rewardBlocks"`
	RewardAmount *big.Int      `json:"rewardAmount"`
}

type RewardsApi added in v1.2.4

type RewardsApi struct {
	// contains filtered or unexported fields
}

func NewRewardAPI added in v1.3.0

func NewRewardAPI(c *QLCClient) *RewardsApi

NewRewardAPI creates reward module for client

func (*RewardsApi) GetConfidantRewords added in v1.2.4

func (r *RewardsApi) GetConfidantRewords(confidant types.Address) (map[string]*big.Int, error)

func (*RewardsApi) GetReceiveRewardBlock added in v1.2.4

func (r *RewardsApi) GetReceiveRewardBlock(send *types.Hash) (*types.StateBlock, error)

func (*RewardsApi) GetSendConfidantBlock added in v1.2.4

func (r *RewardsApi) GetSendConfidantBlock(param *RewardsParam, sign *types.Signature) (*types.StateBlock, error)

func (*RewardsApi) GetSendRewardBlock added in v1.2.4

func (r *RewardsApi) GetSendRewardBlock(param *RewardsParam, sign *types.Signature) (*types.StateBlock, error)

func (*RewardsApi) GetTotalRewards added in v1.2.4

func (r *RewardsApi) GetTotalRewards(txId string) (*big.Int, error)

func (*RewardsApi) GetUnsignedConfidantData added in v1.2.4

func (r *RewardsApi) GetUnsignedConfidantData(param *RewardsParam) (types.Hash, error)

func (*RewardsApi) GetUnsignedRewardData added in v1.2.4

func (r *RewardsApi) GetUnsignedRewardData(param *RewardsParam) (types.Hash, error)

type RewardsParam added in v1.2.4

type RewardsParam struct {
	Id     string        `json:"Id"`
	Amount types.Balance `json:"amount"`
	Self   types.Address `json:"self"`
	To     types.Address `json:"to"`
}

type SLA added in v1.3.5

type SLA struct {
	SLAType       SLAType         `json:"type"`
	Priority      uint            `json:"priority"`
	Value         float32         `json:"value"`
	Compensations []*Compensation `json:"compensations,omitempty"`
}

type SLAType added in v1.3.5

type SLAType int
const (
	// SLATypeDeliveredRate is a SLAType of type DeliveredRate
	SLATypeDeliveredRate SLAType = iota
	// SLATypeLatency is a SLAType of type Latency
	SLATypeLatency
)

func ParseSLAType added in v1.3.5

func ParseSLAType(name string) (SLAType, error)

ParseSLAType attempts to convert a string to a SLAType

func (SLAType) MarshalText added in v1.3.5

func (x SLAType) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (SLAType) String added in v1.3.5

func (x SLAType) String() string

String implements the Stringer interface.

func (*SLAType) UnmarshalText added in v1.3.5

func (x *SLAType) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type SendingStatus added in v1.3.5

type SendingStatus int
const (
	// SendingStatusSent is a SendingStatus of type Sent
	SendingStatusSent SendingStatus = iota
	// SendingStatusError is a SendingStatus of type Error
	SendingStatusError
	// SendingStatusEmpty is a SendingStatus of type Empty
	SendingStatusEmpty
)

func ParseSendingStatus added in v1.3.5

func ParseSendingStatus(name string) (SendingStatus, error)

ParseSendingStatus attempts to convert a string to a SendingStatus

func (SendingStatus) MarshalText added in v1.3.5

func (x SendingStatus) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (SendingStatus) String added in v1.3.5

func (x SendingStatus) String() string

String implements the Stringer interface.

func (*SendingStatus) UnmarshalText added in v1.3.5

func (x *SendingStatus) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type SettlementAPI added in v1.3.5

type SettlementAPI struct {
	// contains filtered or unexported fields
}

func NewSettlementAPI added in v1.3.5

func NewSettlementAPI(c *QLCClient) *SettlementAPI

func (*SettlementAPI) GenerateInvoices added in v1.3.5

func (s *SettlementAPI) GenerateInvoices(addr *types.Address, start, end int64) ([]*InvoiceRecord, error)

func (*SettlementAPI) GenerateInvoicesByAccount added in v1.4.0

func (s *SettlementAPI) GenerateInvoicesByAccount(addr *types.Address, account string, start, end int64) ([]*InvoiceRecord, error)

GenerateInvoicesByAccount generate invoice by PCCWG account @param addr settlement contract address @param account PCCWG account @param start report start date (UTC unix time) @param end report end data (UTC unix time) @return settlement invoice

func (*SettlementAPI) GenerateInvoicesByContract added in v1.3.5

func (s *SettlementAPI) GenerateInvoicesByContract(addr *types.Address, start, end int64) ([]*InvoiceRecord, error)

func (*SettlementAPI) GenerateInvoicesByCustomer added in v1.4.0

func (s *SettlementAPI) GenerateInvoicesByCustomer(addr *types.Address, customer string, start, end int64) ([]*InvoiceRecord, error)

GenerateInvoicesByCustomer generate invoice by PCCWG customer name @param addr settlement contract address @param customer PCCWG customer name @param start report start date (UTC unix time) @param end report end data (UTC unix time) @return settlement invoice

func (*SettlementAPI) GenerateMultiPartyInvoice added in v1.3.5

func (s *SettlementAPI) GenerateMultiPartyInvoice(firstAddr, secondAddr *types.Address, start, end int64) ([]*InvoiceRecord, error)

func (*SettlementAPI) GenerateMultiPartySummaryReport added in v1.3.5

func (s *SettlementAPI) GenerateMultiPartySummaryReport(firstAddr, secondAddr *types.Address, start, end int64) (*MultiPartySummaryResult, error)

func (*SettlementAPI) GetAddNextStopBlock added in v1.3.5

func (s *SettlementAPI) GetAddNextStopBlock(param *StopParam, sign Signature) (*types.StateBlock, error)

func (*SettlementAPI) GetAddPreStopBlock added in v1.3.5

func (s *SettlementAPI) GetAddPreStopBlock(param *StopParam, sign Signature) (*types.StateBlock, error)

func (*SettlementAPI) GetAllAssets added in v1.3.5

func (s *SettlementAPI) GetAllAssets(count int, offset *int) ([]*AssetParam, error)

func (*SettlementAPI) GetAllCDRStatus added in v1.3.5

func (s *SettlementAPI) GetAllCDRStatus(addr *types.Address, count int, offset *int) ([]*CDRStatus, error)

func (*SettlementAPI) GetAllContracts added in v1.3.5

func (s *SettlementAPI) GetAllContracts(count int, offset *int) ([]*SettlementContract, error)

func (*SettlementAPI) GetAsset added in v1.3.5

func (s *SettlementAPI) GetAsset(address types.Address) (*AssetParam, error)

func (*SettlementAPI) GetAssetsByOwner added in v1.3.5

func (s *SettlementAPI) GetAssetsByOwner(owner *types.Address, count int, offset *int) ([]*AssetParam, error)

func (*SettlementAPI) GetCDRStatus added in v1.3.5

func (s *SettlementAPI) GetCDRStatus(addr *types.Address, hash types.Hash) (*CDRStatus, error)

func (*SettlementAPI) GetCDRStatusByCdrData added in v1.3.5

func (s *SettlementAPI) GetCDRStatusByCdrData(addr *types.Address, index uint64, sender, destination string) (*CDRStatus, error)

func (*SettlementAPI) GetCDRStatusByDate added in v1.3.5

func (s *SettlementAPI) GetCDRStatusByDate(addr *types.Address, start, end int64, count int, offset *int) ([]*CDRStatus, error)

func (*SettlementAPI) GetContractAddressByPartyANextStop added in v1.3.5

func (s *SettlementAPI) GetContractAddressByPartyANextStop(addr *types.Address, stopName string) (*types.Address, error)

func (*SettlementAPI) GetContractAddressByPartyBPreStop added in v1.3.5

func (s *SettlementAPI) GetContractAddressByPartyBPreStop(addr *types.Address, stopName string) (*types.Address, error)

func (*SettlementAPI) GetContractsAsPartyA added in v1.3.5

func (s *SettlementAPI) GetContractsAsPartyA(addr *types.Address, count int, offset *int) ([]*SettlementContract, error)

func (*SettlementAPI) GetContractsAsPartyB added in v1.3.5

func (s *SettlementAPI) GetContractsAsPartyB(addr *types.Address, count int, offset *int) ([]*SettlementContract, error)

func (*SettlementAPI) GetContractsByAddress added in v1.3.5

func (s *SettlementAPI) GetContractsByAddress(addr *types.Address, count int, offset *int) ([]*SettlementContract, error)

func (*SettlementAPI) GetContractsByStatus added in v1.3.5

func (s *SettlementAPI) GetContractsByStatus(addr *types.Address, status string, count int, offset *int) ([]*SettlementContract, error)

func (*SettlementAPI) GetCreateContractBlock added in v1.3.5

func (s *SettlementAPI) GetCreateContractBlock(param *CreateContractParam, sign Signature) (*types.StateBlock, error)

func (*SettlementAPI) GetExpiredContracts added in v1.3.5

func (s *SettlementAPI) GetExpiredContracts(addr *types.Address, count int, offset *int) ([]*SettlementContract, error)

func (*SettlementAPI) GetMultiPartyCDRStatus added in v1.4.0

func (s *SettlementAPI) GetMultiPartyCDRStatus(firstAddr, secondAddr *types.Address, count int, offset *int) ([]*CDRStatus, error)

func (*SettlementAPI) GetNextStopNames added in v1.3.5

func (s *SettlementAPI) GetNextStopNames(addr *types.Address) ([]string, error)

func (*SettlementAPI) GetPreStopNames added in v1.3.5

func (s *SettlementAPI) GetPreStopNames(addr *types.Address) ([]string, error)

func (*SettlementAPI) GetProcessCDRBlock added in v1.3.5

func (s *SettlementAPI) GetProcessCDRBlock(addr *types.Address, params []*CDRParam, sign Signature) (*types.StateBlock, error)

func (*SettlementAPI) GetRegisterAssetBlock added in v1.3.5

func (s *SettlementAPI) GetRegisterAssetBlock(param *RegisterAssetParam, sign Signature) (*types.StateBlock, error)

func (*SettlementAPI) GetRemoveNextStopBlock added in v1.3.5

func (s *SettlementAPI) GetRemoveNextStopBlock(param *StopParam, sign Signature) (*types.StateBlock, error)

func (*SettlementAPI) GetRemovePreStopBlock added in v1.3.5

func (s *SettlementAPI) GetRemovePreStopBlock(param *StopParam, sign Signature) (*types.StateBlock, error)

func (*SettlementAPI) GetSettlementRewardsBlock added in v1.3.5

func (s *SettlementAPI) GetSettlementRewardsBlock(send *types.Hash, sign Signature) (*types.StateBlock, error)

func (*SettlementAPI) GetSignContractBlock added in v1.3.5

func (s *SettlementAPI) GetSignContractBlock(param *SignContractParam, sign Signature) (*types.StateBlock, error)

func (*SettlementAPI) GetSummaryReport added in v1.3.5

func (s *SettlementAPI) GetSummaryReport(addr *types.Address, start, end int64) (*SummaryResult, error)

func (*SettlementAPI) GetSummaryReportByAccount added in v1.4.0

func (s *SettlementAPI) GetSummaryReportByAccount(addr *types.Address, account string, start, end int64) (*SummaryResult, error)

GetSummaryReportByAccount generate summary report by PCCWG account @param addr settlement contract address @param account PCCWG account @param start report start date (UTC unix time) @param end report end data (UTC unix time) @return summary report if error not exist

func (*SettlementAPI) GetSummaryReportByCustomer added in v1.4.0

func (s *SettlementAPI) GetSummaryReportByCustomer(addr *types.Address, customer string, start, end int64) (*SummaryResult, error)

GetSummaryReportByCustomer generate summary report by PCCWG customer name @param addr settlement contract address @param customer PCCWG customer name @param start report start date (UTC unix time) @param end report end data (UTC unix time) @return summary report if error not exist

func (*SettlementAPI) GetTerminateContractBlock added in v1.3.5

func (s *SettlementAPI) GetTerminateContractBlock(param *TerminateParam, sign Signature) (*types.StateBlock, error)

func (*SettlementAPI) GetUpdateNextStopBlock added in v1.3.5

func (s *SettlementAPI) GetUpdateNextStopBlock(param *UpdateStopParam, sign Signature) (*types.StateBlock, error)

func (*SettlementAPI) GetUpdatePreStopBlock added in v1.3.5

func (s *SettlementAPI) GetUpdatePreStopBlock(param *UpdateStopParam, sign Signature) (*types.StateBlock, error)

func (*SettlementAPI) ToAddress added in v1.3.5

func (s *SettlementAPI) ToAddress(param *CreateContractParam) (types.Address, error)

type SettlementCDR added in v1.3.5

type SettlementCDR struct {
	CDRParam
	From types.Address `json:"from"`
}

type SettlementContract added in v1.3.5

type SettlementContract struct {
	CreateContractParam
	PreStops    []string       `json:"preStops"`
	NextStops   []string       `json:"nextStops"`
	ConfirmDate int64          `json:"confirmDate"`
	Status      ContractStatus `json:"status"`
	Address     types.Address  `json:"address"`
	Terminator  *types.Address `json:"-"`
}

type SettlementStatus added in v1.3.5

type SettlementStatus int
const (
	// SettlementStatusUnknown is a SettlementStatus of type Unknown
	SettlementStatusUnknown SettlementStatus = iota
	// SettlementStatusStage1 is a SettlementStatus of type Stage1
	SettlementStatusStage1
	// SettlementStatusSuccess is a SettlementStatus of type Success
	SettlementStatusSuccess
	// SettlementStatusFailure is a SettlementStatus of type Failure
	SettlementStatusFailure
	// SettlementStatusMissing is a SettlementStatus of type Missing
	SettlementStatusMissing
	// SettlementStatusDuplicate is a SettlementStatus of type Duplicate
	SettlementStatusDuplicate
)

func ParseSettlementStatus added in v1.3.5

func ParseSettlementStatus(name string) (SettlementStatus, error)

ParseSettlementStatus attempts to convert a string to a SettlementStatus

func (SettlementStatus) MarshalText added in v1.3.5

func (x SettlementStatus) MarshalText() ([]byte, error)

MarshalText implements the text marshaller method

func (SettlementStatus) String added in v1.3.5

func (x SettlementStatus) String() string

String implements the Stringer interface.

func (*SettlementStatus) UnmarshalText added in v1.3.5

func (x *SettlementStatus) UnmarshalText(text []byte) error

UnmarshalText implements the text unmarshaller method

type SignContractParam added in v1.3.5

type SignContractParam struct {
	ContractAddress types.Address `json:"contractAddress"`
	Address         types.Address `json:"address"`
}

type Signature added in v1.2.4

type Signature func(hash types.Hash) (types.Signature, error)

type SignatureParam added in v1.3.0

type SignatureParam func() (types.Signature, error)

type StopParam added in v1.3.5

type StopParam struct {
	ContractAddress types.Address `json:"contractAddress"`
	StopName        string        `json:"stopName" validate:"nonzero"`
	Address         types.Address `json:"address"`
}

type Subscribe added in v1.3.0

type Subscribe struct {
	Stopped chan bool
	// contains filtered or unexported fields
}

func NewSubscribe added in v1.3.0

func NewSubscribe(url string) *Subscribe

func (*Subscribe) Close added in v1.3.0

func (s *Subscribe) Close() error

func (*Subscribe) Unsubscribe added in v1.3.0

func (s *Subscribe) Unsubscribe(request string) error

type SummaryRecord added in v1.3.5

type SummaryRecord struct {
	Total   uint64  `json:"total"`
	Success uint64  `json:"success"`
	Fail    uint64  `json:"fail"`
	Result  float64 `json:"result"`
}

type SummaryResult added in v1.3.5

type SummaryResult struct {
	Contract *SettlementContract       `json:"contract"`
	Records  map[string]*CompareRecord `json:"records"`
	Total    CompareRecord             `json:"total"`
}

type TerminateParam added in v1.3.5

type TerminateParam struct {
	ContractAddress types.Address `json:"contractAddress"`
	Address         types.Address `json:"address"`
	Request         bool          `json:"request"`
}

type UpdateStopParam added in v1.3.5

type UpdateStopParam struct {
	ContractAddress types.Address `json:"contractAddress"`
	StopName        string        `json:"stopName" validate:"nonzero"`
	New             string        `json:"newName" validate:"nonzero"`
	Address         types.Address `json:"address"`
}

type UtilApi added in v1.2.4

type UtilApi struct {
	// contains filtered or unexported fields
}

func NewUtilAPI added in v1.3.0

func NewUtilAPI(c *QLCClient) *UtilApi

NewUtilAPI creates unit module for client

func (*UtilApi) BalanceToRaw added in v1.2.4

func (u *UtilApi) BalanceToRaw(balance types.Balance, unit string) (types.Balance, error)

RawToBalance transforms QLC amount from unit to raw

func (*UtilApi) BalanceToRawForToken added in v1.2.4

func (u *UtilApi) BalanceToRawForToken(balance types.Balance, tokenName string) (types.Balance, error)

RawToBalance transforms token (not QLC) amount to raw

func (*UtilApi) Decrypt added in v1.2.4

func (u *UtilApi) Decrypt(cryptograph string, passphrase string) (string, error)

Decrypt decrypts cryptograph to raw by passphrase

func (*UtilApi) Encrypt added in v1.2.4

func (u *UtilApi) Encrypt(raw string, passphrase string) (string, error)

Encrypt encrypts raw to cryptograph by passphrase

func (*UtilApi) RawToBalance added in v1.2.4

func (u *UtilApi) RawToBalance(balance types.Balance, unit string) (APIBalance, error)

RawToBalance transforms QLC amount from raw to unit

func (*UtilApi) RawToBalanceForToken added in v1.2.4

func (u *UtilApi) RawToBalanceForToken(balance types.Balance, tokenName string) (APIBalance, error)

RawToBalance transforms token (not QLC) amount from raw

type WithdrawParams added in v1.2.4

type WithdrawParams struct {
	SelfAddr types.Address `json:"selfAddr"`
	TokenId  types.Hash    `json:"tokenId"`
}

type WithdrawPledgeParam added in v1.2.4

type WithdrawPledgeParam struct {
	Beneficial types.Address `json:"beneficial"`
	Amount     types.Balance `json:"amount"`
	PType      string        `json:"pType"`
	NEP5TxId   string        `json:"nep5TxId"`
}

Directories

Path Synopsis
pov
pkg
ed25519
Package ed25519 implements the Ed25519 signature algorithm.
Package ed25519 implements the Ed25519 signature algorithm.
util
Package common contains various helper functions.
Package common contains various helper functions.
util/hexutil
Package hexutil implements hex encoding with 0x prefix.
Package hexutil implements hex encoding with 0x prefix.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL