<|start_filename|>operations/operation_chain_properties_update.go<|end_filename|>
package operations

import (
	"encoding/json"

	"github.com/asuleymanov/golos-go/encoding/transaction"
	"github.com/asuleymanov/golos-go/types"
)

//ChainPropertiesUpdateOperation represents chain_properties_update operation data.
type ChainPropertiesUpdateOperation struct {
	Owner string        `json:"owner"`
	Props []interface{} `json:"props"`
}

//Type function that defines the type of operation ChainPropertiesUpdateOperation.
func (op *ChainPropertiesUpdateOperation) Type() OpType {
	return TypeChainPropertiesUpdate
}

//Data returns the operation data ChainPropertiesUpdateOperation.
func (op *ChainPropertiesUpdateOperation) Data() interface{} {
	return op
}

//MarshalTransaction is a function of converting type ChainPropertiesUpdateOperation to bytes.
func (op *ChainPropertiesUpdateOperation) MarshalTransaction(encoder *transaction.Encoder) error {
	enc := transaction.NewRollingEncoder(encoder)
	enc.EncodeUVarint(uint64(TypeChainPropertiesUpdate.Code()))
	enc.Encode(op.Owner)
	enc.Encode(byte(2))
	z, _ := json.Marshal(op.Props[1])
	var d types.ChainProperties
	_ = json.Unmarshal(z, &d)
	enc.Encode(&d)
	return enc.Err()
}


<|start_filename|>helper.go<|end_filename|>
package golos

import (
	"github.com/asuleymanov/golos-go/operations"
	"github.com/asuleymanov/golos-go/transactions"
	"github.com/asuleymanov/golos-go/types"
)

//SetAsyncProtocol enables or disables the asynchronous operation protocol
func (client *Client) SetAsyncProtocol(value bool) {
	client.asyncProtocol = value
}

//SetKeys you can specify keys for signing transactions.
func (client *Client) SetKeys(keys *Keys) {
	client.CurrentKeys = keys
}

//SetAsset returns data of type Asset
func SetAsset(amount float64, symbol string) *types.Asset {
	return &types.Asset{Amount: amount, Symbol: symbol}
}

//JSONTrxString generate Trx to String
func JSONTrxString(v *transactions.SignedTransaction) (string, error) {
	ans, err := types.JSONMarshal(v)
	if err != nil {
		return "", err
	}
	return string(ans), nil
}

//JSONOpString generate Operations to String
func JSONOpString(v []operations.Operation) (string, error) {
	var tx operations.Operations

	tx = append(tx, v...)

	ans, err := types.JSONMarshal(tx)
	if err != nil {
		return "", err
	}
	return string(ans), nil
}

//GenerateProposalOperation generate []Operation to ProposalOperations
func GenerateProposalOperation(ops []operations.Operation) operations.ProposalObjects {
	var ans operations.ProposalObjects

	for _, val := range ops {
		ans = append(ans, operations.ProposalObject{Operation: val, OperationType: val.Type()})
	}

	return ans
}


<|start_filename|>operations/voperation_producer_reward.go<|end_filename|>
package operations

import (
	"github.com/asuleymanov/golos-go/types"
)

//ProducerRewardOperationOperation represents producer_reward operation data.
type ProducerRewardOperationOperation struct {
	Producer      string      `json:"producer"`
	VestingShares types.Asset `json:"vesting_shares"`
}

//Type function that defines the type of operation ProducerRewardOperationOperation.
func (op *ProducerRewardOperationOperation) Type() OpType {
	return TypeProducerRewardOperation
}

//Data returns the operation data ProducerRewardOperationOperation.
func (op *ProducerRewardOperationOperation) Data() interface{} {
	return op
}


<|start_filename|>operations/operation_worker_request_delete.go<|end_filename|>
package operations

import (
	"github.com/asuleymanov/golos-go/encoding/transaction"
)

//WorkerRequestDeleteOperation represents worker_request_delete operation data.
type WorkerRequestDeleteOperation struct {
	Author     string        `json:"author"`
	Permlink   string        `json:"permlink"`
	Extensions []interface{} `json:"extensions"`
}

//Type function that defines the type of operation WorkerRequestDeleteOperation.
func (op *WorkerRequestDeleteOperation) Type() OpType {
	return TypeWorkerRequestDelete
}

//Data returns the operation data WorkerRequestDeleteOperation.
func (op *WorkerRequestDeleteOperation) Data() interface{} {
	return op
}

//MarshalTransaction is a function of converting type WorkerRequestDeleteOperation to bytes.
func (op *WorkerRequestDeleteOperation) MarshalTransaction(encoder *transaction.Encoder) error {
	enc := transaction.NewRollingEncoder(encoder)
	enc.EncodeUVarint(uint64(TypeWorkerRequestDelete.Code()))
	enc.EncodeString(op.Author)
	enc.EncodeString(op.Permlink)
	//enc.Encode(Extensions)
	enc.Encode(byte(0))
	return enc.Err()
}


<|start_filename|>operations/voperation_worker_state.go<|end_filename|>
package operations

//WorkerStateOperation represents worker_state operation data.
type WorkerStateOperation struct {
	Author   string `json:"author"`
	Permlink string `json:"permlink"`
	State    int    `json:"state"`
}

//Type function that defines the type of operation WorkerStateOperation.
func (op *WorkerStateOperation) Type() OpType {
	return TypeWorkerState
}

//Data returns the operation data WorkerStateOperation.
func (op *WorkerStateOperation) Data() interface{} {
	return op
}


<|start_filename|>operations/voperation_convert_sbd_debt.go<|end_filename|>
package operations

import (
	"github.com/asuleymanov/golos-go/types"
)

//ConvertSbdDebtOperation represents convert_sbd_debt operation data.
type ConvertSbdDebtOperation struct {
	Owner              string      `json:"owner"`
	SbdAmount          types.Asset `json:"sbd_amount"`
	SteemAmount        types.Asset `json:"steem_amount"`
	SavingsSbdAmount   types.Asset `json:"savings_sbd_amount"`
	SavingsSteemAmount types.Asset `json:"savings_steem_amount"`
}

//Type function that defines the type of operation ConvertSbdDebtOperation.
func (op *ConvertSbdDebtOperation) Type() OpType {
	return TypeConvertSbdDebt
}

//Data returns the operation data ConvertSbdDebtOperation.
func (op *ConvertSbdDebtOperation) Data() interface{} {
	return op
}


<|start_filename|>operations/operation_break_free_referral.go<|end_filename|>
package operations

import (
	"github.com/asuleymanov/golos-go/encoding/transaction"
)

//BreakFreeReferralOperation represents break_free_referral operation data.
type BreakFreeReferralOperation struct {
	Referral   string        `json:"referral"`
	Extensions []interface{} `json:"extensions"`
}

//Type function that defines the type of operation BreakFreeReferralOperation.
func (op *BreakFreeReferralOperation) Type() OpType {
	return TypeBreakFreeReferral
}

