Skip to content

Conversation

@tnunamak
Copy link
Member

Summary

Implements the data consumer payment flow, enabling users to request access to datasets, pay for operations, and download results.

Changes

New Consumer Page

  • Added /consume page for data access requests
  • Implements simple state machine: idle → requesting → processing → pending_payment → paying → paid
  • Integrates with Vana Runtime API for operation submission and status polling

SDK Upgrade

  • Updated @opendatalabs/vana-sdk from ^2.0.0 to ^v0.1.0-alpha.e2f8234
  • Adds AccessSettlementController for on-chain payment settlement
  • Adds RuntimePermissionsController for permission management

Payment Settlement

  • Uses sdk.accessSettlement.settlePaymentWithNative() to pay invoices on-chain
  • Polls operation status until payment is required
  • Unlocks artifacts after payment confirmation

Testing

  1. Start vana-runtime with payment monitoring enabled
  2. Create a runtime permission for a dataset
  3. Navigate to /consume page
  4. Submit operation request
  5. Wait for processing to complete
  6. Pay invoice when prompted
  7. Download artifacts after payment settles

Dependencies

  • Requires AccessSettlement contract deployed on Moksha
  • Requires vana-runtime with payment settlement service running
  • Requires vana-task-demo returning finalPrice in responses

Related

  • SDK PR: vana-com/vana-sdk#[number]
  • Design doc: /workspace/mvp-design-v2-final.md

🤖 Generated with Claude Code

- Add /consume page for data access requests and payment
- Update @opendatalabs/vana-sdk to v0.1.0-alpha.e2f8234
- Integrate AccessSettlementController for payment settlement
- Implement simple state machine: request → process → pay → download

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Nov 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
dlp-ui-template Ready Ready Preview Dec 9, 2025 3:58am

@tnunamak tnunamak changed the base branch from main to feat/PRO-768/data-access-v1 November 14, 2025 01:11
- Update PGE_URL to new server: https://7e59ad2764...phala.network
- Remove /api/pge/public-key proxy (no longer needed)
- Call PGE directly from browser (CORS is now enabled)
- Fix ESLint: remove unused derivePgeAddress import
- Update .env.example with new PGE URL

The new PGE deployment has CORS enabled, so browser clients can
call /v1/public-key directly without needing a server-side proxy.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add ESLint disable for walletClient type assertion
- Use vana-app pattern for SDK initialization
- Add address guard to payment handler
- Configure webpack to ignore .devcontainer symlink
- Update task image URL to vanaorg/vana-task-demo
- Remove yarn.lock in favor of package-lock.json

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The .devcontainer symlink is local-only and won't exist in Vercel,
so the webpack ignore config is unnecessary.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add mounted state to prevent hydration mismatch between server and
client when wallet connection state differs.

Fixes React error #418 (hydration mismatch) caused by useAccount()
having different values on server vs client.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add automatic Google OAuth access token refresh to prevent "Invalid
Credentials" errors when tokens expire (after ~1 hour).

Changes:
- Implement refreshAccessToken() function to exchange refresh token
  for new access token
- Track access token expiration time in JWT
- Automatically refresh token when expired
- Update TypeScript types for new session/JWT fields
- Add detailed error logging for Google API calls

Fixes 401 "Invalid Credentials" errors by refreshing expired tokens
before making API calls.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Fix signature verification failure by signing the actual request body
instead of a separate timestamp message.

Issue:
- Frontend was signing: {"permission_id":1,"timestamp":...}
- Runtime was verifying: {"operation_request_json":{...},"permission_id":1}
- Result: Signature mismatch (recovered wrong signer address)

Fix:
- Build request body without signature
- Sign canonical JSON of request body (RFC 8785 format)
- Add signature to request body before sending
- Runtime can now recover correct signer address

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix artifact data structure mapping (top_keywords)
- Update operation status polling endpoint
- Improve error handling with user-friendly messages
- Remove debug logging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Replace `any` type with properly typed ExtendedToken interface that extends JWT.
Add null check for refresh token before using it in URLSearchParams.

This ensures type safety and fixes ESLint no-explicit-any error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Updates start-thinker-task.sh to detect execution mode based on
ORCHESTRATOR_URL env var. Supports both direct runtime connection
and orchestrator-proxied connections with appropriate health checks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add consumer-facing UI for viewing purchased operations and downloading
artifacts with wallet signature authentication. Includes task health
checking and automatic cleanup of stale tasks.

Changes:
- Add operation history view with payment status tracking
- Implement artifact download with signature verification
- Add data visualization for keywords, evolution, and insights
- Add task health check and cleanup logic to startup script
- Handle artifact authentication errors with clear user feedback

Co-Authored-By: Claude <noreply@anthropic.com>
Fix compilation errors preventing Vercel deployment:
- Replace unknown types with any for dynamic JSON data
- Remove unused selectedOperation state variables
- Wrap loadMyOperations in useCallback to fix hooks dependency
- Move hooks before conditional render to follow Rules of Hooks
- Fix payment status conditional to include both pending_payment and paying states

Co-Authored-By: Claude <noreply@anthropic.com>
vercel bot and others added 2 commits December 9, 2025 03:33
Updated dependencies to fix Next.js CVE vulnerabilities.

The fix-react2shell-next tool automatically updated the following packages to their secure versions:
- next
- react-server-dom-webpack
- react-server-dom-parcel  
- react-server-dom-turbopack

All package.json files have been scanned and vulnerable versions have been patched to the correct fixed versions based on the official React advisory.

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
…isor-zeon0a

Fix React Server Components RCE vulnerability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants