Versions in this module Expand all Collapse all v0 v0.1.8 Dec 10, 2019 v0.1.7 Jul 16, 2019 v0.1.6 Jul 16, 2019 v0.1.5 Jul 16, 2019 v0.1.4 Jul 2, 2019 v0.1.3 Jul 2, 2019 v0.1.2 Jun 25, 2019 Changes in this version type CybexAPI + ValidateTransaction func(tx *types.SignedTransaction) error v0.1.1 Jun 21, 2019 v0.1.0 Jun 12, 2019 Changes in this version + const AssetsListAll + const AssetsMaxBatchSize + const GetAccountHistoryLimit + const GetCallOrdersLimit + const GetLimitOrdersLimit + const GetSettleOrdersLimit + const GetTradeHistoryLimit + const InvalidApiID + var DialerTimeout = time.Duration(5 * time.Second) + var ErrShutdown = errors.New("connection is shut down") + var LoopSeconds = 60 + var ReadWriteTimeout = time.Duration(10 * time.Second) + func KeyBagByUserPass(username string, password string) *crypto.KeyBag + func Sha256f(input []byte, outputEncoding string) string + func UserPasstoPri(username string, password string) []string + type BestNodeClientProvider struct + func (p *BestNodeClientProvider) CallAPI(apiID int, method string, args ...interface{}) (interface{}, error) + func (p *BestNodeClientProvider) Close() error + type ClientProvider interface + CallAPI func(apiID int, method string, args ...interface{}) (interface{}, error) + Close func() error + Connect func() error + OnError func(fn ErrorFunc) + OnNotify func(subscriberID int, fn NotifyFunc) error + func NewBestNodeClientProvider(endpointURL string, api CybexAPI) (ClientProvider, error) + func NewSimpleClientProvider(endpointURL string, api CybexAPI) ClientProvider + type CybexAPI interface + BroadcastAPIID func() int + BroadcastTransaction func(tx *types.SignedTransaction) error + BuildSignedTransaction func(keyBag *crypto.KeyBag, feeAsset types.GrapheneObject, ops ...types.Operation) (*types.SignedTransaction, error) + CallWsAPI func(apiID int, method string, args ...interface{}) (interface{}, error) + CancelAllSubscriptions func() error + CancelOrder func(orderID types.GrapheneObject, broadcast bool) (*types.SignedTransaction, error) + Close func() error + Connect func() error + DatabaseAPIID func() int + Get24Volume func(base types.GrapheneObject, quote types.GrapheneObject) (types.Volume24, error) + GetAccountBalances func(account types.GrapheneObject, assets ...types.GrapheneObject) (types.AssetAmounts, error) + GetAccountByName func(name string) (*types.Account, error) + GetAccountHistory func(account types.GrapheneObject, stop types.GrapheneObject, limit int, ...) (types.OperationHistories, error) + GetAccounts func(accountIDs ...types.GrapheneObject) (types.Accounts, error) + GetAsset func(lowerBoundSymbol string) (types.Asset, error) + GetBlock func(number uint64) (interface{}, error) + GetCallOrders func(assetID types.GrapheneObject, limit int) (types.CallOrders, error) + GetChainID func() (string, error) + GetDynamicGlobalProperties func() (*types.DynamicGlobalProperties, error) + GetFullAccounts func(accountIDs ...types.GrapheneObject) (types.FullAccountInfos, error) + GetLimitOrders func(base, quote types.GrapheneObject, limit int) (types.LimitOrders, error) + GetMarginPositions func(accountID types.GrapheneObject) (types.CallOrders, error) + GetObjects func(objectIDs ...types.GrapheneObject) ([]interface{}, error) + GetOrderBook func(base, quote types.GrapheneObject, depth int) (types.OrderBook, error) + GetPotentialSignatures func(tx *types.SignedTransaction) (types.PublicKeys, error) + GetRequiredFees func(ops types.Operations, feeAsset types.GrapheneObject) (types.AssetAmounts, error) + GetRequiredSignatures func(tx *types.SignedTransaction, keys types.PublicKeys) (types.PublicKeys, error) + GetSettleOrders func(assetID types.GrapheneObject, limit int) (types.SettleOrders, error) + GetTradeHistory func(base, quote types.GrapheneObject, toTime, fromTime time.Time, limit int) (types.MarketTrades, error) + HistoryAPIID func() int + LimitOrder func(user string, base string, quote string, action string, price string, ...) (*types.SignedTransaction, error) + LimitOrderCancel func(user string, orderid string, password string) (*types.SignedTransaction, error) + LimitOrderGet func(user string) (types.LimitOrders, error) + ListAssets func(lowerBoundSymbol string, limit int) (types.Assets, error) + LoginVerify func(fund types.Fund, sign string) (re bool, err error) + OnError func(ErrorFunc) + OnNotify func(subscriberID int, notifyFn func(msg interface{}) error) error + PreSends func(tosends []types.SimpleSend) (*types.SignedTransaction, error) + Send func(from string, to string, amount string, asset string, memo string, ...) (*types.SignedTransaction, error) + Sends func(tosends []types.SimpleSend) (*types.SignedTransaction, error) + SetCredentials func(username, password string) + SetSubscribeCallback func(notifyID int, clearFilter bool) error + SignStr func(toSign string, prikey string) (sign string, err error) + SignTransaction func(keyBag *crypto.KeyBag, trx *types.SignedTransaction) error + SignWithKeys func(types.PrivateKeys, *types.SignedTransaction) error + SubscribeToMarket func(notifyID int, base types.GrapheneObject, quote types.GrapheneObject) error + UnsubscribeFromMarket func(base types.GrapheneObject, quote types.GrapheneObject) error + VerifySign func(accountName string, toSign string, sign string) (re bool, err error) + VerifySignedTransaction func(keyBag *crypto.KeyBag, tx *types.SignedTransaction) (bool, error) + WalletBorrowAsset func(account types.GrapheneObject, amountToBorrow string, ...) (*types.SignedTransaction, error) + WalletBuy func(account types.GrapheneObject, base, quote types.GrapheneObject, rate string, ...) (*types.SignedTransaction, error) + WalletBuyEx func(account types.GrapheneObject, base, quote types.GrapheneObject, rate float64, ...) (*types.SignedTransaction, error) + WalletGetBlock func(number uint64) (*types.Block, error) + WalletGetDynamicGlobalProperties func() (*types.DynamicGlobalProperties, error) + WalletGetRelativeAccountHistory func(account types.GrapheneObject, stop int64, limit int, start int64) (types.OperationRelativeHistories, error) + WalletIsLocked func() (bool, error) + WalletListAccountBalances func(account types.GrapheneObject) (types.AssetAmounts, error) + WalletLock func() error + WalletReadMemo func(memo *types.Memo) (string, error) + WalletSell func(account types.GrapheneObject, base, quote types.GrapheneObject, rate string, ...) (*types.SignedTransaction, error) + WalletSellAsset func(account types.GrapheneObject, amountToSell string, ...) (*types.SignedTransaction, error) + WalletSellEx func(account types.GrapheneObject, base, quote types.GrapheneObject, rate float64, ...) (*types.SignedTransaction, error) + WalletSerializeTransaction func(tx *types.SignedTransaction) (string, error) + WalletSignTransaction func(tx *types.SignedTransaction, broadcast bool) (*types.SignedTransaction, error) + WalletUnlock func(password string) error + func New(wsEndpointURL, rpcEndpointURL string) CybexAPI + func NewWithAutoEndpoint(startupEndpointURL, rpcEndpointURL string) (CybexAPI, error) + type ErrorFunc func(error) + type LatencyTester interface + AddEndpoint func(ep string) + Close func() error + Done func() <-chan struct{} + OnTopNodeChanged func(fn func(string) error) + Start func() + String func() string + TopNodeClient func() WebsocketClient + TopNodeEndpoint func() string + func NewLatencyTester(fallbackURL string) (LatencyTester, error) + func NewLatencyTesterWithContext(ctx context.Context, fallbackURL string) (LatencyTester, error) + type NodeStats struct + func NewNodeStats(wsRPCEndpoint string) *NodeStats + func (p *NodeStats) Equals(n *NodeStats) bool + func (p *NodeStats) Latency() time.Duration + func (p *NodeStats) Score() int64 + func (p *NodeStats) String() string + type NotifyFunc func(msg interface{}) error + type RPCCall struct + Done chan *RPCCall + Error error + Method string + Reply interface{} + Request rpcRequest + type RPCClient interface + CallAPI func(method string, args ...interface{}) (interface{}, error) + Close func() error + Connect func() error + func NewRPCClient(rpcEndpointURL string) RPCClient + type ResponseError struct + Code int + Data ResponseErrorData + Message string + func (p ResponseError) Error() string + type ResponseErrorContext struct + File string + Hostname string + Level string + Line int + Method string + ThreadName string + Timestamp string + type ResponseErrorData struct + Code int + Message string + Name string + Stack []ResponseErrorStack + type ResponseErrorStack struct + Context ResponseErrorContext + Data interface{} + Format string + type SimpleClientProvider struct + func (p *SimpleClientProvider) CallAPI(apiID int, method string, args ...interface{}) (interface{}, error) + type WebsocketClient interface + Call func(method string, args []interface{}) (*RPCCall, error) + CallAPI func(apiID int, method string, args ...interface{}) (interface{}, error) + Close func() error + Connect func() error + IsConnected func() bool + OnError func(fn ErrorFunc) + OnNotify func(subscriberID int, fn NotifyFunc) error + func NewWebsocketClient(endpointURL string) WebsocketClient