contracts

package
v1.5.8 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: GPL-2.0, GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFailedContractCall = errors.New("calling smart contract failed")
	ErrInvalidEventData   = errors.New("event data could not be parsed")
	ErrNoCode             = errors.New("no contract code at given address")
)

Functions

func DeployWallet

func DeployWallet(opts *ConstructOpts, eth bind.ContractBackend, owner common.Address, transferable bool, ens common.Address, oracleName [32]byte, controllerName [32]byte, spendLimit *big.Int) (common.Address, *types.Transaction, error)

Types

type ConstructOpts

type ConstructOpts struct {
	From     common.Address  // Ethereum account to send the transaction from
	Nonce    uint64          // Nonce to use for the transaction execution
	Value    *big.Int        // Funds to transfer along along the transaction (nil = 0 = no funds)
	GasPrice *big.Int        // Gas price to use for the transaction execution (nil = gas price oracle)
	GasLimit uint64          // Gas limit to set for the transaction execution (0 = estimate)
	Sign     SignTransaction // Method to use for signing the transaction (nil = return unsigned transaction)
	Context  context.Context // Network context to support cancellation and timeouts
}

type Event

type Event struct {
	Address   common.Address
	TxHash    common.Hash
	BlockHash common.Hash
	Data      [][]byte
}

Event represents a raw smart contract event.

type SignTransaction

type SignTransaction func(context.Context, *types.Transaction) (*types.Transaction, error)

type Wallet

type Wallet struct {
	// contains filtered or unexported fields
}

func NewWallet

func NewWallet(ethereum bind.ContractBackend, address common.Address) (*Wallet, error)

func (*Wallet) AddedToWhitelistEvents

func (w *Wallet) AddedToWhitelistEvents(ctx context.Context, fromBlock *big.Int, toBlock *big.Int) ([]*Event, error)

func (*Wallet) Balance

func (w *Wallet) Balance(ctx context.Context, block *big.Int, asset common.Address) (*big.Int, error)

func (*Wallet) CancelSpendLimit

func (w *Wallet) CancelSpendLimit(opts *ConstructOpts) (*types.Transaction, error)

func (*Wallet) CancelTopUpLimit

func (w *Wallet) CancelTopUpLimit(opts *ConstructOpts) (*types.Transaction, error)

func (*Wallet) CancelWhitelistAddition

func (w *Wallet) CancelWhitelistAddition(opts *ConstructOpts) (*types.Transaction, error)

func (*Wallet) CancelWhitelistRemoval

func (w *Wallet) CancelWhitelistRemoval(opts *ConstructOpts) (*types.Transaction, error)

func (*Wallet) ConfirmSpendLimit

func (w *Wallet) ConfirmSpendLimit(opts *ConstructOpts) (*types.Transaction, error)

func (*Wallet) ConfirmTopUpLimit

func (w *Wallet) ConfirmTopUpLimit(opts *ConstructOpts) (*types.Transaction, error)

func (*Wallet) ConfirmWhitelistAddition

func (w *Wallet) ConfirmWhitelistAddition(opts *ConstructOpts, hash common.Hash) (*types.Transaction, error)

func (*Wallet) ConfirmWhitelistRemoval

func (w *Wallet) ConfirmWhitelistRemoval(opts *ConstructOpts, hash common.Hash) (*types.Transaction, error)

func (*Wallet) InitializeSpendLimit

func (w *Wallet) InitializeSpendLimit(opts *ConstructOpts, amount *big.Int) (*types.Transaction, error)

func (*Wallet) InitializeTopUpLimit

func (w *Wallet) InitializeTopUpLimit(opts *ConstructOpts, amount *big.Int) (*types.Transaction, error)

func (*Wallet) InitializeWhitelist

func (w *Wallet) InitializeWhitelist(opts *ConstructOpts, addresses []common.Address) (*types.Transaction, error)

func (*Wallet) InitializedSpendLimit

func (w *Wallet) InitializedSpendLimit(ctx context.Context, block *big.Int) (bool, error)

func (*Wallet) InitializedTopUpLimit

func (w *Wallet) InitializedTopUpLimit(ctx context.Context, block *big.Int) (bool, error)

func (*Wallet) InitializedWhitelist

func (w *Wallet) InitializedWhitelist(ctx context.Context, block *big.Int) (bool, error)

