This commit is contained in:
Aleksandr Kraiz
2023-03-31 19:43:30 +04:00
parent facf5153df
commit 665bd568a4
16 changed files with 43 additions and 19 deletions

View File

@@ -9,7 +9,9 @@ import {
} from '../../constants/index.js';
import { denormalizeNumber, normalizeNumber } from '../../utils/index.js';
import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency.js';
import { simpleFetch } from 'simple-typed-fetch';
import stf from 'simple-typed-fetch';
const { simpleFetch } = stf;
export type DepositParams = {
asset: string

View File

@@ -1,12 +1,14 @@
import { BigNumber } from 'bignumber.js';
import { ethers } from 'ethers';
import { simpleFetch } from 'simple-typed-fetch';
import stf from 'simple-typed-fetch';
import { NATIVE_CURRENCY_PRECISION, SWAP_THROUGH_ORION_POOL_GAS_LIMIT } from '../../constants/index.js';
import type { OrionAggregator } from '../../services/OrionAggregator/index.js';
import type { OrionBlockchain } from '../../services/OrionBlockchain/index.js';
import { calculateFeeInFeeAsset, denormalizeNumber, getNativeCryptocurrency } from '../../utils/index.js';
const { simpleFetch } = stf;
export type GetSwapInfoParams = {
type: 'exactSpend' | 'exactReceive'
assetIn: string

View File

@@ -11,7 +11,9 @@ import { calculateFeeInFeeAsset, denormalizeNumber, normalizeNumber } from '../.
import { signOrder } from '../../crypt/index.js';
import type orderSchema from '../../services/OrionAggregator/schemas/orderSchema.js';
import type { z } from 'zod';
import { simpleFetch } from 'simple-typed-fetch';
import stf from 'simple-typed-fetch';
const { simpleFetch } = stf;
export type SwapLimitParams = {
type: 'exactSpend' | 'exactReceive'

View File

@@ -11,7 +11,9 @@ import { signOrder } from '../../crypt/index.js';
import type orderSchema from '../../services/OrionAggregator/schemas/orderSchema.js';
import type { z } from 'zod';
import type { SwapLimitParams } from './swapLimit.js';
import { simpleFetch } from 'simple-typed-fetch';
import stf from 'simple-typed-fetch';
const { simpleFetch } = stf;
export type SwapMarketParams = Omit<SwapLimitParams, 'price'> & {
slippagePercent: BigNumber.Value

View File

@@ -9,7 +9,9 @@ import {
} from '../../constants/index.js';
import { denormalizeNumber, normalizeNumber } from '../../utils/index.js';
import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency.js';
import { simpleFetch } from 'simple-typed-fetch';
import stf from 'simple-typed-fetch';
const { simpleFetch } = stf;
export type WithdrawParams = {
asset: string

View File

@@ -1,7 +1,7 @@
import { Exchange__factory, IUniswapV2Pair__factory, IUniswapV2Router__factory } from '@orionprotocol/contracts';
import { BigNumber } from 'bignumber.js';
import { ethers } from 'ethers';
import { simpleFetch } from 'simple-typed-fetch';
import stf from 'simple-typed-fetch';
import type OrionUnit from '../index.js';
import BalanceGuard from '../../BalanceGuard.js';
import { ADD_LIQUIDITY_GAS_LIMIT, INTERNAL_ORION_PRECISION, NATIVE_CURRENCY_PRECISION } from '../../constants/index.js';
@@ -9,6 +9,8 @@ import { denormalizeNumber, normalizeNumber } from '../../utils/index.js';
import getBalances from '../../utils/getBalances.js';
import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency.js';
const { simpleFetch } = stf;
const ADD_LIQUIDITY_SLIPPAGE = 0.05;
export type AddLiquidityParams = {