Skip to content

Add sol wallet signature auth to SDK#14019

Open
raymondjacobson wants to merge 6 commits intomainfrom
ray/sdk-wallet-auth
Open

Add sol wallet signature auth to SDK#14019
raymondjacobson wants to merge 6 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

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>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 27, 2026

⚠️ No Changeset found

Latest commit: 3768677

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

- 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>
@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 4 commits March 26, 2026 23:20
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>
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