//Data returns the operation data BreakFreeReferralOperation.
func (op *BreakFreeReferralOperation) Data() interface{} {
	return op
}

//MarshalTransaction is a function of converting type BreakFreeReferralOperation to bytes.
func (op *BreakFreeReferralOperation) MarshalTransaction(encoder *transaction.Encoder) error {
	enc := transaction.NewRollingEncoder(encoder)
	enc.EncodeUVarint(uint64(TypeBreakFreeReferral.Code()))
	enc.Encode(op.Referral)
	//enc.Encode(op.Extensions)
	enc.Encode(byte(0))
	return enc.Err()
}


<|start_filename|>api/worker_api.go<|end_filename|>
package api

import (
	"errors"
)

//worker_api

//GetWorkerRequests api request get_worker_requests
//sort:
//0 = by_created,
//1 = by_net_rshares,
//2 = by_upvotes,
//3 = by_downvotes
func (api *API) GetWorkerRequests(query WorkerRequestQuery, sort int8, fill_posts bool) ([]*WorkerRequests, error) {
	var resp []*WorkerRequests
	q, err := queryJson([]interface{}{query})
	if err != nil {
		return resp, err
	}

	err = api.call("worker_api", "get_worker_requests", []interface{}{q, sort, fill_posts}, &resp)
	return resp, err
}

//GetWorkerRequestVotes api request get_worker_request_votes
func (api *API) GetWorkerRequestVotes(author, permlink, start_voter string, limit uint32) ([]*WorkerVotes, error) {
	if limit > 50 {
		return nil, errors.New("worker_api: get_worker_request_votes -> limit must not exceed 50")
	}
	var resp []*WorkerVotes
	err := api.call("worker_api", "get_worker_request_votes", []interface{}{author, permlink, start_voter, limit}, &resp)
	return resp, err
}


<|start_filename|>api/tags.go<|end_filename|>
package api

import (
	"github.com/asuleymanov/golos-go/types"
)

//tags

//GetDiscussionsByActive api request get_discussions_by_active
func (api *API) GetDiscussionsByActive(query DiscussionQuery) ([]*Discussion, error) {
	var resp []*Discussion
	q, err := queryJson([]interface{}{query})
	if err != nil {
		return resp, err
	}
	err = api.call("tags", "get_discussions_by_active", []interface{}{q}, &resp)
	return resp, err
}

//GetDiscussionsByAuthorBeforeDate api request get_discussions_by_author_before_date
func (api *API) GetDiscussionsByAuthorBeforeDate(author, permlink string, date types.Time, limit uint32, opts ...uint32) ([]*Discussion, error) {
	var params []interface{}
	if len(opts) > 0 {
		params = []interface{}{author, permlink, date, limit, opts}
	} else {
		params = []interface{}{author, permlink, date, limit}
	}
	var resp []*Discussion
	err := api.call("tags", "get_discussions_by_author_before_date", params, &resp)
	return resp, err
}

//GetDiscussionsByBlog api request get_discussions_by_blog
func (api *API) GetDiscussionsByBlog(query DiscussionQuery) ([]*Discussion, error) {
	var resp []*Discussion
	q, err := queryJson([]interface{}{query})
	if err != nil {
		return resp, err
	}
	err = api.call("tags", "get_discussions_by_blog", []interface{}{q}, &resp)
	return resp, err
}

//GetDiscussionsByCashout api request get_discussions_by_cashout
func (api *API) GetDiscussionsByCashout(query DiscussionQuery) ([]*Discussion, error) {
	var resp []*Discussion
	q, err := queryJson([]interface{}{query})
	if err != nil {
		return resp, err
	}
	err = api.call("tags", "get_discussions_by_cashout", []interface{}{q}, &resp)
	return resp, err
}

//GetDiscussionsByChildren api request get_discussions_by_children
func (api *API) GetDiscussionsByChildren(query DiscussionQuery) ([]*Discussion, error) {
	var resp []*Discussion
	q, err := queryJson([]interface{}{query})
	if err != nil {
		return resp, err
	}
	err = api.call("tags", "get_discussions_by_children", []interface{}{q}, &resp)
	return resp, err
}

//GetDiscussionsByComments api request get_discussions_by_comments
func (api *API) GetDiscussionsByComments(query DiscussionQuery) ([]*Discussion, error) {
	var resp []*Discussion
	q, err := queryJson([]interface{}{query})
	if err != nil {
		return resp, err
	}
	err = api.call("tags", "get_discussions_by_comments", []interface{}{q}, &resp)
	return resp, err
}

//GetDiscussionsByCreated api request get_discussions_by_created
func (api *API) GetDiscussionsByCreated(query DiscussionQuery) ([]*Discussion, error) {
	var resp []*Discussion
	q, err := queryJson([]interface{}{query})
	if err != nil {
		return resp, err
	}
	err = api.call("tags", "get_discussions_by_created", []interface{}{q}, &resp)
	return resp, err
}

//GetDiscussionsByFeed api request get_discussions_by_feed
func (api *API) GetDiscussionsByFeed(query DiscussionQuery) ([]*Discussion, error) {
	var resp []*Discussion
	q, err := queryJson([]interface{}{query})
	if err != nil {
		return resp, err
	}
	err = api.call("tags", "get_discussions_by_feed", []interface{}{q}, &resp)
	return resp, err
}

//GetDiscussionsByHot api request get_discussions_by_hot
func (api *API) GetDiscussionsByHot(query DiscussionQuery) ([]*Discussion, error) {
	var resp []*Discussion
	q, err := queryJson([]interface{}{query})
	if err != nil {
		return resp, err
	}
	err = api.call("tags", "get_discussions_by_hot", []interface{}{q}, &resp)
	return resp, err
}

//GetDiscussionsByPayout api request get_discussions_by_payout
func (api *API) GetDiscussionsByPayout(query DiscussionQuery) ([]*Discussion, error) {
	var resp []*Discussion
	q, err := queryJson([]interface{}{query})
	if err != nil {
		return resp, err
	}
	err = api.call("tags", "get_discussions_by_payout", []interface{}{q}, &resp)
	return resp, err
}

//GetDiscussionsByPromoted api request get_discussions_by_promoted
func (api *API) GetDiscussionsByPromoted(query DiscussionQuery) ([]*Discussion, error) {
	var resp []*Discussion
	q, err := queryJson([]interface{}{query})
	if err != nil {
		return resp, err
	}
	err = api.call("tags", "get_discussions_by_promoted", []interface{}{q}, &resp)
	return resp, err
}

//GetDiscussionsByTrending api request get_discussions_by_trending
func (api *API) GetDiscussionsByTrending(query DiscussionQuery) ([]*Discussion, error) {
	var resp []*Discussion
	q, err := queryJson([]interface{}{query})
	if err != nil {
		return resp, err
	}
	err = api.call("tags", "get_discussions_by_trending", []interface{}{q}, &resp)
	return resp, err
}

//GetDiscussionsByVotes api request get_discussions_by_votes
func (api *API) GetDiscussionsByVotes(query DiscussionQuery) ([]*Discussion, error) {
	var resp []*Discussion
	q, err := queryJson([]interface{}{query})
	if err != nil {
		return resp, err
	}
	err = api.call("tags", "get_discussions_by_votes", []interface{}{q}, &resp)
	return resp, err
}

//GetLanguages api request get_languages
func (api *API) GetLanguages() ([]*string, error) {
	var resp []*string
	err := api.call("tags", "get_languages", EmptyParams, &resp)
	return resp, err
}

//GetTagsUsedByAuthor api request get_tags_used_by_author
func (api *API) GetTagsUsedByAuthor(accountName string) ([]*uint32, error) {
	var resp []*uint32
	err := api.call("tags", "get_tags_used_by_author", []interface{}{accountName}, &resp)
	return resp, err
}

//GetTrendingTags api request get_trending_tags
func (api *API) GetTrendingTags(afterTag string, limit uint32) ([]*TrendingTags, error) {
	var resp []*TrendingTags
	err := api.call("tags", "get_trending_tags", []interface{}{afterTag, limit}, &resp)
	return resp, err
}


<|start_filename|>example/TemplateAPI/main.go<|end_filename|>
package main

import (
	"fmt"

	"github.com/asuleymanov/golos-go"
)

func main() {
	cls, _ := golos.NewClient("wss://golos.solox.world/ws")
	defer cls.Close()

	ans, err := cls.API.GetOpsInBlock(35137873, true)
	if err != nil {
		fmt.Println("Error : ", err)
	} else {
		fmt.Println("Answer :")
		for k, v := range ans {
			fmt.Printf("OP : %d -> %+v \n", k, v)
		}
	}
}


<|start_filename|>operations/voperation_interest.go<|end_filename|>
package operations

import (
	"github.com/asuleymanov/golos-go/types"
)

//InterestOperation represents interest operation data.
type InterestOperation struct {
	Owner    string      `json:"owner"`
	Interest types.Asset `json:"interest"`
}

//Type function that defines the type of operation InterestOperation.
func (op *InterestOperation) Type() OpType {
	return TypeInterest
}

//Data returns the operation data InterestOperation.
func (op *InterestOperation) Data() interface{} {
	return op
}


<|start_filename|>operations/custom_json_body.go<|end_filename|>
package operations


var (
	TypeFollow         = "follow"
	TypeReblog         = "reblog"
  TypeDeleteReblog = "delete_reblog"
)

var customJSONDataObjects = map[string]interface{}{
	TypeFollow:         &FollowOperation{},
	TypeReblog:         &ReblogOperation{},
  TypeDeleteReblog:         &DeleteReblogOperation{},
}

//FollowOperation the structure for the operation CustomJSONOperation.
type FollowOperation struct {
	Follower  string   `json:"follower"`
	Following string   `json:"following"`
	What      []string `json:"what"`
}

//ReblogOperation the structure for the operation CustomJSONOperation.
type ReblogOperation struct {
	Account  string `json:"account"`
	Author   string `json:"author"`
	Permlink string `json:"permlink"`
 Title string `json:"title"`
Body   string `json:"body"`
JSONMetadata   string `json:"json_metadata"`
}

//DeleteReblogOperation the structure for the operation CustomJSONOperation.
type DeleteReblogOperation struct {
	Account  string `json:"account"`
	Author   string `json:"author"`
	Permlink string `json:"permlink"`
}

<|start_filename|>operations/operation_report_over_production.go<|end_filename|>
package operations

//ReportOverProductionOperation represents report_over_production operation data.
type ReportOverProductionOperation struct {
	Reporter string `json:"reporter"`
}

//Type function that defines the type of operation ReportOverProductionOperation.
func (op *ReportOverProductionOperation) Type() OpType {
	return TypeReportOverProduction
}

//Data returns the operation data ReportOverProductionOperation.
func (op *ReportOverProductionOperation) Data() interface{} {
	return op
}


<|start_filename|>api/social_network.go<|end_filename|>
package api

//social_network

//GetAccountVotes api request get_account_votes
func (api *API) GetAccountVotes(author string, opts ...interface{}) ([]*Votes, error) {
	var params []interface{}
	if len(opts) > 0 {
		params = []interface{}{author, opts}
	} else {
		params = []interface{}{author}
	}
	var resp []*Votes
	err := api.call("social_network", "get_account_votes", params, &resp)
	return resp, err
}

//GetActiveVotes api request get_active_votes
func (api *API) GetActiveVotes(author, permlink string, opts ...interface{}) ([]*VoteState, error) {
	var params []interface{}
	if len(opts) > 0 {
		params = []interface{}{author, permlink, opts}
	} else {
		params = []interface{}{author, permlink}
	}
	var resp []*VoteState
	err := api.call("social_network", "get_active_votes", params, &resp)
	return resp, err
}

//GetAllContentReplies api request get_all_content_replies
func (api *API) GetAllContentReplies(parentAuthor, parentPermlink string, opts ...interface{}) ([]*Discussion, error) {
	var params []interface{}
	if len(opts) > 0 {
		params = []interface{}{parentAuthor, parentPermlink, opts}
	} else {
		params = []interface{}{parentAuthor, parentPermlink}
	}
	var resp []*Discussion
	err := api.call("social_network", "get_all_content_replies", params, &resp)
	return resp, err
}

//GetContent api request get_content
func (api *API) GetContent(author, permlink string, opts ...interface{}) (*Discussion, error) {
	var params []interface{}
	if len(opts) > 0 {
		params = []interface{}{author, permlink, opts}
	} else {
		params = []interface{}{author, permlink}
	}
	var resp Discussion
	err := api.call("social_network", "get_content", params, &resp)
	return &resp, err
}

//GetContentReplies api request get_content_replies
func (api *API) GetContentReplies(parentAuthor, parentPermlink string, opts ...interface{}) ([]*Discussion, error) {
	var params []interface{}
	if len(opts) > 0 {
		params = []interface{}{parentAuthor, parentPermlink, opts}
	} else {
		params = []interface{}{parentAuthor, parentPermlink}
	}
	var resp []*Discussion
	err := api.call("social_network", "get_content_replies", params, &resp)
	return resp, err
}

//GetRepliesByLastUpdate api request get_replies_by_last_update
func (api *API) GetRepliesByLastUpdate(startAuthor, startPermlink string, limit, vote_limit, vote_offset uint32) ([]*Discussion, error) {

	var resp []*Discussion
	err := api.call("social_network", "get_replies_by_last_update", []interface{}{startAuthor, startPermlink, limit, vote_limit, vote_offset}, &resp)
	return resp, err
}


<|start_filename|>operations/operation_cancel_transfer_from_savings.go<|end_filename|>
package operations

import (
	"github.com/asuleymanov/golos-go/encoding/transaction"
)

