Versions in this module Expand all Collapse all v0 v0.2.3 Jun 20, 2021 Changes in this version + var ChequeTypes = eip712.Types + var ErrBouncingCheque = errors.New("bouncing cheque") + var ErrChequeInvalid = errors.New("invalid cheque") + var ErrChequeNotIncreasing = errors.New("cheque cumulativePayout is not increasing") + var ErrInsufficientFunds = errors.New("insufficient token balance") + var ErrInvalidFactory = errors.New("not a valid factory contract") + var ErrNoCashout = errors.New("no prior cashout") + var ErrNoCheque = errors.New("no cheque") + var ErrNotDeployedByFactory = errors.New("chequebook not deployed by factory") + var ErrOutOfFunds = errors.New("chequebook out of funds") + var ErrWrongBeneficiary = errors.New("wrong beneficiary") + func DiscoverFactoryAddress(chainID int64) (common.Address, bool) + func RecoverCheque(cheque *SignedCheque, chaindID int64) (common.Address, error) + type CashChequeResult struct + Beneficiary common.Address + Bounced bool + Caller common.Address + CallerPayout *big.Int + CumulativePayout *big.Int + Recipient common.Address + TotalPayout *big.Int + func (r *CashChequeResult) Equal(o *CashChequeResult) bool + type CashoutService interface + CashCheque func(ctx context.Context, chequebook common.Address, recipient common.Address) (common.Hash, error) + CashoutStatus func(ctx context.Context, chequebookAddress common.Address) (*CashoutStatus, error) + func NewCashoutService(store storage.StateStorer, backend transaction.Backend, ...) CashoutService + type CashoutStatus struct + Cheque SignedCheque + Result *CashChequeResult + Reverted bool + TxHash common.Hash + type Cheque struct + Beneficiary common.Address + Chequebook common.Address + CumulativePayout *big.Int + func (cheque *Cheque) Equal(other *Cheque) bool + func (cheque *Cheque) String() string + type ChequeSigner interface + Sign func(cheque *Cheque) ([]byte, error) + func NewChequeSigner(signer crypto.Signer, chainID int64) ChequeSigner + type ChequeStore interface + LastCheque func(chequebook common.Address) (*SignedCheque, error) + LastCheques func() (map[common.Address]*SignedCheque, error) + ReceiveCheque func(ctx context.Context, cheque *SignedCheque) (*big.Int, error) + func NewChequeStore(store storage.StateStorer, backend transaction.Backend, factory Factory, ...) ChequeStore + type Factory interface + Deploy func(ctx context.Context, issuer common.Address, ...) (common.Hash, error) + ERC20Address func(ctx context.Context) (common.Address, error) + VerifyBytecode func(ctx context.Context) error + VerifyChequebook func(ctx context.Context, chequebook common.Address) error + WaitDeployed func(ctx context.Context, txHash common.Hash) (common.Address, error) + func NewFactory(backend transaction.Backend, transactionService transaction.Service, ...) Factory + type RecoverChequeFunc func(cheque *SignedCheque, chainID int64) (common.Address, error) + type SendChequeFunc func(cheque *SignedCheque) error + type Service interface + Address func() common.Address + AvailableBalance func(ctx context.Context) (*big.Int, error) + Balance func(ctx context.Context) (*big.Int, error) + Deposit func(ctx context.Context, amount *big.Int) (hash common.Hash, err error) + Issue func(ctx context.Context, beneficiary common.Address, amount *big.Int, ...) (*big.Int, error) + LastCheque func(beneficiary common.Address) (*SignedCheque, error) + LastCheques func() (map[common.Address]*SignedCheque, error) + WaitForDeposit func(ctx context.Context, txHash common.Hash) error + Withdraw func(ctx context.Context, amount *big.Int) (hash common.Hash, err error) + func Init(ctx context.Context, chequebookFactory Factory, stateStore storage.StateStorer, ...) (chequebookService Service, err error) + func New(backend transaction.Backend, transactionService transaction.Service, ...) (Service, error) + type SignedCheque struct + Signature []byte + func (cheque *SignedCheque) Equal(other *SignedCheque) bool + type SimpleSwapBinding interface + Balance func(*bind.CallOpts) (*big.Int, error) + Issuer func(*bind.CallOpts) (common.Address, error) + PaidOut func(*bind.CallOpts, common.Address) (*big.Int, error) + TotalPaidOut func(*bind.CallOpts) (*big.Int, error) + func NewSimpleSwapBindings(address common.Address, backend bind.ContractBackend) (SimpleSwapBinding, error) + type SimpleSwapBindingFunc = func(common.Address, bind.ContractBackend) (SimpleSwapBinding, error)