Documentation
¶
Overview ¶
Package wallet manages EVM-compatible wallets for DOSRouter payment. Supports BIP-39 mnemonic generation, key derivation, and balance queries.
Index ¶
- func SupportedChains() []string
- type ChainConfig
- type Wallet
- func (w *Wallet) Address() string
- func (w *Wallet) Chain() string
- func (w *Wallet) ChainConfig() ChainConfig
- func (w *Wallet) GetBalance() (float64, error)
- func (w *Wallet) IsNew() bool
- func (w *Wallet) Mnemonic() string
- func (w *Wallet) PrivateKeyHex() string
- func (w *Wallet) SetChain(name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SupportedChains ¶
func SupportedChains() []string
SupportedChains returns the list of supported chain names.
Types ¶
type ChainConfig ¶
type ChainConfig struct {
Name string `json:"name"`
RPCURL string `json:"rpcUrl"`
ChainID int64 `json:"chainId"`
TokenAddress string `json:"tokenAddress"` // USDC or payment token contract
TokenSymbol string `json:"tokenSymbol"`
Explorer string `json:"explorer"`
}
Chain configuration
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
Wallet represents an EVM wallet with key material and chain config.
func LoadOrCreate ¶
LoadOrCreate loads an existing wallet or creates a new one.
func (*Wallet) ChainConfig ¶
func (w *Wallet) ChainConfig() ChainConfig
ChainConfig returns the current chain's configuration.
func (*Wallet) GetBalance ¶
GetBalance queries the on-chain balance for the wallet's token.
func (*Wallet) PrivateKeyHex ¶
PrivateKeyHex returns the private key as a hex string.
Click to show internal directories.
Click to hide internal directories.