func (*Wallet) IsWhitelisted

func (w *Wallet) IsWhitelisted(ctx context.Context, block *big.Int, address common.Address) (bool, error)

func (*Wallet) Owner

func (w *Wallet) Owner(ctx context.Context, block *big.Int) (common.Address, error)

func (*Wallet) PendingSpendLimit

func (w *Wallet) PendingSpendLimit(ctx context.Context, block *big.Int) (*big.Int, error)

func (*Wallet) PendingTopUpLimit

func (w *Wallet) PendingTopUpLimit(ctx context.Context, block *big.Int) (*big.Int, error)

func (*Wallet) PendingWhitelistAddition

func (w *Wallet) PendingWhitelistAddition(ctx context.Context, block *big.Int) ([]common.Address, error)

func (*Wallet) PendingWhitelistRemoval

func (w *Wallet) PendingWhitelistRemoval(ctx context.Context, block *big.Int) ([]common.Address, error)

func (*Wallet) ReceivedEvents

func (w *Wallet) ReceivedEvents(ctx context.Context, fromBlock *big.Int, toBlock *big.Int) ([]*Event, error)

func (*Wallet) RemovedFromWhitelistEvents

func (w *Wallet) RemovedFromWhitelistEvents(ctx context.Context, fromBlock *big.Int, toBlock *big.Int) ([]*Event, error)

func (*Wallet) SetSpendLimitEvents

func (w *Wallet) SetSpendLimitEvents(ctx context.Context, fromBlock *big.Int, toBlock *big.Int) ([]*Event, error)

func (*Wallet) SetTopUpLimitEvents

func (w *Wallet) SetTopUpLimitEvents(ctx context.Context, fromBlock *big.Int, toBlock *big.Int) ([]*Event, error)

func (*Wallet) SpendAvailable

func (w *Wallet) SpendAvailable(ctx context.Context, block *big.Int) (*big.Int, error)

func (*Wallet) SpendLimit

func (w *Wallet) SpendLimit(ctx context.Context, block *big.Int) (*big.Int, error)

func (*Wallet) SubmitSpendLimit

func (w *Wallet) SubmitSpendLimit(opts *ConstructOpts, amount *big.Int) (*types.Transaction, error)

func (*Wallet) SubmitTopUpLimit

func (w *Wallet) SubmitTopUpLimit(opts *ConstructOpts, amount *big.Int) (*types.Transaction, error)

func (*Wallet) SubmitWhitelistAddition

func (w *Wallet) SubmitWhitelistAddition(opts *ConstructOpts, addresses []common.Address) (*types.Transaction, error)

func (*Wallet) SubmitWhitelistRemoval

func (w *Wallet) SubmitWhitelistRemoval(opts *ConstructOpts, addresses []common.Address) (*types.Transaction, error)

func (*Wallet) SubmittedWhitelistAdditionEvents

func (w *Wallet) SubmittedWhitelistAdditionEvents(ctx context.Context, fromBlock *big.Int, toBlock *big.Int) ([]*Event, error)

func (*Wallet) SubmittedWhitelistRemovalEvents

func (w *Wallet) SubmittedWhitelistRemovalEvents(ctx context.Context, fromBlock *big.Int, toBlock *big.Int) ([]*Event, error)

func (*Wallet) TopUpAvailable

func (w *Wallet) TopUpAvailable(ctx context.Context, block *big.Int) (*big.Int, error)

func (*Wallet) TopUpGas

func (w *Wallet) TopUpGas(opts *ConstructOpts, amount *big.Int) (*types.Transaction, error)

func (*Wallet) TopUpLimit

func (w *Wallet) TopUpLimit(ctx context.Context, block *big.Int) (*big.Int, error)

func (*Wallet) ToppedUpGasEvents

func (w *Wallet) ToppedUpGasEvents(ctx context.Context, fromBlock *big.Int, toBlock *big.Int) ([]*Event, error)

func (*Wallet) Transfer

func (w *Wallet) Transfer(opts *ConstructOpts, to common.Address, asset common.Address, amount *big.Int) (*types.Transaction, error)

func (*Wallet) TransferredEvents

func (w *Wallet) TransferredEvents(ctx context.Context, fromBlock *big.Int, toBlock *big.Int) ([]*Event, error)

Jump to

Keyboard shortcuts

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