Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Add FTX to Swap Mocks #1577

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,11 @@ const envDefinitions = {
parser: stringParser,
desc: "mock the server response for the exchange KYC check, options are 'open', 'pending', 'closed' or 'approved'.",
},
MOCK_SWAP_LOGIN: {
def: "false",
parser: stringParser,
desc: "mock the server response for the exchange Login check",
},
NFT: {
def: false,
parser: boolParser,
Expand Down
29 changes: 28 additions & 1 deletion src/exchange/swap/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,32 @@ export const mockGetExchangeRates = async (
tradeMethod: "fixed",
},
{
rate: new BigNumber("1"),
rate: new BigNumber("2"),
toAmount: amount.times(magnitudeAwareRate),
magnitudeAwareRate,
rateId: "mockedRateId",
provider: "changelly",
expirationDate: new Date(),
tradeMethod: "float",
},
{
rate: new BigNumber("3"),
toAmount: amount.times(magnitudeAwareRate),
magnitudeAwareRate,
rateId: "mockedRateId",
provider: "wyre",
expirationDate: new Date(),
tradeMethod: "float",
},
{
rate: new BigNumber("4"),
toAmount: amount.times(magnitudeAwareRate),
magnitudeAwareRate,
rateId: "mockedRateId",
provider: "ftx",
expirationDate: new Date(),
tradeMethod: "float",
},
];
};
export const mockInitSwap = (
Expand Down Expand Up @@ -143,6 +161,15 @@ export const mockGetProviders: GetProviders = async () => {
{ from: "ethereum", to: "bitcoin", tradeMethod: "fixed" },
],
},
{
provider: "ftx",
pairs: [
{ from: "bitcoin", to: "ethereum", tradeMethod: "float" },
{ from: "bitcoin", to: "ethereum", tradeMethod: "fixed" },
{ from: "ethereum", to: "bitcoin", tradeMethod: "float" },
{ from: "ethereum", to: "bitcoin", tradeMethod: "fixed" },
],
},
]
: [
{
Expand Down