types

package
v0.0.0-...-7e56884 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 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 AccountReferral

type AccountReferral struct {
	Referrer     string `json:"referrer"`
	InterestRate uint16 `json:"interest_rate"`
	EndDate      Time   `json:"end_date"`
	BreakFee     Asset  `json:"break_fee"`
}

AccountReferral is an additional structure used by other structures.

func (*AccountReferral) MarshalTransaction

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

MarshalTransaction is a function of converting type AccountReferral to bytes.

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 ChainParameters

type ChainParameters struct {
	CurrentFees                      map[string]interface{} `json:"current_fees"`
	BlockInterval                    uint8                  `json:"block_interval"`
	MaintenanceInterval              uint32                 `json:"maintenance_interval"`
	MaintenanceSkipSlots             uint8                  `json:"maintenance_skip_slots"`
	CommitteeProposalReviewPeriod    uint32                 `json:"committee_proposal_review_period"`
	MaximumTransactionSize           uint32                 `json:"maximum_transaction_size"`
	MaximumBlockSize                 uint32                 `json:"maximum_block_size"`
	MaximumTimeUntilExpiration       uint32                 `json:"maximum_time_until_expiration"`
	MaximumProposalLifetime          uint32                 `json:"maximum_proposal_lifetime"`
	MaximumAssetWhitelistAuthorities uint8                  `json:"maximum_asset_whitelist_authorities"`
	MaximumAssetFeedPublishers       uint8                  `json:"maximum_asset_feed_publishers"`
	MaximumWitnessCount              uint16                 `json:"maximum_witness_count"`
	MaximumCommitteeCount            uint16                 `json:"maximum_committee_count"`
	MaximumAuthorityMembership       uint16                 `json:"maximum_authority_membership"`
	ReservePercentOfFee              uint16                 `json:"reserve_percent_of_fee"`
	NetworkPercentOfFee              uint16                 `json:"network_percent_of_fee"`
	LifetimeReferrerPercentOfFee     uint16                 `json:"lifetime_referrer_percent_of_fee"`
	CashbackVestingPeriodSeconds     uint32                 `json:"cashback_vesting_period_seconds"`
	CashbackVestingThreshold         int64                  `json:"cashback_vesting_threshold"`
	CountNonMemberVotes              bool                   `json:"count_non_member_votes"`
	AllowNonMemberWhitelists         bool                   `json:"allow_non_member_whitelists"`
	WitnessPayPerBlock               int64                  `json:"witness_pay_per_block"`
	WitnessPayVestingSeconds         uint32                 `json:"witness_pay_vesting_seconds"`
	WorkerBudgetPerDay               string                 `json:"worker_budget_per_day"`
	MaxPredicateOpcode               uint16                 `json:"max_predicate_opcode"`
	FeeLiquidationThreshold          int64                  `json:"fee_liquidation_threshold"`
	AccountsPerFeeScale              uint16                 `json:"accounts_per_fee_scale"`
	AccountFeeScaleBitshifts         uint8                  `json:"account_fee_scale_bitshifts"`
	MaxAuthorityDepth                uint8                  `json:"max_authority_depth"`
	Extensions                       map[string]interface{} `json:"extensions"`
}

type ChainProperties

type ChainProperties struct {
	AccountCreationFee              Asset  `json:"account_creation_fee"`
	MaximumBlockSize                uint32 `json:"maximum_block_size"`
	SBDInterestRate                 uint16 `json:"sbd_interest_rate"`
	CreateAccountMinGolosFee        Asset  `json:"create_account_min_golos_fee,omitempty"`
	CreateAccountMinDelegation      Asset  `json:"create_account_min_delegation,omitempty"`
	CreateAccountDelegationTime     uint32 `json:"create_account_delegation_time,omitempty"`
	MinDelegation                   Asset  `json:"min_delegation,omitempty"`
	MaxReferralInterestRate         uint16 `json:"max_referral_interest_rate,omitempty"`
	MaxReferralTermSec              uint32 `json:"max_referral_term_sec,omitempty"`
	MinReferralBreakFee             Asset  `json:"min_referral_break_fee,omitempty"`
	MaxReferralBreakFee             Asset  `json:"max_referral_break_fee,omitempty"`
	PostsWindow                     uint16 `json:"posts_window,omitempty"`
	PostsPerWindow                  uint16 `json:"posts_per_window,omitempty"`
	CommentsWindow                  uint16 `json:"comments_window,omitempty"`
	CommentsPerWindow               uint16 `json:"comments_per_window,omitempty"`
	VotesWindow                     uint16 `json:"votes_window,omitempty"`
	VotesPerWindow                  uint16 `json:"votes_per_window,omitempty"`
	AuctionWindowSize               uint16 `json:"auction_window_size,omitempty"`
	MaxDelegatedVestingInterestRate uint16 `json:"max_delegated_vesting_interest_rate,omitempty"`
	CustomOpsBandwidthMultiplier    uint16 `json:"custom_ops_bandwidth_multiplier,omitempty"`
	MinCurationPercent              uint16 `json:"min_curation_percent,omitempty"`
	MaxCurationPercent              uint16 `json:"max_curation_percent,omitempty"`
	CurationRewardCurve             string `json:"curation_reward_curve,omitempty"`
	AllowDistributeAuctionReward    bool   `json:"allow_distribute_auction_reward,omitempty"`
	AllowReturnAuctionRewardToFund  bool   `json:"allow_return_auction_reward_to_fund,omitempty"`
	WorkerRewardPercent             uint16 `json:"worker_reward_percent,omitempty"`
	WitnessRewardPercent            uint16 `json:"witness_reward_percent,omitempty"`
	VestingRewardPercent            uint16 `json:"vesting_reward_percent,omitempty"`
	WorkerRequestCreationFee        Asset  `json:"worker_request_creation_fee,omitempty"`
	WorkerRequestApproveMinPercent  uint16 `json:"worker_request_approve_min_percent,omitempty"`
	SbdDebtConvertRate              uint16 `json:"sbd_debt_convert_rate,omitempty"`
	VoteRegenerationPerDay          uint32 `json:"vote_regeneration_per_day,omitempty"`
	WitnessSkippingResetTime        uint32 `json:"witness_skipping_reset_time,omitempty"`
	WitnessIdlenessTime             uint32 `json:"witness_idleness_time,omitempty"`
	AccountIdlenessTime             uint32 `json:"account_idleness_time,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 CommentAuctionWindowRewardDestination

type CommentAuctionWindowRewardDestination struct {
	Destination int `json:"destination"`
}

CommentAuctionWindowRewardDestination is an additional structure used by other structures.

Destination: to_reward_fund - 0 to_curators - 1 to_author - 2

func (*CommentAuctionWindowRewardDestination) MarshalTransaction

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

MarshalTransaction is a function of converting type CommentAuctionWindowRewardDestination to bytes.

type CommentCurationRewardsPercent

type CommentCurationRewardsPercent struct {
	Percent uint16 `json:"percent"`
}

CommentCurationRewardsPercent is an additional structure used by other structures.

func (*CommentCurationRewardsPercent) MarshalTransaction

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

MarshalTransaction is a function of converting type CommentCurationRewardsPercent 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 ExchRate

type ExchRate struct {
	Base  *Asset `json:"base"`
	Quote *Asset `json:"quote"`
}

ExchRate is an additional structure used by other structures.

func (*ExchRate) MarshalTransaction

func (exch *ExchRate) MarshalTransaction(encoder *transaction.Encoder) error

MarshalTransaction is a function of converting type ExchRate 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 ObjectID

type ObjectID struct {
	Space uint64
	Type  uint64
	ID    uint64
}

On the BitShares blockchains there are no addresses, but objects identified by a unique id, an type and a space in the form: space.type.id

func ParseObjectID

func ParseObjectID(str string) (ObjectID, error)

func (*ObjectID) MarshalJSON

func (o *ObjectID) MarshalJSON() ([]byte, error)

func (ObjectID) String

func (o ObjectID) String() string

func (*ObjectID) UnmarshalJSON

func (o *ObjectID) UnmarshalJSON(s []byte) error

type OperationResponse

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

OperationResponse of response when sending a transaction.

type POW

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

POW is an additional structure used by other structures.

type POW2Input

type POW2Input struct {
	WorkerAccount string `json:"worker_account"`
	PrevBlock     []byte `json:"prev_block"`
	Nonce         uint64 `json:"nonce"`
}

POW2Input is an additional structure used by other structures.

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 StringSlice

type StringSlice []string

StringSlice type from parameter JSON

func (*StringSlice) UnmarshalJSON

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

UnmarshalJSON unpacking the JSON parameter in the StringSlice 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