forked from urdt/ussd
WIP refactor models usage
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
package models
|
||||
|
||||
type AccountResponse struct {
|
||||
Ok bool `json:"ok"`
|
||||
Description string `json:"description"` // Include the description field
|
||||
Result struct {
|
||||
PublicKey string `json:"publicKey"`
|
||||
TrackingId string `json:"trackingId"`
|
||||
} `json:"result"`
|
||||
type AccountResult struct {
|
||||
PublicKey string `json:"publicKey"`
|
||||
TrackingId string `json:"trackingId"`
|
||||
}
|
||||
|
||||
@@ -3,10 +3,15 @@ package models
|
||||
import "encoding/json"
|
||||
|
||||
|
||||
type BalanceResponse struct {
|
||||
Ok bool `json:"ok"`
|
||||
Result struct {
|
||||
Balance string `json:"balance"`
|
||||
Nonce json.Number `json:"nonce"`
|
||||
} `json:"result"`
|
||||
//type BalanceResponse struct {
|
||||
// Ok bool `json:"ok"`
|
||||
// Result struct {
|
||||
// Balance string `json:"balance"`
|
||||
// Nonce json.Number `json:"nonce"`
|
||||
// } `json:"result"`
|
||||
//}
|
||||
//
|
||||
type BalanceResult struct {
|
||||
Balance string `json:"balance"`
|
||||
Nonce json.Number `json:"nonce"`
|
||||
}
|
||||
|
||||
@@ -4,23 +4,18 @@ import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
)
|
||||
type Transaction struct {
|
||||
//type Transaction struct {
|
||||
// CreatedAt time.Time `json:"createdAt"`
|
||||
// Status string `json:"status"`
|
||||
// TransferValue json.Number `json:"transferValue"`
|
||||
// TxHash string `json:"txHash"`
|
||||
// TxType string `json:"txType"`
|
||||
//}
|
||||
|
||||
type TrackStatusResult struct {
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
Status string `json:"status"`
|
||||
TransferValue json.Number `json:"transferValue"`
|
||||
TxHash string `json:"txHash"`
|
||||
TxType string `json:"txType"`
|
||||
}
|
||||
|
||||
type TrackStatusResponse struct {
|
||||
Ok bool `json:"ok"`
|
||||
Result struct {
|
||||
Transaction struct {
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
Status string `json:"status"`
|
||||
TransferValue json.Number `json:"transferValue"`
|
||||
TxHash string `json:"txHash"`
|
||||
TxType string `json:"txType"`
|
||||
}
|
||||
} `json:"result"`
|
||||
}
|
||||
|
||||
@@ -1,14 +1 @@
|
||||
package models
|
||||
|
||||
import dataserviceapi "github.com/grassrootseconomics/ussd-data-service/pkg/api"
|
||||
|
||||
type VoucherHoldingResponse struct {
|
||||
Ok bool `json:"ok"`
|
||||
Description string `json:"description"`
|
||||
Result VoucherResult `json:"result"`
|
||||
}
|
||||
|
||||
// VoucherResult holds the list of token holdings
|
||||
type VoucherResult struct {
|
||||
Holdings []dataserviceapi.TokenHoldings `json:"holdings"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user