opportunity-service 0.0.543 → 0.0.544

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,19 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
1
10
  import opportunityService from '../../OpportunityService';
2
11
  import * as addressMap from '../../blockchain/addresses.json';
3
- export default {
4
- 'MarketFactory': addressMap[opportunityService.getEthNetwork()]['MarketFactory'],
5
- 'UserRegistration': addressMap[opportunityService.getEthNetwork()]['UserRegistration'],
6
- 'UserSummaryFactory': addressMap[opportunityService.getEthNetwork()]['UserSummaryFactory'],
7
- 'Dai': addressMap[opportunityService.getEthNetwork()]['Dai'],
8
- 'Participation': addressMap[opportunityService.getEthNetwork()]['Participation']
9
- };
12
+ function getAddressMap() {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ const network = yield opportunityService.getEthNetwork();
15
+ return addressMap[network];
16
+ });
17
+ }
18
+ export default getAddressMap();
10
19
  //# sourceMappingURL=addresses.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"addresses.js","sourceRoot":"","sources":["../../../src/api/internal/addresses.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAE9D,eAAe;IACP,eAAe,EAAE,UAAU,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC,CAAC,eAAe,CAAC;IAChF,kBAAkB,EAAE,UAAU,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC,CAAC,kBAAkB,CAAC;IACtF,oBAAoB,EAAE,UAAU,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC,CAAC,oBAAoB,CAAC;IAC1F,KAAK,EAAE,UAAU,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC;IAC5D,eAAe,EAAE,UAAU,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC,CAAC,eAAe,CAAC;CACvF,CAAA"}
1
+ {"version":3,"file":"addresses.js","sourceRoot":"","sources":["../../../src/api/internal/addresses.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,kBAAkB,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAG9D,SAAe,aAAa;;QACxB,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC,aAAa,EAAE,CAAA;QACxD,OAAO,UAAU,CAAC,OAAO,CAAC,CAAA;IAC9B,CAAC;CAAA;AAED,eAAe,aAAa,EAAE,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opportunity-service",
3
- "version": "0.0.543",
3
+ "version": "0.0.544",
4
4
  "description": "A service layer that connects all services between the blockchain and ui.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,10 +1,10 @@
1
1
  import opportunityService from '../../OpportunityService';
2
2
  import * as addressMap from '../../blockchain/addresses.json';
3
+ import { EthNetworkID } from 'dvote-js';
3
4
 
4
- export default {
5
- 'MarketFactory': addressMap[opportunityService.getEthNetwork()]['MarketFactory'],
6
- 'UserRegistration': addressMap[opportunityService.getEthNetwork()]['UserRegistration'],
7
- 'UserSummaryFactory': addressMap[opportunityService.getEthNetwork()]['UserSummaryFactory'],
8
- 'Dai': addressMap[opportunityService.getEthNetwork()]['Dai'],
9
- 'Participation': addressMap[opportunityService.getEthNetwork()]['Participation']
10
- }
5
+ async function getAddressMap() {
6
+ const network = await opportunityService.getEthNetwork()
7
+ return addressMap[network]
8
+ }
9
+
10
+ export default getAddressMap()