|
| 1 | +package api |
| 2 | + |
| 3 | +import ( |
| 4 | + "github.com/Safeheron/safeheron-api-sdk-go/safeheron" |
| 5 | +) |
| 6 | + |
| 7 | +type GasApi struct { |
| 8 | + Client safeheron.Client |
| 9 | +} |
| 10 | + |
| 11 | +type GasStatusResponse struct { |
| 12 | + GasBalance []GasBalance `json:"gasBalance"` |
| 13 | +} |
| 14 | + |
| 15 | +type GasBalance struct { |
| 16 | + Symbol string `json:"symbol"` |
| 17 | + Amount string `json:"amount"` |
| 18 | +} |
| 19 | + |
| 20 | +func (e *GasApi) GasStatus(r *GasStatusResponse) error { |
| 21 | + return e.Client.SendRequest(nil, r, "/v1/gas/status") |
| 22 | +} |
| 23 | + |
| 24 | +type GasTransactionsGetByTxKeyRequest struct { |
| 25 | + TxKey string `json:"txKey,omitempty"` |
| 26 | +} |
| 27 | + |
| 28 | +type GasTransactionsGetByTxKeyResponse struct { |
| 29 | + TxKey string `json:"txKey"` |
| 30 | + Symbol string `json:"symbol"` |
| 31 | + TotalAmount string `json:"totalAmount"` |
| 32 | + DetailList []Detail `json:"detailList"` |
| 33 | +} |
| 34 | +type Detail struct { |
| 35 | + GasServiceTxKey string `json:"gasServiceTxKey"` |
| 36 | + Symbol string `json:"symbol"` |
| 37 | + Amount string `json:"amount"` |
| 38 | + Balance string `json:"balance"` |
| 39 | + Status string `json:"status"` |
| 40 | + ResourceType string `json:"resourceType"` |
| 41 | + Timestamp string `json:"timestamp"` |
| 42 | +} |
| 43 | + |
| 44 | +func (e *GasApi) GasTransactionsGetByTxKey(d GasTransactionsGetByTxKeyRequest, r *GasTransactionsGetByTxKeyResponse) error { |
| 45 | + return e.Client.SendRequest(d, r, "/v1/gas/transactions/getByTxKey") |
| 46 | +} |
0 commit comments