Versions in this module Expand all Collapse all v0 v0.4.2 Jun 28, 2019 v0.4.1 Jun 13, 2019 Changes in this version + const Version + var ContractParams = &Params + func ValidateCode(ctx context.Context, b Backend, address common.Address) (bool, error) + type API struct + func NewAPI(ch func() *Chequebook) *API + func (a *API) Balance() (string, error) + func (a *API) Cash(cheque *Cheque) (txhash string, err error) + func (a *API) Deposit(amount *big.Int) (txhash string, err error) + func (a *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 (ch *Cheque) Cash(session *contract.ChequebookSession) (string, error) + func (ch *Cheque) String() string + func (ch *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) (*Chequebook, error) + func NewChequebook(path string, contractAddr common.Address, prvKey *ecdsa.PrivateKey, ...) (*Chequebook, error) + func (cb *Chequebook) Address() common.Address + func (cb *Chequebook) AutoDeposit(interval time.Duration, threshold, buffer *big.Int) + func (cb *Chequebook) Balance() *big.Int + func (cb *Chequebook) Cash(ch *Cheque) (string, error) + func (cb *Chequebook) Deposit(amount *big.Int) (string, error) + func (cb *Chequebook) Issue(beneficiary common.Address, amount *big.Int) (*Cheque, error) + func (cb *Chequebook) MarshalJSON() ([]byte, error) + func (cb *Chequebook) Owner() common.Address + func (cb *Chequebook) Save() error + func (cb *Chequebook) Stop() + func (cb *Chequebook) String() string + func (cb *Chequebook) UnmarshalJSON(data []byte) error + type Inbox struct + func NewInbox(prvKey *ecdsa.PrivateKey, contractAddr, beneficiary common.Address, ...) (*Inbox, error) + func (i *Inbox) AutoCash(cashInterval time.Duration, maxUncashed *big.Int) + func (i *Inbox) Cash() (string, error) + func (i *Inbox) Receive(promise swap.Promise) (*big.Int, error) + func (i *Inbox) Stop() + func (i *Inbox) String() string + type Outbox struct + func NewOutbox(cb *Chequebook, beneficiary common.Address) *Outbox + func (o *Outbox) AutoDeposit(interval time.Duration, threshold, buffer *big.Int) + func (o *Outbox) Issue(amount *big.Int) (swap.Promise, error) + func (o *Outbox) Stop() + func (o *Outbox) String() string + type Params struct + ContractAbi string + ContractCode string