//CancelTransferFromSavingsOperation represents cancel_transfer_from_savings operation data.
type CancelTransferFromSavingsOperation struct {
	From      string `json:"from"`
	RequestID uint32 `json:"request_id"`
}

//Type function that defines the type of operation CancelTransferFromSavingsOperation.
func (op *CancelTransferFromSavingsOperation) Type() OpType {
	return TypeCancelTransferFromSavings
}

//Data returns the operation data CancelTransferFromSavingsOperation.
func (op *CancelTransferFromSavingsOperation) Data() interface{} {
	return op
}

//MarshalTransaction is a function of converting type CancelTransferFromSavingsOperation to bytes.
func (op *CancelTransferFromSavingsOperation) MarshalTransaction(encoder *transaction.Encoder) error {
	enc := transaction.NewRollingEncoder(encoder)
	enc.EncodeUVarint(uint64(TypeCancelTransferFromSavings.Code()))
	enc.Encode(op.From)
	enc.Encode(op.RequestID)
	return enc.Err()
}


<|start_filename|>operations/operation_custom_binary.go<|end_filename|>
package operations

import (
	"github.com/asuleymanov/golos-go/types"
)

//CustomBinaryOperation represents custom_binary operation data.
type CustomBinaryOperation struct {
	RequiredOwnerAuths   []string          `json:"required_owner_auths"`
	RequiredActiveAuths  []string          `json:"required_active_auths"`
	RequiredPostingAuths []string          `json:"required_posting_auths"`
	RequiredAuths        []types.Authority `json:"required_auths"`
	ID                   string            `json:"id"`
	Datas                []byte            `json:"data"`
}

//Type function that defines the type of operation CustomBinaryOperation.
func (op *CustomBinaryOperation) Type() OpType {
	return TypeCustomBinary
}

//Data returns the operation data CustomBinaryOperation.
func (op *CustomBinaryOperation) Data() interface{} {
	return op
}


<|start_filename|>operations/voperation_fill_convert_request.go<|end_filename|>
package operations

import (
	"github.com/asuleymanov/golos-go/types"
)

//FillConvertRequestOperation represents fill_convert_request operation data.
type FillConvertRequestOperation struct {
	Owner     string      `json:"owner"`
	Requestid uint32      `json:"requestid"`
	AmountIn  types.Asset `json:"amount_in"`
	AmountOut types.Asset `json:"amount_out"`
}

//Type function that defines the type of operation FillConvertRequestOperation.
func (op *FillConvertRequestOperation) Type() OpType {
	return TypeFillConvertRequest
}

//Data returns the operation data FillConvertRequestOperation.
func (op *FillConvertRequestOperation) Data() interface{} {
	return op
}


<|start_filename|>operations/operation_reject_vesting_shares_delegation.go<|end_filename|>
package operations

import (
	"github.com/asuleymanov/golos-go/encoding/transaction"
)

//RejectVestingSharesDelegationOperation represents reject_vesting_shares_delegation operation data.
type RejectVestingSharesDelegationOperation struct {
	Delegator  string        `json:"delegator"`
	Delegatee  string        `json:"delegatee"`
	Extensions []interface{} `json:"extensions"`
}

//Type function that defines the type of operation RejectVestingSharesDelegationOperation.
func (op *RejectVestingSharesDelegationOperation) Type() OpType {
	return TypeRejectVestingSharesDelegation
}

//Data returns the operation data RejectVestingSharesDelegationOperation.
func (op *RejectVestingSharesDelegationOperation) Data() interface{} {
	return op
}

//MarshalTransaction is a function of converting type RejectVestingSharesDelegationOperation to bytes.
func (op *RejectVestingSharesDelegationOperation) MarshalTransaction(encoder *transaction.Encoder) error {
	enc := transaction.NewRollingEncoder(encoder)
	enc.EncodeUVarint(uint64(TypeRejectVestingSharesDelegation.Code()))
	enc.Encode(op.Delegator)
	enc.Encode(op.Delegatee)
	//enc.Encode(op.Extensions)
	enc.Encode(byte(0))
	return enc.Err()
}


<|start_filename|>operations/operation_account_create.go<|end_filename|>
package operations

import (
	"github.com/asuleymanov/golos-go/encoding/transaction"
	"github.com/asuleymanov/golos-go/types"
)

//AccountCreateOperation represents account_create operation data.
type AccountCreateOperation struct {
	Fee            *types.Asset     `json:"fee"`
	Creator        string           `json:"creator"`
	NewAccountName string           `json:"new_account_name"`
	Owner          *types.Authority `json:"owner"`
	Active         *types.Authority `json:"active"`
	Posting        *types.Authority `json:"posting"`
	MemoKey        string           `json:"memo_key"`
	JSONMetadata   string           `json:"json_metadata"`
}

//Type function that defines the type of operation AccountCreateOperation.
func (op *AccountCreateOperation) Type() OpType {
	return TypeAccountCreate
}

//Data returns the operation data AccountCreateOperation.
func (op *AccountCreateOperation) Data() interface{} {
	return op
}

//MarshalTransaction is a function of converting type AccountCreateOperation to bytes.
func (op *AccountCreateOperation) MarshalTransaction(encoder *transaction.Encoder) error {
	enc := transaction.NewRollingEncoder(encoder)
	enc.EncodeUVarint(uint64(TypeAccountCreate.Code()))
	enc.Encode(op.Fee)
	enc.EncodeString(op.Creator)
	enc.EncodeString(op.NewAccountName)
	enc.Encode(op.Owner)
	enc.Encode(op.Active)
	enc.Encode(op.Posting)
	enc.EncodePubKey(op.MemoKey)
	enc.Encode(op.JSONMetadata)
	return enc.Err()
}


<|start_filename|>operations/voperation_worker_reward.go<|end_filename|>
package operations

import (
	"github.com/asuleymanov/golos-go/types"
)

//WorkerRewardOperation represents worker_reward operation data.
type WorkerRewardOperation struct {
	Worker                string      `json:"worker"`
	WorkerRequestAuthor   string      `json:"worker_request_author"`
	WorkerRequestPermlink string      `json:"worker_request_permlink"`
	Reward                types.Asset `json:"reward"`
	RewardInVestsIfVest   types.Asset `json:"reward_in_vests_if_vest"`
}

//Type function that defines the type of operation WorkerRewardOperation.
func (op *WorkerRewardOperation) Type() OpType {
	return TypeWorkerReward
}

//Data returns the operation data WorkerRewardOperation.
func (op *WorkerRewardOperation) Data() interface{} {
	return op
}


<|start_filename|>operations/operation_convert.go<|end_filename|>
package operations

import (
	"github.com/asuleymanov/golos-go/encoding/transaction"
	"github.com/asuleymanov/golos-go/types"
)

//ConvertOperation represents convert operation data.
type ConvertOperation struct {
	Owner     string       `json:"owner"`
	RequestID uint32       `json:"requestid"`
	Amount    *types.Asset `json:"amount"`
}

