Skip to content

Commit f7e6437

Browse files
authored
Merge pull request #27 from Safeheron/dev
v2.1.26
2 parents d1e6f6b + 8b49a1c commit f7e6437

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

safeheron/api/gas_api.go

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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

Comments
 (0)