types

package
v0.0.0-...-b400eb5 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SigTypeIllegal   = 0
	SigTypeInvalid   = 1
	SigTypeEIP712    = 2
	SigTypeEthSign   = 3
	SigTypeWallet    = 4
	SigTypeValidator = 5
	SigTypePreSigned = 6
	NSigTypes        = 7
)

Variables

View Source
var ERC20ProxyID = [4]byte{244, 114, 97, 176} // 0xf47261b0
View Source
var ERC721ProxyID = [4]byte{2, 87, 23, 146} // 0x02571792

Functions

func HexStringToBytes

func HexStringToBytes(hexString string) ([]byte, error)

Types

type Address

type Address [20]byte

func (*Address) MarshalJSON

func (data *Address) MarshalJSON() ([]byte, error)

func (*Address) Scan

func (addr *Address) Scan(src interface{}) error

func (*Address) String

func (addr *Address) String() string

func (*Address) ToGethAddress

func (data *Address) ToGethAddress() common.Address

func (*Address) UnmarshalJSON

func (addr *Address) UnmarshalJSON(data []byte) error

func (*Address) Value

func (addr *Address) Value() (driver.Value, error)

type AssetData

type AssetData []byte

func (AssetData) Address

func (data AssetData) Address() *Address

func (AssetData) IsType

func (data AssetData) IsType(proxyId [4]byte) bool

func (AssetData) MarshalJSON

func (data AssetData) MarshalJSON() ([]byte, error)

func (AssetData) ProxyId

func (data AssetData) ProxyId() [4]byte

func (AssetData) SupportedType

func (data AssetData) SupportedType() bool

func (AssetData) TokenID

func (data AssetData) TokenID() *Uint256

func (AssetData) Value

func (data AssetData) Value() (driver.Value, error)

type NetworkAddressMap

type NetworkAddressMap map[uint]*Address

func (NetworkAddressMap) GormDataType

func (nmap NetworkAddressMap) GormDataType(dialect gorm.Dialect) string

GormDataType tells gorm what data type to use for the column.

func (NetworkAddressMap) Scan

func (nmap NetworkAddressMap) Scan(src interface{}) error

func (NetworkAddressMap) Value

func (nmap NetworkAddressMap) Value() (driver.Value, error)

type Order

type Order struct {
	Maker                    *Address  `gorm:"index"`
	Taker                    *Address  `gorm:"index"`
	MakerAssetAddress        *Address  `gorm:"index"`
	TakerAssetAddress        *Address  `gorm:"index"`
	MakerAssetData           AssetData `gorm:"index"`
	TakerAssetData           AssetData `gorm:"index"`
	FeeRecipient             *Address  `gorm:"index"`
	ExchangeAddress          *Address  `gorm:"index"`
	SenderAddress            *Address  `gorm:"index"`
	MakerAssetAmount         *Uint256
	TakerAssetAmount         *Uint256
	MakerFee                 *Uint256
	TakerFee                 *Uint256 `gorm:"index"`
	ExpirationTimestampInSec *Uint256 `gorm:"index"`
	Salt                     *Uint256
	Signature                Signature //`gorm:"type:bytea"`
	TakerAssetAmountFilled   *Uint256
	Cancelled                bool
	PoolID                   []byte `gorm:"index"`
}

Order represents an 0x order object

func NewOrder

func NewOrder(maker, taker, makerToken, takerToken, feeRecipient, exchangeAddress, senderAddress, makerTokenAmount, takerTokenAmount, makerFee, takerFee, expirationTimestampInSec, salt, sig, takerTokenAmountFilled, cancelled string) (*Order, error)

NewOrder takes string representations of values and converts them into an Order object

func OrderFromBytes

func OrderFromBytes(data []byte) (*Order, error)

func (*Order) Bytes

func (order *Order) Bytes() []byte

func (*Order) FromBytes

func (order *Order) FromBytes(data []byte) error

func (*Order) Hash

func (order *Order) Hash() []byte

func (*Order) Initialize

func (order *Order) Initialize()

func (*Order) MarshalJSON

func (order *Order) MarshalJSON() ([]byte, error)

func (*Order) UnmarshalJSON

func (order *Order) UnmarshalJSON(b []byte) error

type Pool

type Pool interface {
	Filter(*gorm.DB) (*gorm.DB, error)
	QueryString() string
}

type Signature

type Signature []byte

func (Signature) MarshalJSON

func (sig Signature) MarshalJSON() ([]byte, error)

func (Signature) Supported

func (sig Signature) Supported() bool

func (Signature) Type

func (sig Signature) Type() byte

func (Signature) UnmarshalJSON

func (sig Signature) UnmarshalJSON(b []byte) error

func (Signature) Verify

func (sig Signature) Verify(address *Address, hash []byte) bool

type Uint256

type Uint256 [32]byte

func IntStringToUint256

func IntStringToUint256(intString string) (*Uint256, error)

func (*Uint256) Big

func (data *Uint256) Big() *big.Int

func (*Uint256) MarshalJSON

func (data *Uint256) MarshalJSON() ([]byte, error)

func (*Uint256) Scan

func (data *Uint256) Scan(src interface{}) error

func (*Uint256) String

func (data *Uint256) String() string

func (*Uint256) UnmarshalJSON

func (data *Uint256) UnmarshalJSON(jsonData []byte) error

func (*Uint256) Value

func (data *Uint256) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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