This is the staking API of a custodial CNFT staking system that allows checking for wallet rewards and starting a reward claim session. This API may be wallet by a website that allows the user to check the reward balance and initiate a clim session. The number of tokens a wallet can claim is calculated based on the elapsed time since the last claim and the defined daily reward rate for the asset. The system uses the Blockfrost API to query the wallet balance and ADA handle. The created claim sessions may be processed by the Cardano Worker server. A connection to a shared MongoDB instance is required.
DATABASE_URL
- MongoDB Connection StringBLOCKFROST_API_KEY
- Blockfrost API key
StakeAsset
represents a CNFT with a defined daily reward rate that is eligible for staking.StakeClaim
represents a initiates claim session by the wallet holderStakeReward
represents the token that can be claimed as staking reward
GET /status
Check the server statusPOST /rewards
Returns the available rewards for a given wallet addressPOST /claim
Creates a new claim session with the requested assetsGET /claim
Returns information about a claim session with a given sessionId
Run the server with node app.js