feat: add OWS (Open Wallet Standard) as x402 payment provider#390
Open
arein wants to merge 4 commits intonansen-ai:mainfrom
Open
feat: add OWS (Open Wallet Standard) as x402 payment provider#390arein wants to merge 4 commits intonansen-ai:mainfrom
arein wants to merge 4 commits intonansen-ai:mainfrom
Conversation
Enables nansen-cli to auto-pay x402 API calls using OWS wallets. OWS signs internally (no private key export) via EIP-712 typed data for EVM and SPL TransferChecked for Solana. Falls back gracefully when OWS is not installed. Provider chain: Privy → Local → OWS → WalletConnect Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Strip 0x prefix from Solana signature hex before Buffer.from - Add comment explaining OWS extract_signable_bytes for full-tx signing - Normalize log prefix to [x402] OWS: (matching codebase convention) - Gate signing failure log behind DEBUG (matching Privy pattern) - Add debug logging for wallet resolution and signing status - Add debug logging for _x402Retry payment rejection - Remove dead make402Response test helper Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove all process.env.DEBUG logging - Revert DEBUG logging added to _x402Retry in api.js - Remove section dividers, reduce from 254 to 187 lines - Fix double base64 decode in Solana path - Add ed25519 signature length validation - Consistent resource shape between EVM and Solana payloads - Use options objects instead of 6 positional params - Inline resolveOwsPassphrase() one-liner - Remove 2 broken tests, dead code, unnecessary comments Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
New files
src/x402-ows.js— SDK loading (viacreateRequirefrom globalnode_modules), wallet discovery, EVM/Solana signing, async generatorsrc/__tests__/x402-ows.test.js— 19 tests covering SDK loading, wallet resolution, EVM signing, Solana signing, priority orderingModified files
src/api.js— 10-line insertion between local wallet and WalletConnect in the 402 handlerEnvironment variables
OWS_WALLETOWS_PASSPHRASEnull(unencrypted only)Test plan
OWS_WALLET=agent-treasury nansen token info --address 0x... --chain ethereumtriggers x402 → OWS signing🤖 Generated with Claude Code