Skip to content

Auto-follow artist on coin purchase#14091

Merged
dylanjeffers merged 2 commits intomainfrom
claude/auto-follow-artist-purchase-IxZtA
Apr 10, 2026
Merged

Auto-follow artist on coin purchase#14091
dylanjeffers merged 2 commits intomainfrom
claude/auto-follow-artist-purchase-IxZtA

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

This PR adds functionality to automatically follow an artist when a user purchases their coin through the Jupiter swap interface.

Key Changes

  • Added autoFollowArtistOnCoinPurchase function that:

    • Fetches the artist coin metadata after a successful swap
    • Resolves the coin's owner (artist)
    • Automatically follows the artist if the user isn't already following them
    • Gracefully handles errors and skips non-artist coins
  • Integrated auto-follow logic into the useSwapCoins hook's onSuccess callback to trigger after successful coin purchases

  • Added ARTIST_COIN_PURCHASE to the FollowSource enum in Analytics to track the source of these auto-follows

  • Added necessary imports and dependencies:

    • useDispatch from react-redux
    • useFollowUser hook for executing the follow action
    • coinFromSdk adapter for coin data transformation
    • NON_ARTIST_COIN_MINTS constant to filter out non-artist coins
    • getArtistCoinQueryFn for fetching coin metadata
    • entityCacheOptions for query configuration

Implementation Details

  • The auto-follow is non-blocking and wrapped in error handling to prevent swap failures
  • Skips execution if the output mint is not an artist coin or if the user already follows the artist
  • Uses the existing query client to fetch coin data and check follow status
  • Reports any errors to Sentry for monitoring

https://claude.ai/code/session_01E5VEqdyb3VyG6cicnNRzgd

When a user successfully buys an artist coin via the Jupiter swap flow,
look up the coin's owner and follow that artist if the user doesn't already
follow them. Tagged as a new FollowSource.ARTIST_COIN_PURCHASE for analytics.

https://claude.ai/code/session_01E5VEqdyb3VyG6cicnNRzgd
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 9, 2026

🦋 Changeset detected

Latest commit: 2e53b84

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@audius/common Patch
@audius/mobile Patch
@audius/web Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

🌐 Web preview ready

Preview URL: https://audius-web-preview-pr-14091.audius.workers.dev

Unique preview for this PR (deployed from this branch).
Workflow run

@dylanjeffers dylanjeffers merged commit 44dba8d into main Apr 10, 2026
14 checks passed
@dylanjeffers dylanjeffers deleted the claude/auto-follow-artist-purchase-IxZtA branch April 10, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants