Add governanceChainsInfoSchema

This commit is contained in:
Dmitry Leleko
2023-06-01 09:17:12 +03:00
parent 95fecabce9
commit 4cac52f016
4 changed files with 17 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.19.12",
"version": "0.19.13",
"description": "Orion Protocol SDK",
"main": "./lib/index.cjs",
"module": "./lib/index.js",
@@ -108,4 +108,4 @@
"overrides": {
"tsconfig-paths": "^4.0.0"
}
}
}

View File

@@ -14,6 +14,7 @@ import {
governanceContractsSchema,
governancePoolsSchema,
governancePoolSchema,
governanceChainsInfoSchema,
} from './schemas/index.js';
import type redeemOrderSchema from '../Aggregator/schemas/redeemOrderSchema.js';
import { sourceAtomicHistorySchema, targetAtomicHistorySchema } from './schemas/atomicHistorySchema.js';
@@ -110,6 +111,7 @@ class BlockchainService {
this.getGovernanceContracts = this.getGovernanceContracts.bind(this);
this.getGovernancePools = this.getGovernancePools.bind(this);
this.getGovernancePool = this.getGovernancePool.bind(this);
this.getGovernanceChainsInfo = this.getGovernanceChainsInfo.bind(this);
}
get blockchainServiceWsUrl() {
@@ -443,6 +445,11 @@ class BlockchainService {
`${this.apiUrl}/api/governance/pools/${address}`,
governancePoolSchema,
);
getGovernanceChainsInfo = () => fetchWithValidation(
`${this.apiUrl}/api/governance/chains-info`,
governanceChainsInfoSchema,
);
}
export * as schemas from './schemas/index.js';

View File

@@ -0,0 +1,7 @@
import { z } from 'zod';
const governanceChainsInfoSchema = z.object({
isChainSupported: z.boolean(),
});
export default governanceChainsInfoSchema;

View File

@@ -17,3 +17,4 @@ 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';
export { default as governanceChainsInfoSchema } from './governanceChainsInfoSchema.js';