types

package
v0.0.0-...-d4a708c Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ReceiptStatusFailed is the status code of a action if execution failed.
	ReceiptStatusFailed = 0

	// ReceiptStatusSuccessful is the status code of a action if execution succeeded.
	ReceiptStatusSuccessful = 1
)
View Source
const AddressLength = 20
View Source
const BloomByteLength = 256
View Source
const HashLength = 32
View Source
const PubKeyLength = 65

Variables

View Source
var (
	Big1   = big.NewInt(1)
	Big2   = big.NewInt(2)
	Big3   = big.NewInt(3)
	Big0   = big.NewInt(0)
	Big32  = big.NewInt(32)
	Big256 = big.NewInt(256)
	Big257 = big.NewInt(257)
	Big20  = big.NewInt(20)
	Big80  = big.NewInt(80)
	Big100 = big.NewInt(100)
)
View Source
var ActionTypeToString map[ActionType]string = map[ActionType]string{
	CallContract:          "CallContract",
	CreateContract:        "CreateContract",
	CreateAccount:         "CreateAccount",
	UpdateAccount:         "UpdateAccount",
	IncreaseAsset:         "IncreaseAsset",
	IssueAsset:            "IssueAsset",
	DestroyAsset:          "DestroyAsset",
	SetAssetOwner:         "SetAssetOwner",
	Transfer:              "Transfer",
	UpdateAccountAuthor:   "UpdateAccountAuthor",
	UpdateCandidate:       "UpdateCandidate",
	UnregCandidate:        "UnregCandidate",
	RefundCandidate:       "RefundCandidate",
	VoteCandidate:         "VoteCandidate",
	WithdrawFee:           "WithdrawFee",
	UpdateAsset:           "UpdateAsset",
	RegCandidate:          "RegCandidate",
	KickedCandidate:       "KickedCandidate",
	ExitTakeOver:          "ExitTakeOver",
	UpdateAssetContract:   "UpdateAssetContract",
	UpdateCandidatePubKey: "UpdateCandidatePubKey",
}
View Source
var (
	AuthorTypeToString map[AuthorType]string = map[AuthorType]string{
		AccountNameType: "account",
		PubKeyType:      "pubKey",
		AddressType:     "address",
	}
)

Functions

func Bytes2Hex

func Bytes2Hex(d []byte) string

Bytes2Hex returns the hexadecimal encoding of d.

func CopyBytes

func CopyBytes(b []byte) (copiedBytes []byte)

CopyBytes returns an exact copy of the provided bytes.

func FromHex

func FromHex(s string) []byte

FromHex returns the bytes represented by the hexadecimal string s. s may be prefixed with "0x".

func Hex2Bytes

func Hex2Bytes(str string) []byte

Hex2Bytes returns the bytes represented by the hexadecimal string str.

func Hex2BytesFixed

func Hex2BytesFixed(str string, flen int) []byte

Hex2BytesFixed returns bytes of a specified fixed length flen.

func IsValidName

func IsValidName(s string) bool

IsValidName verifies whether a string can represent a valid name or not.

func ToHex deprecated

func ToHex(b []byte) string

ToHex returns the hex representation of b, prefixed with '0x'. For empty slices, the return value is "0x0".

Deprecated: use hexutil.Encode instead.

Types

type Account

type Account struct {
	AcctName              Name            `json:"accountName"`
	Founder               Name            `json:"founder"`
	AccountID             uint64          `json:"accountID"`
	Number                uint64          `json:"number"`
	Nonce                 uint64          `json:"nonce"`
	Code                  hexutil.Bytes   `json:"code"`
	CodeHash              Hash            `json:"codeHash"`
	CodeSize              uint64          `json:"codeSize"`
	Threshold             uint64          `json:"threshold"`
	UpdateAuthorThreshold uint64          `json:"updateAuthorThreshold"`
	AuthorVersion         Hash            `json:"authorVersion"`
	Balances              []*AssetBalance `json:"balances"`
	Authors               []*Author       `json:"authors"`
	Suicide               bool            `json:"suicide"`
	Destroy               bool            `json:"destroy"`
	Description           string          `json:"description"`
}

