feat / Add execute-tx endpoint with Privy wallet integration#618
Draft
fengtality wants to merge 4 commits intodevelopmentfrom
Draft
feat / Add execute-tx endpoint with Privy wallet integration#618fengtality wants to merge 4 commits intodevelopmentfrom
fengtality wants to merge 4 commits intodevelopmentfrom
Conversation
Adds a generic execute-tx endpoint for executing transaction payloads from external APIs (like USDM). Includes full Privy server wallet integration for both Solana and Ethereum chains. New features: - POST /chains/solana/execute-tx endpoint - POST /chains/ethereum/execute-tx endpoint - Privy wallet management (add/remove routes) - Support for serialized transactions, instructions arrays, and single instruction (ix) format for USDM compatibility - Hardware wallet (Ledger), Privy, and local wallet signing Files created: - src/chains/solana/routes/execute-tx.ts - src/chains/ethereum/routes/execute-tx.ts - src/schemas/execute-tx-schema.ts - src/wallet/privy/privy-client.ts - src/wallet/privy/privy-evm-signer.ts - src/wallet/privy/privy-solana-signer.ts - src/wallet/routes/addPrivyWallet.ts - src/wallet/routes/removePrivyWallet.ts - test/chains/solana/routes/execute-tx.test.ts Files modified: - src/app.ts (register sensible globally) - src/chains/solana/schemas.ts (add execute-tx schemas) - src/chains/solana/solana.ts (add isPrivyWallet method) - src/chains/ethereum/ethereum.ts (add isPrivyWallet method) - src/wallet/utils.ts (add Privy wallet utilities) - src/templates/apiKeys.yml (add Privy credentials) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Addresses CodeQL security finding by: - Adding validateWalletId() function to validate wallet IDs contain only alphanumeric characters, hyphens, and underscores - Rejecting wallet IDs with path traversal or URL manipulation chars - Adding encodeURIComponent() as additional defense in depth - Adding length limit to prevent abuse Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The @fastify/sensible plugin returns error names like 'InternalServerError' instead of 'Internal Server Error'. Updated test to accept both formats. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
Author
|
@rapcmia this PR needs more work before it's ready. Moving to v2.15 |
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
execute-txendpoint for executing transaction payloads from external APIs (like USDM)New Endpoints
Execute Transaction
POST /chains/solana/execute-tx- Execute Solana transactionsPOST /chains/ethereum/execute-tx- Execute Ethereum transactionsPrivy Wallet Management
POST /wallet/add-privy- Register a Privy walletDELETE /wallet/remove-privy- Unregister a Privy walletFeatures
Request Format (Solana)
{ "network": "mainnet-beta", "walletAddress": "...", "ix": { "keys": [{"pubkey": "...", "isSigner": true, "isWritable": true}], "programId": "...", "data": "base64..." } }Or with instructions array:
{ "instructions": [...] }Or with serialized transaction:
{ "serializedTx": "base64..." }Test plan
🤖 Generated with Claude Code