//Type function that defines the type of operation ConvertOperation.
func (op *ConvertOperation) Type() OpType {
	return TypeConvert
}

//Data returns the operation data ConvertOperation.
func (op *ConvertOperation) Data() interface{} {
	return op
}

//MarshalTransaction is a function of converting type ConvertOperation to bytes.
func (op *ConvertOperation) MarshalTransaction(encoder *transaction.Encoder) error {
	enc := transaction.NewRollingEncoder(encoder)
	enc.EncodeUVarint(uint64(TypeConvert.Code()))
	enc.Encode(op.Owner)
	enc.Encode(op.RequestID)
	enc.Encode(op.Amount)
	return enc.Err()
}


<|start_filename|>operations/optype.go<|end_filename|>
package operations

// OpType represents a Golos operation type, i.e. vote, comment, pow and so on.
type OpType string

// Code returns the operation code associated with the given operation type.
func (kind OpType) Code() uint16 {
	return opCodes[kind]
}

const (
	TypeVote                              OpType = "vote"
	TypeComment                           OpType = "comment"
	TypeTransfer                          OpType = "transfer"
	TypeTransferToVesting                 OpType = "transfer_to_vesting"
	TypeWithdrawVesting                   OpType = "withdraw_vesting"
	TypeLimitOrderCreate                  OpType = "limit_order_create"
	TypeLimitOrderCancel                  OpType = "limit_order_cancel"
	TypeFeedPublish                       OpType = "feed_publish"
	TypeConvert                           OpType = "convert"
	TypeAccountCreate                     OpType = "account_create"
	TypeAccountUpdate                     OpType = "account_update"
	TypeWitnessUpdate                     OpType = "witness_update"
	TypeAccountWitnessVote                OpType = "account_witness_vote"
	TypeAccountWitnessProxy               OpType = "account_witness_proxy"
	TypePOW                               OpType = "pow"
	TypeCustom                            OpType = "custom"
	TypeReportOverProduction              OpType = "report_over_production"
	TypeDeleteComment                     OpType = "delete_comment"
	TypeCustomJSON                        OpType = "custom_json"
	TypeCommentOptions                    OpType = "comment_options"
	TypeSetWithdrawVestingRoute           OpType = "set_withdraw_vesting_route"
	TypeLimitOrderCreate2                 OpType = "limit_order_create2"
	TypeChallengeAuthority                OpType = "challenge_authority"
	TypeProveAuthority                    OpType = "prove_authority"
	TypeRequestAccountRecovery            OpType = "request_account_recovery"
	TypeRecoverAccount                    OpType = "recover_account"
	TypeChangeRecoveryAccount             OpType = "change_recovery_account"
	TypeEscrowTransfer                    OpType = "escrow_transfer"
	TypeEscrowDispute                     OpType = "escrow_dispute"
	TypeEscrowRelease                     OpType = "escrow_release"
	TypePOW2                              OpType = "pow2"
	TypeEscrowApprove                     OpType = "escrow_approve"
	TypeTransferToSavings                 OpType = "transfer_to_savings"
	TypeTransferFromSavings               OpType = "transfer_from_savings"
	TypeCancelTransferFromSavings         OpType = "cancel_transfer_from_savings"
	TypeCustomBinary                      OpType = "custom_binary"
	TypeDeclineVotingRights               OpType = "decline_voting_rights"
	TypeResetAccount                      OpType = "reset_account"
	TypeSetResetAccount                   OpType = "set_reset_account"
	TypeDelegateVestingShares             OpType = "delegate_vesting_shares"
	TypeAccountCreateWithDelegation       OpType = "account_create_with_delegation"
	TypeAccountMetadata                   OpType = "account_metadata"
	TypeProposalCreate                    OpType = "proposal_create"
	TypeProposalUpdate                    OpType = "proposal_update"
	TypeProposalDelete                    OpType = "proposal_delete"
	TypeChainPropertiesUpdate             OpType = "chain_properties_update"
	TypeBreakFreeReferral                 OpType = "break_free_referral"
	TypeDelegateVestingSharesWithInterest OpType = "delegate_vesting_shares_with_interest"
	TypeRejectVestingSharesDelegation     OpType = "reject_vesting_shares_delegation"
	TypeTransitToCyberway                 OpType = "transit_to_cyberway"
	TypeWorkerRequest                     OpType = "worker_request"
	TypeWorkerRequestDelete               OpType = "worker_request_delete"
	TypeWorkerRequestVote                 OpType = "worker_request_vote"
	TypeFillConvertRequest                OpType = "fill_convert_request" //Virtual Operation
	TypeAuthorReward                      OpType = "author_reward"
	TypeCurationReward                    OpType = "curation_reward"
	TypeCommentReward                     OpType = "comment_reward"
	TypeLiquidityReward                   OpType = "liquidity_reward"
	TypeInterest                          OpType = "interest"
	TypeFillVestingWithdraw               OpType = "fill_vesting_withdraw"
	TypeFillOrder                         OpType = "fill_order"
	TypeShutdownWitness                   OpType = "shutdown_witness"
	TypeFillTransferFromSavings           OpType = "fill_transfer_from_savings"
	TypeHardfork                          OpType = "hardfork"
	TypeCommentPayoutUpdate               OpType = "comment_payout_update"
	TypeCommentBenefactorReward           OpType = "comment_benefactor_reward"
	TypeReturnVestingDelegation           OpType = "return_vesting_delegation"
	TypeProducerRewardOperation           OpType = "producer_reward_operation"
	TypeDelegationReward                  OpType = "delegation_reward"
	TypeAuctionWindowReward               OpType = "auction_window_reward"
	TypeTotalCommentReward                OpType = "total_comment_reward"
	TypeWorkerReward                      OpType = "worker_reward"
	TypeWorkerState                       OpType = "worker_state"
	TypeConvertSbdDebt                    OpType = "convert_sbd_debt"
)