type AccountAuthor

type AccountAuthor struct {
	AuthorType AuthorType
	Author     string
	Weight     uint64
}

type AccountAuthorAction

type AccountAuthorAction struct {
	Threshold             uint64          `json:"threshold,omitempty"`
	UpdateAuthorThreshold uint64          `json:"updateAuthorThreshold,omitempty"`
	AuthorActions         []*AuthorAction `json:"authorActions,omitempty"`
}

type ActionResult

type ActionResult struct {
	GasAllot []*GasDistribution `json:"GasAllot"`
	Status   uint64             `json:"Status"`
	GasUsed  uint64             `json:"GasUsed"`
	Error    string             `json:"Error"`
}

ActionResult represents the results the transaction action.

type ActionType

type ActionType uint64

ActionType type of Action.

const (
	// CallContract represents the call contract action.
	CallContract ActionType = iota
	// CreateContract repesents the create contract action.
	CreateContract
)
const (
	//CreateAccount repesents the create account.
	CreateAccount ActionType = 0x100 + iota
	//UpdateAccount repesents update account.
	UpdateAccount
	// DeleteAccount repesents the delete account action.
	DeleteAccount
	//UpdateAccountAuthor represents the update account author.
	UpdateAccountAuthor
)
const (
	// IncreaseAsset Asset operation
	IncreaseAsset ActionType = 0x200 + iota
	// IssueAsset repesents Issue asset action.
	IssueAsset
	//DestroyAsset destroy asset
	DestroyAsset
	// SetAssetOwner repesents set asset new owner action.
	SetAssetOwner
	//SetAssetFounder set asset founder
	//SetAssetFounder
	UpdateAsset
	//Transfer repesents transfer asset action.
	Transfer
	UpdateAssetContract
)
const (
	// RegCandidate repesents register candidate action.
	RegCandidate ActionType = 0x300 + iota
	// UpdateCandidate repesents update candidate action.
	UpdateCandidate
	// UnregCandidate repesents unregister candidate action.
	UnregCandidate
	// RefundCandidate repesents unregister candidate action.
	RefundCandidate
	// VoteCandidate repesents voter vote candidate action.
	VoteCandidate
	// UpdateCandidatePubKey repesents update candidate action.
	UpdateCandidatePubKey
)
const (
	// KickedCandidate kicked
	KickedCandidate ActionType = 0x400 + iota
	// ExitTakeOver exit
	ExitTakeOver
)
const (
	// WithdrawFee
	WithdrawFee ActionType = 0x500 + iota
)

type Address

type Address [AddressLength]byte

Address represents the 20 byte address of an account.

func BytesToAddress

func BytesToAddress(b []byte) Address

func (Address) Big

func (a Address) Big() *big.Int

Big converts an address to a big integer.

func (Address) Bytes

func (a Address) Bytes() []byte

Bytes gets the string representation of the underlying address.

func (Address) Compare

func (a Address) Compare(x Address) int

func (Address) Format

func (a Address) Format(s fmt.State, c rune)

Format implements fmt.Formatter, forcing the byte slice to be formatted as is, without going through the stringer interface used for logging.

func (Address) Hash

func (a Address) Hash() Hash

Hash converts an address to a hash by left-padding it with zeros.

func (Address) Hex

func (a Address) Hex() string

Hex returns an EIP55-compliant hex string representation of the address.

func (Address) MarshalText

func (a Address) MarshalText() ([]byte, error)

MarshalText returns the hex representation of a.

func (*Address) SetBytes

func (a *Address) SetBytes(b []byte)

SetBytes sets the address to the value of b. If b is larger than len(a) it will panic.

func (Address) String

func (a Address) String() string

String implements fmt.Stringer.

func (*Address) UnmarshalJSON

func (a *Address) UnmarshalJSON(input []byte) error

UnmarshalJSON parses a hash in hex syntax.

func (*Address) UnmarshalText

func (a *Address) UnmarshalText(input []byte) error

UnmarshalText parses a hash in hex syntax.

type AssetBalance

