types

package
v0.0.0-...-5589fd4 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnknownAsset = Asset{Symbol: "UNKNOWN"}
)

Functions

func Price

func Price(base, quote *big.Float) *big.Float

func SignHash

func SignHash(orderHash common.Hash, privateKey *ecdsa.PrivateKey) (string, error)

func SignHashEIP712

func SignHashEIP712(orderHash common.Hash, privateKey *ecdsa.PrivateKey) (string, error)

func SignHashEthSign

func SignHashEthSign(orderHash common.Hash, privateKey *ecdsa.PrivateKey) (string, error)

func VerifySignature

func VerifySignature(signature []byte, address common.Address, hash common.Hash) bool

func VerifySignatureEIP712

func VerifySignatureEIP712(signature []byte, address common.Address, hash common.Hash) bool

func VerifySignatureEthSign

func VerifySignatureEthSign(signature []byte, address common.Address, hash common.Hash) bool

Types

type Asset

type Asset struct {
	AssetData string
	MinAmount string
	MaxAmount string
	Precision int

	Symbol string
	Digits int
}

func (Asset) NormalizedValue

func (t Asset) NormalizedValue(amount *big.Int) *big.Float

type AssetPair

type AssetPair struct {
	AssetDataA Asset
	AssetDataB Asset
}

type AssetPairs

type AssetPairs struct {
	Records []AssetPair
}

type Fees

type Fees struct {
	FeeRecipient common.Address
	MakerFee     *big.Int
	TakerFee     *big.Int
}

func (*Fees) UnmarshalJSON

func (f *Fees) UnmarshalJSON(b []byte) error

type Order

type Order struct {
	OrderHash                  common.Hash
	ExchangeContractAddress    common.Address
	Sender                     common.Address
	Maker                      common.Address
	Taker                      common.Address
	MakerTokenAddress          common.Address
	TakerTokenAddress          common.Address
	FeeRecipient               common.Address
	MakerTokenAmount           *big.Int
	TakerTokenAmount           *big.Int
	MakerFee                   *big.Int
	TakerFee                   *big.Int
	ExpirationUnixTimestampSec time.Time
	Signature                  string
	Salt                       *big.Int
}

func (*Order) CalculateOrderHash

func (o *Order) CalculateOrderHash() common.Hash

func (*Order) MarshalJSON

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

func (*Order) MarshalJSONOrderData

func (o *Order) MarshalJSONOrderData() ([]byte, error)

func (*Order) UnmarshalJSON

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

type Signature

type Signature struct {
	V byte
	R common.Hash
	S common.Hash
}

type UnsignedOrder

type UnsignedOrder struct {
	ExchangeContractAddress    common.Address
	Maker                      common.Address
	Taker                      common.Address
	MakerTokenAddress          common.Address
	TakerTokenAddress          common.Address
	MakerTokenAmount           *big.Int
	TakerTokenAmount           *big.Int
	ExpirationUnixTimestampSec time.Time
	Salt                       *big.Int
}

func (*UnsignedOrder) MarshalJSON

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

Jump to

Keyboard shortcuts

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