Skip to content

Latest commit

 

History

History
189 lines (154 loc) · 3.22 KB

api.md

File metadata and controls

189 lines (154 loc) · 3.22 KB

Bitgreen API Documentation

Serve API via command npm run api, API endpoint will be available at localhost:port, where port is defined in .env file. Default port: 3000


Base Endpoint

http://localhost:3000/

Search Transactions by Account and Date

http://localhost:3000/transactions

Params:

account: account of sender or recipient
date_start: date of transaction seen on chain (optional)
date_end: date of transaction seen on chain (optional)

Get Transaction by Hash

http://localhost:3000/transaction

Params:

hash: transaction hash you want to retrieve

Get All Assets

Returns all assets

http://localhost:3000/assets

Get Specific Asset

Returns asset by asset id or project id.

http://localhost:3000/asset

Params:

asset_id: asset id
project_id: project id

Get Assets Transactions

Returns all asset transactions. You can use asset_id or project_id to filter them out. Field project_id is ignored when asset_id is specified.

http://localhost:3000/assets/transactions

Params:

asset_id: asset id
project_id: project id
account: account of sender or recipient
date_start: date of transaction seen on chain (optional)
date_end: date of transaction seen on chain (optional)

Get Asset Transaction by Hash

http://localhost:3000/assets/transaction

Params:

hash: transaction hash you want to retrieve

Get Impact Actions

Returns all impact actions

http://localhost:3000/impact_actions

Get Impact Actions - Auditors

Returns all auditors

http://localhost:3000/impact_actions/auditors

Get Impact Actions - Categories

Returns all categories

http://localhost:3000/impact_actions/categories

Get Impact Actions - Oracles

Returns all oracles

http://localhost:3000/impact_actions/oracles

Get Impact Actions - Proxies

Returns all proxies

http://localhost:3000/impact_actions/proxy

Get Impact Actions - Approval Requests

Returns all approval requests

http://localhost:3000/impact_actions/approval_requests

Get Impact Actions - Approval Request By ID

Returns approval request

http://localhost:3000/impact_actions/approval_request

Params:

approval_request_id: approval request id

Get Impact Actions - Approval Requests - Auditors

Returns all auditors for given approval request

http://localhost:3000/impact_actions/approval_requests/auditors

Params:

approval_request_id: approval request id

Get Impact Actions - Approval Requests - Auditors - Votes

Returns all votes for given approval request

http://localhost:3000/impact_actions/approval_requests/auditors/votes

Params:

approval_request_id: approval request id

Analyze Data

Returns all possible sections/methods fetched from a chain.

http://localhost:3000/analyze-data

Params:

section: name of section to search for (optional)

Get Block Data

Get block data directly from a chain.

http://localhost:3000/get-block

Params:

block_number: block number to fetch