Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Whitelist pairs for HoudiniSwap because it declares support for pairs…
Browse files Browse the repository at this point in the history
… it actually doesn't support.
  • Loading branch information
sproxet committed Oct 17, 2023
1 parent 3b547c0 commit 2638f17
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/lib/coinswap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,6 @@ export class StealthExApi extends AbstractCoinSwapApi {
export class HoudiniSwapApi extends AbstractCoinSwapApi {
API: string = 'https://api-partner.houdiniswap.com';
provider: Provider = 'HoudiniSwap';
pairs: [Ticker, Ticker][];
hasRefundAddress: boolean = false;

constructor(apiKey: ApiKey) {
Expand All @@ -490,21 +489,9 @@ export class HoudiniSwapApi extends AbstractCoinSwapApi {
}

async getPairs(): Promise<[Ticker, Ticker][]> {
if (this.pairs)
return this.pairs;

const r = await axios.get(`${this.API}/tokens`, {headers: {
Authorization: this.apiKey
}});

this.pairs = r.data
.map(x => x.symbol)
.sort()
.reduce((a, x) => a[a.length - 1] == x ? a : [...a, x], [])
.map(ticker => [['FIRO', ticker.toUpperCase()], [ticker.toUpperCase(), 'FIRO']])
return <[Ticker, Ticker][]>['BTC', 'BNB', 'DASH', 'DCR', 'ETH', 'LTC']
.map(ticker => [['FIRO', ticker], [ticker, 'FIRO']])
.reduce((a, x) => [...a, ...x], []);

return this.pairs;
}

async getPairInfo(from: Ticker, to: Ticker, amount: bigint): Promise<PairInfo> {
Expand Down

0 comments on commit 2638f17

Please sign in to comment.