mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-29 09:07:59 +03:00
OP-3702 Add governance pools
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
cfdContractsSchema,
|
||||
cfdHistorySchema,
|
||||
governanceContractsSchema,
|
||||
governancePoolsSchema,
|
||||
} from './schemas/index.js';
|
||||
import type redeemOrderSchema from '../OrionAggregator/schemas/redeemOrderSchema.js';
|
||||
import { sourceAtomicHistorySchema, targetAtomicHistorySchema } from './schemas/atomicHistorySchema.js';
|
||||
@@ -106,6 +107,7 @@ class OrionBlockchain {
|
||||
this.getCFDContracts = this.getCFDContracts.bind(this);
|
||||
this.getCFDHistory = this.getCFDHistory.bind(this);
|
||||
this.getGovernanceContracts = this.getGovernanceContracts.bind(this);
|
||||
this.getGovernancePools = this.getGovernancePools.bind(this);
|
||||
}
|
||||
|
||||
get orionBlockchainWsUrl() {
|
||||
@@ -429,6 +431,11 @@ class OrionBlockchain {
|
||||
`${this.apiUrl}/api/governance/info`,
|
||||
governanceContractsSchema,
|
||||
);
|
||||
|
||||
getGovernancePools = () => fetchWithValidation(
|
||||
`${this.apiUrl}/api/governance/pools`,
|
||||
governancePoolsSchema,
|
||||
);
|
||||
}
|
||||
|
||||
export * as schemas from './schemas/index.js';
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
const governancePoolsSchema = z.array(
|
||||
z.object({
|
||||
identifier: z.string(),
|
||||
chain: z.string(),
|
||||
platform: z.string(),
|
||||
logo: z.string(),
|
||||
pair: z.string(),
|
||||
lp_address: z.string(),
|
||||
farm_address: z.string(),
|
||||
pool_tokens: z.tuple([z.string(), z.string()]),
|
||||
pool_rewards: z.tuple([z.string(), z.string()]),
|
||||
liquidity_locked: z.number(),
|
||||
base_apy: z.number(),
|
||||
max_apy: z.number(),
|
||||
reward_per_week: z.number(),
|
||||
})
|
||||
);
|
||||
|
||||
export default governancePoolsSchema;
|
||||
@@ -15,3 +15,4 @@ export { default as userEarnedSchema } from './userEarnedSchema.js';
|
||||
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';
|
||||
|
||||
Reference in New Issue
Block a user