anchor verified build uses apr.dev (#26655)

Co-authored-by: Arrowana <8245419+Arrowana@users.noreply.github.com>
This commit is contained in:
Pierre 2022-08-01 20:17:32 +10:00 committed by GitHub
parent 00ce805788
commit ac915776c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -74,10 +74,10 @@ export interface AnchorBuild {
* last verified build. * last verified build.
*/ */
export async function getAnchorVerifiableBuild( export async function getAnchorVerifiableBuild(
programId: PublicKey, programId: PublicKey
limit: number = 5
): Promise<VerifiableBuild> { ): Promise<VerifiableBuild> {
const url = `https://anchor.projectserum.com/api/v0/program/${programId.toString()}/latest?limit=${limit}`; const programIdBase58 = programId.toBase58();
const url = `https://api.apr.dev/api/v0/program/${programIdBase58}/latest?limit=5`;
const latestBuildsResp = await fetch(url); const latestBuildsResp = await fetch(url);
// Filter out all non successful builds. // Filter out all non successful builds.
@ -96,7 +96,7 @@ export async function getAnchorVerifiableBuild(
...defaultAnchorBuild, ...defaultAnchorBuild,
verified_slot, verified_slot,
id, id,
url: `https://anchor.projectserum.com/build/${id}`, url: `https://apr.dev/program/${programIdBase58}/build/${id}`,
}; };
} }