Documentation
¶
Index ¶
- Constants
- type Storage
- func (s *Storage) AddressCount() int
- func (s *Storage) AddressInfo(address string) (*types.AddressInfo, error)
- func (s *Storage) AllAddresses() []types.AddressInfo
- func (s *Storage) Clone(path string) (storage.IStorage, error)
- func (s *Storage) Close() error
- func (s *Storage) GetPendingTransactions() (map[string]*types.TransactionInfo, error)
- func (s *Storage) GetTransaction(no int64) (*types.TransactionInfo, error)
- func (s *Storage) HasAddress(address string) bool
- func (s *Storage) HasTransaction(txID string) bool
- func (s *Storage) InsertAddress(info *types.AddressInfo) error
- func (s *Storage) InsertTransaction(info *types.TransactionInfo) error
- func (*Storage) IsLegacy() bool
- func (s *Storage) QueryTransactions(params storage.QueryParams) ([]*types.TransactionInfo, error)
- func (s *Storage) SetDefaultFee(fee amount.Amount) error
- func (s *Storage) UpdateAddress(info *types.AddressInfo) error
- func (s *Storage) UpdateTransactionStatus(no int64, status types.TransactionStatus, blockHeight uint32) error
- func (s *Storage) UpdateVault(vlt *vault.Vault) error
- func (s *Storage) Vault() *vault.Vault
- func (s *Storage) WalletInfo() *types.WalletInfo
Constants ¶
const ( Version1 = 1 // Initial version VersionLatest = Version1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage represents the SQLite-based wallet storage implementing IStorage interface.
func Create ¶
func Create(ctx context.Context, path string, network genesis.ChainType, vlt *vault.Vault) (*Storage, error)
Create creates a new SQLite storage instance and initializes the schema.
func (*Storage) AddressCount ¶
AddressCount returns the number of addresses in the wallet.
func (*Storage) AddressInfo ¶
func (s *Storage) AddressInfo(address string) (*types.AddressInfo, error)
AddressInfo returns the address information for the given address.
func (*Storage) AllAddresses ¶
func (s *Storage) AllAddresses() []types.AddressInfo
AllAddresses returns all addresses in the wallet.
func (*Storage) GetPendingTransactions ¶
func (s *Storage) GetPendingTransactions() (map[string]*types.TransactionInfo, error)
GetPendingTransactions returns pending transactions keyed by transaction ID.
func (*Storage) GetTransaction ¶
func (s *Storage) GetTransaction(no int64) (*types.TransactionInfo, error)
GetTransaction retrieves a transaction by primary key.
func (*Storage) HasAddress ¶
HasAddress checks if an address exists.
func (*Storage) HasTransaction ¶
HasTransaction checks if a transaction exists by transaction ID.
func (*Storage) InsertAddress ¶
func (s *Storage) InsertAddress(info *types.AddressInfo) error
InsertAddress inserts a new address.
func (*Storage) InsertTransaction ¶
func (s *Storage) InsertTransaction(info *types.TransactionInfo) error
InsertTransaction inserts a new transaction.
func (*Storage) QueryTransactions ¶
func (s *Storage) QueryTransactions(params storage.QueryParams) ([]*types.TransactionInfo, error)
QueryTransactions returns transactions matching the provided filters with pagination. Empty or "*" address value is treated as no filter. Filters are combined with AND.
func (*Storage) SetDefaultFee ¶
SetDefaultFee sets the default fee.
func (*Storage) UpdateAddress ¶
func (s *Storage) UpdateAddress(info *types.AddressInfo) error
UpdateAddress updates an existing address.
func (*Storage) UpdateTransactionStatus ¶
func (s *Storage) UpdateTransactionStatus(no int64, status types.TransactionStatus, blockHeight uint32) error
UpdateTransactionStatus updates the status and block height for all transactions with the given primary key.
func (*Storage) UpdateVault ¶
UpdateVault updates the vault in storage.
func (*Storage) WalletInfo ¶
func (s *Storage) WalletInfo() *types.WalletInfo
WalletInfo returns the wallet information.