type AssetBalance struct {
	AssetID uint64   `json:"assetID"`
	Balance *big.Int `json:"balance"`
}

type AssetFee

type AssetFee struct {
	AssetID  uint64   `json:"assetID”`  //资产ID
	TotalFee *big.Int `json:"totalFee”` //收到过的手续费数量

}

AssetFee asset fee

type AssetObject

type AssetObject struct {
	AssetId    uint64   `json:"assetId,omitempty"`
	Number     uint64   `json:"number,omitempty"`
	AssetName  string   `json:"assetName"`
	Symbol     string   `json:"symbol"`
	Amount     *big.Int `json:"amount"`
	Decimals   uint64   `json:"decimals"`
	Founder    Name     `json:"founder"`
	Owner      Name     `json:"owner"`
	AddIssue   *big.Int `json:"addIssue"`
	UpperLimit *big.Int `json:"upperLimit"`
	Contract   Name     `json:"contract"`
	Detail     string   `json:"detail"`
}

type Author

type Author struct {
	Owner
	Weight uint64 `json:"weight"`
}

func NewAuthor

func NewAuthor(owner Owner, weight uint64) *Author

func (*Author) DecodeRLP

func (a *Author) DecodeRLP(s *rlp.Stream) error

func (*Author) EncodeRLP

func (a *Author) EncodeRLP(w io.Writer) error

func (*Author) GetWeight

func (a *Author) GetWeight() uint64

func (*Author) MarshalJSON

func (a *Author) MarshalJSON() ([]byte, error)

func (*Author) UnmarshalJSON

func (a *Author) UnmarshalJSON(data []byte) error

type AuthorAction

type AuthorAction struct {
	ActionType AuthorActionType
	Author     *Author
}

type AuthorActionType

type AuthorActionType uint64
const (
	AddAuthor AuthorActionType = iota
	UpdateAuthor
	DeleteAuthor
)

type AuthorJSON

type AuthorJSON struct {
	OwnerStr string `json:"owner"`
	Weight   uint64 `json:"weight"`
	// contains filtered or unexported fields
}

type AuthorType

type AuthorType uint8
const (
	AccountNameType AuthorType = iota
	PubKeyType
	AddressType
)

type BlockAndResult

type BlockAndResult struct {
	Block     *RpcBlock   `json:"block"`
	Receipts  []*Receipt  `json:"receipts"`
	DetailTxs []*DetailTx `json:"detailTxs"`
}

type Bloom

type Bloom [BloomByteLength]byte

func (Bloom) MarshalText

func (b Bloom) MarshalText() ([]byte, error)

MarshalText encodes b as a hex string with 0x prefix.

func (*Bloom) UnmarshalText

func (b *Bloom) UnmarshalText(input []byte) error

UnmarshalText b as a hex string with 0x prefix.

type ChainConfig

type ChainConfig struct {
	BootNodes        []string      `json:"bootnodes,omitempty"` // enode URLs of the P2P bootstrap nodes
	ChainID          *big.Int      `json:"chainId,omitempty"`   // chainId identifies the current chain and is used for replay protection
	ChainName        string        `json:"chainName,omitempty"` // chain name
	ChainURL         string        `json:"chainUrl,omitempty"`  // chain url
	AccountNameCfg   *NameConfig   `json:"accountParams,omitempty"`
	AssetNameCfg     *NameConfig   `json:"assetParams,omitempty"`
	ChargeCfg        *ChargeConfig `json:"chargeParams,omitempty"`
	ForkedCfg        *FrokedConfig `json:"upgradeParams,omitempty"`
	DposCfg          *DposConfig   `json:"dposParams,omitempty"`
	SysName          string        `json:"systemName,omitempty"`  // system name
	AccountName      string        `json:"accountName,omitempty"` // account name
	AssetName        string        `json:"assetName,omitempty"`   // asset name
	DposName         string        `json:"dposName,omitempty"`    // system name
	SnapshotInterval uint64        `json:"snapshotInterval,omitempty"`
	FeeName          string        `json:"feeName,omitempty"`     //fee name
	SysToken         string        `json:"systemToken,omitempty"` // system token
	SysTokenID       uint64        `json:"sysTokenID,omitempty"`
	SysTokenDecimals uint64        `json:"sysTokenDecimal,omitempty"`
	ReferenceTime    uint64        `json:"referenceTime,omitempty"`
}

