Giter Site home page Giter Site logo

citycoins / protocol-api Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 530 KB

An API to interact with Stacks and CityCoin on-chain data.

Home Page: https://protocol.citycoins.co/api

License: MIT License

TypeScript 92.89% HTML 4.33% CSS 2.78%
api cloudflare stacks citycoins

protocol-api's Introduction

CityCoins Protocol API

The new and improved version of the CityCoins API, developed to work with the CityCoins Protocol contracts.

Endpoints

The base URL is https://protocol.citycoins.co/api/

The URLs are formatted: contract-name/function-name?param1=x&param2=y

Function and parameter names match the contract function definitions.

Responses include:

  • status: 400 for missing parameters and
  • status: 404 if a none value is returned, or if there is an issue with the query
  • status: 200 returns data as JSON strings (formats coming soon)
    • single values are returned as-is: number, string, and boolean
    • object types are defined in lib/api-helpers.ts

Examples

base-dao: What block height was ccip012-bootstrap executed at?

ccd001-direct-execute: Is the address SP7DGES13508FHRWS1FB0J3SZA326FP6QRMB6JDE an approver?

ccd002-treasury: What is the balance of the ccd002-treasury-mia-mining contract?

ccd003-user-registry: What is the user ID for SP7DGES13508FHRWS1FB0J3SZA326FP6QRMB6JDE?

ccd004-city-registry: What is the city ID for MIA?

ccd005-city-data: What are the city activation details and treasury info for MIA?

ccd006-citycoin-mining: What are the mining stats at block 87,000?

ccd007-citycoin-stacking: What is the current reward cycle?

ccd011-stacking-payouts: Who is the pool operator?

Development

To run locally:

npm install
npm run build
npx wrangler pages dev dist/

Or as a one-liner:

npm run build && npx wrangler pages dev dist/

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.