api

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2020 License: MIT, MIT Imports: 4 Imported by: 0

README

API

This package adds support for blurt api.

State

API Command Name Status
account_by_key
get_key_references
account_history
get_account_history
committee_api
get_committee_request
get_committee_request_votes
get_committee_requests_list
database_api
get_account_count
get_accounts
get_block
get_block_header
get_chain_properties
get_config
get_database_info
get_dynamic_global_properties
get_escrow
get_expiring_vesting_delegations
get_hardfork_version
get_next_scheduled_hardfork
get_owner_history
get_potential_signatures
get_proposed_transaction
get_recovery_request
get_required_signatures
get_transaction_hex
get_vesting_delegations
get_withdraw_routes
lookup_account_names
lookup_accounts
verify_account_authority
verify_authority
follow
get_blog
get_blog_authors
get_blog_entries
get_feed
get_feed_entries
get_follow_count
get_followers
get_following
get_reblogged_by
invite_api
get_invites_list
get_invite_by_id
get_invite_by_key
network_broadcast_api
broadcast_block
broadcast_transaction
broadcast_transaction_synchronous
broadcast_transaction_with_callback
operation_history
get_ops_in_block
get_transaction
social_network
get_account_votes
get_active_votes
get_all_content_replies
get_content
get_content_replies
get_replies_by_last_update
tags
get_discussions_by_active
get_discussions_by_author_before_date
get_discussions_by_blog
get_discussions_by_cashout
get_discussions_by_children
get_discussions_by_contents
get_discussions_by_created
get_discussions_by_feed
get_discussions_by_hot
get_discussions_by_payout
get_discussions_by_trending
get_discussions_by_votes
get_languages
get_tags_used_by_author
get_trending_tags
witness_api
get_active_witnesses
get_miner_queue
get_witness_by_account
get_witness_count
get_witness_schedule
get_witnesses
get_witnesses_by_vote
lookup_witness_accounts

License

MIT, see the LICENSE file.

Documentation

Index

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
}

API plug-in structure

func NewAPI

func NewAPI(caller transports.Caller) *API

NewAPI plug-in initialization

func (*API) BroadcastTransaction

func (api *API) BroadcastTransaction(tx *types.Transaction) (err error)

BroadcastTransaction api request broadcast_transaction

func (*API) BroadcastTransactionSynchronous

func (api *API) BroadcastTransactionSynchronous(tx *types.Transaction) (resp *BroadcastResponse, err error)

BroadcastTransactionSynchronous api request broadcast_transaction_synchronous

func (*API) GetBlock

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

GetBlock api request get_block

func (*API) GetBlockHeader

func (api *API) GetBlockHeader(blockNum uint32) (resp *BlockHeader, err error)

GetBlockHeader api request get_block_header

func (*API) GetConfig

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

GetConfig api request get_config

func (*API) GetDynamicGlobalProperties

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

GetDynamicGlobalProperties api request get_dynamic_global_properties

func (*API) SetBlockAppliedCallback

func (api *API) SetBlockAppliedCallback(notice func(header *BlockHeader, error error)) (err error)

Set callback to invoke as soon as a new block is applied

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          []*types.Transaction `json:"transactions"`
}

Block structure for the GetBlock function

type BlockHeader

type BlockHeader struct {
	Number                uint32        `json:"-"`
	Previous              string        `json:"previous"`
	Timestamp             string        `json:"timestamp"`
	Witness               string        `json:"witness"`
	TransactionMerkleRoot string        `json:"transaction_merkle_root"`
	Extensions            []interface{} `json:"extensions"`
}

BlockHeader structure for the GetBlockHeader and SetBlockAppliedCallback functions

type BroadcastResponse

type BroadcastResponse struct {
	ID       string `json:"id"`
	BlockNum int32  `json:"block_num"`
	TrxNum   int32  `json:"trx_num"`
	Expired  bool   `json:"expired"`
}

BroadcastResponse structure for the BroadcastTransactionSynchronous function

type Config