ChainConfig is the core config which determines the blockchain settings.

type ChargeConfig

type ChargeConfig struct {
	AssetRatio    uint64 `json:"assetRatio,omitempty"`
	ContractRatio uint64 `json:"contractRatio,omitempty"`
}

type CreateAccountAction

type CreateAccountAction struct {
	AccountName Name   `json:"accountName,omitempty"`
	Founder     Name   `json:"founder,omitempty"`
	PublicKey   PubKey `json:"publicKey,omitempty"`
	Description string `json:"description,omitempty"`
}

type DetailTx

type DetailTx struct {
	TxHash          Hash              `json:"txhash"`
	InternalActions []*InternalAction `json:"actions"`
}

type DposConfig

type DposConfig struct {
	MaxURLLen             uint64   `json:"maxURLLen,omitempty"`            // url length
	UnitStake             *big.Int `json:"unitStake,omitempty"`            // state unit
	CandidateMinQuantity  *big.Int `json:"candidateMinQuantity,omitempty"` // min quantity
	VoterMinQuantity      *big.Int `json:"voterMinQuantity,omitempty"`     // min quantity
	ActivatedMinQuantity  *big.Int `json:"activatedMinQuantity,omitempty"` // min active quantity
	BlockInterval         uint64   `json:"blockInterval,omitempty"`
	BlockFrequency        uint64   `json:"blockFrequency,omitempty"`
	CandidateScheduleSize uint64   `json:"candidateScheduleSize,omitempty"`
	BackupScheduleSize    uint64   `json:"backupScheduleSize,omitempty"`
	EpchoInterval         uint64   `json:"epchoInterval,omitempty"`
	FreezeEpchoSize       uint64   `json:"freezeEpchoSize,omitempty"`
	ExtraBlockReward      *big.Int `json:"extraBlockReward,omitempty"`
	BlockReward           *big.Int `json:"blockReward,omitempty"`
}

type DposIrreversible

type DposIrreversible struct {
	Reversible           uint64 `json:"reversible"`
	ProposedIrreversible uint64 `json:"proposedIrreversible"`
	BftIrreversible      uint64 `json:"bftIrreversible"`
}

type DposKickedCandidate

type DposKickedCandidate struct {
	Candidates []string
}

type DposRegisterCandidate

type DposRegisterCandidate struct {
	URL string
}

type DposUpdateCandidate

type DposUpdateCandidate struct {
	URL string
}

type DposUpdateCandidatePubKey

type DposUpdateCandidatePubKey struct {
	PubKey PubKey
}

type DposVoteCandidate

type DposVoteCandidate struct {
	Candidate string
	Stake     *big.Int
}

type ForkID

type ForkID struct {
	Cur  uint64 `json:"cur"`
	Next uint64 `json:"next"`
}

type FrokedConfig

type FrokedConfig struct {
	ForkBlockNum   uint64 `json:"blockCnt,omitempty"`
	Forkpercentage uint64 `json:"upgradeRatio,omitempty"`
}

type GasDistribution

type GasDistribution struct {
	Account Name   `json:"name"`
	Gas     uint64 `json:"gas"`
	Reason  uint64 `json:"typeId"`
}

Reason 0 asset 1 contract 2 produce

func (*GasDistribution) NewRpcAction

func (g *GasDistribution) NewRpcAction() *RPCAction

type Genesis

type Genesis struct {
	Config *ChainConfig `json:"config"`
	//Dpos          *DposConfig       `json:"dpos"`
	Timestamp uint64 `json:"timestamp"`
	//ExtraData     []byte            `json:"extraData"`
	GasLimit   uint64   `json:"gasLimit" `
	Difficulty *big.Int `json:"difficulty" `
	//Coinbase      Name              `json:"coinbase"`
	//AllocAccounts []*GenesisAccount `json:"allocAccounts"`
	//AllocAssets   []*AssetObject    `json:"allocAssets"`
	AllocAccounts   []*GenesisAccount   `json:"allocAccounts,omitempty"`
	AllocCandidates []*GenesisCandidate `json:"allocCandidates,omitempty"`
	AllocAssets     []*GenesisAsset     `json:"allocAssets,omitempty"`
}

