Moved fetching to simple-typed-fetch

This commit is contained in:
Aleksandr Kraiz
2023-03-24 21:59:04 +04:00
parent 07f947eb35
commit 51257adcd4
22 changed files with 256 additions and 653 deletions

View File

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

View File

@@ -1,10 +1,10 @@
import BigNumber from 'bignumber.js';
import { ethers } from 'ethers';
import { simpleFetch } from 'simple-typed-fetch';
import { NATIVE_CURRENCY_PRECISION, SWAP_THROUGH_ORION_POOL_GAS_LIMIT } from '../../constants';
import type { OrionAggregator } from '../../services/OrionAggregator';
import type { OrionBlockchain } from '../../services/OrionBlockchain';
import simpleFetch from '../../simpleFetch';
import { calculateFeeInFeeAsset, denormalizeNumber, getNativeCryptocurrency } from '../../utils';
export type GetSwapInfoParams = {

View File

@@ -7,11 +7,11 @@ import getAvailableSources from '../../utils/getAvailableFundsSources';
import type OrionUnit from '..';
import { INTERNAL_ORION_PRECISION, NATIVE_CURRENCY_PRECISION, SWAP_THROUGH_ORION_POOL_GAS_LIMIT } from '../../constants';
import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency';
import simpleFetch from '../../simpleFetch';
import { calculateFeeInFeeAsset, denormalizeNumber, normalizeNumber } from '../../utils';
import { signOrder } from '../../crypt';
import type orderSchema from '../../services/OrionAggregator/schemas/orderSchema';
import type { z } from 'zod';
import { simpleFetch } from 'simple-typed-fetch';
export type SwapLimitParams = {
type: 'exactSpend' | 'exactReceive'

View File

@@ -6,12 +6,12 @@ import BalanceGuard from '../../BalanceGuard';
import getAvailableSources from '../../utils/getAvailableFundsSources';
import { INTERNAL_ORION_PRECISION, NATIVE_CURRENCY_PRECISION, SWAP_THROUGH_ORION_POOL_GAS_LIMIT } from '../../constants';
import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency';
import simpleFetch from '../../simpleFetch';
import { calculateFeeInFeeAsset, denormalizeNumber, normalizeNumber } from '../../utils';
import { signOrder } from '../../crypt';
import type orderSchema from '../../services/OrionAggregator/schemas/orderSchema';
import type { z } from 'zod';
import type { SwapLimitParams } from './swapLimit';
import { simpleFetch } from 'simple-typed-fetch';
export type SwapMarketParams = Omit<SwapLimitParams, 'price'> & {
slippagePercent: BigNumber.Value

View File

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

View File

@@ -1,10 +1,10 @@
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 type OrionUnit from '..';
import BalanceGuard from '../../BalanceGuard';
import { ADD_LIQUIDITY_GAS_LIMIT, INTERNAL_ORION_PRECISION, NATIVE_CURRENCY_PRECISION } from '../../constants';
import simpleFetch from '../../simpleFetch';
import { denormalizeNumber, normalizeNumber } from '../../utils';
import getBalances from '../../utils/getBalances';
import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency';