Documentation ¶
Index ¶
- type Client
- func (client *Client) ApproveDai() (*types.Transaction, error)
- func (client *Client) ApproveMkr() (*types.Transaction, error)
- func (client *Client) DoDrawDai(cdp *cdp.CDP, ethPrice, pethRatio, target *big.Float) (*transaction.Tx, error)
- func (client *Client) DoFreeEth(cdp *cdp.CDP, ethPrice, target *big.Float) (*transaction.Tx, error)
- func (client Client) DrawSellLock(dai *big.Float) (*types.Transaction, error)
- func (client *Client) FreeEth(eth *big.Float, cdp *cdp.CDP) (*types.Transaction, error)
- func (client Client) FreeSellWipe(eth *big.Float) (*types.Transaction, error)
- func (client *Client) GetAuth() (*bind.TransactOpts, error)
- func (client *Client) GetCDP(cdpID int64) (*cdp.CDP, error)
- func (client *Client) GetEthBalance() (eth *big.Float, err error)
- func (client *Client) GetEthPrice() (eth *big.Float, err error)
- func (client *Client) GetOasisDaiToEth(dai *big.Float) (eth *big.Float, err error)
- func (client *Client) GetOasisEthToDai(eth *big.Float) (dai *big.Float, err error)
- func (client *Client) GetPethRatio() (ratio *big.Float, err error)
- func (client *Client) GetReceipt(hash string) (*types.Receipt, error)
- func (client *Client) GetUniswapDaiToEth(dai *big.Float) (eth *big.Float, err error)
- func (client *Client) GetUniswapEthToDai(eth *big.Float) (dai *big.Float, err error)
- func (client *Client) IsDaiAllowed() (allowed bool, err error)
- func (client *Client) IsMkrAllowed() (allowed bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
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) DrawSellLock ¶
DrawSellLock retrieve DAI from CDP, sells it on oasis.direct and locks ETH in the CDP
func (Client) FreeSellWipe ¶
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) GetEthBalance ¶
GetEthBalance returns the ETH balance of the account
func (*Client) GetEthPrice ¶
GetEthPrice returns the price from the makerDAO oracle
func (*Client) GetOasisDaiToEth ¶
GetOasisDaiToEth returns the amount of ETH that will be given in exchange of DAI
func (*Client) GetOasisEthToDai ¶
GetOasisEthToDai returns the amount of DAI that will be given in exchange of ETH
func (*Client) GetPethRatio ¶
GetPethRatio retrieve the Peth / Eth ratio on the blockchain
func (*Client) GetReceipt ¶
GetReceipt returns the transaction receipt defined by hash. return nil if not yet mined
func (*Client) GetUniswapDaiToEth ¶
GetUniswapDaiToEth returns the amount of ETH that will be given in exchange of DAI
func (*Client) GetUniswapEthToDai ¶
GetUniswapEthToDai returns the amount of DAI that will be given in exchange of ETH
func (*Client) IsDaiAllowed ¶
IsDaiAllowed returns true if the CDP Station contract is allowed to use our DAI
func (*Client) IsMkrAllowed ¶
IsMkrAllowed returns true if the CDP Station contract is allowed to use our PETH