Genesis specifies the header fields, state of a genesis block.

func (*Genesis) UnmarshalJSON

func (g *Genesis) UnmarshalJSON(input []byte)

type GenesisAccount

type GenesisAccount struct {
	Name   Name   `json:"name,omitempty"`
	PubKey PubKey `json:"pubKey,omitempty"`
}

GenesisAccount is an account in the state of the genesis block.

type GenesisAsset

type GenesisAsset struct {
	Name       string   `json:"name,omitempty"`
	Symbol     string   `json:"symbol,omitempty"`
	Amount     *big.Int `json:"amount,omitempty"`
	Decimals   uint64   `json:"decimals,omitempty"`
	Founder    string   `json:"founder,omitempty"`
	Owner      string   `json:"owner,omitempty"`
	UpperLimit *big.Int `json:"upperLimit,omitempty"`
}

GenesisAsset is an asset in the state of the genesis block.

type GenesisCandidate

type GenesisCandidate struct {
	Name  string   `json:"name,omitempty"`
	URL   string   `json:"url,omitempty"`
	Stake *big.Int `json:"stake,omitempty"`
}

GenesisCandidate is an cadicate in the state of the genesis block.

type Hash

type Hash [HashLength]byte

Hash represents the 32 byte Keccak256 hash of arbitrary data.

func BigToHash

func BigToHash(b *big.Int) Hash

BigToHash sets byte representation of b to hash. If b is larger than len(h), b will be cropped from the left.

func BytesToHash

func BytesToHash(b []byte) Hash

BytesToHash sets b to hash. If b is larger than len(h), b will be cropped from the left.

func HexToHash

func HexToHash(s string) Hash

HexToHash sets byte representation of s to hash. If b is larger than len(h), b will be cropped from the left.

func RlpHash

func RlpHash(x interface{}) (h Hash)

func (Hash) Big

func (h Hash) Big() *big.Int

Big converts a hash to a big integer.

func (Hash) Bytes

func (h Hash) Bytes() []byte

Bytes gets the byte representation of the underlying hash.

func (Hash) Format

func (h Hash) Format(s fmt.State, c rune)

Format implements fmt.Formatter, forcing the byte slice to be formatted as is, without going through the stringer interface used for logging.

func (Hash) Hex

func (h Hash) Hex() string

Hex converts a hash to a hex string.

func (Hash) MarshalText

func (h Hash) MarshalText() ([]byte, error)

MarshalText returns the hex representation of h.

func (*Hash) SetBytes

func (h *Hash) SetBytes(b []byte)

SetBytes sets the hash to the value of b. If b is larger than len(h), b will be cropped from the left.

func (Hash) String

func (h Hash) String() string

String implements the stringer interface and is used also by the logger when doing full logging into a file.

func (Hash) TerminalString

func (h Hash) TerminalString() string

TerminalString implements log.TerminalStringer, formatting a string for console output during logging.

func (*Hash) UnmarshalJSON

func (h *Hash) UnmarshalJSON(input []byte) error

UnmarshalJSON parses a hash in hex syntax.

func (*Hash) UnmarshalText

func (h *Hash) UnmarshalText(input []byte) error

UnmarshalText parses a hash in hex syntax.

type IncAssetObject

type IncAssetObject struct {
	AssetId uint64   `json:"assetId,omitempty"`
	Amount  *big.Int `json:"amount,omitempty"`
	To      Name     `json:"acceptor,omitempty"`
}

type InternalAction

type InternalAction struct {
	InternalLogs []*InternalLog `json:"internalActions"`
}

type InternalLog

