Giter Site home page Giter Site logo

cf-cardano-staking-api's Introduction

cf-cardano-staking-api

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.

Environment variables

  • DATABASE_URL - MongoDB Connection String
  • BLOCKFROST_API_KEY - Blockfrost API key

Models

  • StakeAsset represents a CNFT with a defined daily reward rate that is eligible for staking.
  • StakeClaim represents a initiates claim session by the wallet holder
  • StakeReward represents the token that can be claimed as staking reward

Endpoints

  • GET /status Check the server status
  • POST /rewards Returns the available rewards for a given wallet address
  • POST /claim Creates a new claim session with the requested assets
  • GET /claim Returns information about a claim session with a given sessionId

Running the system

Run the server with node app.js

cf-cardano-staking-api's People

Contributors

steffenkeller avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.