type Config struct {
	Percent100                       int           `json:"CHAIN_100_PERCENT"`
	Percent1                         *types.Int    `json:"CHAIN_1_PERCENT"`
	AddressPrefix                    string        `json:"CHAIN_ADDRESS_PREFIX"`
	BandwidthAverageWindowSeconds    *types.Int    `json:"CHAIN_BANDWIDTH_AVERAGE_WINDOW_SECONDS"`
	BandwidthPrecision               *types.Int    `json:"CHAIN_BANDWIDTH_PRECISION"`
	ConsensusBandwidthReservePercent *types.Int    `json:"CONSENSUS_BANDWIDTH_RESERVE_PERCENT"`
	ConsensusBandwidthReserveBelow   *types.Int    `json:"CONSENSUS_BANDWIDTH_RESERVE_BELOW"`
	HardforkVersion                  string        `json:"CHAIN_HARDFORK_VERSION"`
	Version                          string        `json:"CHAIN_VERSION"`
	BlockInterval                    uint          `json:"CHAIN_BLOCK_INTERVAL"`
	BlocksPerDay                     *types.Int    `json:"CHAIN_BLOCKS_PER_DAY"`
	BlocksPerYear                    *types.Int    `json:"CHAIN_BLOCKS_PER_YEAR"`
	CashoutWindowSeconds             *types.Int    `json:"CHAIN_CASHOUT_WINDOW_SECONDS"`
	ChainID                          string        `json:"CHAIN_ID"`
	HardforkRequiredWitnesses        *types.Int    `json:"CHAIN_HARDFORK_REQUIRED_WITNESSES"`
	InitiatorName                    string        `json:"CHAIN_INITIATOR_NAME"`
	InitiatorPublicKey               string        `json:"CHAIN_INITIATOR_PUBLIC_KEY_STR"`
	InitSupply                       *types.UInt32 `json:"CHAIN_INIT_SUPPLY"`
	CommitteeAccount                 string        `json:"CHAIN_COMMITTEE_ACCOUNT"`
	CommitteePublicKey               string        `json:"CHAIN_COMMITTEE_PUBLIC_KEY_STR"`
	IrreversibleThreshold            *types.Int    `json:"CHAIN_IRREVERSIBLE_THRESHOLD"`
	MaxAccountNameLength             *types.Int    `json:"CHAIN_MAX_ACCOUNT_NAME_LENGTH"`
	MaxAccountWitnessVotes           *types.Int    `json:"CHAIN_MAX_ACCOUNT_WITNESS_VOTES"`
	BlockSize                        *types.Int    `json:"CHAIN_BLOCK_SIZE"`
	MaxCommentDepth                  *types.Int    `json:"CHAIN_MAX_COMMENT_DEPTH"`
	MaxMemoSize                      *types.Int    `json:"CHAIN_MAX_MEMO_SIZE"`
	MaxWitnesses                     *types.Int    `json:"CHAIN_MAX_WITNESSES"`
	MaxProxyRecursionDepth           *types.Int    `json:"CHAIN_MAX_PROXY_RECURSION_DEPTH"`
	MaxReserveRatio                  *types.Int    `json:"CHAIN_MAX_RESERVE_RATIO"`
	MaxSupportWitnesses              *types.Int    `json:"CHAIN_MAX_SUPPORT_WITNESSES"`
	MaxShareSupply                   string        `json:"CHAIN_MAX_SHARE_SUPPLY"`
	MaxSigCheckDepth                 *types.Int    `json:"CHAIN_MAX_SIG_CHECK_DEPTH"`
	MaxTimeUntilExpiration           *types.Int    `json:"CHAIN_MAX_TIME_UNTIL_EXPIRATION"`
	MaxTransactionSize               *types.Int    `json:"CHAIN_MAX_TRANSACTION_SIZE"`
	MaxUndoHistory                   *types.Int    `json:"CHAIN_MAX_UNDO_HISTORY"`
	MaxVoteChanges                   *types.Int    `json:"CHAIN_MAX_VOTE_CHANGES"`
	MaxTopWitnesses                  *types.Int    `json:"CHAIN_MAX_TOP_WITNESSES"`
	MaxWithdrawRoutes                *types.Int    `json:"CHAIN_MAX_WITHDRAW_ROUTES"`
	MaxWitnessURLLength              *types.Int    `json:"CHAIN_MAX_WITNESS_URL_LENGTH"`
	MinAccountCreationFee            *types.Int    `json:"CHAIN_MIN_ACCOUNT_CREATION_FEE"`
	MinAccountNameLength             *types.Int    `json:"CHAIN_MIN_ACCOUNT_NAME_LENGTH"`
	MinBlockSizeLimit                *types.Int    `json:"CHAIN_MIN_BLOCK_SIZE_LIMIT"`
	MaxBlockSizeLimit                *types.Int    `json:"CHAIN_MAX_BLOCK_SIZE_LIMIT"`
	NullAccount                      string        `json:"CHAIN_NULL_ACCOUNT"`
	NumInitiators                    *types.Int    `json:"CHAIN_NUM_INITIATORS"`
	ProxyToSelfAccount               string        `json:"CHAIN_PROXY_TO_SELF_ACCOUNT"`
	SecondsPerYear                   *types.Int    `json:"CHAIN_SECONDS_PER_YEAR"`
	VestingWithdrawIntervals         *types.Int    `json:"CHAIN_VESTING_WITHDRAW_INTERVALS"`
	VestingWithdrawIntervalSeconds   *types.Int    `json:"CHAIN_VESTING_WITHDRAW_INTERVAL_SECONDS"`
	EnergyRegenerationSeconds        int           `json:"CHAIN_ENERGY_REGENERATION_SECONDS"`
	TokenSymbol                      *types.Int    `json:"TOKEN_SYMBOL"`
	SharesSymbol                     *types.Int    `json:"SHARES_SYMBOL"`
	ChainName                        string        `json:"CHAIN_NAME"`
}

