diff --git a/package.json b/package.json index f5104b2..45408ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@orionprotocol/sdk", - "version": "0.23.0-rc8", + "version": "0.23.0-rc9", "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 7c14735..66a0777 100644 --- a/src/services/BlockchainService/index.ts +++ b/src/services/BlockchainService/index.ts @@ -19,7 +19,7 @@ import { sourceAtomicHistorySchema, targetAtomicHistorySchema } from './schemas/ import { makePartial } from '../../utils'; import type { networkCodes } from '../../constants/index.js'; import { fetchWithValidation } from 'simple-typed-fetch'; -import type { BasicAuthCredentials } from '../../types.js'; +import { type BasicAuthCredentials, SupportedChainId } from '../../types.js'; import errorSchema from '../Aggregator/schemas/errorSchema'; type IAdminAuthHeaders = { @@ -66,6 +66,12 @@ type PlatformFees = { fromWidget?: string | undefined } +type MinLockAmount = { + assetIn: string + assetOut: string + targetChainId: SupportedChainId +} + class BlockchainService { private readonly apiUrl: string; @@ -117,6 +123,7 @@ class BlockchainService { this.getGasLimits = this.getGasLimits.bind(this); this.getExchangeContractWalletBalance = this.getExchangeContractWalletBalance.bind(this); this.getAtomicSwapFee = this.getAtomicSwapFee.bind(this); + this.getMinLockAmountForCCS = this.getMinLockAmountForCCS.bind(this); } get basicAuthHeaders() { @@ -515,6 +522,12 @@ class BlockchainService { z.record(z.string()), { headers: this.basicAuthHeaders } ); + + ф = ({ assetIn, assetOut, targetChainId }: MinLockAmount) => fetchWithValidation( + `${this.apiUrl}/api/atomic/min-lock-amount?assetIn=${assetIn}&assetOut=${assetOut}&targetChainId=${targetChainId}`, + z.number(), + { headers: this.basicAuthHeaders } + ); } export * as schemas from './schemas/index.js';