type InternalLog struct {
	Action     *RPCAction `json:"action"`
	ActionType string     `json:"actionType"`
	GasUsed    uint64     `json:"gasUsed"`
	GasLimit   uint64     `json:"gasLimit"`
	Depth      uint64     `json:"depth"`
	Error      string     `json:"error"`
}

type IssueAssetObject

type IssueAssetObject struct {
	AssetName   string   `json:"assetName"`
	Symbol      string   `json:"symbol"`
	Amount      *big.Int `json:"amount"`
	Decimals    uint64   `json:"decimals"`
	Founder     Name     `json:"founder"`
	Owner       Name     `json:"owner"`
	UpperLimit  *big.Int `json:"upperLimit"`
	Contract    Name     `json:"contract"`
	Description string   `json:"description"`
}

type Name

type Name string

Name represents the account name

func BigToName

func BigToName(b *big.Int) (Name, error)

BigToName returns Name with byte values of b.

func BytesToName

func BytesToName(b []byte) (Name, error)

BytesToName returns Name with value b.

func StrToName

func StrToName(s string) Name

StrToName returns Name with string of s.

func (Name) Big

func (n Name) Big() *big.Int

Big converts a name to a big integer.

func (*Name) SetString

func (n *Name) SetString(s string) bool

SetString sets the name to the value of b..

func (Name) String

func (n Name) String() string

String implements fmt.Stringer.

func (*Name) UnmarshalJSON

func (n *Name) UnmarshalJSON(data []byte) error

UnmarshalJSON parses a hash in hex syntax.

func (*Name) UnmarshalText

func (n *Name) UnmarshalText(input []byte) error

UnmarshalText parses a hash in hex syntax.

type NameConfig

type NameConfig struct {
	Level     uint64 `json:"level,omitempty"`
	Length    uint64 `json:"length,omitempty"`
	SubLength uint64 `json:"subLength,omitempty"`
}

type ObjectFee

type ObjectFee struct {
	ObjectFeeID uint64      `json:"objectFeeID”` // 为每个手续费对象分配的ID
	ObjectType  uint64      `json:"objectType”`  //手续费类型,0:资产 1:合约 2:矿工
	ObjectName  string      `json:"objectName”`  //对象名称:账号名或资产名
	AssetFees   []*AssetFee `json:"assetFee”`    //对象收到的各种资产类型的手续费数量,目前只有FT
}

type ObjectFeeResult

type ObjectFeeResult struct {
	Continue   bool         `json:"continue"`
	ObjectFees []*ObjectFee `json:"objectFees"`
}

type Owner

type Owner interface {
	String() string
}

func GenerateOwner

func GenerateOwner(author string, at AuthorType) Owner

type PubKey

type PubKey [PubKeyLength]byte

func BytesToPubKey

func BytesToPubKey(b []byte) PubKey

BytesToPubKey returns PubKey with value b.

func HexToPubKey

func HexToPubKey(s string) PubKey

HexToPubKey returns PubKey with byte values of s.

func (PubKey) Big

func (p PubKey) Big() *big.Int

Big converts a hash to a big integer.

func (PubKey) Bytes

func (p PubKey) Bytes() []byte

Bytes return bytes

func (PubKey) Compare

func (p PubKey) Compare(x PubKey) int

Compare returns an integer comparing two byte slices lexicographically. The result will be 0 if a==b, -1 if a < b, and +1 if a > b. A nil argument is equivalent to an empty slice.

func (PubKey) Hex

func (p PubKey) Hex() string

Hex converts a hash to a hex string.

func (PubKey) MarshalText

func (p PubKey) MarshalText() ([]byte, error)

MarshalText returns the hex representation of a.

func (*PubKey) SetBytes

func (p *PubKey) SetBytes(key []byte)

SetBytes set bytes to publicKey

func (PubKey) String

func (p PubKey) String() string

String implements fmt.Stringer.

func (*PubKey) UnmarshalJSON

func (p *PubKey) UnmarshalJSON(input []byte) error

UnmarshalJSON parses a hash in hex syntax.

func (*PubKey) UnmarshalText

func (p *PubKey) UnmarshalText(input []byte) error

UnmarshalText parses a hash in hex syntax.

