mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
Add governanceChainsInfoSchema
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
const governanceChainsInfoSchema = z.object({
|
||||
isChainSupported: z.boolean(),
|
||||
});
|
||||
|
||||
export default governanceChainsInfoSchema;
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user