blockchain

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: Unlicense Imports: 23 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 {
	Client *ethclient.Client
	// contains filtered or unexported fields
}

Client is a struct that can make some calls to some contracts

func NewClient

func NewClient(node string, privateKey string, cdpID int64, proxy string) (client *Client, err error)

NewClient initialize a new Client, using an ethClient

func (*Client) ApproveDai

func (client *Client) ApproveDai() (*types.Transaction, error)

ApproveDai approves that the equalizer contract will play with our DAI

func (*Client) ApproveMkr

func (client *Client) ApproveMkr() (*types.Transaction, error)

ApproveMkr approves that the equalizer contract will play with our PETH

func (*Client) DoDrawDai

func (client *Client) DoDrawDai(cdp *cdp.CDP, ethPrice, pethRatio, target *big.Float) (*transaction.Tx, error)

DoDrawDai is the high level function to draw DAI from the CDP

func (*Client) DoFreeEth

func (client *Client) DoFreeEth(cdp *cdp.CDP, ethPrice, target *big.Float) (*transaction.Tx, error)

DoFreeEth is the high level function to free ETH from the CDP

func (Client) DrawSellLock

func (client Client) DrawSellLock(dai *big.Float) (*types.Transaction, error)

DrawSellLock retrieve DAI from CDP, sells it on oasis.direct and locks ETH in the CDP

func (*Client) FreeEth

func (client *Client) FreeEth(eth *big.Float, cdp *cdp.CDP) (*types.Transaction, error)

FreeEth unlock some ETH from the CDP

func (Client) FreeSellWipe

func (client Client) FreeSellWipe(eth *big.Float) (*types.Transaction, error)

FreeSellWipe retrieve ETH from CDP, sells it on oasis.direct and wipe DAI in the CDP

func (*Client) GetAuth

func (client *Client) GetAuth() (*bind.TransactOpts, error)

GetAuth returns a *bind.TransactOpts to go to signed transactions

func (*Client) GetCDP

func (client *Client) GetCDP(cdpID int64) (*cdp.CDP, error)

GetCDP returns the given CDP

func (*Client) GetEthBalance

func (client *Client) GetEthBalance() (eth *big.Float, err error)

GetEthBalance returns the ETH balance of the account

func (*Client) GetEthPrice

func (client *Client) GetEthPrice() (eth *big.Float, err error)

GetEthPrice returns the price from the makerDAO oracle

func (*Client) GetOasisDaiToEth

func (client *Client) GetOasisDaiToEth(dai *big.Float) (eth *big.Float, err error)

GetOasisDaiToEth returns the amount of ETH that will be given in exchange of DAI

func (*Client) GetOasisEthToDai

func (client *Client) GetOasisEthToDai(eth *big.Float) (dai *big.Float, err error)

GetOasisEthToDai returns the amount of DAI that will be given in exchange of ETH

func (*Client) GetPethRatio

func (client *Client) GetPethRatio() (ratio *big.Float, err error)

GetPethRatio retrieve the Peth / Eth ratio on the blockchain

func (*Client) GetReceipt

func (client *Client) GetReceipt(hash string) (*types.Receipt, error)

GetReceipt returns the transaction receipt defined by hash. return nil if not yet mined

func (*Client) GetUniswapDaiToEth

func (client *Client) GetUniswapDaiToEth(dai *big.Float) (eth *big.Float, err error)

GetUniswapDaiToEth returns the amount of ETH that will be given in exchange of DAI

func (*Client) GetUniswapEthToDai

func (client *Client) GetUniswapEthToDai(eth *big.Float) (dai *big.Float, err error)

GetUniswapEthToDai returns the amount of DAI that will be given in exchange of ETH

func (*Client) IsDaiAllowed

func (client *Client) IsDaiAllowed() (allowed bool, err error)

IsDaiAllowed returns true if the CDP Station contract is allowed to use our DAI

func (*Client) IsMkrAllowed

func (client *Client) IsMkrAllowed() (allowed bool, err error)

IsMkrAllowed returns true if the CDP Station contract is allowed to use our PETH

Jump to

Keyboard shortcuts

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