var opTypes = [...]OpType{
	TypeVote,
	TypeComment,
	TypeTransfer,
	TypeTransferToVesting,
	TypeWithdrawVesting,
	TypeLimitOrderCreate,
	TypeLimitOrderCancel,
	TypeFeedPublish,
	TypeConvert,
	TypeAccountCreate,
	TypeAccountUpdate,
	TypeWitnessUpdate,
	TypeAccountWitnessVote,
	TypeAccountWitnessProxy,
	TypePOW,
	TypeCustom,
	TypeReportOverProduction,
	TypeDeleteComment,
	TypeCustomJSON,
	TypeCommentOptions,
	TypeSetWithdrawVestingRoute,
	TypeLimitOrderCreate2,
	TypeChallengeAuthority,
	TypeProveAuthority,
	TypeRequestAccountRecovery,
	TypeRecoverAccount,
	TypeChangeRecoveryAccount,
	TypeEscrowTransfer,
	TypeEscrowDispute,
	TypeEscrowRelease,
	TypePOW2,
	TypeEscrowApprove,
	TypeTransferToSavings,
	TypeTransferFromSavings,
	TypeCancelTransferFromSavings,
	TypeCustomBinary,
	TypeDeclineVotingRights,
	TypeResetAccount,
	TypeSetResetAccount,
	TypeDelegateVestingShares,
	TypeAccountCreateWithDelegation,
	TypeAccountMetadata,
	TypeProposalCreate,
	TypeProposalUpdate,
	TypeProposalDelete,
	TypeChainPropertiesUpdate,
	TypeBreakFreeReferral,
	TypeDelegateVestingSharesWithInterest,
	TypeRejectVestingSharesDelegation,
	TypeTransitToCyberway,
	TypeWorkerRequest,
	TypeWorkerRequestDelete,
	TypeWorkerRequestVote,
	TypeFillConvertRequest, //Virtual Operation
	TypeAuthorReward,
	TypeCurationReward,
	TypeCommentReward,
	TypeLiquidityReward,
	TypeInterest,
	TypeFillVestingWithdraw,
	TypeFillOrder,
	TypeShutdownWitness,
	TypeFillTransferFromSavings,
	TypeHardfork,
	TypeCommentPayoutUpdate,
	TypeCommentBenefactorReward,
	TypeReturnVestingDelegation,
	TypeProducerRewardOperation,
	TypeDelegationReward,
	TypeAuctionWindowReward,
	TypeTotalCommentReward,
	TypeWorkerReward,
	TypeWorkerState,
	TypeConvertSbdDebt,
}

// opCodes keeps mapping operation type -> operation code.
var opCodes map[OpType]uint16

func init() {
	opCodes = make(map[OpType]uint16, len(opTypes))
	for i, opType := range opTypes {
		opCodes[opType] = uint16(i)
	}
}


<|start_filename|>api/private_message.go<|end_filename|>
package api

import (
	"encoding/json"
	"time"
)

//private_message

//GetInbox api request get_inbox
func (api *API) GetInbox(to string, limit, offset uint16) ([]*Message, error) {
	var resp []*Message
	err := api.call("private_message", "get_inbox", []interface{}{to, time.Now(), limit, offset}, &resp)
	return resp, err
}

//GetOutbox api request get_outbox
func (api *API) GetOutbox(from string, limit, offset uint16) ([]*Message, error) {
	var resp []*Message
	err := api.call("private_message", "get_outbox", []interface{}{from, time.Now(), limit, offset}, &resp)
	return resp, err
}

//GetThread api request get_thread
func (api *API) GetThread(from, to string, limit, offset uint16) ([]*Message, error) {
	var resp []*Message
	err := api.call("private_message", "get_thread", []interface{}{from, to, limit, offset}, &resp)
	return resp, err
}

//GetSettings api request get_settings
func (api *API) GetSettings(owner string) (*MessageSettings, error) {
	var resp MessageSettings
	err := api.call("private_message", "get_settings", []interface{}{owner}, &resp)
	return &resp, err
}

//GetContactsSize api request get_contacts_size
func (api *API) GetContactsSize(owner string) (*json.RawMessage, error) {
	var resp json.RawMessage
	err := api.call("private_message", "get_contacts_size", []interface{}{owner}, &resp)
	return &resp, err
}

//GetContactInfo api request get_contact_info
func (api *API) GetContactInfo(from, contact string) (*MessageContact, error) {
	var resp MessageContact
	err := api.call("private_message", "get_contact_info", []interface{}{from, contact}, &resp)
	return &resp, err
}

//GetContacts api request get_contacts
func (api *API) GetContacts(from, contact string) ([]*MessageContact, error) {
	var resp []*MessageContact
	err := api.call("private_message", "get_contacts", []interface{}{from, contact}, &resp)
	return resp, err
}


<|start_filename|>api/follow.go<|end_filename|>
package api

import (
	"errors"
)

//follow

//GetAccountReputations api request get_account_reputations
func (api *API) GetAccountReputations(accounts ...string) ([]*AccountReputation, error) {
	var resp []*AccountReputation
	err := api.call("follow", "get_account_reputations", []interface{}{accounts}, &resp)
	return resp, err
}

//GetBlog api request get_blog
func (api *API) GetBlog(accountName string, entryID, limit uint32) ([]*Blogs, error) {
	if limit > 500 {
		return nil, errors.New("follow: get_blog -> limit must not exceed 500")
	}
	var resp []*Blogs
	err := api.call("follow", "get_blog", []interface{}{accountName, entryID, limit}, &resp)
	return resp, err
}

//GetBlogAuthors api request get_blog_authors
func (api *API) GetBlogAuthors(author string) ([]*BlogAuthor, error) {
	var resp []*BlogAuthor
	err := api.call("follow", "get_blog_authors", []interface{}{author}, &resp)
	return resp, err
}

//GetBlogEntries api request get_blog_entries
func (api *API) GetBlogEntries(accountName string, entryID, limit uint32) ([]*BlogEntries, error) {
	if limit > 500 {
		return nil, errors.New("follow: get_blog_entries -> limit must not exceed 500")
	}
	var resp []*BlogEntries
	err := api.call("follow", "get_blog_entries", []interface{}{accountName, entryID, limit}, &resp)
	return resp, err
}

//GetFeed api request get_feed
func (api *API) GetFeed(accountName string, entryID, limit uint32) ([]*Feeds, error) {
	if limit > 500 {
		return nil, errors.New("follow: get_feed -> limit must not exceed 500")
	}
	var resp []*Feeds
	err := api.call("follow", "get_feed", []interface{}{accountName, entryID, limit}, &resp)
	return resp, err
}

//GetFeedEntries api request get_feed_entries
func (api *API) GetFeedEntries(accountName string, entryID, limit uint32) ([]*FeedEntry, error) {
	if limit > 500 {
		return nil, errors.New("follow: get_feed_entries -> limit must not exceed 500")
	}
	var resp []*FeedEntry
	err := api.call("follow", "get_feed_entries", []interface{}{accountName, entryID, limit}, &resp)
	return resp, err
}

//GetFollowCount api request get_follow_count
func (api *API) GetFollowCount(accountName string) (*FollowCount, error) {
	var resp FollowCount
	err := api.call("follow", "get_follow_count", []interface{}{accountName}, &resp)
	return &resp, err
}

//GetFollowers api request get_followers
/*
kind:
0 = undefined
1 = blog
2 = ignore
*/
func (api *API) GetFollowers(accountName, start string, kind, limit uint32) ([]*FollowObject, error) {
	if limit > 1000 {
		return nil, errors.New("follow: get_followers -> limit must not exceed 1000")
	}

	var resp []*FollowObject
	err := api.call("follow", "get_followers", []interface{}{accountName, start, kind, limit}, &resp)
	return resp, err
}

//GetFollowing api request get_following
/*
kind:
0 = undefined
1 = blog
2 = ignore
*/
func (api *API) GetFollowing(accountName, start string, kind, limit uint32) ([]*FollowObject, error) {
	if limit > 1000 {
		return nil, errors.New("follow: get_following -> limit must not exceed 1000")
	}

	var resp []*FollowObject
	err := api.call("follow", "get_following", []interface{}{accountName, start, kind, limit}, &resp)
	return resp, err
}

