Skip to content

Commit

Permalink
Merge pull request #312 from EdgeApp/william/split-package
Browse files Browse the repository at this point in the history
Split package
  • Loading branch information
swansontec authored Feb 1, 2024
2 parents 9225e58 + 98f06bb commit ced359a
Show file tree
Hide file tree
Showing 12 changed files with 334 additions and 262 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- fixed: Do not crash at load time if `BigInt` is not present.

## 2.0.1 (2023-01-09)

- fixed: Error when swapping from tokens
Expand Down
22 changes: 11 additions & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@ import 'regenerator-runtime/runtime'

import type { EdgeCorePlugins } from 'edge-core-js/types'

import { makeChangeHeroPlugin } from './swap/changehero'
import { makeChangeNowPlugin } from './swap/changenow'
import { makeChangeHeroPlugin } from './swap/central/changehero'
import { makeChangeNowPlugin } from './swap/central/changenow'
import { makeExolixPlugin } from './swap/central/exolix'
import { makeGodexPlugin } from './swap/central/godex'
import { makeLetsExchangePlugin } from './swap/central/letsexchange'
import { makeSideshiftPlugin } from './swap/central/sideshift'
import { makeSwapuzPlugin } from './swap/central/swapuz'
import { makeLifiPlugin } from './swap/defi/lifi'
import { makeThorchainPlugin } from './swap/defi/thorchain'
import { makeThorchainDaPlugin } from './swap/defi/thorchainDa'
import { makeSpookySwapPlugin } from './swap/defi/uni-v2-based/plugins/spookySwap'
import { makeTombSwapPlugin } from './swap/defi/uni-v2-based/plugins/tombSwap'
import { makeVelodromePlugin } from './swap/defi/uni-v2-based/plugins/velodrome'
import { makeXrpDexPlugin } from './swap/defi/xrpDex'
import { makeExolixPlugin } from './swap/exolix'
import { makeGodexPlugin } from './swap/godex'
import { makeLetsExchangePlugin } from './swap/letsexchange'
import { makeSideshiftPlugin } from './swap/sideshift'
import { makeSwapuzPlugin } from './swap/swapuz'
import { makeTransferPlugin } from './swap/transfer'
import { xrpdex } from './swap/xrpDexInfo'

const plugins = {
// Swap plugins:
changehero: makeChangeHeroPlugin,
changenow: makeChangeNowPlugin,
exolix: makeExolixPlugin,
godex: makeGodexPlugin,
letsexchange: makeLetsExchangePlugin,
lifi: makeLifiPlugin,
sideshift: makeSideshiftPlugin,
spookySwap: makeSpookySwapPlugin,
tombSwap: makeTombSwapPlugin,
swapuz: makeSwapuzPlugin,
thorchain: makeThorchainPlugin,
thorchainda: makeThorchainDaPlugin,
tombSwap: makeTombSwapPlugin,
transfer: makeTransferPlugin,
velodrome: makeVelodromePlugin,
xrpdex: makeXrpDexPlugin,
letsexchange: makeLetsExchangePlugin
xrpdex
}

declare global {
Expand Down
6 changes: 3 additions & 3 deletions src/swap/changehero.ts → src/swap/central/changehero.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import {
InvalidCurrencyCodes,
makeSwapPluginQuote,
SwapOrder
} from '../util/swapHelpers'
import { convertRequest, getAddress } from '../util/utils'
import { EdgeSwapRequestPlugin, StringMap } from './types'
} from '../../util/swapHelpers'
import { convertRequest, getAddress } from '../../util/utils'
import { EdgeSwapRequestPlugin, StringMap } from '../types'

const pluginId = 'changehero'

Expand Down
6 changes: 3 additions & 3 deletions src/swap/changenow.ts → src/swap/central/changenow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import {
InvalidCurrencyCodes,
makeSwapPluginQuote,
SwapOrder
} from '../util/swapHelpers'
import { convertRequest, getAddress } from '../util/utils'
import { EdgeSwapRequestPlugin } from './types'
} from '../../util/swapHelpers'
import { convertRequest, getAddress } from '../../util/utils'
import { EdgeSwapRequestPlugin } from '../types'
const pluginId = 'changenow'

const swapInfo: EdgeSwapInfo = {
Expand Down
6 changes: 3 additions & 3 deletions src/swap/exolix.ts → src/swap/central/exolix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import {
InvalidCurrencyCodes,
makeSwapPluginQuote,
SwapOrder
} from '../util/swapHelpers'
import { convertRequest, getAddress } from '../util/utils'
import { EdgeSwapRequestPlugin } from './types'
} from '../../util/swapHelpers'
import { convertRequest, getAddress } from '../../util/utils'
import { EdgeSwapRequestPlugin } from '../types'

const pluginId = 'exolix'

Expand Down
6 changes: 3 additions & 3 deletions src/swap/godex.ts → src/swap/central/godex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import {
InvalidCurrencyCodes,
makeSwapPluginQuote,
SwapOrder
} from '../util/swapHelpers'
import { convertRequest, getAddress } from '../util/utils'
import { asNumberString, EdgeSwapRequestPlugin } from './types'
} from '../../util/swapHelpers'
import { convertRequest, getAddress } from '../../util/utils'
import { asNumberString, EdgeSwapRequestPlugin } from '../types'

const pluginId = 'godex'

Expand Down
6 changes: 3 additions & 3 deletions src/swap/letsexchange.ts → src/swap/central/letsexchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import {
InvalidCurrencyCodes,
makeSwapPluginQuote,
SwapOrder
} from '../util/swapHelpers'
import { convertRequest, getAddress } from '../util/utils'
} from '../../util/swapHelpers'
import { convertRequest, getAddress } from '../../util/utils'
import { asNumberString, EdgeSwapRequestPlugin } from '../types'
import { asOptionalBlank } from './changenow'
import { asNumberString, EdgeSwapRequestPlugin } from './types'

const pluginId = 'letsexchange'

Expand Down
6 changes: 3 additions & 3 deletions src/swap/sideshift.ts → src/swap/central/sideshift.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import {
InvalidCurrencyCodes,
makeSwapPluginQuote,
SwapOrder
} from '../util/swapHelpers'
import { convertRequest, getAddress } from '../util/utils'
import { EdgeSwapRequestPlugin } from './types'
} from '../../util/swapHelpers'
import { convertRequest, getAddress } from '../../util/utils'
import { EdgeSwapRequestPlugin } from '../types'

// See https://help.sideshift.ai/en/articles/4559664-which-coins-and-tokens-are-listed for list of supported currencies
const MAINNET_CODE_TRANSCRIPTION = {
Expand Down
8 changes: 4 additions & 4 deletions src/swap/swapuz.ts → src/swap/central/swapuz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
SwapCurrencyError
} from 'edge-core-js/types'

import { div18 } from '../util/biggystringplus'
import { div18 } from '../../util/biggystringplus'
import {
checkInvalidCodes,
ensureInFuture,
Expand All @@ -28,9 +28,9 @@ import {
isLikeKind,
makeSwapPluginQuote,
SwapOrder
} from '../util/swapHelpers'
import { convertRequest, getAddress } from '../util/utils'
import { EdgeSwapRequestPlugin } from './types'
} from '../../util/swapHelpers'
import { convertRequest, getAddress } from '../../util/utils'
import { EdgeSwapRequestPlugin } from '../types'

const pluginId = 'swapuz'

Expand Down
Loading

0 comments on commit ced359a

Please sign in to comment.