type RPCAction

type RPCAction struct {
	Type             ActionType    `json:"type"`
	Nonce            uint64        `json:"nonce"`
	From             Name          `json:"from"`
	To               Name          `json:"to"`
	AssetID          uint64        `json:"assetID"`
	GasLimit         uint64        `json:"gas"`
	Amount           *big.Int      `json:"value"`
	Remark           hexutil.Bytes `json:"remark"`
	Payload          hexutil.Bytes `json:"payload"`
	ActionHash       Hash          `json:"actionHash"`
	ActionIndex      uint64        `json:"actionIndex"`
	Payer            Name          `json:"payer"`
	PayerGasPrice    *big.Int      `json:"payerGasPrice"`
	ParentIndex      uint64        `json:"parentIndex"`
	PayerParentIndex uint64        `json:"payerParentIndex"`
}

type RPCTransaction

type RPCTransaction struct {
	BlockHash        Hash         `json:"blockHash"`
	BlockNumber      uint64       `json:"blockNumber"`
	Hash             Hash         `json:"txHash"`
	TransactionIndex uint64       `json:"transactionIndex"`
	RPCActions       []*RPCAction `json:"actions"`
	GasAssetID       uint64       `json:"gasAssetID"`
	GasPrice         *big.Int     `json:"gasPrice"`
	GasCost          *big.Int     `json:"gasCost"`
}

type Receipt

type Receipt struct {
	//PostState         []byte          `json:"PostState"`
	ActionResults []*ActionResult `json:"ActionResults"`
	//CumulativeGasUsed uint64          `json:"CumulativeGasUsed"`
	TxHash       Hash   `json:"TxHash"`
	TotalGasUsed uint64 `json:"TotalGasUsed"`
}

Receipt represents the results of a transaction.

type RpcBlock

type RpcBlock struct {
	Number *big.Int `json:"number"`
	Hash   Hash     `json:"hash"`
	//ProposedIrreversible uint64            `json:"proposedIrreversible"`
	ParentHash Hash `json:"parentHash"`
	//Bloom                Bloom             `json:"logsBloom"`
	//Root                 Hash              `json:"stateRoot"`
	CoinBase   Name          `json:"miner"`
	Difficulty *big.Int      `json:"difficulty"`
	Extra      hexutil.Bytes `json:"extraData"`
	//Size                 uint64            `json:"size"`
	GasLimit uint64 `json:"gasLimit"`
	GasUsed  uint64 `json:"gasUsed"`
	Time     uint64 `json:"timestamp"`
	//TxsRoot              Hash              `json:"transactionsRoot"`
	//ReceiptsRoot         Hash              `json:"receiptsRoot"`
	//ForkID               ForkID            `json:"forkID"`
	TotalDifficulty *big.Int          `json:"totalDifficulty"`
	Txs             []*RPCTransaction `json:"transactions"`
}

type StorageAuthor

type StorageAuthor struct {
	Type    AuthorType
	DataRaw rlp.RawValue
	Weight  uint64
}

type UpdateAccountAction

type UpdateAccountAction struct {
	Founder Name `json:"founder,omitempty"`
}

type UpdateAssetContractObject

type UpdateAssetContractObject struct {
	AssetID  uint64 `json:"assetId,omitempty"`
	Contract Name   `json:"contract"`
}

type UpdateAssetObject

type UpdateAssetObject struct {
	AssetID uint64 `json:"assetId,omitempty"`
	Founder Name   `json:"founder"`
}

type UpdateAssetOwnerObject

type UpdateAssetOwnerObject struct {
	AssetID uint64 `json:"assetId,omitempty"`
	Owner   Name   `json:"owner"`
}

type WithdrawAsset

type WithdrawAsset struct {
	AssetID uint64
	Amount  *big.Int
}

WithdrawAsset withdraw asset info

type WithdrawInfo

type WithdrawInfo struct {
	ObjectName string
	ObjectType uint64
	Founder    Name
	AssetInfo  []*WithdrawAsset
}

WithdrawInfo record withdraw info

Jump to

Keyboard shortcuts

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