types

package
Version: v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Layout = `"2006-01-02T15:04:05"`
View Source
const (
	TypeFollow = "follow"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountCreateOperation added in v0.4.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"`
}

func (*AccountCreateOperation) Data added in v0.4.0

func (op *AccountCreateOperation) Data() interface{}

func (*AccountCreateOperation) Type added in v0.4.0

func (op *AccountCreateOperation) Type() OpType

type AccountUpdateOperation added in v0.4.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"`
}

func (*AccountUpdateOperation) Data added in v0.4.0

func (op *AccountUpdateOperation) Data() interface{}

func (*AccountUpdateOperation) Type added in v0.4.0

func (op *AccountUpdateOperation) Type() OpType

type AccountWitnessProxyOperation added in v0.4.0

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

func (*AccountWitnessProxyOperation) Data added in v0.4.0

func (op *AccountWitnessProxyOperation) Data() interface{}

func (*AccountWitnessProxyOperation) Type added in v0.4.0

type AccountWitnessVoteOperation added in v0.4.0

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

func (*AccountWitnessVoteOperation) Data added in v0.4.0

func (op *AccountWitnessVoteOperation) Data() interface{}

func (*AccountWitnessVoteOperation) Type added in v0.4.0

type Auth added in v0.4.0

type Auth struct {
	Key   string
	Check uint32
}

XXX: Not sure about the struct field names.

func (*Auth) UnmarshalJSON added in v0.4.0

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

type Authority added in v0.4.0

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

type ChainProperties added in v0.4.0

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

type CommentOperation added in v0.4.0

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) Data added in v0.4.0

func (op *CommentOperation) Data() interface{}

func (*CommentOperation) IsStoryOperation added in v0.4.0

func (op *CommentOperation) IsStoryOperation() bool

func (*CommentOperation) Type added in v0.4.0

func (op *CommentOperation) Type() OpType

type CommentOptionsOperation added in v0.4.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"`
}

func (*CommentOptionsOperation) Data added in v0.4.0

func (op *CommentOptionsOperation) Data() interface{}

func (*CommentOptionsOperation) Type added in v0.4.0

func (op *CommentOptionsOperation) Type() OpType

type ConvertOperation added in v0.4.0

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

func (*ConvertOperation) Data added in v0.4.0

func (op *ConvertOperation) Data() interface{}

func (*ConvertOperation) Type added in v0.4.0

func (op *ConvertOperation) Type() OpType

type CustomJSONOperation added in v0.4.0

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

CustomJSONOperation represents custom_json operation data.

func (*CustomJSONOperation) Data added in v0.4.0

func (op *CustomJSONOperation) Data() interface{}

func (*CustomJSONOperation) Type added in v0.4.0

func (op *CustomJSONOperation) Type() OpType

func (*CustomJSONOperation) UnmarshalData added in v0.4.0

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

type DeleteCommentOperation added in v0.4.0

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

func (*DeleteCommentOperation) Data added in v0.4.0

func (op *DeleteCommentOperation) Data() interface{}

func (*DeleteCommentOperation) Type added in v0.4.0

func (op *DeleteCommentOperation) Type() OpType

type FeedPublishOperation added in v0.4.0

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

func (*FeedPublishOperation) Data added in v0.4.0

func (op *FeedPublishOperation) Data() interface{}

func (*FeedPublishOperation) Type added in v0.4.0

func (op *FeedPublishOperation) Type() OpType

type FollowOperation added in v0.4.0

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

type ID

type ID struct {
	ValueInt    *Int
	ValueString string
}

func (*ID) UnmarshalJSON

func (id *ID) UnmarshalJSON(data []byte) error

type Int

type Int struct {
	*big.Int
}

func (*Int) UnmarshalJSON

func (num *Int) UnmarshalJSON(data []byte) error

type Int16 added in v0.4.0

type Int16 int16

func (Int16) MarshalTransaction added in v0.4.0

func (num Int16) MarshalTransaction(encoder *transaction.Encoder) error

func (*Int16) UnmarshalJSON added in v0.4.0

func (num *Int16) UnmarshalJSON(data []byte) error

type Int32 added in v0.4.0

type Int32 int32

