mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 14:12:35 +03:00
all time leaderboard
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.20.57",
|
||||
"version": "0.20.59",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.20.57",
|
||||
"version": "0.20.59",
|
||||
"hasInstallScript": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.20.58",
|
||||
"version": "0.20.59",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "./lib/index.cjs",
|
||||
"module": "./lib/index.js",
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
aggregatedHistorySchema,
|
||||
inviteCodeLinkSchema,
|
||||
contractsAddressesSchema,
|
||||
allTimeLeadersSchema,
|
||||
} from './schemas/index.js';
|
||||
import type { SupportedChainId } from '../../types.js';
|
||||
|
||||
@@ -71,6 +72,7 @@ class ReferralSystem {
|
||||
this.claimRewards = this.claimRewards.bind(this);
|
||||
this.getLeaderboard = this.getLeaderboard.bind(this);
|
||||
this.getLeaderboardSingleChain = this.getLeaderboardSingleChain.bind(this);
|
||||
this.getAllTimeLeaders = this.getAllTimeLeaders.bind(this);
|
||||
this.getContractsAddresses = this.getContractsAddresses.bind(this);
|
||||
this.getClaimInfo = this.getClaimInfo.bind(this);
|
||||
this.getAggregatedHistory = this.getAggregatedHistory.bind(this);
|
||||
@@ -231,6 +233,19 @@ class ReferralSystem {
|
||||
errorSchema
|
||||
);
|
||||
|
||||
getAllTimeLeaders = (refererAddress: string | undefined) =>
|
||||
fetchWithValidation(
|
||||
`${this.apiUrl}/referer/ve/leaderboard-lifetime`,
|
||||
ratingSchema,
|
||||
{
|
||||
headers:
|
||||
refererAddress !== undefined
|
||||
? { 'referer-address': refererAddress }
|
||||
: {},
|
||||
},
|
||||
allTimeLeadersSchema
|
||||
);
|
||||
|
||||
getContractsAddresses = () =>
|
||||
fetchWithValidation(
|
||||
`${this.apiUrl}/referer/view/contracts`,
|
||||
|
||||
11
src/services/ReferralSystem/schemas/allTimeLeadersSchema.ts
Normal file
11
src/services/ReferralSystem/schemas/allTimeLeadersSchema.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
const allTimeLeadersSchema = z.array(z.object({
|
||||
wallet: z.string(),
|
||||
total_earnings_fmt: z.number(),
|
||||
referrals_count_fmt: z.number(),
|
||||
total_trades_fmt: z.number(),
|
||||
weekly_earnings_fmt: z.number(),
|
||||
}));
|
||||
|
||||
export default allTimeLeadersSchema;
|
||||
@@ -10,3 +10,4 @@ export { default as claimInfoSchema } from './claimInfoSchema.js';
|
||||
export { default as aggregatedHistorySchema } from './aggregatedHistorySchema.js';
|
||||
export { default as contractsAddressesSchema } from './contractsAddressesSchema.js';
|
||||
export { default as inviteCodeLinkSchema } from './inviteCodeLinkSchema.js';
|
||||
export { default as allTimeLeadersSchema } from './allTimeLeadersSchema.js';
|
||||
|
||||
Reference in New Issue
Block a user