mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-15 14:42:38 +03:00
Fix bugs
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.18.1",
|
||||
"version": "0.18.2",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "./lib/esm/index.js",
|
||||
"module": "./lib/esm/index.js",
|
||||
|
||||
@@ -2,9 +2,11 @@ import { ethers } from 'ethers';
|
||||
import type OrionUnit from '../../OrionUnit/index.js';
|
||||
import type { SupportedChainId } from '../../types.js';
|
||||
import { isValidChainId } from '../../utils/index.js';
|
||||
import { simpleFetch } from 'simple-typed-fetch';
|
||||
import stf from 'simple-typed-fetch';
|
||||
import bsonObjectId from 'bson-objectid';
|
||||
|
||||
const { simpleFetch } = stf;
|
||||
|
||||
const ObjectID = bsonObjectId.default
|
||||
|
||||
const getHistory = async (units: OrionUnit[], address: string, limit = 1000) => {
|
||||
|
||||
@@ -17,7 +17,9 @@ import type { SupportedChainId } from '../../types.js';
|
||||
import type Orion from '../index.js';
|
||||
import type { z } from 'zod';
|
||||
import type { placeAtomicSwapSchema } from '../../services/OrionAggregator/schemas/index.js';
|
||||
import { simpleFetch } from 'simple-typed-fetch';
|
||||
import stf from 'simple-typed-fetch';
|
||||
|
||||
const { simpleFetch } = stf;
|
||||
|
||||
type Params = {
|
||||
assetName: string
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { BigNumber } from 'bignumber.js';
|
||||
import type { BigNumber } from 'bignumber.js';
|
||||
import type { ethers } from 'ethers';
|
||||
import { merge } from 'merge-anything';
|
||||
import { chains, envs } from '../config/index.js';
|
||||
@@ -9,7 +9,9 @@ import type { SupportedChainId, DeepPartial, VerboseOrionUnitConfig, KnownEnv }
|
||||
import { isValidChainId } from '../utils/index.js';
|
||||
import swap from './bridge/swap.js';
|
||||
import getHistory from './bridge/getHistory.js';
|
||||
import { simpleFetch } from 'simple-typed-fetch';
|
||||
import stf from 'simple-typed-fetch';
|
||||
|
||||
const { simpleFetch } = stf;
|
||||
|
||||
type EnvConfig = {
|
||||
analyticsAPI: string
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -9,8 +9,8 @@ import {
|
||||
createHttpTerminator,
|
||||
} from 'http-terminator';
|
||||
import { ethers } from 'ethers';
|
||||
import { simpleFetch } from 'simple-typed-fetch';
|
||||
|
||||
import stf from 'simple-typed-fetch';
|
||||
const { simpleFetch } = stf;
|
||||
jest.setTimeout(10000);
|
||||
|
||||
const createServer = (externalHost: string) => {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { BigNumber } from 'bignumber.js';
|
||||
import { simpleFetch, fetchWithValidation } from 'simple-typed-fetch';
|
||||
BigNumber.config({ EXPONENTIAL_AT: 1e+9 });
|
||||
|
||||
export * as config from './config/index.js';
|
||||
@@ -10,4 +9,3 @@ export * as services from './services/index.js';
|
||||
export * as crypt from './crypt/index.js';
|
||||
export * from './constants/index.js';
|
||||
export * from './types.js';
|
||||
export { simpleFetch, fetchWithValidation };
|
||||
|
||||
@@ -19,7 +19,9 @@ import httpToWS from '../../utils/httpToWS.js';
|
||||
import { ethers } from 'ethers';
|
||||
import orderSchema from './schemas/orderSchema.js';
|
||||
import { exchanges } from '../../constants/index.js';
|
||||
import { fetchWithValidation } from 'simple-typed-fetch';
|
||||
import stf from 'simple-typed-fetch';
|
||||
|
||||
const { fetchWithValidation } = stf;
|
||||
|
||||
class OrionAggregator {
|
||||
private readonly apiUrl: string;
|
||||
|
||||
@@ -17,7 +17,9 @@ import type redeemOrderSchema from '../OrionAggregator/schemas/redeemOrderSchema
|
||||
import { sourceAtomicHistorySchema, targetAtomicHistorySchema } from './schemas/atomicHistorySchema.js';
|
||||
import { makePartial } from '../../utils/index.js';
|
||||
import type { networkCodes } from '../../constants/index.js';
|
||||
import { fetchWithValidation } from 'simple-typed-fetch';
|
||||
import stf from 'simple-typed-fetch';
|
||||
|
||||
const { fetchWithValidation } = stf;
|
||||
|
||||
type IAdminAuthHeaders = {
|
||||
auth: string
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { fetchWithValidation } from 'simple-typed-fetch';
|
||||
import stf from 'simple-typed-fetch';
|
||||
import type { Exchange } from '../../types.js';
|
||||
import { statisticsOverviewSchema, topPairsStatisticsSchema } from './schemas/index.js';
|
||||
import candlesSchema from './schemas/candlesSchema.js';
|
||||
import { PriceFeedWS } from './ws/index.js';
|
||||
|
||||
const { fetchWithValidation } = stf;
|
||||
|
||||
class PriceFeed {
|
||||
private readonly apiUrl: string;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { fetchWithValidation } from 'simple-typed-fetch';
|
||||
import stf from 'simple-typed-fetch';
|
||||
import {
|
||||
errorSchema,
|
||||
miniStatsSchema,
|
||||
@@ -9,6 +9,8 @@ import {
|
||||
linkSchema,
|
||||
} from './schemas/index.js';
|
||||
|
||||
const { fetchWithValidation } = stf;
|
||||
|
||||
type CreateLinkPayloadType = {
|
||||
referer: string
|
||||
link_option: number
|
||||
|
||||
Reference in New Issue
Block a user