feat: added models

This commit is contained in:
darwincereska
2025-12-20 04:21:13 -05:00
parent f5f40eb79c
commit 59adb32e68
13 changed files with 154 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
package transaction
type SendTransactionRequest struct {
FromAddress string `json:"from_address"`
ToAddress string `json:"to_address"`
Amount float64 `json:"amount"`
Fee float64 `json:"fee"`
Memo *string `json:"memo,omitempty"`
Password string `json:"password"`
}
type TransactionResponse struct {
Hash string `json:"hash"`
FromAddress *string `json:"from_address,omitempty"`
ToAddress string `json:"to_address"`
Amount float64 `json:"amount"`
Fee float64 `json:"fee"`
Memo *string `json:"memo,omitempty"`
BlockHash string `json:"block_hash"`
Timestamp int64 `json:"timestamp"`
Status string `json:"status"`
Confirmations int `json:"confirmations"`
}
type TransactionHistoryResponse struct {
Transactions []TransactionResponse `json:"transactions"`
TotalCount int `json:"total_count"`
Page int `json:"page"`
PageSize int `json:"page_size"`
}
type TransactionStatus string
const (
PENDING TransactionStatus = "PENDING"
CONFIRMED TransactionStatus = "CONFIRMED"
FAILED TransactionStatus = "FAILED"
CANCELLED TransactionStatus = "CANCELLED"
)