Skip to content

Commit

Permalink
addresses issue #97
Browse files Browse the repository at this point in the history
Moves api urls to (.)ENV
set utls to new api.realtoken.community domain (previously api.realt.community)
  • Loading branch information
BenoistP committed Dec 18, 2024
1 parent 81848e4 commit a56d0c1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ To run the project you will need to set-up a `.env` file in the root folder:
```
COMMUNITY_API_KEY=XXXXXXXXXXXX
THEGRAPH_API_KEY=XXXXXXXXXXXX
NEXT_PUBLIC_REALTOKENAPI='https://api.realtoken.community/v1/token'
NEXT_PUBLIC_REALTOKENAPI_HISTORY='https://history.api.realtoken.community/'
```

To get a `COMMUNITY_API_KEY`, join the dedicated [telegram dev channel](https://t.me/+XQyoaFfmN61yk7X0) then ask for.
Expand Down
6 changes: 4 additions & 2 deletions src/pages/api/history/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ const getRealTokenHistory = useCache(
if (!process.env.COMMUNITY_API_KEY) {
throw new Error('Missing COMMUNITY_API_KEY env variable')
}

const response = await fetch('https://history.api.realt.community/', {
if (!process.env.NEXT_PUBLIC_REALTOKENAPI_HISTORY) {
throw new Error('Missing NEXT_PUBLIC_REALTOKENAPI_HISTORY env variable')
}
const response = await fetch(process.env.NEXT_PUBLIC_REALTOKENAPI_HISTORY, {
method: 'GET',
headers: { 'X-AUTH-REALT-TOKEN': process.env.COMMUNITY_API_KEY },
})
Expand Down
6 changes: 4 additions & 2 deletions src/pages/api/properties/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ const getRealTokenList = useCache(
if (!process.env.COMMUNITY_API_KEY) {
throw new Error('Missing COMMUNITY_API_KEY env variable')
}

const response = await fetch('https://api.realt.community/v1/token', {
if (!process.env.NEXT_PUBLIC_REALTOKENAPI) {
throw new Error('Missing NEXT_PUBLIC_REALTOKENAPI env variable')
}
const response = await fetch(process.env.NEXT_PUBLIC_REALTOKENAPI, {
method: 'GET',
headers: { 'X-AUTH-REALT-TOKEN': process.env.COMMUNITY_API_KEY },
})
Expand Down

0 comments on commit a56d0c1

Please sign in to comment.