database

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpTypeConvert             = "convert"
	OpTypeFeedPublish         = "feed_publish"
	OpTypePow                 = "pow"
	OpTypeCustomJSON          = "custom_json"
	OpTypeAccountCreate       = "account_create"
	OpTypeAccountUpdate       = "account_update"
	OpTypeTransfer            = "transfer"
	OpTypeTransferToVesting   = "transfer_to_vesting"
	OpTypeWithdrawVesting     = "withdraw_vesting"
	OpTypeAccountWitnessVote  = "account_witness_vote"
	OpTypeAccountWitnessProxy = "account_witness_proxy"
	OpTypeComment             = "comment"
	OpTypeVote                = "vote"
	OpTypeLimitOrderCreate    = "limit_order_create"
	OpTypeFillOrder           = "fill_order"
	OpTypeLimitOrderCancel    = "limit_order_cancel"
	OpTypeDeleteComment       = "delete_comment"
	OpTypeCommentOptions      = "comment_options"
)
View Source
const (
	CustomJSONOperationIDFollow = "follow"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI(caller interfaces.Caller) *API

func (*API) GetAccountCountRaw

func (api *API) GetAccountCountRaw() (*json.RawMessage, error)

func (*API) GetAccountHistoryRaw

func (api *API) GetAccountHistoryRaw(account string, from uint64, limit uint32) (*json.RawMessage, error)

func (*API) GetAccountVotesRaw

func (api *API) GetAccountVotesRaw(voter string) (*json.RawMessage, error)

func (*API) GetAccountsRaw

func (api *API) GetAccountsRaw(accountNames []string) (*json.RawMessage, error)

func (*API) GetActiveCategoriesRaw

func (api *API) GetActiveCategoriesRaw(after string, limit uint32) (*json.RawMessage, error)

func (*API) GetActiveVotes added in v0.3.0

func (api *API) GetActiveVotes(author, permlink string) ([]*VoteState, error)

func (*API) GetActiveVotesRaw

func (api *API) GetActiveVotesRaw(author, permlink string) (*json.RawMessage, error)

func (*API) GetBestCategoriesRaw

func (api *API) GetBestCategoriesRaw(after string, limit uint32) (*json.RawMessage, error)

func (*API) GetBlock

func (api *API) GetBlock(blockNum uint32) (*Block, error)

func (*API) GetBlockHeaderRaw

func (api *API) GetBlockHeaderRaw(blockNum uint32) (*json.RawMessage, error)

func (*API) GetBlockRaw

func (api *API) GetBlockRaw(blockNum uint32) (*json.RawMessage, error)

func (*API) GetChainPropertiesRaw

func (api *API) GetChainPropertiesRaw() (*json.RawMessage, error)

func (*API) GetConfig

func (api *API) GetConfig() (*Config, error)

func (*API) GetConfigRaw

func (api *API) GetConfigRaw() (*json.RawMessage, error)

func (*API) GetContent

func (api *API) GetContent(author, permlink string) (*Content, error)

func (*API) GetContentRaw

func (api *API) GetContentRaw(author, permlink string) (*json.RawMessage, error)

func (*API) GetContentReplies

func (api *API) GetContentReplies(parentAuthor, parentPermlink string) ([]*Content, error)

func (*API) GetContentRepliesRaw

func (api *API) GetContentRepliesRaw(parentAuthor, parentPermlink string) (*json.RawMessage, error)

func (*API) GetConversionRequestsRaw

func (api *API) GetConversionRequestsRaw(accountName string) (*json.RawMessage, error)

func (*API) GetCurrentMedianHistoryPriceRaw

func (api *API) GetCurrentMedianHistoryPriceRaw() (*json.RawMessage, error)

func (*API) GetDiscussionsByActiveRaw

func (api *API) GetDiscussionsByActiveRaw(query *DiscussionQuery) (*json.RawMessage, error)

func (*API) GetDiscussionsByCashoutRaw

func (api *API) GetDiscussionsByCashoutRaw(query *DiscussionQuery) (*json.RawMessage, error)

func (*API) GetDiscussionsByChildrenRaw

func (api *API) GetDiscussionsByChildrenRaw(query *DiscussionQuery) (*json.RawMessage, error)

func (*API) GetDiscussionsByCreatedRaw

func (api *API) GetDiscussionsByCreatedRaw(query *DiscussionQuery) (*json.RawMessage, error)

func (*API) GetDiscussionsByHotRaw

func (api *API) GetDiscussionsByHotRaw(query *DiscussionQuery) (*json.RawMessage, error)

func (*API) GetDiscussionsByPayoutRaw

func (api *API) GetDiscussionsByPayoutRaw(query *DiscussionQuery) (*json.RawMessage, error)

func (*API) GetDiscussionsByTrendingRaw

func (api *API) GetDiscussionsByTrendingRaw(query *DiscussionQuery) (*json.RawMessage, error)

func (*API) GetDiscussionsByVotesRaw

func (api *API) GetDiscussionsByVotesRaw(query *DiscussionQuery) (*json.RawMessage, error)

func (*API) GetDynamicGlobalProperties

func (api *API) GetDynamicGlobalProperties() (*DynamicGlobalProperties, error)

func (*API) GetDynamicGlobalPropertiesRaw

func (api *API) GetDynamicGlobalPropertiesRaw() (*json.RawMessage, error)

func (*API) GetFeedHistoryRaw

func (api *API) GetFeedHistoryRaw() (*json.RawMessage, error)

func (*API) GetHardforkVersion

func (api *API) GetHardforkVersion() (string, error)

func (*API) GetHardforkVersionRaw

func (api *API) GetHardforkVersionRaw() (*json.RawMessage, error)

func (*API) GetNextScheduledHardforkRaw

func (api *API) GetNextScheduledHardforkRaw() (*json.RawMessage, error)

func (*API) GetOrderBookRaw

func (api *API) GetOrderBookRaw(limit uint32) (*json.RawMessage, error)

func (*API) GetRecentCategoriesRaw

func (api *API) GetRecentCategoriesRaw(after string, limit uint32) (*json.RawMessage, error)

func (*API) GetRecommendedForRaw

func (api *API) GetRecommendedForRaw(user string, limit uint32) (*json.RawMessage, error)

func (*API) GetRepliesByLastUpdateRaw

func (api *API) GetRepliesByLastUpdateRaw(
	startAuthor string,
	startPermlink string,
	limit uint32,
) (*json.RawMessage, error)

func (*API) GetStateRaw

func (api *API) GetStateRaw(path string) (*json.RawMessage, error)

func (*API) GetTrendingCategoriesRaw

func (api *API) GetTrendingCategoriesRaw(after string, limit uint32) (*json.RawMessage, error)

func (*API) GetTrendingTagsRaw

func (api *API) GetTrendingTagsRaw(afterTag string, limit uint32) (*json.RawMessage, error)

func (*API) GetWitnessScheduleRaw

func (api *API) GetWitnessScheduleRaw() (*json.RawMessage, error)

func (*API) LookupAccountNamesRaw

func (api *API) LookupAccountNamesRaw(accountNames []string) (*json.RawMessage, error)

func (*API) LookupAccountsRaw

func (api *API) LookupAccountsRaw(lowerBoundName string, limit uint32) (*json.RawMessage, error)

type AccountCreateOperation added in v0.3.0

type AccountCreateOperation struct {
	Fee            string     `json:"fee"`
	Creator        string     `json:"creator"`
	NewAccountName string     `json:"new_account_name"`
	Owner          *Authority `json:"owner"`
	Active         *Authority `json:"active"`
	Posting        *Authority `json:"posting"`
	MemoKey        string     `json:"memo_key"`
	JsonMetadata   string     `json:"json_metadata"`
}

type AccountUpdateOperation added in v0.3.0

type AccountUpdateOperation struct {
	Account      string     `json:"account"`
	Owner        *Authority `json:"owner"`
	Active       *Authority `json:"active"`
	Posting      *Authority `json:"posting"`
	MemoKey      string     `json:"memo_key"`
	JsonMetadata string     `json:"json_metadata"`
}

type AccountWitnessProxyOperation added in v0.3.0

type AccountWitnessProxyOperation struct {
	Account string `json:"account"`
	Proxy   string `json:"proxy"`
}

type AccountWitnessVoteOperation added in v0.3.0

type AccountWitnessVoteOperation struct {
	Account string `json:"account"`
	Witness string `json:"witness"`
	Approve bool   `json:"approve"`
}

type Auth added in v0.3.0

type Auth struct {
	Key   string
	Check uint32
}

XXX: Not sure about the struct field names.

func (*Auth) UnmarshalJSON added in v0.3.0

func (auth *Auth) UnmarshalJSON(data []byte) error

type Authority added in v0.3.0

type Authority struct {
	AccountAuths    []*Auth `json:"account_auths"`
	KeyAuths        []*Auth `json:"key_auths"`
	WeightThreshold uint32  `json:"weight_threshold"`
}

type Block

type Block struct {
	Number                uint32          `json:"-"`
	Timestamp             *types.Time     `json:"timestamp"`
	Witness               string          `json:"witness"`
	WitnessSignature      string          `json:"witness_signature"`
	TransactionMerkleRoot string          `json:"transaction_merkle_root"`
	Previous              string          `json:"previous"`
	Extensions            [][]interface{} `json:"extensions"`
	Transactions          []*Transaction  `json:"transactions"`
}

type ChainProperties added in v0.3.0

type ChainProperties struct {
	AccountCreationFee string `json:"account_creation_fee"`
	MaximumBlockSize   uint32 `json:"maximum_block_size"`
	SBDInterestRate    uint16 `json:"sbd_interest_rate"`
}

type CommentOperation

type CommentOperation struct {
	Author         string `json:"author"`
	Title          string `json:"title"`
	Permlink       string `json:"permlink"`
	ParentAuthor   string `json:"parent_author"`
	ParentPermlink string `json:"parent_permlink"`
	Body           string `json:"body"`
}

CommentOperation represents either a new post or a comment.

In case Title is filled in and ParentAuthor is empty, it is a new post. The post category can be read from ParentPermlink.

func (*CommentOperation) IsStoryOperation

func (op *CommentOperation) IsStoryOperation() bool

type CommentOptionsOperation added in v0.3.0

type CommentOptionsOperation struct {
	Author               string        `json:"author"`
	Permlink             string        `json:"permlink"`
	MaxAcceptedPayout    string        `json:"max_accepted_payout"`
	PercentSteemDollars  uint16        `json:"percent_steem_dollars"`
	AllowVotes           bool          `json:"allow_votes"`
	AllowCurationRewards bool          `json:"allow_curation_rewards"`
	Extensions           []interface{} `json:"extensions"`
}

type Config

type Config struct {
	SteemitBlockchainHardforkVersion string `json:"STEEMIT_BLOCKCHAIN_HARDFORK_VERSION"`
	SteemitBlockchainVersion         string `json:"STEEMIT_BLOCKCHAIN_VERSION"`
	SteemitBlockInterval             uint   `json:"STEEMIT_BLOCK_INTERVAL"`
}

type Content

type Content struct {
	Id                      *types.ID        `json:"id"`
	RootTitle               string           `json:"root_title"`
	Active                  *types.Time      `json:"active"`
	AbsRshares              *types.Int       `json:"abs_rshares"`
	PendingPayoutValue      string           `json:"pending_payout_value"`
	TotalPendingPayoutValue string           `json:"total_pending_payout_value"`
	Category                string           `json:"category"`
	Title                   string           `json:"title"`
	LastUpdate              *types.Time      `json:"last_update"`
	Stats                   string           `json:"stats"`
	Body                    string           `json:"body"`
	Created                 *types.Time      `json:"created"`
	Replies                 []*Content       `json:"replies"`
	Permlink                string           `json:"permlink"`
	JsonMetadata            *ContentMetadata `json:"json_metadata"`
	Children                *types.Int       `json:"children"`
	NetRshares              *types.Int       `json:"net_rshares"`
	URL                     string           `json:"url"`
	ActiveVotes             []*VoteState     `json:"active_votes"`
	ParentPermlink          string           `json:"parent_permlink"`
	CashoutTime             *types.Time      `json:"cashout_time"`
	TotalPayoutValue        string           `json:"total_payout_value"`
	ParentAuthor            string           `json:"parent_author"`
	ChildrenRshares2        *types.Int       `json:"children_rshares2"`
	Author                  string           `json:"author"`
	Depth                   *types.Int       `json:"depth"`
	TotalVoteWeight         *types.Int       `json:"total_vote_weight"`
}

func (*Content) IsStory

func (content *Content) IsStory() bool

type ContentMetadata

type ContentMetadata struct {
	Flag  bool
	Users []string
	Tags  []string
	Image []string
}

func (*ContentMetadata) UnmarshalJSON

func (metadata *ContentMetadata) UnmarshalJSON(data []byte) error

type ContentMetadataRaw

type ContentMetadataRaw struct {
	Users types.StringSlice `json:"users"`
	Tags  types.StringSlice `json:"tags"`
	Image types.StringSlice `json:"image"`
}

type ConvertOperation added in v0.3.0

type ConvertOperation struct {
	Owner     string `json:"owner"`
	RequestID uint32 `json:"requestid"`
	Amount    string `json:"amount"`
}

type CustomJSONOperation added in v0.3.0

type CustomJSONOperation struct {
	RequiredAuths        []string `json:"required_auths"`
	RequiredPostingAuths []string `json:"required_posting_auths"`
	ID                   string   `json:"id"`
	JSON                 string   `json:"json"`
}

func (*CustomJSONOperation) UnmarshalBody added in v0.3.0

func (op *CustomJSONOperation) UnmarshalBody() (interface{}, error)

type DeleteCommentOperation added in v0.3.0

type DeleteCommentOperation struct {
	Author   string `json:"author"`
	Permlink string `json:"permlink"`
}

type DiscussionQuery

type DiscussionQuery struct {
	Tag   string `json:"tag"`
	Limit uint32 `json:"limit"`
	// XXX: Not sure about the type here.
	FilterTags     []string `json:"filter_tags"`
	StartAuthor    string   `json:"start_author,omitempty"`
	StartPermlink  string   `json:"start_permlink,omitempty"`
	ParentAuthor   string   `json:"parent_author,omitempty"`
	ParentPermlink string   `json:"parent_permlink"`
}

type DynamicGlobalProperties

type DynamicGlobalProperties struct {
	Time                     *types.Time `json:"time"`
	TotalPow                 *types.Int  `json:"total_pow"`
	NumPowWitnesses          *types.Int  `json:"num_pow_witnesses"`
	CurrentReserveRatio      *types.Int  `json:"current_reserve_ratio"`
	Id                       *types.ID   `json:"id"`
	CurrentSupply            string      `json:"current_supply"`
	CurrentSBDSupply         string      `json:"current_sbd_supply"`
	MaximumBlockSize         *types.Int  `json:"maximum_block_size"`
	RecentSlotsFilled        *types.Int  `json:"recent_slots_filled"`
	CurrentWitness           string      `json:"current_witness"`
	TotalRewardShares2       *types.Int  `json:"total_reward_shares2"`
	AverageBlockSize         *types.Int  `json:"average_block_size"`
	CurrentAslot             *types.Int  `json:"current_aslot"`
	LastIrreversibleBlockNum uint32      `json:"last_irreversible_block_num"`
	TotalVestingShares       string      `json:"total_vesting_shares"`
	TotalVersingFundSteem    string      `json:"total_vesting_fund_steem"`
	HeadBlockId              string      `json:"head_block_id"`
	VirtualSupply            string      `json:"virtual_supply"`
	ConfidentialSupply       string      `json:"confidential_supply"`
	ConfidentialSBDSupply    string      `json:"confidential_sbd_supply"`
	TotalRewardFundSteem     string      `json:"total_reward_fund_steem"`
	TotalActivityFundSteem   string      `json:"total_activity_fund_steem"`
	TotalActivityFundShares  *types.Int  `json:"total_activity_fund_shares"`
	SBDInterestRate          *types.Int  `json:"sbd_interest_rate"`
	MaxVirtualBandwidth      *types.Int  `json:"max_virtual_bandwidth"`
	HeadBlockNumber          *types.Int  `json:"head_block_number"`
}

type FeedPublishOperation added in v0.3.0

type FeedPublishOperation struct {
	Publisher    string `json:"publisher"`
	ExchangeRate struct {
		Base  string `json:"base"`
		Quote string `json:"quote"`
	} `json:"exchange_rate"`
}

type FillOrderOperation added in v0.3.0

type FillOrderOperation struct {
	Owner    string `json:"owner"`
	OrderID  string `json:"orderid"`
	Pays     string `json:"pays"`
	Receives string `json:"receives"`
}

type FollowOperation added in v0.3.0

type FollowOperation struct {
	Follower  string   `json:"follower"`
	Following string   `json:"following"`
	What      []string `json:"what"`
}

type LimitOrderCancelOperation added in v0.3.0

type LimitOrderCancelOperation struct {
	Owner   string `json:"owner"`
	OrderID uint32 `json:"orderid"`
}

type LimitOrderCreateOperation added in v0.3.0

type LimitOrderCreateOperation struct {
	Owner        string      `json:"owner"`
	OrderID      uint32      `json:"orderid"`
	AmountToSell string      `json:"amount_to_sell"`
	MinToReceive string      `json:"min_to_receive"`
	FillOrKill   bool        `json:"fill_or_kill"`
	Expiration   *types.Time `json:"expiration"`
}

type Operation

type Operation struct {
	// Type contains the string representation of the operation.
	Type string
	// Body contains one of the operation objects depending on the type.
	Body interface{}
}

Operation represents an operation stored in a transaction.

func (*Operation) UnmarshalJSON

func (op *Operation) UnmarshalJSON(data []byte) error

type Pow added in v0.3.0

type Pow struct {
	Worker    string `json:"worker"`
	Input     string `json:"input"`
	Signature string `json:"signature"`
	Work      string `json:"work"`
}

type PowOperation added in v0.3.0

type PowOperation struct {
	WorkerAccount string           `json:"worker_account"`
	BlockID       string           `json:"block_id"`
	Nonce         *types.Int       `json:"nonce"`
	Work          *Pow             `json:"work"`
	Props         *ChainProperties `json:"props"`
}

type ReportOverProductionOperation added in v0.3.0

type ReportOverProductionOperation struct {
	Reporter string `json:"reporter"`
}

type Transaction

type Transaction struct {
	RefBlockNum    *types.Int   `json:"ref_block_num"`
	RefBlockPrefix *types.Int   `json:"ref_block_prefix"`
	Expiration     string       `json:"expiration"`
	Operations     []*Operation `json:"operations"`
}

type TransferOperation added in v0.3.0

type TransferOperation struct {
	From   string `json:"from"`
	To     string `json:"to"`
	Amount string `json:"amount"`
	Memo   string `json:"memo"`
}

type TransferToVestingOperation added in v0.3.0

type TransferToVestingOperation struct {
	From   string `json:"from"`
	To     string `json:"to"`
	Amount string `json:"amount"`
}

type VoteOperation

type VoteOperation struct {
	Voter    string     `json:"voter"`
	Author   string     `json:"author"`
	Permlink string     `json:"permlink"`
	Weight   *types.Int `json:"weight"`
}

type VoteState added in v0.3.0

type VoteState struct {
	Voter   string      `json:"voter"`
	Weight  *types.Int  `json:"weight"`
	Rshares *types.Int  `json:"rshares"`
	Percent *types.Int  `json:"percent"`
	Time    *types.Time `json:"time"`
}

type WithdrawVestingOperation added in v0.3.0

type WithdrawVestingOperation struct {
	Account       string `json:"account"`
	VestingShares string `json:"vesting_shares"`
}

Jump to

Keyboard shortcuts

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