oneinch

package
v0.0.0-...-ea289b0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ChainId int64
	// contains filtered or unexported fields
}

func ReadOnly

func ReadOnly() (*Client, error)

func ReadWrite

func ReadWrite() (*Client, error)

func (*Client) GetEpoch

func (client *Client) GetEpoch() (*big.Int, error)

func (*Client) GetOrders

func (client *Client) GetOrders() ([]Order, error)

func (*Client) PlaceOrder

func (client *Client) PlaceOrder(makerAsset, takerAsset string, makerAmount, takerAmount big.Float, nonce big.Int) error

type MakerTraits

type MakerTraits struct {
	AllowedSender string
	Expiry        int64
	Nonce         int64
	Series        int64

	NeedPostinteraction bool
	NeedPreinteraction  bool
	NeedEpochCheck      bool
	HasExtension        bool
	ShouldUsePermit2    bool
	ShouldUnwrapWeth    bool

	AllowPartialFills  bool
	AllowMultipleFills bool
}

type Order

type Order struct {
	Signature string    `json:"signature"`
	OrderHash string    `json:"orderHash"`
	Data      OrderData `json:"data"`
}

type OrderData

type OrderData struct {
	Salt         string `json:"salt"`         // the highest 96 bits represent salt, and the lowest 160 bit represent extension hash.
	Maker        string `json:"maker"`        // the maker’s address
	Receiver     string `json:"receiver"`     // the receiver’s address. the taker assets will be transferred to this address.
	MakerAsset   string `json:"makerAsset"`   // the maker’s asset address.
	TakerAsset   string `json:"takerAsset"`   // the taker’s asset address.
	MakingAmount string `json:"makingAmount"` // the amount of tokens maker will give
	TakingAmount string `json:"takingAmount"` // the amount of tokens maker wants to receive
	MakerTraits  string `json:"makerTraits"`  // limit order options, coded as bit flags into uint256 number.
	Extension    string `json:"extension"`    // extensions are features that consume more gas to execute, but are not always necessary for a limit order.
}

func (*OrderData) GetMakerAmount

func (order *OrderData) GetMakerAmount() (*big.Int, error)

func (*OrderData) GetTakerAmount

func (order *OrderData) GetTakerAmount() (*big.Int, error)

Jump to

Keyboard shortcuts

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