Documentation ¶
Index ¶
- Constants
- type BackendClient
- type Key
- type Token
- type TokenInfoGetterFn
- type TokenWallet
- type TransactionSender
- type Wallet
- func (w *Wallet) BalanceERC20(ctx context.Context, addr common.Address, token Token) (*big.Int, error)
- func (w *Wallet) BalanceNative(ctx context.Context, addr common.Address) (*big.Int, error)
- func (w *Wallet) ChainID(ctx context.Context) (int64, error)
- func (w *Wallet) ERC20() TokenWallet
- func (w *Wallet) Native() TokenWallet
- func (w *Wallet) PublicAddress() common.Address
- func (w *Wallet) TransferERC20(ctx context.Context, toAddr common.Address, amount *big.Int, token Token) error
- func (w *Wallet) TransferNative(ctx context.Context, toAddr common.Address, amount *big.Int) error
Constants ¶
View Source
const ( SwarmTokenDecimals = 16 LocalnetChainID = 12345 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackendClient ¶
type BackendClient interface { ChainID(ctx context.Context) (*big.Int, error) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) SuggestGasPrice(ctx context.Context) (*big.Int, error) SuggestGasTipCap(ctx context.Context) (*big.Int, error) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error) SendTransaction(ctx context.Context, tx *types.Transaction) error BalanceAt(ctx context.Context, address common.Address, block *big.Int) (*big.Int, error) }
type Key ¶
type Key string
func GenerateKey ¶
func (Key) PrivateECDSA ¶
func (k Key) PrivateECDSA() (*ecdsa.PrivateKey, error)
type TokenInfoGetterFn ¶
type TokenWallet ¶
type TransactionSender ¶
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
func New ¶
func New(client BackendClient, key Key) *Wallet
func (*Wallet) BalanceERC20 ¶
func (*Wallet) BalanceNative ¶
func (*Wallet) ERC20 ¶
func (w *Wallet) ERC20() TokenWallet
func (*Wallet) Native ¶
func (w *Wallet) Native() TokenWallet
func (*Wallet) PublicAddress ¶
func (*Wallet) TransferERC20 ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.