Skip to content

About

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

Topics

Resources

Code of conduct

Contributing

Stars

1 star

Watchers

3 watching

Forks

Repository files navigation

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/

About

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

Topics

Resources

Code of conduct

Contributing

Stars

1 star

Watchers

3 watching

Forks

Releases

Used by

Contributors

Languages