diff --git a/package.json b/package.json index 8fdfd98..2526764 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.19.41-rc1", + "version": "0.19.42-rc1", "description": "Orion Protocol SDK", "main": "./lib/index.cjs", "module": "./lib/index.js", diff --git a/src/services/BlockchainService/index.ts b/src/services/BlockchainService/index.ts index 6e7bd19..e2b091c 100644 --- a/src/services/BlockchainService/index.ts +++ b/src/services/BlockchainService/index.ts @@ -2,6 +2,7 @@ import { z } from 'zod'; import { IDOSchema, atomicHistorySchema, poolsConfigSchema, poolsInfoSchema, infoSchema, historySchema, + poolsV3InfoSchema, type addPoolSchema, adminPoolsListSchema, adminPoolSchema, atomicSummarySchema, poolsLpAndStakedSchema, @@ -81,6 +82,7 @@ class BlockchainService { this.getPoolsLpAndStaked = this.getPoolsLpAndStaked.bind(this); this.getUserVotes = this.getUserVotes.bind(this); this.getUserEarned = this.getUserEarned.bind(this); + this.getPoolsV3Info = this.getPoolsV3Info.bind(this); this.getHistory = this.getHistory.bind(this); this.getPricesWithQuoteAsset = this.getPricesWithQuoteAsset.bind(this); this.getTokensFee = this.getTokensFee.bind(this); @@ -201,6 +203,12 @@ class BlockchainService { { headers: this.basicAuthHeaders } ); + getPoolsV3Info = () => fetchWithValidation( + `${this.apiUrl}/api/pools-v3/info`, + poolsV3InfoSchema, + { headers: this.basicAuthHeaders } + ); + getHistory = (address: string) => fetchWithValidation( `${this.apiUrl}/api/history/${address}`, historySchema, @@ -326,18 +334,18 @@ class BlockchainService { checkAuth = (headers: IAdminAuthHeaders) => fetchWithValidation(`${this.apiUrl}/api/auth/check`, z.object({ auth: z.boolean(), - }), { headers: { ...headers, ...this.basicAuthHeaders }}); + }), { headers: { ...headers, ...this.basicAuthHeaders } }); getPool = (address: string, headers: IAdminAuthHeaders) => fetchWithValidation( `${this.apiUrl}/api/pools/${address}`, adminPoolSchema, - { headers: { ...headers, ...this.basicAuthHeaders }}, + { headers: { ...headers, ...this.basicAuthHeaders } }, ); getPoolsList = (headers: IAdminAuthHeaders) => fetchWithValidation( `${this.apiUrl}/api/pools/list`, adminPoolsListSchema, - { headers: { ...headers, ...this.basicAuthHeaders }}, + { headers: { ...headers, ...this.basicAuthHeaders } }, ); editPool = (address: string, data: IEditPool, headers: IAdminAuthHeaders) => fetchWithValidation( diff --git a/src/services/BlockchainService/schemas/index.ts b/src/services/BlockchainService/schemas/index.ts index ee8a122..80b82f3 100644 --- a/src/services/BlockchainService/schemas/index.ts +++ b/src/services/BlockchainService/schemas/index.ts @@ -16,4 +16,5 @@ export { default as governanceContractsSchema } from './governanceContractsSchem export { default as governancePoolsSchema } from './governancePoolsSchema.js'; export { default as governancePoolSchema } from './governancePoolSchema.js'; export { default as governanceChainsInfoSchema } from './governanceChainsInfoSchema.js'; +export { default as poolsV3InfoSchema } from './poolsV3InfoSchema.js'; export { pricesWithQuoteAssetSchema } from './pricesWithQuoteAssetSchema.js'; diff --git a/src/services/BlockchainService/schemas/poolsV3InfoSchema.ts b/src/services/BlockchainService/schemas/poolsV3InfoSchema.ts new file mode 100644 index 0000000..e484276 --- /dev/null +++ b/src/services/BlockchainService/schemas/poolsV3InfoSchema.ts @@ -0,0 +1,9 @@ +import { z } from 'zod'; + +const poolsV3InfoSchema = z.object({ + OrionV3Factory: z.string(), + OrionV3Pool: z.string(), + OrionV3NFTManager: z.string(), +}); + +export default poolsV3InfoSchema;