-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from JustaName-id/develop
Develop
- Loading branch information
Showing
438 changed files
with
18,408 additions
and
741 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { NextRequest } from 'next/server'; | ||
import axios from 'axios'; | ||
|
||
interface QueryParams { | ||
address: string; | ||
} | ||
|
||
export async function GET(req: NextRequest & { query: QueryParams }) { | ||
const { searchParams } = req.nextUrl; | ||
const address = searchParams.get('address'); | ||
|
||
if (!address) { | ||
return new Response('Address is required', { status: 400 }); | ||
} | ||
|
||
let poaps = []; | ||
|
||
try { | ||
const response = await axios.get( | ||
`https://api.poap.tech/actions/scan/${address}`, | ||
{ | ||
headers: { | ||
Accept: 'application/json', | ||
'x-api-key': process.env.POAP_API_KEY, | ||
}, | ||
} | ||
); | ||
poaps = response.data; | ||
} catch (error) { | ||
console.error('Error fetching POAPs', error); | ||
return new Response('Error fetching POAPs', { status: 500 }); | ||
} | ||
|
||
return new Response(JSON.stringify(poaps), { | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { NextRequest } from 'next/server'; | ||
import axios from 'axios'; | ||
|
||
interface QueryParams { | ||
address: string; | ||
} | ||
|
||
export async function GET(req: NextRequest & { query: QueryParams }) { | ||
const { searchParams } = req.nextUrl; | ||
const address = searchParams.get('address'); | ||
|
||
if (!address) { | ||
return new Response('Address is required', { status: 400 }); | ||
} | ||
|
||
let credentials; | ||
|
||
try { | ||
const response = await axios.get( | ||
`https://api.talentprotocol.com/api/v2/passport_credentials?passport_id=${address}`, | ||
{ | ||
headers: { | ||
Accept: 'application/json', | ||
'x-api-key': process.env.TALENT_PROTOCOL_API_KEY, | ||
}, | ||
} | ||
); | ||
credentials = response.data; | ||
} catch (error) { | ||
console.error('Error fetching POAPs', error); | ||
return new Response('Error fetching Credentials', { status: 500 }); | ||
} | ||
|
||
return new Response(JSON.stringify(credentials), { | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { NextRequest } from 'next/server'; | ||
import axios from 'axios'; | ||
|
||
interface QueryParams { | ||
address: string; | ||
} | ||
|
||
export async function GET(req: NextRequest & { query: QueryParams }) { | ||
const { searchParams } = req.nextUrl; | ||
const address = searchParams.get('address'); | ||
|
||
if (!address) { | ||
return new Response('Address is required', { status: 400 }); | ||
} | ||
|
||
let passport; | ||
|
||
try { | ||
const response = await axios.get( | ||
`https://api.talentprotocol.com/api/v2/passports/${address}`, | ||
{ | ||
headers: { | ||
Accept: 'application/json', | ||
'x-api-key': process.env.TALENT_PROTOCOL_API_KEY, | ||
}, | ||
} | ||
); | ||
passport = response.data; | ||
} catch (error) { | ||
console.error('Error fetching POAPs', error); | ||
return new Response('Error fetching Passport', { status: 500 }); | ||
} | ||
|
||
return new Response(JSON.stringify(passport), { | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.