Documentation
¶
Index ¶
- type API
- func (api *API) CancelAllSubscriptions() error
- func (api *API) GetAccountBalances(accountID types.ObjectID, assets ...types.ObjectID) ([]*types.AssetAmount, error)
- func (api *API) GetBlock(blockNum uint32) (*Block, error)
- func (api *API) GetBlockHeader(blockNum uint32) (*BlockHeader, error)
- func (api *API) GetChainID() (*string, error)
- func (api *API) GetConfig() (*Config, error)
- func (api *API) GetDynamicGlobalProperties() (*DynamicGlobalProperties, error)
- func (api *API) GetLimitOrders(base, quote types.ObjectID, limit uint32) ([]*LimitOrder, error)
- func (api *API) GetNamedAccountBalances(account string, assets ...types.ObjectID) ([]*types.AssetAmount, error)
- func (api *API) GetObjects(assets ...types.ObjectID) ([]json.RawMessage, error)
- func (api *API) GetRecentTransactionByID(transactionID uint32) (*types.Transaction, error)
- func (api *API) GetRequiredFee(ops []types.Operation, assetID string) ([]types.AssetAmount, error)
- func (api *API) GetTicker(base, quote types.ObjectID) (*MarketTicker, error)
- func (api *API) GetTransaction(blockNum uint32, trxInBlock uint32) (*types.Transaction, error)
- func (api *API) LookupAccounts(lowerBoundName string, limit uint16) (AccountsMap, error)
- func (api *API) LookupAssetSymbols(symbols ...string) ([]*Asset, error)
- func (api *API) SetBlockAppliedCallback(notice func(blockID string, err error)) (err error)
- type AccountsMap
- type Asset
- type Block
- type BlockHeader
- type Config
- type DynamicGlobalProperties
- type LimitOrder
- type MarketTicker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) CancelAllSubscriptions ¶
CancelAllSubscriptions cancel all subscriptions
func (*API) GetAccountBalances ¶
func (api *API) GetAccountBalances(accountID types.ObjectID, assets ...types.ObjectID) ([]*types.AssetAmount, error)
GetAccountBalances Get an account’s balances in various assets.
func (*API) GetBlockHeader ¶
func (api *API) GetBlockHeader(blockNum uint32) (*BlockHeader, error)
GetBlockHeader returns block header by the given block number
func (*API) GetChainID ¶
func (*API) GetDynamicGlobalProperties ¶
func (api *API) GetDynamicGlobalProperties() (*DynamicGlobalProperties, error)
GetDynamicGlobalProperties retrieves the current global_property_object
func (*API) GetLimitOrders ¶
GetLimitOrders returns limit orders in a given market. There are both sell and buy orders. For the sell orders LimitOrder.SellPrice.Base = the given base For the buy orders LimitOrder.SellPrice.Base = the given quote
func (*API) GetNamedAccountBalances ¶
func (api *API) GetNamedAccountBalances(account string, assets ...types.ObjectID) ([]*types.AssetAmount, error)
Semantically equivalent to get_account_balances, but takes a name instead of an ID.
func (*API) GetObjects ¶
GetBlock return a block by the given block number
func (*API) GetRecentTransactionByID ¶
func (api *API) GetRecentTransactionByID(transactionID uint32) (*types.Transaction, error)
GetRecentTransactionByID If the transaction has not expired, this method will return the transaction for the given ID or it will return NULL if it is not known. Just because it is not known does not mean it wasn’t included in the blockchain.
func (*API) GetRequiredFee ¶
GetRequiredFee fetchs fee for operations
func (*API) GetTicker ¶
func (api *API) GetTicker(base, quote types.ObjectID) (*MarketTicker, error)
GetTicker returns the ticker for the market assetA:assetB (past 24 hours)
func (*API) GetTransaction ¶
GetTransaction used to fetch an individual transaction
func (*API) LookupAccounts ¶
func (api *API) LookupAccounts(lowerBoundName string, limit uint16) (AccountsMap, error)
LookupAccounts gets names and IDs for registered accounts lower_bound_name: Lower bound of the first name to return limit: Maximum number of results to return must not exceed 1000
func (*API) LookupAssetSymbols ¶
LookupAssetSymbols get assets corresponding to the provided symbols or IDs
type AccountsMap ¶
func (*AccountsMap) UnmarshalJSON ¶
func (o *AccountsMap) UnmarshalJSON(b []byte) error
type Block ¶
type Block struct { TransactionMerkleRoot string `json:"transaction_merkle_root"` Previous string `json:"previous"` Timestamp types.Time `json:"timestamp"` Witness string `json:"witness"` Extensions []json.RawMessage `json:"extensions"` WitnessSignature string `json:"witness_signature"` Transactions []types.Transaction `json:"transactions"` }
type BlockHeader ¶
type Config ¶
type Config struct { GrapheneSymbol string `json:"GRAPHENE_SYMBOL"` GrapheneAddressPrefix string `json:"GRAPHENE_ADDRESS_PREFIX"` GrapheneMinAccountNameLength uint8 `json:"GRAPHENE_MIN_ACCOUNT_NAME_LENGTH"` GrapheneMaxAccountNameLength uint8 `json:"GRAPHENE_MAX_ACCOUNT_NAME_LENGTH"` GrapheneMinAssetSymbolLength uint8 `json:"GRAPHENE_MIN_ASSET_SYMBOL_LENGTH"` GrapheneMaxAssetSymbolLength uint8 `json:"GRAPHENE_MAX_ASSET_SYMBOL_LENGTH"` }
type DynamicGlobalProperties ¶
type DynamicGlobalProperties struct { ID types.ObjectID `json:"id"` HeadBlockNumber uint32 `json:"head_block_number"` HeadBlockID string `json:"head_block_id"` Time types.Time `json:"time"` CurrentWitness types.ObjectID `json:"current_witness"` NextMaintenanceTime types.Time `json:"next_maintenance_time"` LastBudgetTime types.Time `json:"last_budget_time"` AccountsRegisteredThisInterval int `json:"accounts_registered_this_interval"` DynamicFlags int `json:"dynamic_flags"` RecentSlotsFilled string `json:"recent_slots_filled"` LastIrreversibleBlockNum uint32 `json:"last_irreversible_block_num"` CurrentAslot int64 `json:"current_aslot"` WitnessBudget int64 `json:"witness_budget"` RecentlyMissedCount int64 `json:"recently_missed_count"` }
type LimitOrder ¶
type MarketTicker ¶
type MarketTicker struct { Time types.Time `json:"time"` Base types.ObjectID `json:"base"` Quote types.ObjectID `json:"quote"` Latest string `json:"latest"` LowestAsk string `json:"lowest_ask"` HighestBid string `json:"highest_bid"` PercentChange string `json:"percent_change"` BaseVolume string `json:"base_volume"` QuoteVolume string `json:"quote_volume"` }