mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-29 09:07:59 +03:00
feat: added getMinLockAmountForCCS method
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user