[SDK Example] Add coin-gated text posts to coin-gated web example#14252
Open
dylanjeffers wants to merge 1 commit intomainfrom
Open
[SDK Example] Add coin-gated text posts to coin-gated web example#14252dylanjeffers wants to merge 1 commit intomainfrom
dylanjeffers wants to merge 1 commit intomainfrom
Conversation
Extends the coin-gated example to also fetch and display members-only fan-club text posts via `sdk.comments.getFanClubFeed`. Verifies that when a Solana wallet holding the artist coin is connected through the SDK, the API decrypts members-only post bodies via X-Solana-* headers. - App.tsx: `useFanClubPosts` hook keyed on wallet pubkey + userId so connecting/disconnecting refetches; renders a Members-only/Public badge plus Access granted/Locked indicator per post. - index.css: styles for the new post list. - README: adds verification walkthrough and getFanClubFeed reference. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Contributor
🌐 Web preview readyPreview URL: https://audius-web-preview-pr-14252.audius.workers.dev Unique preview for this PR (deployed from this branch). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the existing
packages/web/examples/coin-gated/Vite/React example to also fetch and display coin-gated fan-club text posts, so devs can verify that connecting a Solana wallet through the SDK correctly decrypts members-only post bodies for holders of the artist's coin.useFanClubPostshook callingsdk.comments.getFanClubFeed({ mint, userId, sortMethod: 'newest' }), query key includeswalletPubkeyso connect/disconnect refetches automatically. UI shows aMembers-only/Publicbadge plus anAccess granted/Lockedindicator per post; locked posts render a placeholder, unlocked ones render the full message body.getFanClubFeed/X-Solana-Walletfor SDK search.The relevant SDK plumbing already exists:
sdk.solanaWallet.auth(provider)stores{publicKey, message, signature}andaddSolanaWalletSignatureMiddlewareinjectsX-Solana-Wallet/X-Solana-Message/X-Solana-Signatureon every request, which the API uses to gate fan-club content by holdings (CommentsAPI.getFanClubFeed: "API enforces holder gate").Test plan
npm install && npm run build -w @audius/sdk, thencd packages/web/examples/coin-gated && cp .env .env.local(setVITE_AUDIUS_API_KEY),npm install,npm run dev-> opens http://localhost:5178YAK)🤖 Generated with Claude Code