mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-26 23:57:48 +03:00
OP-3735 referrals rating (#87)
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
globalAnalyticsSchema,
|
||||
rewardsClaimedSchema,
|
||||
linkSchema,
|
||||
ratingSchema,
|
||||
} from './schemas/index.js';
|
||||
|
||||
type CreateLinkPayloadType = {
|
||||
@@ -152,6 +153,14 @@ class ReferralSystem {
|
||||
},
|
||||
errorSchema
|
||||
);
|
||||
|
||||
getRating = () =>
|
||||
fetchWithValidation(
|
||||
`${this.apiUrl}/referer/ve/rating-table-leaderboard`,
|
||||
ratingSchema,
|
||||
{},
|
||||
errorSchema
|
||||
);
|
||||
}
|
||||
|
||||
export * as schemas from './schemas/index.js';
|
||||
|
||||
@@ -5,3 +5,4 @@ export { default as miniStatsSchema } from './miniStatsSchema.js';
|
||||
export { default as rewardsMappingSchema } from './rewardsMappingSchema.js';
|
||||
export { default as rewardsClaimedSchema } from './rewardsClaimedSchema.js';
|
||||
export { default as globalAnalyticsSchema } from './globalAnalyticsSchema.js';
|
||||
export { default as ratingSchema } from './ratingSchema.js';
|
||||
|
||||
26
src/services/ReferralSystem/schemas/ratingSchema.ts
Normal file
26
src/services/ReferralSystem/schemas/ratingSchema.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
const ratingSchema = z.object({
|
||||
info: z.object({
|
||||
weekly_boost_budget: z.string(),
|
||||
weekly_boost_budget_fmt: z.number(),
|
||||
time_left_for_the_reward: z.number(),
|
||||
time_left_for_the_reward_local: z.string(),
|
||||
time_left_for_the_reward_utc: z.string(),
|
||||
personal_info: z.any(),
|
||||
}),
|
||||
list: z.array(z.object({
|
||||
rank_id: z.number(),
|
||||
wallet: z.string(),
|
||||
staked_ve_orn: z.string(),
|
||||
staked_ve_orn_fmt: z.number(),
|
||||
weighted_volume: z.string(),
|
||||
weighted_volume_fmt: z.number(),
|
||||
total_weight: z.string(),
|
||||
total_weight_fmt: z.number(),
|
||||
reward: z.string(),
|
||||
reward_fmt: z.number()
|
||||
})),
|
||||
});
|
||||
|
||||
export default ratingSchema;
|
||||
Reference in New Issue
Block a user