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
4 changes: 4 additions & 0 deletions api/swagger/swagger-v1-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions api/swagger/swagger-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 23 additions & 15 deletions api/v1_coins.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down