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

Commit

Permalink
Merge pull request #108 from makerdao/sdk-699
Browse files Browse the repository at this point in the history
Remove exchange services
  • Loading branch information
ethanbennett authored May 14, 2019
2 parents 4fce584 + d6bd663 commit bae8e6e
Show file tree
Hide file tree
Showing 20 changed files with 44 additions and 890 deletions.
1 change: 0 additions & 1 deletion src/config/ConfigFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const serviceRoles = [
'allowance',
'cdp',
'conversion',
'exchange',
'gas',
'log',
'price',
Expand Down
5 changes: 0 additions & 5 deletions src/config/DefaultServiceProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import GasService from '../eth/GasService';
import NonceService from '../eth/NonceService';
import NullEventService from '../utils/events/NullEventService';
import NullLogger from '../utils/loggers/NullLogger';
import Eth2DaiDirect from '../exchanges/oasis/Eth2DaiDirect';
import OasisExchangeService from '../exchanges/oasis/OasisExchangeService';
import PriceService from '../eth/PriceService';
import ServiceProvider from './ServiceProvider';
import SmartContractService from '../eth/SmartContractService';
Expand All @@ -29,7 +27,6 @@ export const resolver = {
cdp: 'EthereumCdpService',
conversion: 'TokenConversionService',
event: 'EventService',
// exchange: intentionally omitted
gas: 'GasService',
log: 'ConsoleLogger',
nonce: 'NonceService',
Expand Down Expand Up @@ -66,15 +63,13 @@ export default class DefaultServiceProvider extends ServiceProvider {
CacheService,
ConsoleLogger,
DSProxyService,
Eth2DaiDirect,
EthereumCdpService,
EthereumTokenService,
EventService,
GasService,
NonceService,
NullEventService,
NullLogger,
OasisExchangeService,
PriceService,
SmartContractService,
TimerService,
Expand Down
5 changes: 5 additions & 0 deletions src/config/ServiceProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ export default class ServiceProvider {
instance = new service();
} else {
// string
if (!this.supports(service) && role === 'exchange') {
throw new Error(
'This service has been extracted from dai.js. Please refer to the documentation to add it as a plugin: \n\n https://github.com/makerdao/dai.js/wiki/Basic-Usage-(Plugins)'
);
}
if (!this.supports(service)) {
throw new Error('Unsupported service in configuration: ' + service);
}
Expand Down
2 changes: 1 addition & 1 deletion src/config/presets/browser.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"type": "BROWSER"
}
},
"exchange": "OasisExchangeService"
"cdp": true
}
2 changes: 1 addition & 1 deletion src/config/presets/http.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"type": "HTTP"
}
},
"exchange": "OasisExchangeService"
"cdp": true
}
2 changes: 1 addition & 1 deletion src/config/presets/inject.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"type": "INJECT"
}
},
"exchange": "OasisExchangeService"
"cdp": true
}
2 changes: 1 addition & 1 deletion src/config/presets/kovan.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"network": "kovan"
}
},
"exchange": "OasisExchangeService"
"cdp": true
}
2 changes: 1 addition & 1 deletion src/config/presets/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"network": "mainnet"
}
},
"exchange": "OasisExchangeService"
"cdp": true
}
2 changes: 1 addition & 1 deletion src/config/presets/test.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"url": "http://localhost:2000"
}
},
"exchange": "OasisExchangeService"
"cdp": true
}
2 changes: 1 addition & 1 deletion src/config/presets/ws.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"type": "WEBSOCKET"
}
},
"exchange": "OasisExchangeService"
"cdp": true
}
203 changes: 0 additions & 203 deletions src/exchanges/oasis/Eth2DaiDirect.js

This file was deleted.

73 changes: 0 additions & 73 deletions src/exchanges/oasis/OasisExchangeService.js

This file was deleted.

Loading

0 comments on commit bae8e6e

Please sign in to comment.