Documentation ¶
Index ¶
Constants ¶
View Source
const StatusOK = 1
StatusOK defined by ethereum is the value of status for a transaction that succeeds
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callbacks ¶
type Callbacks interface { // TransactionCommitted is called when the owner has successfully committed a // transaction TransactionCommitted(ctx context.Context, body callback.TransactionCommittedBody) // WalletOutOfFunds is called when the wallet owned by the // WalletOwner does not have enough funds for a transaction WalletOutOfFunds(ctx context.Context, body callback.WalletOutOfFundsBody) // WalletReachedFundsThreshold is called when the wallet owned by the // WalletOwner realizes it's wallet balance has go down a certain // threshold WalletReachedFundsThreshold(ctx context.Context, body callback.WalletReachedFundsThresholdBody) }
Callbacks implemented by the WalletOwner
type ExecuteRequest ¶
type ExecuteRequest struct { // AAD is the identifier of the original issuer for the transaction data AAD string // Transaction ID ID uint64 // Address to which to execute transaction Address string // Transaction data Data []byte }
ExecuteRequest is the request to execute an Ethereum transaction
type ExecuteResponse ¶
type Executor ¶
func NewExecutor ¶
func NewExecutor(ctx context.Context, services *ExecutorServices, props *ExecutorProps) (*Executor, error)
func (*Executor) Execute ¶
func (s *Executor) Execute(ctx context.Context, req ExecuteRequest) (ExecuteResponse, errors.Err)
Executes the desired transaction.
type ExecutorProps ¶
type ExecutorProps struct {
PrivateKeys []*ecdsa.PrivateKey
}
type ExecutorServices ¶
type InternalWallet ¶
type InternalWallet struct {
// contains filtered or unexported fields
}
func NewWallet ¶
func NewWallet( privateKey *ecdsa.PrivateKey, signer types.Signer, ) *InternalWallet
func (*InternalWallet) Address ¶
func (w *InternalWallet) Address() common.Address
func (*InternalWallet) SignTransaction ¶
func (w *InternalWallet) SignTransaction(tx *types.Transaction) (*types.Transaction, errors.Err)
type Wallet ¶
type Wallet interface { Address() common.Address SignTransaction(tx *types.Transaction) (*types.Transaction, errors.Err) }
Wallet is an interface for any type that signs transactions and receives responses
type WalletOwner ¶
type WalletOwner struct {
// contains filtered or unexported fields
}
WalletOwner is the only instance that should interact with a wallet. Its main goal is to send transactions and keep the funding and nonce of the wallet up to date
func NewWalletOwner ¶
func NewWalletOwner( ctx context.Context, services *WalletOwnerServices, props *WalletOwnerProps, ) (*WalletOwner, error)
NewWalletOwner creates a new instance of a wallet owner. The wallet is derived from the private key provided
type WalletOwnerProps ¶
type WalletOwnerProps struct { PrivateKey *ecdsa.PrivateKey Signer types.Signer Nonce uint64 }
Click to show internal directories.
Click to hide internal directories.