mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-22 21:59:44 +03:00
ESM
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import { ethers } from 'ethers';
|
||||
import type OrionUnit from '../../OrionUnit';
|
||||
import type { SupportedChainId } from '../../types';
|
||||
import { isValidChainId } from '../../utils';
|
||||
import ObjectID from 'bson-objectid';
|
||||
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 bsonObjectId from 'bson-objectid';
|
||||
|
||||
const ObjectID = bsonObjectId.default
|
||||
|
||||
const getHistory = async (units: OrionUnit[], address: string, limit = 1000) => {
|
||||
if (!ethers.utils.isAddress(address)) throw new Error(`Invalid address: ${address}`);
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
import BigNumber from 'bignumber.js';
|
||||
import { BigNumber } from 'bignumber.js';
|
||||
import { ethers } from 'ethers';
|
||||
import { Exchange__factory } from '@orionprotocol/contracts';
|
||||
import getBalances from '../../utils/getBalances';
|
||||
import BalanceGuard from '../../BalanceGuard';
|
||||
import getAvailableSources from '../../utils/getAvailableFundsSources';
|
||||
import getBalances from '../../utils/getBalances.js';
|
||||
import BalanceGuard from '../../BalanceGuard.js';
|
||||
import getAvailableSources from '../../utils/getAvailableFundsSources.js';
|
||||
import {
|
||||
INTERNAL_ORION_PRECISION,
|
||||
NATIVE_CURRENCY_PRECISION,
|
||||
LOCKATOMIC_GAS_LIMIT,
|
||||
REDEEMATOMIC_GAS_LIMIT,
|
||||
WITHDRAW_GAS_LIMIT
|
||||
} from '../../constants';
|
||||
import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency';
|
||||
import { denormalizeNumber, generateSecret, normalizeNumber, toUpperCase } from '../../utils';
|
||||
import type { SupportedChainId } from '../../types';
|
||||
import type Orion from '..';
|
||||
} from '../../constants/index.js';
|
||||
import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency.js';
|
||||
import { denormalizeNumber, generateSecret, normalizeNumber, toUpperCase } from '../../utils/index.js';
|
||||
import type { SupportedChainId } from '../../types.js';
|
||||
import type Orion from '../index.js';
|
||||
import type { z } from 'zod';
|
||||
import type { placeAtomicSwapSchema } from '../../services/OrionAggregator/schemas';
|
||||
import type { placeAtomicSwapSchema } from '../../services/OrionAggregator/schemas/index.js';
|
||||
import { simpleFetch } from 'simple-typed-fetch';
|
||||
|
||||
type Params = {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
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';
|
||||
import type { networkCodes } from '../constants';
|
||||
import OrionUnit from '../OrionUnit';
|
||||
import { ReferralSystem } from '../services/ReferralSystem';
|
||||
import type { SupportedChainId, DeepPartial, VerboseOrionUnitConfig, KnownEnv } from '../types';
|
||||
import { isValidChainId } from '../utils';
|
||||
import swap from './bridge/swap';
|
||||
import getHistory from './bridge/getHistory';
|
||||
import { chains, envs } from '../config/index.js';
|
||||
import type { networkCodes } from '../constants/index.js';
|
||||
import OrionUnit from '../OrionUnit/index.js';
|
||||
import { ReferralSystem } from '../services/ReferralSystem/index.js';
|
||||
import type { SupportedChainId, DeepPartial, VerboseOrionUnitConfig, KnownEnv } from '../types.js';
|
||||
import { isValidChainId } from '../utils/index.js';
|
||||
import swap from './bridge/swap.js';
|
||||
import getHistory from './bridge/getHistory.js';
|
||||
import { simpleFetch } from 'simple-typed-fetch';
|
||||
|
||||
type EnvConfig = {
|
||||
|
||||
Reference in New Issue
Block a user