mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
OP-3702 Add governancePoolSchema
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.18.13-rc2",
|
||||
"version": "0.18.13-rc3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.18.13-rc2",
|
||||
"version": "0.18.13-rc3",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.21.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.18.13-rc2",
|
||||
"version": "0.18.13-rc3",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "./lib/index.cjs",
|
||||
"module": "./lib/index.js",
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
cfdHistorySchema,
|
||||
governanceContractsSchema,
|
||||
governancePoolsSchema,
|
||||
governancePoolSchema,
|
||||
} from './schemas/index.js';
|
||||
import type redeemOrderSchema from '../OrionAggregator/schemas/redeemOrderSchema.js';
|
||||
import { sourceAtomicHistorySchema, targetAtomicHistorySchema } from './schemas/atomicHistorySchema.js';
|
||||
@@ -108,6 +109,7 @@ class OrionBlockchain {
|
||||
this.getCFDHistory = this.getCFDHistory.bind(this);
|
||||
this.getGovernanceContracts = this.getGovernanceContracts.bind(this);
|
||||
this.getGovernancePools = this.getGovernancePools.bind(this);
|
||||
this.getGovernancePool = this.getGovernancePool.bind(this);
|
||||
}
|
||||
|
||||
get orionBlockchainWsUrl() {
|
||||
@@ -436,6 +438,11 @@ class OrionBlockchain {
|
||||
`${this.apiUrl}/api/governance/pools`,
|
||||
governancePoolsSchema,
|
||||
);
|
||||
|
||||
getGovernancePool = (address: string) => fetchWithValidation(
|
||||
`${this.apiUrl}/api/governance/pools/${address}`,
|
||||
governancePoolSchema,
|
||||
);
|
||||
}
|
||||
|
||||
export * as schemas from './schemas/index.js';
|
||||
|
||||
18
src/services/OrionBlockchain/schemas/governancePoolSchema.ts
Normal file
18
src/services/OrionBlockchain/schemas/governancePoolSchema.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
const governancePoolSchema = z.object({
|
||||
base_apr: z.number(),
|
||||
max_apr: z.number(),
|
||||
tvl: z.string(),
|
||||
lp_supply: z.string(),
|
||||
lp_staked: z.string(),
|
||||
lp_staked_with_boost: z.string(),
|
||||
lp_price: z.string(),
|
||||
reward_per_period: z.number(),
|
||||
lock_time_for_max_multiplier: z.string(),
|
||||
lock_max_multiplier: z.string(),
|
||||
veorn_max_multiplier: z.string(),
|
||||
veorn_boost_scale_factor: z.string(),
|
||||
});
|
||||
|
||||
export default governancePoolSchema;
|
||||
@@ -16,3 +16,4 @@ export { default as cfdContractsSchema } from './cfdContractsSchema.js';
|
||||
export { default as cfdHistorySchema } from './cfdHistorySchema.js';
|
||||
export { default as governanceContractsSchema } from './governanceContractsSchema.js';
|
||||
export { default as governancePoolsSchema } from './governancePoolsSchema.js';
|
||||
export { default as governancePoolSchema } from './governancePoolSchema.js';
|
||||
|
||||
Reference in New Issue
Block a user