stx

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: GPL-3.0 Imports: 17 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsHex

func IsHex(s string) bool

func SetTxForVersion0

func SetTxForVersion0(b *T, v0 *ZtxVersion_0)

func SetTxForVersion1

func SetTxForVersion1(b *T, v1 *ZtxVersion_1)

func SetTxForVersion2

func SetTxForVersion2(b *T, v2 *ZtxVersion_2)

func SetVersion0ForTx

func SetVersion0ForTx(v0 *ZtxVersion_0, b *T)

func SetVersion1ForTx

func SetVersion1ForTx(v1 *ZtxVersion_1, b *T)

func SetVersion2ForTx

func SetVersion2ForTx(v2 *ZtxVersion_2, b *T)

Types

type BuyShareCmd

type BuyShareCmd struct {
	Value utils.U256
	Vote  c_type.PKr
	Pool  *c_type.Uint256 `rlp:"nil"`
}

func (*BuyShareCmd) Asset

func (self *BuyShareCmd) Asset() (ret assets.Asset)

func (*BuyShareCmd) ToHash

func (self *BuyShareCmd) ToHash() (ret c_type.Uint256)

type ClosePoolCmd

type ClosePoolCmd struct {
	None byte
}

func (*ClosePoolCmd) ToHash

func (self *ClosePoolCmd) ToHash() (ret c_type.Uint256)

type ContractCmd

type ContractCmd struct {
	Asset assets.Asset
	To    *c_type.PKr `rlp:"nil"`
	Data  []byte
}

func (ContractCmd) MarshalJSON

func (c ContractCmd) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*ContractCmd) ToHash

func (self *ContractCmd) ToHash() (ret c_type.Uint256)

func (*ContractCmd) UnmarshalJSON

func (c *ContractCmd) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type ContractCmdMarshaling

type ContractCmdMarshaling struct {
	Asset assets.Asset
	To    *c_type.PKr
	Data  ContractData
}

type ContractData

type ContractData []byte

func (ContractData) MarshalText

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

MarshalText implements encoding.TextMarshaler

func (*ContractData) UnmarshalText

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

type DescCmd

type DescCmd struct {
	BuyShare   *BuyShareCmd   `rlp:"nil"`
	RegistPool *RegistPoolCmd `rlp:"nil"`
	ClosePool  *ClosePoolCmd  `rlp:"nil"`
	Contract   *ContractCmd   `rlp:"nil"`
	// contains filtered or unexported fields
}

func (*DescCmd) Count

func (self *DescCmd) Count() int

func (*DescCmd) OutAsset

func (self *DescCmd) OutAsset() *assets.Asset

func (*DescCmd) ToAssetCC_Szk

func (self *DescCmd) ToAssetCC_Szk() *c_type.Uint256

func (*DescCmd) ToHash

func (self *DescCmd) ToHash() (ret c_type.Uint256)

func (*DescCmd) ToPkr

func (self *DescCmd) ToPkr() *c_type.PKr

func (*DescCmd) Valid

func (self *DescCmd) Valid() bool

type PkgClose

type PkgClose struct {
	Id   c_type.Uint256
	Sign c_type.Uint512
}

func (*PkgClose) Clone

func (self *PkgClose) Clone() (ret PkgClose)

func (*PkgClose) ToHash

func (self *PkgClose) ToHash() (ret c_type.Uint256)

func (*PkgClose) ToHash_for_gen

func (self *PkgClose) ToHash_for_gen() (ret c_type.Uint256)

func (*PkgClose) ToHash_for_sign

func (self *PkgClose) ToHash_for_sign() (ret c_type.Uint256)

func (PkgClose) ToRef

func (this PkgClose) ToRef() (ret *PkgClose)

func (*PkgClose) Tx1_Hash

func (self *PkgClose) Tx1_Hash() (ret c_type.Uint256)

type PkgCreate

type PkgCreate struct {
	Id    c_type.Uint256
	PKr   c_type.PKr
	Pkg   pkg.Pkg_Z
	Proof c_type.Proof
}

func (*PkgCreate) Clone

func (self *PkgCreate) Clone() (ret PkgCreate)

func (*PkgCreate) ToHash

func (self *PkgCreate) ToHash() (ret c_type.Uint256)

func (*PkgCreate) ToHash_for_gen

func (self *PkgCreate) ToHash_for_gen() (ret c_type.Uint256)

func (*PkgCreate) ToHash_for_sign

func (self *PkgCreate) ToHash_for_sign() (ret c_type.Uint256)

func (PkgCreate) ToRef

func (this PkgCreate) ToRef() (ret *PkgCreate)

func (*PkgCreate) Tx1_Hash

func (self *PkgCreate) Tx1_Hash() (ret c_type.Uint256)

type PkgDesc_Z

type PkgDesc_Z struct {
	Create   *PkgCreate   `rlp:"nil"`
	Transfer *PkgTransfer `rlp:"nil"`
	Close    *PkgClose    `rlp:"nil"`
}

func (*PkgDesc_Z) Clone

func (self *PkgDesc_Z) Clone() (ret PkgDesc_Z)

func (*PkgDesc_Z) Count

func (self *PkgDesc_Z) Count() int

