Versions in this module Expand all Collapse all v0 v0.5.0 Jan 3, 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) + type BestNodeClientProvider struct + func (p *BestNodeClientProvider) CallAPI(apiID int, method string, args ...interface{}) (interface{}, error) + func (p *BestNodeClientProvider) Close() error + type BitsharesAPI 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) + GetBlock func(number uint64) (*types.Block, 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 + ListAssets func(lowerBoundSymbol string, limit int) (types.Assets, error) + OnError func(ErrorFunc) + OnNotify func(subscriberID int, notifyFn func(msg interface{}) error) error + SetCredentials func(username, password string) + SetSubscribeCallback func(notifyID int, clearFilter bool) 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 + 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) BitsharesAPI + func NewWithAutoEndpoint(startupEndpointURL, rpcEndpointURL string) (BitsharesAPI, 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 BitsharesAPI) (ClientProvider, error) + func NewSimpleClientProvider(endpointURL string, api BitsharesAPI) ClientProvider + 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