Documentation ¶
Index ¶
- Constants
- Variables
- type AccountBalance
- type Greeter
- type GreeterRepo
- type GreeterUsecase
- type KeystoreRepo
- type SendTransaction
- type TransactionResult
- type TxCost
- type WalletUsecase
- func (s *WalletUsecase) ReadBalance(accountAddress string) (*AccountBalance, error)
- func (s *WalletUsecase) SendTransaction(ctx context.Context, sendTx *SendTransaction) (*TransactionResult, error)
- func (s *WalletUsecase) SuggestGasPrice(ctx context.Context) (string, error)
- func (s *WalletUsecase) TransferAll(ctx context.Context, sendTx *SendTransaction) (*TransactionResult, error)
- func (s *WalletUsecase) TxCost(ctx context.Context, txHashStr string) (*TxCost, error)
Constants ¶
View Source
const KEYSTORE_DIR = "%LocalAppData%\\Ethereum\\keystore" // TODO: Change with host os
View Source
const MY_PUBLIC_ADDRESS = "0x929548598a3b93362c5aa2a24de190d18e657ae0"
View Source
const PASSWORD = "P@ssw0rd" // TODO: Remove
View Source
const RECIPIENT_ADDRESS = "0xb02A2EdA1b317FBd16760128836B0Ac59B560e91"
Variables ¶
View Source
var ( // ErrUserNotFound is user not found. ErrUserNotFound = errors.NotFound(v1.ErrorReason_USER_NOT_FOUND.String(), "user not found") )
View Source
var ProviderSet = wire.NewSet(NewGreeterUsecase, NewWalletUsecase)
ProviderSet is biz providers.
Functions ¶
This section is empty.
Types ¶
type AccountBalance ¶
type GreeterRepo ¶
type GreeterRepo interface { Save(context.Context, *Greeter) (*Greeter, error) Update(context.Context, *Greeter) (*Greeter, error) FindByID(context.Context, int64) (*Greeter, error) ListByHello(context.Context, string) ([]*Greeter, error) ListAll(context.Context) ([]*Greeter, error) }
GreeterRepo is a Greater repo.
type GreeterUsecase ¶
type GreeterUsecase struct {
// contains filtered or unexported fields
}
GreeterUsecase is a Greeter usecase.
func NewGreeterUsecase ¶
func NewGreeterUsecase(repo GreeterRepo, logger log.Logger) *GreeterUsecase
NewGreeterUsecase new a Greeter usecase.
func (*GreeterUsecase) CreateGreeter ¶
CreateGreeter creates a Greeter, and returns the new Greeter.
type KeystoreRepo ¶
type SendTransaction ¶
type TransactionResult ¶
type TransactionResult struct {
TransactionHash string
}
type WalletUsecase ¶
type WalletUsecase struct {
// contains filtered or unexported fields
}
func NewWalletUsecase ¶
func NewWalletUsecase(repo KeystoreRepo, logger log.Logger, cl *ethclient.Client) *WalletUsecase
func (*WalletUsecase) ReadBalance ¶
func (s *WalletUsecase) ReadBalance(accountAddress string) (*AccountBalance, error)
Prints the balance of an account
func (*WalletUsecase) SendTransaction ¶
func (s *WalletUsecase) SendTransaction(ctx context.Context, sendTx *SendTransaction) (*TransactionResult, error)
func (*WalletUsecase) SuggestGasPrice ¶
func (s *WalletUsecase) SuggestGasPrice(ctx context.Context) (string, error)
func (*WalletUsecase) TransferAll ¶
func (s *WalletUsecase) TransferAll(ctx context.Context, sendTx *SendTransaction) (*TransactionResult, error)
Click to show internal directories.
Click to hide internal directories.