func (*PkgDesc_Z) ToHash

func (self *PkgDesc_Z) ToHash() (ret c_type.Uint256)

func (*PkgDesc_Z) ToHash_for_gen

func (self *PkgDesc_Z) ToHash_for_gen() (ret c_type.Uint256)

func (*PkgDesc_Z) ToHash_for_sign

func (self *PkgDesc_Z) ToHash_for_sign() (ret c_type.Uint256)

func (PkgDesc_Z) ToRef

func (this PkgDesc_Z) ToRef() (ret *PkgDesc_Z)

func (*PkgDesc_Z) Tx1_Hash

func (self *PkgDesc_Z) Tx1_Hash() (ret c_type.Uint256)

func (*PkgDesc_Z) Valid

func (self *PkgDesc_Z) Valid() bool

type PkgTransfer

type PkgTransfer struct {
	Id   c_type.Uint256
	PKr  c_type.PKr
	Sign c_type.Uint512
}

func (*PkgTransfer) Clone

func (self *PkgTransfer) Clone() (ret PkgTransfer)

func (*PkgTransfer) ToHash

func (self *PkgTransfer) ToHash() (ret c_type.Uint256)

func (*PkgTransfer) ToHash_for_gen

func (self *PkgTransfer) ToHash_for_gen() (ret c_type.Uint256)

func (*PkgTransfer) ToHash_for_sign

func (self *PkgTransfer) ToHash_for_sign() (ret c_type.Uint256)

func (PkgTransfer) ToRef

func (this PkgTransfer) ToRef() (ret *PkgTransfer)

func (*PkgTransfer) Tx1_Hash

func (self *PkgTransfer) Tx1_Hash() (ret c_type.Uint256)

type RegistPoolCmd

type RegistPoolCmd struct {
	Value   utils.U256
	Vote    c_type.PKr
	FeeRate uint32
}

func (*RegistPoolCmd) Asset

func (self *RegistPoolCmd) Asset() (ret assets.Asset)

func (*RegistPoolCmd) ToHash

func (self *RegistPoolCmd) ToHash() (ret c_type.Uint256)

type T

type T struct {
	Ehash    c_type.Uint256
	From     c_type.PKr
	Fee      assets.Token
	Sign     c_type.Uint512
	Bcr      c_type.Uint256
	Bsign    c_type.Uint512
	Desc_O   stx_v0.Desc_O
	Desc_Z   stx_v0.Desc_Z
	Desc_Pkg PkgDesc_Z
	Desc_Cmd DescCmd
	Tx1      stx_v1.Tx
	// contains filtered or unexported fields
}

func (*T) ContractAddress

func (self *T) ContractAddress() *c_type.PKr

func (*T) ContractAsset

func (self *T) ContractAsset() *assets.Asset

func (*T) DecodeRLP

func (b *T) DecodeRLP(s *rlp.Stream) error

func (*T) EncodeRLP

func (b *T) EncodeRLP(w io.Writer) error

EncodeRLP serializes b into the Ethereum RLP block format.

func (*T) IsOpContract

func (self *T) IsOpContract() bool

func (*T) ToFeeCC_Szk

func (self *T) ToFeeCC_Szk() c_type.Uint256

func (*T) ToHash

func (self *T) ToHash() (ret c_type.Uint256)

func (*T) ToHash_for_gen

func (self *T) ToHash_for_gen() (ret c_type.Uint256)

func (*T) ToHash_for_sign

func (self *T) ToHash_for_sign() (ret c_type.Uint256)

func (*T) Tx0

func (self *T) Tx0() (ret *stx_v0.Tx)

func (*T) Tx1_Hash

func (self *T) Tx1_Hash() (ret c_type.Uint256)

func (*T) Tx1_Hash_Cmd

func (self *T) Tx1_Hash_Cmd() (ret c_type.Uint256)

func (*T) Tx1_Hash_From

func (self *T) Tx1_Hash_From() (ret c_type.Uint256)

func (*T) Tx1_Hash_Pkg

func (self *T) Tx1_Hash_Pkg() (ret c_type.Uint256)

func (*T) Tx1_Hash_Tx1

func (self *T) Tx1_Hash_Tx1() (ret c_type.Uint256)

type Tx2

type Tx2 struct {
}

type ZtxVersion_0

type ZtxVersion_0 struct {
	Ehash    c_type.Uint256
	From     c_type.PKr
	Fee      assets.Token
	Sign     c_type.Uint512
	Bcr      c_type.Uint256
	Bsign    c_type.Uint512
	Desc_Z   stx_v0.Desc_Z
	Desc_O   stx_v0.Desc_O
	Desc_Pkg PkgDesc_Z
}

type ZtxVersion_1

type ZtxVersion_1 struct {
	BuyShare   *BuyShareCmd   `rlp:"nil"`
	RegistPool *RegistPoolCmd `rlp:"nil"`
	ClosePool  *ClosePoolCmd  `rlp:"nil"`
	Contract   *ContractCmd   `rlp:"nil"`
}

type ZtxVersion_2

type ZtxVersion_2 struct {
	Version0 ZtxVersion_0
	Version1 ZtxVersion_1
	Tx1      stx_v1.Tx
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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