Documentation ¶
Index ¶
- Constants
- Variables
- func ConstructTransaction(p DatabaseAPI, feeAsset objects.GrapheneObject, ops ...objects.Operation) (*objects.Transaction, error)
- func LoadAccounts(rpc DatabaseAPI, handler FullAccountHandler) error
- func SignAndBroadcast(api BitsharesAPI, keys map[string]*btcec.PrivateKey, ...) (*objects.Transaction, error)
- func SignTransaction(p DatabaseAPI, pvtKeys map[string]*btcec.PrivateKey, tx *objects.Transaction) error
- type APINotifyFunc
- type AssetCache
- type BitsharesAPI
- type BitsharesAPIConnEvent
- type BitsharesAPIConnection
- type BitsharesWalletAPI
- type BlockAppliedHandler
- type BroadcastAPI
- type Builder
- type CryptoAPI
- type DatabaseAPI
- type FullAccountHandler
- type HistoryAPI
- type NetworkNodeAPI
- type Params
Constants ¶
View Source
const ( InvalidAPIID = -1 AssetsListAll = -1 AssetsMaxBatchSize = 100 GetCallOrdersLimit = 100 GetLimitOrdersLimit = 100 GetSettleOrdersLimit = 100 GetTradeHistoryLimit = 100 )
Variables ¶
View Source
var (
EmptyParams = []interface{}{}
)
Functions ¶
func ConstructTransaction ¶
func ConstructTransaction(p DatabaseAPI, feeAsset objects.GrapheneObject, ops ...objects.Operation) (*objects.Transaction, error)
func LoadAccounts ¶
func LoadAccounts(rpc DatabaseAPI, handler FullAccountHandler) error
func SignAndBroadcast ¶
func SignAndBroadcast(api BitsharesAPI, keys map[string]*btcec.PrivateKey, feeAsset objects.GrapheneObject, ops ...objects.Operation) (*objects.Transaction, error)
func SignTransaction ¶
func SignTransaction(p DatabaseAPI, pvtKeys map[string]*btcec.PrivateKey, tx *objects.Transaction) error
Types ¶
type APINotifyFunc ¶
type APINotifyFunc func(params []json.RawMessage) error
type AssetCache ¶
type AssetCache struct {
// contains filtered or unexported fields
}
func NewAssetCache ¶
func NewAssetCache(api DatabaseAPI) *AssetCache
func (*AssetCache) GetByID ¶
func (c *AssetCache) GetByID(id *objects.GrapheneID) *objects.Asset
func (*AssetCache) GetBySymbol ¶
func (c *AssetCache) GetBySymbol(name string) *objects.Asset
type BitsharesAPI ¶
type BitsharesAPI interface {}
func New ¶
func New(wsConnection BitsharesAPIConnection, params Params) BitsharesAPI
New creates a new BitsharesAPI interface.
type BitsharesAPIConnection ¶
type BitsharesAPIConnection interface {}
func NewConnection ¶
func NewConnection(wsEndpointURL string) BitsharesAPIConnection
NewConnection creates new websocket connection with Bitshares API.
type BitsharesWalletAPI ¶
type BitsharesWalletAPI interface { //wallet API //Transfer(from, to objects.GrapheneObject, amount objects.AssetAmount) (interface{}, error) }
func NewWallet ¶
func NewWallet(rpcEndpointURL string) BitsharesWalletAPI
NewWallet creates a new BitsharesWalletAPI interface.
type BlockAppliedHandler ¶
type BroadcastAPI ¶
type BroadcastAPI interface {
BroadcastTransaction(tx *objects.Transaction) error
}
BroadcastAPI implements
type Builder ¶
type Builder interface { Node(endpoint string) Builder Credentials(login, password string) Builder BlockHandler(handler BlockAppliedHandler) Builder LoginHandler(login func()) Builder LogoutHandler(close func()) Builder Build() (BitsharesAPIConnection, BitsharesAPI) }
Builder interface provides a clever and convinient way to perform Bitshares API connection initial setup routine
type CryptoAPI ¶
type CryptoAPI interface { }
CryptoAPI interface is intended to produce some low level OTN cryptography operations
type DatabaseAPI ¶
type DatabaseAPI interface { // Objects GetObjects(objectIDs ...objects.GrapheneObject) ([]interface{}, error) ListAssets(lowerBoundSymbol string, limit int) ([]objects.Asset, error) GetTicker(base, quote string) (*objects.MarketTicker, error) // Subscriptions SubscribeBlockApplied(BlockAppliedHandler) error CancelAllSubscriptions() error // Blocks & transactions GetBlock(number uint64) (*objects.Block, error) GetRecentTransactionByID(tx objects.TxID) (*objects.Transaction, error) // Globals GetChainID() objects.ChainID GetDynamicGlobalProperties() (*objects.DynamicGlobalProperties, error) // Accounts GetAccountBalances(account objects.GrapheneObject, assets ...objects.GrapheneObject) ([]objects.AssetAmount, error) GetAccountByName(name string) (*objects.Account, error) GetAccounts(accountIDs ...objects.GrapheneObject) ([]objects.Account, error) GetAccountCount() (uint64, error) GetFullAccounts(subscribe bool, accountIDs ...objects.GrapheneObject) ([]*objects.FullAccountResult, error) // Markets CancelOrder(orderID objects.GrapheneObject, broadcast bool) (*objects.Transaction, error) GetMarginPositions(accountID objects.GrapheneObject) ([]objects.CallOrder, error) GetCallOrders(assetID objects.GrapheneObject, limit int) ([]objects.CallOrder, error) GetLimitOrders(base, quote objects.GrapheneObject, limit int) (objects.LimitOrders, error) GetSettleOrders(assetID objects.GrapheneObject, limit int) ([]objects.SettleOrder, error) GetTradeHistory(base, quote objects.GrapheneObject, toTime, fromTime time.Time, limit int) ([]objects.MarketTrade, error) // Autority/Validation GetRequiredFees(ops objects.Operations, feeAsset objects.GrapheneObject) ([]objects.AssetAmount, error) GetPotentialSignatures(tx *objects.Transaction) ([]objects.PublicKey, error) GetRequiredSignatures(tx *objects.Transaction, keys []objects.PublicKey) ([]objects.PublicKey, error) }
type FullAccountHandler ¶
type FullAccountHandler func(acc *objects.FullAccount) error
type HistoryAPI ¶
type HistoryAPI interface { GetAccountHistory(account objects.GrapheneObject, stop objects.GrapheneObject, start objects.GrapheneObject, limit int) ([]objects.OperationHistory, error) GetChronoRelativeHistory(account objects.GrapheneObject, start uint32, limit int) ([]objects.OperationHistory, error) }
HistoryAPI implements
type NetworkNodeAPI ¶
type NetworkNodeAPI interface { GetNetworkNodeInfo() (objects.NetworkNodeInfo, error) GetConnectedPeers() ([]objects.PeerStatus, error) GetAdvancedNodeParameters() (objects.AdvancedNodeParameters, error) GetPotentialPeers() ([]objects.PotentialPeerRecord, error) }
NetworkNodeAPI interface provides access to internal OTN blockchain networking information
Click to show internal directories.
Click to hide internal directories.