The API that powers WeaverFi.
Learn more about our API and manage your API keys here.
WeaverFi's OpenAPI documentation can be found here.
Contribution guidelines can be found here.
This repository is already setup for Firebase hosting, but could easily be adapted to be deployed on any other cloud deployment service.
Currently the API also uses many other cloud functions to manage token prices, API key caching, etc. but those can be easily disabled.
-
Install dependencies by navigating to the
functions
folder and usingnpm i
. -
Add your project ID in
.firebaserc
(an example file is provided). -
Change any settings to your liking in
index.ts
. -
Optionally, whitelist any origins to be exempt from rate limits in
.env
(an example file is provided). -
To deploy to Firebase, use
firebase deploy
.
Note: The API is currently configured through getKeyInfo()
in functions.ts
to only validate keys with a chain identifier appended to it. Modify that function if your implementation is different!