diff --git a/api/swagger/swagger-v1-full.yaml b/api/swagger/swagger-v1-full.yaml index 621d34f8..60af91f7 100644 --- a/api/swagger/swagger-v1-full.yaml +++ b/api/swagger/swagger-v1-full.yaml @@ -6315,6 +6315,10 @@ components: type: string description: The user ID of the coin owner example: "7eP5n" + escrow_recipient: + type: string + description: The escrow recipient address for custom-created coins without DBCs + example: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263" coin_response: type: object properties: diff --git a/api/swagger/swagger-v1.yaml b/api/swagger/swagger-v1.yaml index 9dd296ba..ba4da9d5 100644 --- a/api/swagger/swagger-v1.yaml +++ b/api/swagger/swagger-v1.yaml @@ -5640,6 +5640,10 @@ components: type: string description: The ID of the user associated with the coin example: "7eP5n" + escrow_recipient: + type: string + description: The escrow recipient address for custom-created coins without DBCs + example: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263" logo_uri: type: string description: URL to the coin's logo image diff --git a/api/v1_coins.go b/api/v1_coins.go index a5144989..9876d951 100644 --- a/api/v1_coins.go +++ b/api/v1_coins.go @@ -10,21 +10,22 @@ import ( ) type ArtistCoin struct { - Name string `json:"name"` - Ticker string `json:"ticker"` - Mint string `json:"mint"` - Decimals int `json:"decimals"` - OwnerId trashid.HashId `db:"user_id" json:"owner_id"` - LogoUri *string `json:"logo_uri,omitempty"` - BannerImageUrl *string `json:"banner_image_url,omitempty"` - Description *string `json:"description,omitempty"` - Link1 *string `json:"link_1,omitempty"` - Link2 *string `json:"link_2,omitempty"` - Link3 *string `json:"link_3,omitempty"` - Link4 *string `json:"link_4,omitempty"` - HasDiscord bool `json:"has_discord"` - CreatedAt time.Time `json:"created_at"` - CoinUpdatedAt time.Time `json:"coin_updated_at"` + Name string `json:"name"` + Ticker string `json:"ticker"` + Mint string `json:"mint"` + Decimals int `json:"decimals"` + OwnerId trashid.HashId `db:"user_id" json:"owner_id"` + EscrowRecipient *string `json:"escrow_recipient,omitempty"` + LogoUri *string `json:"logo_uri,omitempty"` + BannerImageUrl *string `json:"banner_image_url,omitempty"` + Description *string `json:"description,omitempty"` + Link1 *string `json:"link_1,omitempty"` + Link2 *string `json:"link_2,omitempty"` + Link3 *string `json:"link_3,omitempty"` + Link4 *string `json:"link_4,omitempty"` + HasDiscord bool `json:"has_discord"` + CreatedAt time.Time `json:"created_at"` + CoinUpdatedAt time.Time `json:"coin_updated_at"` MarketCap float64 `json:"marketCap" db:"market_cap"` FDV float64 `json:"fdv" db:"fdv"` @@ -106,6 +107,7 @@ const sharedSelectCoinSql = ` artist_coins.ticker, artist_coins.decimals, artist_coins.user_id, + earliest_escrow.recipient as escrow_recipient, artist_coins.logo_uri, artist_coins.banner_image_url, artist_coins.description, @@ -209,6 +211,12 @@ const sharedSelectCoinSql = ` ORDER BY created_at ASC LIMIT 1 ) AS reward_pool ON true + LEFT JOIN ( + SELECT DISTINCT ON (token_mint) token_mint, recipient + FROM sol_locker_vesting_escrows + ORDER BY token_mint, created_at ASC + ) AS earliest_escrow + ON earliest_escrow.token_mint = artist_coins.mint ` type GetArtistCoinsQueryParams struct {