diff --git a/api/swagger/swagger-v1.yaml b/api/swagger/swagger-v1.yaml index f2456571..63d9a0ed 100644 --- a/api/swagger/swagger-v1.yaml +++ b/api/swagger/swagger-v1.yaml @@ -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 @@ -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) diff --git a/api/v1_users_coin.go b/api/v1_users_coin.go index 3d367035..688e5986 100644 --- a/api/v1_users_coin.go +++ b/api/v1_users_coin.go @@ -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( @@ -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 diff --git a/api/v1_users_coins.go b/api/v1_users_coins.go index 6ebf47e4..13d14f8a 100644 --- a/api/v1_users_coins.go +++ b/api/v1_users_coins.go @@ -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"` } @@ -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 diff --git a/api/v1_wallet_coins.go b/api/v1_wallet_coins.go index d9265aa6..45ae21e8 100644 --- a/api/v1_wallet_coins.go +++ b/api/v1_wallet_coins.go @@ -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