diff --git a/package.json b/package.json index 44b4fe2..b347451 100644 --- a/package.json +++ b/package.json @@ -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" } -} \ No newline at end of file +} diff --git a/src/services/BlockchainService/index.ts b/src/services/BlockchainService/index.ts index 6065d67..8a48ab9 100644 --- a/src/services/BlockchainService/index.ts +++ b/src/services/BlockchainService/index.ts @@ -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'; diff --git a/src/services/BlockchainService/schemas/governanceChainsInfoSchema.ts b/src/services/BlockchainService/schemas/governanceChainsInfoSchema.ts new file mode 100644 index 0000000..7a1b8b8 --- /dev/null +++ b/src/services/BlockchainService/schemas/governanceChainsInfoSchema.ts @@ -0,0 +1,7 @@ +import { z } from 'zod'; + +const governanceChainsInfoSchema = z.object({ + isChainSupported: z.boolean(), +}); + +export default governanceChainsInfoSchema; diff --git a/src/services/BlockchainService/schemas/index.ts b/src/services/BlockchainService/schemas/index.ts index e79e0c9..7d56300 100644 --- a/src/services/BlockchainService/schemas/index.ts +++ b/src/services/BlockchainService/schemas/index.ts @@ -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';