Contribution Staking

API Overview

Connect your application to our blockchain-powered GitHub contribution tracking and staking system. The API provides full integration with user contributions, NFTs, and rewards.

Authentication

All API requests require Bearer authentication using a valid API token.

curl -X POST \ -H "Authorization: Bearer YOUR_API_TOKEN"

User Endpoints

GET /api/user/contributions
Retrieve the user's GitHub contribution history and staking status.
POST /api/user/stake
Lock contributions to start staking. Requires lock duration and contribution IDs.
GET /api/user/rewards
Retrieve staking rewards and earned tokens.

Contribution Endpoints

POST /api/contribution/verify
Validate and register new GitHub contributions for NFT minting.
GET /api/contribution/pending
Retrieve the user's pending contributions awaiting verification.
DELETE /api/contribution/{id}
Cancel a pending contribution before verification.

Staking Endpoints

GET /api/stake/history
Retrieve the user's complete staking activity history.
POST /api/stake/withdraw
Withdraw staked contributions after lock period completes.
GET /api/stake/estimates
Calculate potential rewards based on staking duration and contribution size.

NFT Endpoints

GET /api/nft/metadata/{id}
Retrieve metadata for a specific contribution NFT.
POST /api/nft/export
Export NFT proofs of contribution as JSON files.
GET /api/nft/owned
List all NFTs owned by the authenticated user.

Example Request

POST /api/user/stake

{{
  "contributions": [1234, 5678],
  "lock_duration": "90d",
  "auto_compound": true
}}
                            

Response

{
  "stake_id": "STAK-9876543210",
  "lock_until": "2026-12-25",
  "expected_rewards": "150.25 STAKE_TOKENS",
  "status": "active"
}