36 lines
1011 B
Go
36 lines
1011 B
Go
package wallet
|
|
|
|
import "time"
|
|
|
|
type Wallet struct {
|
|
Address string `db:"address" json:"address"`
|
|
Label *string `db:"label" json:"label,omitempty"`
|
|
PasswordHash string `db:"password_hash" json:"password_hash"`
|
|
Balance float64 `db:"balance" json:"balance"`
|
|
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
|
LastActivity *time.Time `db:"last_activity" json:"last_activity,omitempty"`
|
|
}
|
|
|
|
type CreateWalletRequest struct {
|
|
Label *string `json:"label,omitempty"`
|
|
Password string `json:"password"`
|
|
}
|
|
|
|
type WalletResponse struct {
|
|
Address string `json:"address"` // Format: "random_word:123456" (e.g. "cave:595462")
|
|
Balance float64 `json:"balance"`
|
|
Label *string `json:"label,omitempty"`
|
|
PasswordHash string `json:"password_hash"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
LastActivity *int64 `json:"last_activity,omitempty"`
|
|
}
|
|
|
|
type BalanceResponse struct {
|
|
Address string `json:"address"`
|
|
Balance float64 `json:"balance"`
|
|
}
|
|
|
|
type UpdateWalletRequest struct {
|
|
Label *string `json:"label,omitempty"`
|
|
}
|