Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions api/swagger/swagger-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6190,6 +6190,11 @@ components:
type: string
description: The ID of the user associated with the coin
example: "7eP5n"
logo_uri:
type: string
nullable: true
description: URL to the coin's logo image
example: "https://example.com/logo.png"
has_discord:
type: boolean
description: Whether the coin has a Discord server
Expand Down Expand Up @@ -6233,6 +6238,11 @@ components:
type: integer
description: The number of decimals for the coin
example: 8
logo_uri:
type: string
nullable: true
description: URL to the coin's logo image
example: "https://example.com/logo.png"
balance:
type: integer
description: The total balance of the coin in the user's account (in wei)
Expand Down
2 changes: 2 additions & 0 deletions api/v1_users_coin.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func (app *ApiServer) v1UsersCoin(c *fiber.Ctx) error {
artist_coins.decimals,
artist_coins.has_discord,
artist_coins.user_id AS owner_id,
artist_coins.logo_uri,
COALESCE(balances_by_mint.balance, 0) AS balance,
COALESCE((balances_by_mint.balance * COALESCE(stats.price, pools.price_usd)) / POWER(10, artist_coins.decimals), 0) AS balance_usd,
COALESCE(
Expand Down Expand Up @@ -109,6 +110,7 @@ func (app *ApiServer) v1UsersCoin(c *fiber.Ctx) error {
artist_coins.mint,
artist_coins.decimals,
artist_coins.user_id,
artist_coins.logo_uri,
balances_by_mint.balance,
stats.price,
pools.price_usd
Expand Down
2 changes: 2 additions & 0 deletions api/v1_users_coins.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type UserCoin struct {
Decimals int `json:"decimals"`
HasDiscord bool `json:"has_discord"`
OwnerID trashid.HashId `json:"owner_id"`
LogoUri *string `json:"logo_uri"`
Balance float64 `json:"balance"`
BalanceUSD float64 `json:"balance_usd"`
}
Expand Down Expand Up @@ -68,6 +69,7 @@ func (app *ApiServer) v1UsersCoins(c *fiber.Ctx) error {
artist_coins.decimals,
artist_coins.has_discord,
artist_coins.user_id AS owner_id,
artist_coins.logo_uri,
COALESCE(balances_by_mint.balance, 0) AS balance,
(COALESCE(balances_by_mint.balance, 0) * COALESCE(stats.price, pools.price_usd)) / POWER(10, artist_coins.decimals) AS balance_usd
FROM artist_coins
Expand Down
1 change: 1 addition & 0 deletions api/v1_wallet_coins.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func (app *ApiServer) v1WalletCoins(c *fiber.Ctx) error {
artist_coins.decimals,
artist_coins.has_discord,
artist_coins.user_id AS owner_id,
artist_coins.logo_uri,
COALESCE(balances_by_mint.balance, 0) AS balance,
(COALESCE(balances_by_mint.balance, 0) * COALESCE(stats.price, pools.price_usd)) / POWER(10, artist_coins.decimals) AS balance_usd
FROM artist_coins
Expand Down
Loading