Skip to content

Add sol wallet signature auth to SDK#14019

Merged
raymondjacobson merged 8 commits intomainfrom
ray/sdk-wallet-auth
Mar 28, 2026
Merged

Add sol wallet signature auth to SDK#14019
raymondjacobson merged 8 commits intomainfrom
ray/sdk-wallet-auth

Conversation

@raymondjacobson
Copy link
Copy Markdown
Member

@raymondjacobson raymondjacobson commented Mar 27, 2026

Add WalletAuth module to @audius/sdk — apps call sdk.walletAuth.setCredential() with a signed credential and the SDK injects X-Solana-* headers into all requests via middleware

import { sdk as audiusSdk } from '@audius/sdk'
const sdk = audiusSdk({ appName: 'MyApp' })
await sdk.solanaWallet.auth(window.solana)
// This track request now knows about the requestor's coin balances, etc.
sdk.tracks.getTrack({ id: '123' })

🤖 Generated with Claude Code

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 27, 2026

⚠️ No Changeset found

Latest commit: 66f0ffb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@raymondjacobson raymondjacobson changed the title Add Solana wallet auth to SDK Add sol wallet signature auth to SDK Mar 27, 2026
raymondjacobson and others added 7 commits March 27, 2026 19:49
Adds a WalletAuth module to @audius/sdk so apps can hand off wallet
credentials (pubkey, message, signature) and have the SDK inject
X-Solana-* headers automatically via middleware. Apps connect wallets
however they want (Phantom, wallet-adapter, etc.) — the SDK owns the
message format and request plumbing but bundles zero wallet dependencies.

The coin-gated example now uses sdk.walletAuth.setCredential() and a
single sdk.tracks.streamTrack() call for both OAuth and wallet auth
paths, removing the manual fetch + header construction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- walletAuth/ (4 files) → solWallet/ (2 files)
- createAuthMessage → createSolWalletSignatureMessage
- addWalletAuthMiddleware → addSolWalletSignatureMiddleware
- sdk.walletAuth → sdk.solWallet
- Strip superfluous comments, add usage example to middleware docstring

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Moves connect + message creation + signing + base58 encoding into
SolanaWallet.auth(provider), so consumers just pass window.solana
(or any wallet adapter). Includes a minimal inline base58 encoder
to avoid adding a dependency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove Authorization guard in SDK middleware so wallet headers
  are sent alongside OAuth tokens (API needs both to merge balances)
- Add walletConnected to useGatedTracks query key so React Query
  refetches after wallet connect instead of serving stale cache

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

🌐 Web preview ready

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

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

@raymondjacobson raymondjacobson merged commit eb9ec12 into main Mar 28, 2026
15 checks passed
@raymondjacobson raymondjacobson deleted the ray/sdk-wallet-auth branch March 28, 2026 04:32
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.

1 participant