From 430c5d32c8d85bb184b7153dd71e08375d9979e1 Mon Sep 17 00:00:00 2001 From: Carlosokumu Date: Mon, 26 Aug 2024 13:31:20 +0300 Subject: [PATCH] define api calls response --- internal/models/accountresponse.go | 15 +++++---------- internal/models/balanceresponse.go | 12 ++++++++++++ internal/models/trackstatusresponse.go | 20 ++++++++++++++++++++ 3 files changed, 37 insertions(+), 10 deletions(-) create mode 100644 internal/models/balanceresponse.go create mode 100644 internal/models/trackstatusresponse.go diff --git a/internal/models/accountresponse.go b/internal/models/accountresponse.go index 342de0a..1422a20 100644 --- a/internal/models/accountresponse.go +++ b/internal/models/accountresponse.go @@ -2,19 +2,14 @@ package models import ( "encoding/json" - "time" + ) - -type trackStatusResponse struct { +type AccountResponse 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"` - } + CustodialId json.Number `json:"custodialId"` + PublicKey string `json:"publicKey"` + TrackingId string `json:"trackingId"` } `json:"result"` } \ No newline at end of file diff --git a/internal/models/balanceresponse.go b/internal/models/balanceresponse.go new file mode 100644 index 0000000..57c8e5a --- /dev/null +++ b/internal/models/balanceresponse.go @@ -0,0 +1,12 @@ +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"` +} diff --git a/internal/models/trackstatusresponse.go b/internal/models/trackstatusresponse.go new file mode 100644 index 0000000..6054281 --- /dev/null +++ b/internal/models/trackstatusresponse.go @@ -0,0 +1,20 @@ +package models + +import ( + "encoding/json" + "time" +) + + +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"` +} \ No newline at end of file