Config structure for the GetConfig function.

type DynamicGlobalProperties

type DynamicGlobalProperties struct {
	ID                         *types.Int   `json:"id"`
	HeadBlockNumber            uint32       `json:"head_block_number"`
	HeadBlockID                string       `json:"head_block_id"`
	GenesisTime                *types.Time  `json:"genesis_time"`
	Time                       *types.Time  `json:"time"`
	CurrentWitness             string       `json:"current_witness"`
	CommitteeFund              *types.Asset `json:"committee_fund"`
	CommitteeRequests          uint32       `json:"committee_requests"`
	CurrentSupply              *types.Asset `json:"current_supply"`
	TotalVestingFund           *types.Asset `json:"total_vesting_fund"`
	TotalVestingShares         *types.Asset `json:"total_vesting_shares"`
	TotalRewardFund            *types.Asset `json:"total_reward_fund"`
	TotalRewardShares          *types.Int64 `json:"total_reward_shares"`
	InflationCalcBlockNum      uint32       `json:"inflation_calc_block_num"`
	InflationWitnessPercent    int16        `json:"inflation_witness_percent"`
	InflationRatio             int16        `json:"inflation_ratio"`
	AverageBlockSize           uint32       `json:"average_block_size"`
	MaximumBlockSize           uint32       `json:"maximum_block_size"`
	CurrentAslot               uint64       `json:"current_aslot"`
	RecentSlotsFilled          *types.Int64 `json:"recent_slots_filled"`
	ParticipationCount         uint8        `json:"participation_count"`
	LastIrreversibleBlockNum   uint32       `json:"last_irreversible_block_num"`
	MaxVirtualBandwidth        uint64       `json:"max_virtual_bandwidth"`
	CurrentReserveRatio        uint64       `json:"current_reserve_ratio"`
	VoteRegenerationPerDay     uint32       `json:"vote_regeneration_per_day"`
	BandwidthReserveCandidates uint32       `json:"bandwidth_reserve_candidates"`
}

DynamicGlobalProperties structure for the GetDynamicGlobalProperties function.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