Skip to content

Commit

Permalink
types.go: Cleanup, remove unused structs and organize the code a bit …
Browse files Browse the repository at this point in the history
…better.
  • Loading branch information
pnx committed Dec 22, 2022
1 parent ed6fc1c commit 9c1c1d0
Showing 1 changed file with 16 additions and 52 deletions.
68 changes: 16 additions & 52 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,58 +17,6 @@ type TokenPair struct {
Data map[string]interface{} `json:"data"`
}

type Log struct {
ID string `json:"log_id"`
TxID string `json:"txid"`
Name string `json:"name"`
Data map[string]interface{} `json:"data"`
CreatedAtBlock string `json:"created_at_block"`
CreatedAtTime UnixTime `json:"created_at_time"`
}

type LogsResponse struct {
APIResponse
Data []Log
}

// Offer types

type ListingOffer struct {
ID string `json:"offer_id"`
Contract string `json:"contract"`
Sender string `json:"sender_name"`
Recipient string `json:"recipient_name"`
Memo string `json:"memo"`
State int64 `json:"state"`
IsSenderContract bool `json:"is_sender_contract"`
IsRecipientContract bool `json:"is_recipient_contract"`

SenderAssets []ListingAsset `json:"sender_assets"`
RecipientAssets []ListingAsset `json:"recipient_assets"`

UpdatedAtBlock string `json:"updated_at_block"`
UpdatedAtTime UnixTime `json:"updated_at_time"`

CreatedAtBlock string `json:"created_at_block"`
CreatedAtTime UnixTime `json:"created_at_time"`
}

// Transfer types

type ListingTransfer struct {
ID string `json:"transfer_id"`
Contract string `json:"contract"`
Sender string `json:"sender_name"`
Recipient string `json:"recipient_name"`
Memo string `json:"memo"`
Assets []ListingAsset `json:"assets"`

CreatedAtBlock string `json:"created_at_block"`
CreatedAtTime UnixTime `json:"created_at_time"`
}

// Price types

type Price struct {
Average string `json:"average"`
MarketContract string `json:"market_contract"`
Expand All @@ -86,3 +34,19 @@ type PriceToken struct {
Symbol string `json:"token_symbol"`
Precision int `json:"token_precision"`
}

// Logs

type Log struct {
ID string `json:"log_id"`
TxID string `json:"txid"`
Name string `json:"name"`
Data map[string]interface{} `json:"data"`
CreatedAtBlock string `json:"created_at_block"`
CreatedAtTime UnixTime `json:"created_at_time"`
}

type LogsResponse struct {
APIResponse
Data []Log
}

0 comments on commit 9c1c1d0

Please sign in to comment.