//GetRebloggedBy api request get_reblogged_by
func (api *API) GetRebloggedBy(author, permlink string) ([]*string, error) {
	var resp []*string
	err := api.call("follow", "get_reblogged_by", []interface{}{author, permlink}, &resp)
	return resp, err
}


<|start_filename|>operations/voperation_comment_payout_update.go<|end_filename|>
package operations

//CommentPayoutUpdateOperation represents comment_payout_update operation data.
type CommentPayoutUpdateOperation struct {
	Author   string `json:"author"`
	Permlink string `json:"permlink"`
}

//Type function that defines the type of operation CommentPayoutUpdateOperation.
func (op *CommentPayoutUpdateOperation) Type() OpType {
	return TypeCommentPayoutUpdate
}

//Data returns the operation data CommentPayoutUpdateOperation.
func (op *CommentPayoutUpdateOperation) Data() interface{} {
	return op
}


<|start_filename|>operations/operation_custom.go<|end_filename|>
package operations

import (
	"github.com/asuleymanov/golos-go/encoding/transaction"
)

//CustomOperation represents custom operation data.
type CustomOperation struct {
	RequiredAuths []string `json:"required_auths"`
	ID            uint16   `json:"id"`
	Datas         []byte   `json:"data"`
}

//Type function that defines the type of operation CustomOperation.
func (op *CustomOperation) Type() OpType {
	return TypeCustom
}

//Data returns the operation data CustomOperation.
func (op *CustomOperation) Data() interface{} {
	return op
}

//MarshalTransaction is a function of converting type CustomOperation to bytes.
func (op *CustomOperation) MarshalTransaction(encoder *transaction.Encoder) error {
	enc := transaction.NewRollingEncoder(encoder)
	enc.EncodeUVarint(uint64(TypeCustom.Code()))
	enc.Encode(op.RequiredAuths)
	enc.Encode(op.ID)
	enc.Encode(op.Datas)
	return enc.Err()
}


<|start_filename|>api/database_api.go<|end_filename|>
package api

import (
	"encoding/json"

	"github.com/asuleymanov/golos-go/operations"
	"github.com/asuleymanov/golos-go/types"
)

//database_api

//GetAccountBandwidth displays user actions based on type
/*
bandwidthType:
post = 0
forum = 1
market = 2
custom_json = 3
*/
func (api *API) GetAccountBandwidth(accountName string, bandwidthType uint32) (*Bandwidth, error) {
	var resp Bandwidth
	err := api.call("database_api", "get_account_bandwidth", []interface{}{accountName, bandwidthType}, &resp)
	return &resp, err
}

//GetAccountCount returns the number of registered users.
func (api *API) GetAccountCount() (*uint64, error) {
	var resp uint64
	err := api.call("database_api", "get_account_count", EmptyParams, &resp)
	return &resp, err
}

//GetAccounts api request get_accounts
func (api *API) GetAccounts(accountNames ...string) ([]*Account, error) {
	var resp []*Account
	err := api.call("database_api", "get_accounts", []interface{}{accountNames}, &resp)
	return resp, err
}

//GetBlock api request get_block
func (api *API) GetBlock(blockNum uint32) (*Block, error) {
	var resp Block
	err := api.call("database_api", "get_block", []uint32{blockNum}, &resp)
	resp.Number = blockNum
	return &resp, err
}

//GetBlockHeader api request get_block_header
func (api *API) GetBlockHeader(blockNum uint32) (*BlockHeader, error) {
	var resp BlockHeader
	err := api.call("database_api", "get_block_header", []uint32{blockNum}, &resp)
	resp.Number = blockNum
	return &resp, err
}

//GetChainProperties api request get_chain_properties
func (api *API) GetChainProperties() (*types.ChainProperties, error) {
	var resp types.ChainProperties
	err := api.call("database_api", "get_chain_properties", EmptyParams, &resp)
	return &resp, err
}

//GetConfig api request get_config
func (api *API) GetConfig() (*Config, error) {
	var resp Config
	err := api.call("database_api", "get_config", EmptyParams, &resp)
	return &resp, err
}

//GetConversionRequests api request get_conversion_requests
func (api *API) GetConversionRequests(accountName string) ([]*ConversionRequests, error) {
	var resp []*ConversionRequests
	err := api.call("database_api", "get_conversion_requests", []string{accountName}, &resp)
	return resp, err
}

//GetDatabaseInfo api request get_database_info
func (api *API) GetDatabaseInfo() (*DatabaseInfo, error) {
	var resp DatabaseInfo
	err := api.call("database_api", "get_database_info", EmptyParams, &resp)
	return &resp, err
}

//GetDynamicGlobalProperties api request get_dynamic_global_properties
func (api *API) GetDynamicGlobalProperties() (*DynamicGlobalProperties, error) {
	var resp DynamicGlobalProperties
	err := api.call("database_api", "get_dynamic_global_properties", EmptyParams, &resp)
	return &resp, err
}

//GetEscrow api request get_escrow
func (api *API) GetEscrow(from string, escrowID uint32) (*Escrow, error) {
	var resp Escrow
	err := api.call("database_api", "get_escrow", []interface{}{from, escrowID}, &resp)
	return &resp, err
}

//GetExpiringVestingDelegations api request get_expiring_vesting_delegations
func (api *API) GetExpiringVestingDelegations(account string, from types.Time, limit ...uint32) ([]*VestingDelegationExpiration, error) {
	params := []interface{}{account, from}
	switch len(limit) {
	case 0:
		params = append(params, 100)
	default:
		params = append(params, limit[0])
	}
	var resp []*VestingDelegationExpiration
	err := api.call("database_api", "get_expiring_vesting_delegations", params, &resp)
	return resp, err
}

//GetHardforkVersion api request get_hardfork_version
func (api *API) GetHardforkVersion() (*string, error) {
	var resp string
	err := api.call("database_api", "get_hardfork_version", EmptyParams, &resp)
	return &resp, err
}

//GetNextScheduledHardfork api request get_next_scheduled_hardfork
func (api *API) GetNextScheduledHardfork() (*NextScheduledHardfork, error) {
	var resp NextScheduledHardfork
	err := api.call("database_api", "get_next_scheduled_hardfork", EmptyParams, &resp)
	return &resp, err
}

//GetOwnerHistory api request get_owner_history
func (api *API) GetOwnerHistory(accountName string) ([]*OwnerHistory, error) {
	var resp []*OwnerHistory
	err := api.call("database_api", "get_owner_history", []interface{}{accountName}, &resp)
	return resp, err
}

//GetPotentialSignatures api request get_potential_signatures
func (api *API) GetPotentialSignatures(trx *operations.Transaction) ([]*string, error) {
	var resp []*string
	err := api.call("database_api", "get_potential_signatures", []interface{}{&trx}, &resp)
	return resp, err
}

