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