Versions in this module Expand all Collapse all v3 v3.3.5 May 9, 2020 Changes in this version + const Version + var ContractParams = &Params + func ValidateCode(ctx context.Context, b Backend, address common.Address) (ok bool, err error) + type Api struct + func NewApi(ch func() *Chequebook) *Api + func (self *Api) Balance() (string, error) + func (self *Api) Cash(cheque *Cheque) (txhash string, err error) + func (self *Api) Deposit(amount *big.Int) (txhash string, err error) + func (self *Api) Issue(beneficiary common.Address, amount *big.Int) (cheque *Cheque, err error) + type Backend interface + BalanceAt func(ctx context.Context, address common.Address, blockNum *big.Int) (*big.Int, error) + TransactionReceipt func(ctx context.Context, txHash common.Hash) (*types.Receipt, error) + type Cheque struct + Amount *big.Int + Beneficiary common.Address + Contract common.Address + Sig []byte + func (self *Cheque) Cash(session *contract.ChequebookSession) (string, error) + func (self *Cheque) String() string + func (self *Cheque) Verify(signerKey *ecdsa.PublicKey, contract, beneficiary common.Address, sum *big.Int) (*big.Int, error) + type Chequebook struct + func LoadChequebook(path string, prvKey *ecdsa.PrivateKey, backend Backend, checkBalance bool) (self *Chequebook, err error) + func NewChequebook(path string, contractAddr common.Address, prvKey *ecdsa.PrivateKey, ...) (self *Chequebook, err error) + func (self *Chequebook) Address() common.Address + func (self *Chequebook) AutoDeposit(interval time.Duration, threshold, buffer *big.Int) + func (self *Chequebook) Balance() *big.Int + func (self *Chequebook) Cash(ch *Cheque) (txhash string, err error) + func (self *Chequebook) Deposit(amount *big.Int) (string, error) + func (self *Chequebook) Issue(beneficiary common.Address, amount *big.Int) (ch *Cheque, err error) + func (self *Chequebook) MarshalJSON() ([]byte, error) + func (self *Chequebook) Owner() common.Address + func (self *Chequebook) Save() (err error) + func (self *Chequebook) Stop() + func (self *Chequebook) String() string + func (self *Chequebook) UnmarshalJSON(data []byte) error + type Inbox struct + func NewInbox(prvKey *ecdsa.PrivateKey, contractAddr, beneficiary common.Address, ...) (self *Inbox, err error) + func (self *Inbox) AutoCash(cashInterval time.Duration, maxUncashed *big.Int) + func (self *Inbox) Cash() (txhash string, err error) + func (self *Inbox) Receive(ch *Cheque) (*big.Int, error) + func (self *Inbox) Stop() + func (self *Inbox) String() string + type Outbox struct + func NewOutbox(chbook *Chequebook, beneficiary common.Address) *Outbox + func (self *Outbox) AutoDeposit(interval time.Duration, threshold, buffer *big.Int) + func (self *Outbox) Issue(amount *big.Int) (*Cheque, error) + func (self *Outbox) Stop() + func (self *Outbox) String() string + type Params struct + ContractAbi string + ContractCode string Other modules containing this package github.com/beyonderyue/gochain