//GetProposedTransaction api request get_proposed_transactions
func (api *API) GetProposedTransaction(account string, from, limit uint32) ([]*ProposalObject, error) {
	var resp []*ProposalObject
	err := api.call("database_api", "get_proposed_transactions", []interface{}{account, from, limit}, &resp)
	return resp, err
}

//GetRecoveryRequest api request get_recovery_request
func (api *API) GetRecoveryRequest(accountName string) (*AccountRecoveryRequest, error) {
	var resp AccountRecoveryRequest
	err := api.call("database_api", "get_recovery_request", []interface{}{accountName}, &resp)
	return &resp, err
}

//GetRequiredSignatures api request get_required_signatures
func (api *API) GetRequiredSignatures(trx *operations.Transaction, keys ...string) ([]*string, error) {
	var resp []*string
	err := api.call("database_api", "get_required_signatures", []interface{}{trx, keys}, &resp)
	return resp, err
}

//GetSavingsWithdrawFrom api request get_savings_withdraw_from
func (api *API) GetSavingsWithdrawFrom(accountName string) ([]*SavingsWithdraw, error) {
	var resp []*SavingsWithdraw
	err := api.call("database_api", "get_savings_withdraw_from", []interface{}{accountName}, &resp)
	return resp, err
}

//GetSavingsWithdrawTo api request get_savings_withdraw_to
func (api *API) GetSavingsWithdrawTo(accountName string) ([]*SavingsWithdraw, error) {
	var resp []*SavingsWithdraw
	err := api.call("database_api", "get_savings_withdraw_to", []interface{}{accountName}, &resp)
	return resp, err
}

//GetTransactionHex api request get_transaction_hex
func (api *API) GetTransactionHex(trx *operations.Transaction) (*string, error) {
	var resp string
	err := api.call("database_api", "get_transaction_hex", []interface{}{&trx}, &resp)
	return &resp, err
}

//GetVestingDelegations api request get_vesting_delegations
//dtype:
//  delegated
//  any other
func (api *API) GetVestingDelegations(account, from, dtype string, limit ...uint32) ([]*VestingDelegation, error) {
	params := []interface{}{account, from}
	switch len(limit) {
	case 0:
		params = append(params, 100)
	default:
		params = append(params, limit[0])
	}
	params = append(params, dtype)
	var resp []*VestingDelegation
	err := api.call("database_api", "get_vesting_delegations", params, &resp)
	return resp, err
}

//GetWithdrawRoutes api request get_withdraw_routes
/*
withdrawRouteType:
0 = incoming
1 = outgoing
2 = all
*/
func (api *API) GetWithdrawRoutes(accountName string, withdrawRouteType uint32) ([]*WithdrawVestingRoutes, error) {
	var resp []*WithdrawVestingRoutes
	err := api.call("database_api", "get_withdraw_routes", []interface{}{accountName, withdrawRouteType}, &resp)
	return resp, err
}

//LookupAccountNames api request lookup_account_names
func (api *API) LookupAccountNames(accountNames ...string) ([]*Account, error) {
	var resp []*Account
	err := api.call("database_api", "lookup_account_names", []interface{}{accountNames}, &resp)
	return resp, err
}

//LookupAccounts api request lookup_accounts
func (api *API) LookupAccounts(lowerBoundName string, limit uint32) ([]*string, error) {
	var resp []*string
	err := api.call("database_api", "lookup_accounts", []interface{}{lowerBoundName, limit}, &resp)
	return resp, err
}

//GetVerifyAccountAuthority api request verify_account_authority
func (api *API) GetVerifyAccountAuthority(accountName string, keys ...string) (*bool, error) {
	var resp bool
	err := api.call("database_api", "verify_account_authority", []interface{}{accountName, keys}, &resp)
	return &resp, err
}

//GetVerifyAuthority api request verify_authority
func (api *API) GetVerifyAuthority(trx *operations.Transaction) (*bool, error) {
	var resp bool
	err := api.call("database_api", "verify_authority", []interface{}{&trx}, &resp)
	return &resp, err
}

// Set callback to invoke as soon as a new block is applied
func (api *API) SetBlockAppliedCallback(notice func(header *CallbackBlockResponse, error error)) (err error) {
	err = api.setCallback("database_api", "set_block_applied_callback", func(raw json.RawMessage) {
		var header CallbackBlockResponse
		if err := json.Unmarshal(raw, &header); err != nil {
			notice(nil, err)
		}
		notice(&header, nil)
	})
	return
}


<|start_filename|>operations/voperation_liquidity_reward.go<|end_filename|>
package operations

import (
	"github.com/asuleymanov/golos-go/types"
)

//LiquidityRewardOperation represents liquidity_reward operation data.
type LiquidityRewardOperation struct {
	Owner  string      `json:"owner"`
	Payout types.Asset `json:"payout"`
}

//Type function that defines the type of operation LiquidityRewardOperation.
func (op *LiquidityRewardOperation) Type() OpType {
	return TypeLiquidityReward
}

//Data returns the operation data LiquidityRewardOperation.
func (op *LiquidityRewardOperation) Data() interface{} {
	return op
}


<|start_filename|>operations/voperation_delegation_reward.go<|end_filename|>
package operations

import (
	"github.com/asuleymanov/golos-go/types"
)

//DelegationRewardOperation represents delegation_reward operation data.
type DelegationRewardOperation struct {
	Delegator      string      `json:"delegator"`
	Delegatee      string      `json:"delegatee"`
	PayoutStrategy int         `json:"payout_strategy"`
	VestingShares  types.Asset `json:"vesting_shares"`
}

//Type function that defines the type of operation DelegationRewardOperation.
func (op *DelegationRewardOperation) Type() OpType {
	return TypeDelegationReward
}

//Data returns the operation data DelegationRewardOperation.
func (op *DelegationRewardOperation) Data() interface{} {
	return op
}


<|start_filename|>operations/operation_account_metadata.go<|end_filename|>
package operations

import (
	"github.com/asuleymanov/golos-go/encoding/transaction"
)

//AccountMetadataOperation represents account_metadata operation data.
type AccountMetadataOperation struct {
	Account      string `json:"account"`
	JSONMetadata string `json:"json_metadata"`
}

//Type function that defines the type of operation AccountMetadataOperation.
func (op *AccountMetadataOperation) Type() OpType {
	return TypeAccountMetadata
}

//Data returns the operation data AccountMetadataOperation.
func (op *AccountMetadataOperation) Data() interface{} {
	return op
}

//MarshalTransaction is a function of converting type AccountMetadataOperation to bytes.
func (op *AccountMetadataOperation) MarshalTransaction(encoder *transaction.Encoder) error {
	enc := transaction.NewRollingEncoder(encoder)
	enc.EncodeUVarint(uint64(TypeAccountMetadata.Code()))
	enc.Encode(op.Account)
	enc.Encode(op.JSONMetadata)
	return enc.Err()
}
