mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
update
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import {
|
||||
environmentResponseSchema,
|
||||
getPointsAtResponseSchema,
|
||||
getPointsInfoResponseSchema,
|
||||
getPoolResponseSchema,
|
||||
listAmountResponseSchema,
|
||||
listNFTOrderResponseSchema,
|
||||
@@ -53,12 +52,6 @@ type VeORNInfoPayload = BasePayload & {
|
||||
params: [string]
|
||||
};
|
||||
|
||||
type GetPointsInfoPayload = BasePayload & {
|
||||
model: 'veORN'
|
||||
method: 'pointsInfo'
|
||||
params: [string]
|
||||
};
|
||||
|
||||
type GetPointsAtPayload = BasePayload & {
|
||||
model: 'veORN'
|
||||
method: 'pointsInfo'
|
||||
@@ -82,7 +75,6 @@ type Payload =
|
||||
| GetPoolInfoPayload
|
||||
| ListPoolPayload
|
||||
| VeORNInfoPayload
|
||||
| GetPointsInfoPayload
|
||||
| GetPointsAtPayload
|
||||
| ListAmountPayload
|
||||
| GetAmountByORNPayload;
|
||||
@@ -108,7 +100,6 @@ class IndexerService {
|
||||
this.poolV2Info = this.poolV2Info.bind(this);
|
||||
this.listPoolV3 = this.listPoolV3.bind(this);
|
||||
this.veORNInfo = this.veORNInfo.bind(this);
|
||||
this.getPointsInfo = this.getPointsInfo.bind(this);
|
||||
this.getPointsAt = this.getPointsAt.bind(this);
|
||||
this.listAmount = this.listAmount.bind(this);
|
||||
this.getAmountByORN = this.getAmountByORN.bind(this);
|
||||
@@ -136,18 +127,7 @@ class IndexerService {
|
||||
});
|
||||
};
|
||||
|
||||
readonly getPointsInfo = (address: string) => {
|
||||
return fetchWithValidation(this.apiUrl, getPointsInfoResponseSchema, {
|
||||
method: 'POST',
|
||||
body: this.makeRPCPayload({
|
||||
model: 'veORN',
|
||||
method: 'pointsInfo',
|
||||
params: [address],
|
||||
}),
|
||||
});
|
||||
};
|
||||
|
||||
readonly getPointsAt = (timestamp = Date.now(), page?: number, pageSize?: number) => {
|
||||
readonly getPointsAt = (timestamp = Date.now(), page = 1, pageSize = 1000) => {
|
||||
return fetchWithValidation(this.apiUrl, getPointsAtResponseSchema, {
|
||||
method: 'POST',
|
||||
body: this.makeRPCPayload({
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
import { z } from 'zod';
|
||||
import { evmAddressSchema } from './util-schemas.js';
|
||||
import infoSchema from './info-schema.js';
|
||||
|
||||
const getPointsResultSchema = z.object({
|
||||
avgAPR: z.number(),
|
||||
minAPR: z.number(),
|
||||
maxAPR: z.number(),
|
||||
veTokenAddress: evmAddressSchema,
|
||||
totalPointsLocked: z.number(),
|
||||
totalPoints: z.number(),
|
||||
weeklyReward: z.number(),
|
||||
userAPR: z.number(),
|
||||
userPoints: z.number(),
|
||||
userPointsLocked: z.number(),
|
||||
userLockEndDate: z.number(),
|
||||
userReward: z.number(),
|
||||
userWeeklyReward: z.number(),
|
||||
userMinLockPeriod: z.number(),
|
||||
});
|
||||
|
||||
const getPointsInfoSchema = z.object({
|
||||
result: getPointsResultSchema,
|
||||
info: infoSchema,
|
||||
}).nullable();
|
||||
|
||||
export default getPointsInfoSchema;
|
||||
@@ -9,5 +9,4 @@ export { default as veORNInfoResponseSchema } from './veORN-info-schema';
|
||||
export { default as listAmountResponseSchema } from './list-amount-schema';
|
||||
export { default as votingInfoResponseSchema } from './voting-info-schema';
|
||||
export { default as testIncrementorSchema } from './test-incrementor-schema';
|
||||
export { default as getPointsInfoResponseSchema } from './get-points-info-schema';
|
||||
export { default as getPointsAtResponseSchema } from './get-points-at-schema';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { z } from 'zod';
|
||||
import { evmAddressSchema } from './util-schemas.js';
|
||||
import infoSchema from './info-schema.js';
|
||||
import { z } from "zod";
|
||||
import { evmAddressSchema } from "./util-schemas.js";
|
||||
import infoSchema from "./info-schema.js";
|
||||
|
||||
const veORNResultSchema = z.object({
|
||||
avgAPR: z.number(),
|
||||
@@ -17,6 +17,8 @@ const veORNResultSchema = z.object({
|
||||
userReward: z.number(),
|
||||
userWeeklyReward: z.number(),
|
||||
userMinLockPeriod: z.number(),
|
||||
dropLock: z.boolean(),
|
||||
pointsReward: z.number(),
|
||||
});
|
||||
|
||||
const veORNInfoSchema = z.object({
|
||||
|
||||
Reference in New Issue
Block a user