The new and improved version of the CityCoins API, developed to work with the CityCoins Protocol contracts.
The base URL is https://protocol.citycoins.co/api/
The URLs are formatted: contract-name/function-name?param1=x¶m2=y
Function and parameter names match the contract function definitions.
Responses include:
status: 400
for missing parameters andstatus: 404
if a none value is returned, or if there is an issue with the querystatus: 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
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?
- note: matches Stacks reward cycles now!
- https://protocol.citycoins.co/api/ccd007-citycoin-stacking/get-current-reward-cycle
ccd011-stacking-payouts: Who is the pool operator?
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/