Skip to main content

Achievo Back-End Integration Documentation

Overview

This document provides guidelines for back-end developers to integrate with the Achievo service. The process is streamlined as it only requires the use of an API key provided by Achievo.

Warning: Security of Private Keys

DANGER: Never expose your private key to the front-end. It is crucial to keep the private key secure and only use it in the back-end to maintain the integrity and security of your application.

Integration Process

Integrating with Achievo in the back-end is straightforward and does not require a login process. Use the API key provided by Achievo directly for authentication.

Example: Fetching Randomness Data

The following JavaScript example demonstrates how to fetch randomness data using Axios:

const getRandomness = async () => {
const {
data: { randomData, nonce, signature, decodedItems },
} = await axios.post(
`${ACHIEVO_BASE_URL}/v1/vrf/randomness/signature/items/${userAddress}`,
{
layers: [{ dataQty: 1 }],
decode: true,
},
{
headers: { Authorization: ACHIEVO_API_KEY },
}
);
return { randomData, nonce, signature, decodedItems };
};

Summary

To use Achievo's services in the back-end:

  1. Utilize the API key provided by Achievo for authentication.
  2. Ensure that any private keys or sensitive information are never exposed or sent to the front-end.
  3. The provided example demonstrates how to make an API call to retrieve randomness data securely.
  4. This documentation provides the essential steps for back-end developers to securely integrate with Achievo's services.

Request schema:

This is the Zod schema to use the layers:

  body: z.object({
layers: z
.array(
z.object({
dataQty: z.number().optional(),
tier: z.nativeEnum(TierNumber).optional(),
tiers: z.array(z.nativeEnum(TierNumber)).optional(),
level: z.number().min(0).optional(),
levels: z.array(z.number().min(0)).optional(),
category: z.number().optional(),
collection: z.string().optional(),
collections: z.array(z.string()).optional(),
excludeCategories: z.array(z.number()).min(1).optional(),
})
)
.min(1),
decode: z.boolean().optional().default(false),
}),
params: z.object({
address: z.string(),
}),
headers: HeaderJWT,

Supported tiers:

enum TierNumber {
COMMON, // 0
UNCOMMON, // 1
RARE, // 2
LEGENDARY, // 3
MYTHICAL, // 4
CELESTIAL, // 5
ARCANE, // 6
ETHEREAL, // 7
}