func (Int32) MarshalTransaction added in v0.4.0

func (num Int32) MarshalTransaction(encoder *transaction.Encoder) error

func (*Int32) UnmarshalJSON added in v0.4.0

func (num *Int32) UnmarshalJSON(data []byte) error

type Int64 added in v0.4.0

type Int64 int64

func (Int64) MarshalTransaction added in v0.4.0

func (num Int64) MarshalTransaction(encoder *transaction.Encoder) error

func (*Int64) UnmarshalJSON added in v0.4.0

func (num *Int64) UnmarshalJSON(data []byte) error

type Int8 added in v0.4.0

type Int8 int8

func (Int8) MarshalTransaction added in v0.4.0

func (num Int8) MarshalTransaction(encoder *transaction.Encoder) error

func (*Int8) UnmarshalJSON added in v0.4.0

func (num *Int8) UnmarshalJSON(data []byte) error

type LimitOrderCancelOperation added in v0.4.0

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

func (*LimitOrderCancelOperation) Data added in v0.4.0

func (op *LimitOrderCancelOperation) Data() interface{}

func (*LimitOrderCancelOperation) Type added in v0.4.0

func (op *LimitOrderCancelOperation) Type() OpType

type LimitOrderCreateOperation added in v0.4.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   *Time  `json:"expiration"`
}

func (*LimitOrderCreateOperation) Data added in v0.4.0

func (op *LimitOrderCreateOperation) Data() interface{}

func (*LimitOrderCreateOperation) Type added in v0.4.0

func (op *LimitOrderCreateOperation) Type() OpType

type OpType added in v0.4.0

type OpType string

OpType represents a Steem operation type, i.e. vote, comment, pow and so on.

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"
	TypeRequestAccountRecoverty OpType = "request_account_recovery"
	TypeRecoverAccount          OpType = "recover_account"
	TypeChangeRecoveryAccount   OpType = "change_recover_account"
	TypeEscrowTransfer          OpType = "escrow_transfer"
	TypeEscrowDispute           OpType = "escrow_dispute"
	TypeEscrowRelease           OpType = "escrow_release"
	TypePOW2                    OpType = "pow2"
)

func (OpType) Code added in v0.4.0

func (kind OpType) Code() uint16

Code returns the operation code associated with the given operation type.

type Operation added in v0.4.0

type Operation interface {
	// Type returns the operation type as present in the operation object, element [0].
	Type() OpType

	// Data returns the operation data as present in the operation object, element [1].
	//
	// When the operation type is known to this package, this field contains
	// the operation data object associated with the given operation type,
	// e.g. Type is TypeVote -> Data contains *VoteOperation.
	// Otherwise this field contains raw JSON (type *json.RawMessage).
	Data() interface{}
}

Operation represents an operation stored in a transaction.

type Operations added in v0.4.0

type Operations []Operation

func (Operations) MarshalJSON added in v0.4.0

func (ops Operations) MarshalJSON() ([]byte, error)

func (*Operations) UnmarshalJSON added in v0.4.0

func (ops *Operations) UnmarshalJSON(data []byte) error

type POW added in v0.4.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.4.0

type POWOperation struct {
	WorkerAccount string           `json:"worker_account"`
	BlockID       string           `json:"block_id"`
	Nonce         *Int             `json:"nonce"`
	Work          *POW             `json:"work"`
	Props         *ChainProperties `json:"props"`
}

func (*POWOperation) Data added in v0.4.0

func (op *POWOperation) Data() interface{}

func (*POWOperation) Type added in v0.4.0

func (op *POWOperation) Type() OpType

type ReportOverProductionOperation added in v0.4.0

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

func (*ReportOverProductionOperation) Data added in v0.4.0

func (op *ReportOverProductionOperation) Data() interface{}

func (*ReportOverProductionOperation) Type added in v0.4.0

type StringSlice added in v0.4.0

type StringSlice []string

func (*StringSlice) UnmarshalJSON added in v0.4.0

func (ss *StringSlice) UnmarshalJSON(data []byte) error

type Time

type Time struct {
	*time.Time
}

func (*Time) MarshalJSON added in v0.4.0

func (t *Time) MarshalJSON() ([]byte, error)

func (*Time) MarshalTransaction added in v0.4.0

func (t *Time) MarshalTransaction(encoder *transaction.Encoder) error

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

type Transaction added in v0.4.0

type Transaction struct {
	RefBlockNum    UInt16     `json:"ref_block_num"`
	RefBlockPrefix UInt32     `json:"ref_block_prefix"`
	Expiration     *Time      `json:"expiration"`
	Operations     Operations `json:"operations"`
	Signatures     []string   `json:"signatures"`
}

Transaction represents a blockchain transaction.

func (*Transaction) MarshalTransaction added in v0.4.0

func (tx *Transaction) MarshalTransaction(encoder *transaction.Encoder) error

MarshalTransaction implements transaction.Marshaller interface.

func (*Transaction) PushOperation added in v0.4.0

func (tx *Transaction) PushOperation(op Operation)

PushOperation can be used to add an operation into the transaction.

type TransferOperation added in v0.4.0

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

func (*TransferOperation) Data added in v0.4.0

func (op *TransferOperation) Data() interface{}

func (*TransferOperation) Type added in v0.4.0

func (op *TransferOperation) Type() OpType

type TransferToVestingOperation added in v0.4.0

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

func (*TransferToVestingOperation) Data added in v0.4.0

func (op *TransferToVestingOperation) Data() interface{}

func (*TransferToVestingOperation) Type added in v0.4.0

type UInt added in v0.4.0

type UInt uint

func (UInt) MarshalTransaction added in v0.4.0

func (num UInt) MarshalTransaction(encoder *transaction.Encoder) error

func (*UInt) UnmarshalJSON added in v0.4.0

func (num *UInt) UnmarshalJSON(data []byte) error

type UInt16 added in v0.4.0

type UInt16 uint16

func (UInt16) MarshalTransaction added in v0.4.0

func (num UInt16) MarshalTransaction(encoder *transaction.Encoder) error

func (*UInt16) UnmarshalJSON added in v0.4.0

func (num *UInt16) UnmarshalJSON(data []byte) error

type UInt32 added in v0.4.0

type UInt32 uint32

func (UInt32) MarshalTransaction added in v0.4.0

func (num UInt32) MarshalTransaction(encoder *transaction.Encoder) error

func (*UInt32) UnmarshalJSON added in v0.4.0

func (num *UInt32) UnmarshalJSON(data []byte) error

type UInt64 added in v0.4.0

type UInt64 uint64

func (UInt64) MarshalTransaction added in v0.4.0

func (num UInt64) MarshalTransaction(encoder *transaction.Encoder) error

func (*UInt64) UnmarshalJSON added in v0.4.0

func (num *UInt64) UnmarshalJSON(data []byte) error

type UInt8 added in v0.4.0

type UInt8 uint8

func (UInt8) MarshalTransaction added in v0.4.0

func (num UInt8) MarshalTransaction(encoder *transaction.Encoder) error

func (*UInt8) UnmarshalJSON added in v0.4.0

func (num *UInt8) UnmarshalJSON(data []byte) error

type UnknownOperation added in v0.4.0

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

func (*UnknownOperation) Data added in v0.4.0

func (op *UnknownOperation) Data() interface{}

func (*UnknownOperation) Type added in v0.4.0

func (op *UnknownOperation) Type() OpType

type VoteOperation added in v0.4.0

type VoteOperation struct {
	Voter    string `json:"voter"`
	Author   string `json:"author"`
	Permlink string `json:"permlink"`
	Weight   Int16  `json:"weight"`
}

func (*VoteOperation) Data added in v0.4.0

func (op *VoteOperation) Data() interface{}

func (*VoteOperation) MarshalTransaction added in v0.4.0

func (op *VoteOperation) MarshalTransaction(encoder *transaction.Encoder) error

func (*VoteOperation) Type added in v0.4.0

func (op *VoteOperation) Type() OpType

type WithdrawVestingOperation added in v0.4.0

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

func (*WithdrawVestingOperation) Data added in v0.4.0

func (op *WithdrawVestingOperation) Data() interface{}

func (*WithdrawVestingOperation) Type added in v0.4.0

func (op *WithdrawVestingOperation) Type() OpType

Jump to

Keyboard shortcuts

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