@@ -53,16 +53,16 @@ import {
5353 THORNODE_SERVERS_DEFAULT
5454} from './thorchain'
5555
56- const pluginId = 'thorchainda '
56+ const pluginId = 'swapkit '
5757const swapInfo : EdgeSwapInfo = {
5858 pluginId,
5959 isDex : true ,
60- displayName : 'Thorchain DEX Aggregator ' ,
60+ displayName : 'Swap Kit ' ,
6161 supportEmail : 'support@edge.app'
6262}
6363
6464// This needs to be a type so adding the '& {}' prevents auto correction to an interface
65- type ThorSwapQuoteParams = {
65+ type SwapKitSwapQuoteParams = {
6666 sellAsset : string
6767 buyAsset : string
6868 sellAmount : string
@@ -78,7 +78,7 @@ const asCalldata = asObject({
7878 memo : asOptional ( asString )
7979} )
8080
81- const asThorSwapRoute = asObject ( {
81+ const asSwapKitSwapRoute = asObject ( {
8282 contract : asEither ( asString , asNull ) ,
8383 contractMethod : asEither ( asString , asNull ) ,
8484 contractInfo : asOptional ( asString ) ,
@@ -93,8 +93,8 @@ const asThorSwapRoute = asObject({
9393 deadline : asOptional ( asString )
9494} )
9595
96- const asThorSwapQuoteResponse = asObject ( {
97- routes : asArray ( asThorSwapRoute )
96+ const asSwapKitSwapQuoteResponse = asObject ( {
97+ routes : asArray ( asSwapKitSwapRoute )
9898} )
9999
100100/** Max slippage for 5% for estimated quotes */
@@ -111,9 +111,7 @@ const tokenProxyMap: { [currencyPluginId: string]: string } = {
111111 avalanche : '0x69ba883af416ff5501d54d5e27a1f497fbd97156'
112112}
113113
114- export function makeThorchainDaPlugin (
115- opts : EdgeCorePluginOptions
116- ) : EdgeSwapPlugin {
114+ export function makeSwapKitPlugin ( opts : EdgeCorePluginOptions ) : EdgeSwapPlugin {
117115 const { io, log } = opts
118116 const { fetchCors = io . fetch } = io
119117 const {
@@ -225,7 +223,7 @@ export function makeThorchainDaPlugin(
225223 fromCurrencyCode
226224 )
227225
228- const quoteParams : ThorSwapQuoteParams = {
226+ const quoteParams : SwapKitSwapQuoteParams = {
229227 sellAsset :
230228 `${ fromMainnetCode } .${ fromCurrencyCode } ` +
231229 ( fromTokenId != null ? `-0x${ fromTokenId } ` : '' ) ,
@@ -263,7 +261,7 @@ export function makeThorchainDaPlugin(
263261 if ( ! iaResponse . ok ) {
264262 const responseText = await iaResponse . text ( )
265263 throw new Error (
266- `Thorchain could not fetch inbound_addresses: ${ JSON . stringify (
264+ `SwapKitchain could not fetch inbound_addresses: ${ JSON . stringify (
267265 responseText ,
268266 null ,
269267 2
@@ -273,7 +271,7 @@ export function makeThorchainDaPlugin(
273271 if ( ! thorSwapResponse . ok ) {
274272 const responseText = await thorSwapResponse . text ( )
275273 throw new Error (
276- `Thorchain could not get thorswap quote: ${ JSON . stringify (
274+ `SwapKitchain could not get thorswap quote: ${ JSON . stringify (
277275 responseText ,
278276 null ,
279277 2
@@ -285,7 +283,7 @@ export function makeThorchainDaPlugin(
285283 const inboundAddresses = asInboundAddresses ( iaJson )
286284
287285 const thorSwapJson = await thorSwapResponse . json ( )
288- const thorSwapQuote = asThorSwapQuoteResponse ( thorSwapJson )
286+ const thorSwapQuote = asSwapKitSwapQuoteResponse ( thorSwapJson )
289287
290288 // Check for supported chain and asset
291289 const inAddressObject = inboundAddresses . find (
@@ -360,7 +358,7 @@ export function makeThorchainDaPlugin(
360358 throw new Error (
361359 `Missing sourceTokenContractAddress for ${ fromMainnetCode } `
362360 )
363- // Need to use ethers.js to craft a proper tx that calls Thorchain contract, then extract the data payload
361+ // Need to use ethers.js to craft a proper tx that calls SwapKitchain contract, then extract the data payload
364362 // Token transactions send no ETH (or other EVM mainnet coin)
365363 if ( tcDirect ) {
366364 memo = await getEvmTokenData ( {
0 commit comments