types

package
v0.0.0-...-8e4544a Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONMarshal

func JSONMarshal(t interface{}) ([]byte, error)

JSONMarshal the function of packing with the processing of HTML tags.

Types

type Asset

type Asset struct {
	Amount float64
	Symbol string
}

Asset type from parameter JSON

func (*Asset) MarshalJSON

func (op *Asset) MarshalJSON() ([]byte, error)

MarshalJSON function for packing the Asset type in JSON.

func (*Asset) MarshalTransaction

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

MarshalTransaction is a function of converting type Asset to bytes.

func (*Asset) String

func (op *Asset) String() string

String function convert type Asset to string.

func (*Asset) StringAmount

func (op *Asset) StringAmount() string

StringAmount function convert type Asset.Amount to string.

func (*Asset) UnmarshalJSON

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

UnmarshalJSON unpacking the JSON parameter in the Asset type.

type Authority

type Authority struct {
	WeightThreshold uint32         `json:"weight_threshold"`
	AccountAuths    StringInt64Map `json:"account_auths"`
	KeyAuths        StringInt64Map `json:"key_auths"`
}

Authority is an additional structure used by other structures.

func (*Authority) MarshalTransaction

func (auth *Authority) MarshalTransaction(encoder *transaction.Encoder) error

MarshalTransaction is a function of converting type Authority to bytes.

type Beneficiary

type Beneficiary struct {
	Account string `json:"account"`
	Weight  uint16 `json:"weight"`
}

Beneficiary is an additional structure used by other structures.

type ChainProperties

type ChainProperties struct {
	AccountCreationFee                    Asset  `json:"account_creation_fee,omitempty"`
	MaximumBlockSize                      uint32 `json:"maximum_block_size,omitempty"`
	CreateAccountDelegationRatio          uint32 `json:"create_account_delegation_ratio,omitempty"`
	CreateAccountDelegationTime           uint32 `json:"create_account_delegation_time,omitempty"`
	MinDelegation                         Asset  `json:"min_delegation,omitempty"`
	MinCurationPercent                    int16  `json:"min_curation_percent,omitempty"`
	MaxCurationPercent                    int16  `json:"max_curation_percent,omitempty"`
	BandwidthReservePercent               int16  `json:"bandwidth_reserve_percent,omitempty"`
	BandwidthReserveBelow                 Asset  `json:"bandwidth_reserve_below,omitempty"`
	FlagEnergyAdditionalCost              int16  `json:"flag_energy_additional_cost,omitempty"`
	VoteAccountingMinRshares              uint32 `json:"vote_accounting_min_rshares,omitempty"`
	CommitteeRequestApproveMinPercent     int16  `json:"committee_request_approve_min_percent,omitempty"`
	InflationWitnessPercent               int16  `json:"inflation_witness_percent,omitempty"`
	InflationRatioCommitteeVsRewardFund   int16  `json:"inflation_ratio_committee_vs_reward_fund,omitempty"`
	InflationRecalcPeriod                 uint32 `json:"inflation_recalc_period,omitempty"`
	DataOperationsCostAdditionalBandwidth uint32 `json:"data_operations_cost_additional_bandwidth,omitempty"`
	WitnessMissPenaltyPercent             int16  `json:"witness_miss_penalty_percent,omitempty"`
	WitnessMissPenaltyDuration            uint32 `json:"witness_miss_penalty_duration,omitempty"`
}

ChainProperties is an additional structure used by other structures.

func (*ChainProperties) MarshalTransaction

func (cp *ChainProperties) MarshalTransaction(encoder *transaction.Encoder) error

MarshalTransaction is a function of converting type ChainProperties to bytes.

type ChainPropertiesOLD

type ChainPropertiesOLD struct {
	AccountCreationFee *Asset `json:"account_creation_fee"`
	MaximumBlockSize   uint32 `json:"maximum_block_size"`
	SBDInterestRate    uint16 `json:"sbd_interest_rate"`
}

ChainProperties is an additional structure used by other structures.

func (*ChainPropertiesOLD) MarshalTransaction

func (cp *ChainPropertiesOLD) MarshalTransaction(encoder *transaction.Encoder) error

MarshalTransaction is a function of converting type ChainPropertiesOLD to bytes.

type CommentPayoutBeneficiaries

type CommentPayoutBeneficiaries struct {
	Beneficiaries []Beneficiary `json:"beneficiaries"`
}

CommentPayoutBeneficiaries is an additional structure used by other structures.

func (*CommentPayoutBeneficiaries) MarshalTransaction

func (cp *CommentPayoutBeneficiaries) MarshalTransaction(encoder *transaction.Encoder) error

MarshalTransaction is a function of converting type CommentPayoutBeneficiaries to bytes.

type Int

type Int struct {
	*big.Int
}

Int type from parameter JSON

func (*Int) UnmarshalJSON

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

UnmarshalJSON unpacking the JSON parameter in the Int type.

type Int16

type Int16 int16

Int16 type from parameter JSON

func (Int16) MarshalTransaction

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

MarshalTransaction is a function of converting type Int16 to bytes.

func (*Int16) UnmarshalJSON

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

UnmarshalJSON unpacking the JSON parameter in the Int16 type.

type Int32

type Int32 int32

Int32 type from parameter JSON

func (Int32) MarshalTransaction

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

MarshalTransaction is a function of converting type Int32 to bytes.

func (*Int32) UnmarshalJSON

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

UnmarshalJSON unpacking the JSON parameter in the Int32 type.

type Int64

type Int64 int64

Int64 type from parameter JSON

func (Int64) MarshalTransaction

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

MarshalTransaction is a function of converting type Int64 to bytes.

func (*Int64) UnmarshalJSON

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

UnmarshalJSON unpacking the JSON parameter in the Int64 type.

type Int8

type Int8 int8

Int8 type from parameter JSON

func (Int8) MarshalTransaction

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

MarshalTransaction is a function of converting type Int8 to bytes.

func (*Int8) UnmarshalJSON

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

UnmarshalJSON unpacking the JSON parameter in the Int8 type.

type OperationResponse

type OperationResponse struct {
	ID       string
	BlockNum int32
	TrxNum   int32
	Expired  bool
	JSONTrx  string
}

OperationResponse of response when sending a transaction.

type RPCError

type RPCError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    struct {
		Code    int    `json:"code"`
		Name    string `json:"name"`
		Message string `json:"message"`
		Stack   []struct {
			Context struct {
				Level      string `json:"level"`
				File       string `json:"file"`
				Line       int    `json:"line"`
				Method     string `json:"method"`
				Hostname   string `json:"hostname"`
				ThreadName string `json:"thread_name"`
				Timestamp  string `json:"timestamp"`
			} `json:"context"`
			Format string      `json:"format"`
			Data   interface{} `json:"data"`
		} `json:"stack"`
	} `json:"data"`
}

RPCError description of error in response

func (*RPCError) Error

func (e *RPCError) Error() string

type RPCIncoming

type RPCIncoming struct {
	ID     uint64          `json:"id"`
	JSON   string          `json:"jsonrpc"`
	Result json.RawMessage `json:"result"`
}

RPCIncoming incoming request from server

type RPCRequest

type RPCRequest struct {
	Method string      `json:"method"`
	Params interface{} `json:"params,omitempty"`
	JSON   string      `json:"jsonrpc"`
	ID     uint64      `json:"id"`
}

RPCRequest server request

type RPCResponse

type RPCResponse struct {
	Result *json.RawMessage `json:"result,omitempty"`
	Error  *RPCError        `json:"error,omitempty"`
	JSON   string           `json:"jsonrpc,omitempty"`
	ID     uint64           `json:"id"`
}

RPCResponse response to a server request

type StringInt64Map

type StringInt64Map map[string]int64

StringInt64Map type from parameter JSON

func (StringInt64Map) MarshalJSON

func (m StringInt64Map) MarshalJSON() ([]byte, error)

MarshalJSON function for packing the StringInt64Map type in JSON.

func (*StringInt64Map) UnmarshalJSON

func (m *StringInt64Map) UnmarshalJSON(data []byte) error

UnmarshalJSON unpacking the JSON parameter in the StringInt64Map type.

type Time

type Time struct {
	*time.Time
}

Time type from parameter JSON

func (*Time) MarshalJSON

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

MarshalJSON function for packing the Time type in JSON.

func (*Time) MarshalTransaction

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

MarshalTransaction is a function of converting type Time to bytes.

func (*Time) UnmarshalJSON

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

UnmarshalJSON unpacking the JSON parameter in the Time type.

type UInt

type UInt uint

UInt type from parameter JSON

func (UInt) MarshalTransaction

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

MarshalTransaction is a function of converting type UInt to bytes.

func (*UInt) UnmarshalJSON

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

UnmarshalJSON unpacking the JSON parameter in the UInt type.

type UInt16

type UInt16 uint16

UInt16 type from parameter JSON

func (UInt16) MarshalTransaction

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

MarshalTransaction is a function of converting type UInt16 to bytes.

func (*UInt16) UnmarshalJSON

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

UnmarshalJSON unpacking the JSON parameter in the UInt16 type.

type UInt32

type UInt32 uint32

UInt32 type from parameter JSON

func (UInt32) MarshalTransaction

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

MarshalTransaction is a function of converting type UInt32 to bytes.

func (*UInt32) UnmarshalJSON

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

UnmarshalJSON unpacking the JSON parameter in the UInt32 type.

type UInt64

type UInt64 uint64

UInt64 type from parameter JSON

func (UInt64) MarshalTransaction

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

MarshalTransaction is a function of converting type UInt64 to bytes.

func (*UInt64) UnmarshalJSON

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

UnmarshalJSON unpacking the JSON parameter in the UInt64 type.

type UInt8

type UInt8 uint8

UInt8 type from parameter JSON

func (UInt8) MarshalTransaction

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

MarshalTransaction is a function of converting type UInt8 to bytes.

func (*UInt8) UnmarshalJSON

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

UnmarshalJSON unpacking the JSON parameter in the UInt8 type.

Jump to

Keyboard shortcuts

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