opportunity-service 0.0.657 → 0.0.661
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/OpportunityService.js +0 -11
- package/dist/OpportunityService.js.map +1 -1
- package/dist/api/ethereum/sendAsync.js +0 -4
- package/dist/api/ethereum/sendAsync.js.map +1 -1
- package/dist/api/exchange/create-dispute.js +0 -39
- package/dist/api/exchange/create-dispute.js.map +1 -1
- package/dist/api/exchange/create-task.js +3 -15
- package/dist/api/exchange/create-task.js.map +1 -1
- package/dist/api/exchange/enter-work-relationship.js +0 -60
- package/dist/api/exchange/enter-work-relationship.js.map +1 -1
- package/dist/api/identity/register-new-user.js +0 -10
- package/dist/api/identity/register-new-user.js.map +1 -1
- package/dist/api/index.js +2 -16
- package/dist/api/index.js.map +1 -1
- package/dist/api/internal/abis.js +1 -4
- package/dist/api/internal/abis.js.map +1 -1
- package/dist/blockchain/abi.json +104 -89
- package/dist/blockchain/addresses.json +8 -4
- package/dist/blockchain/bytecode.json +0 -1
- package/dist/constants.js +0 -10
- package/dist/constants.js.map +1 -1
- package/dist/events/OpportunityEventEmitter.js +0 -2
- package/dist/events/OpportunityEventEmitter.js.map +1 -1
- package/dist/events/sync-with-ethereum-node.js +0 -2
- package/dist/events/sync-with-ethereum-node.js.map +1 -1
- package/dist/sync/process/process-log.js +0 -7
- package/dist/sync/process/process-log.js.map +1 -1
- package/dist/sync/process/processMarketCreatedLog.js +0 -3
- package/dist/sync/process/processMarketCreatedLog.js.map +1 -1
- package/dist/sync/process/processUserAssignedTrueIdentification.js +1 -2
- package/dist/sync/process/processUserAssignedTrueIdentification.js.map +1 -1
- package/dist/sync/process/processUserRegistered.js +1 -3
- package/dist/sync/process/processUserRegistered.js.map +1 -1
- package/dist/sync/process/processUserSummaryCreated.js +0 -1
- package/dist/sync/process/processUserSummaryCreated.js.map +1 -1
- package/dist/sync/process/processWorkRelationshipCreated.js +0 -2
- package/dist/sync/process/processWorkRelationshipCreated.js.map +1 -1
- package/dist/sync/sync-jobs.js +2 -3
- package/dist/sync/sync-jobs.js.map +1 -1
- package/dist/sync/sync-market-disputes.js +0 -34
- package/dist/sync/sync-market-disputes.js.map +1 -1
- package/dist/sync/sync-markets.js +2 -5
- package/dist/sync/sync-markets.js.map +1 -1
- package/package.json +1 -1
- package/src/OpportunityService.ts +1 -12
- package/src/api/ethereum/sendAsync.ts +0 -4
- package/src/api/exchange/create-dispute.ts +0 -41
- package/src/api/exchange/create-task.ts +3 -15
- package/src/api/exchange/enter-work-relationship.ts +0 -61
- package/src/api/identity/register-new-user.ts +0 -12
- package/src/api/index.ts +2 -16
- package/src/api/internal/abis.ts +1 -4
- package/src/blockchain/abi.json +104 -89
- package/src/blockchain/addresses.json +7 -5
- package/src/blockchain/bytecode.json +0 -1
- package/src/constants.ts +0 -11
- package/src/events/OpportunityEventEmitter.ts +0 -2
- package/src/events/sync-with-ethereum-node.ts +0 -2
- package/src/sync/process/process-log.ts +0 -6
- package/src/sync/process/processMarketCreatedLog.ts +0 -4
- package/src/sync/process/processUserAssignedTrueIdentification.ts +1 -3
- package/src/sync/process/processUserRegistered.ts +1 -5
- package/src/sync/process/processUserSummaryCreated.ts +0 -2
- package/src/sync/process/processWorkRelationshipCreated.ts +1 -5
- package/src/sync/sync-jobs.ts +2 -3
- package/src/sync/sync-market-disputes.ts +0 -27
- package/src/sync/sync-markets.ts +3 -5
- package/src/types.ts +0 -32
- package/dist/sync/process/processDisputeInvolvement.js +0 -33
- package/dist/sync/process/processDisputeInvolvement.js.map +0 -1
- package/dist/sync/process/processMarketDisputes.js +0 -34
- package/dist/sync/process/processMarketDisputes.js.map +0 -1
- package/dist/sync/sync-disputes.js +0 -37
- package/dist/sync/sync-disputes.js.map +0 -1
- package/src/sync/process/processDisputeInvolvement.ts +0 -42
- package/src/sync/process/processMarketDisputes.ts +0 -43
- package/src/sync/sync-disputes.ts +0 -29
@@ -1,35 +1 @@
|
|
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
|
-
};
|
10
|
-
import opportunityService from "../OpportunityService";
|
11
|
-
import { processLog } from './process/process-log';
|
12
|
-
function syncMarketDisputes(marketAddress) {
|
13
|
-
return __awaiter(this, void 0, void 0, function* () {
|
14
|
-
if (opportunityService.getProviderInterface()) {
|
15
|
-
yield opportunityService.getProviderInterface().getLogs({
|
16
|
-
address: marketAddress,
|
17
|
-
fromBlock: 1,
|
18
|
-
toBlock: 'latest',
|
19
|
-
topics: ['MarketDispute(address,address,address,address,address)']
|
20
|
-
}).then((logs) => {
|
21
|
-
console.log('Found logs.. Processing sync market disputes');
|
22
|
-
logs.forEach(log => {
|
23
|
-
if (log && Array.isArray(log.topics) && log.topics.length) {
|
24
|
-
processLog(log); // keccashinside here
|
25
|
-
}
|
26
|
-
});
|
27
|
-
})
|
28
|
-
.catch(err => {
|
29
|
-
console.log('Err on fetching logs from blockchain: ' + err);
|
30
|
-
});
|
31
|
-
}
|
32
|
-
});
|
33
|
-
}
|
34
|
-
export default syncMarketDisputes;
|
35
1
|
//# sourceMappingURL=sync-market-disputes.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sync-market-disputes.js","sourceRoot":"","sources":["../../src/sync/sync-market-disputes.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"sync-market-disputes.js","sourceRoot":"","sources":["../../src/sync/sync-market-disputes.ts"],"names":[],"mappings":""}
|
@@ -13,7 +13,6 @@ import { Contracts } from '../constants';
|
|
13
13
|
import { processLog } from './process/process-log';
|
14
14
|
function syncMarkets() {
|
15
15
|
return __awaiter(this, void 0, void 0, function* () {
|
16
|
-
console.log('syncMarkets: ' + addressMap[opportunityService.getEthNetwork()][Contracts.MARKET_FACTORY]);
|
17
16
|
if (opportunityService.getProviderInterface()) {
|
18
17
|
//sync Markets
|
19
18
|
yield opportunityService.getProviderInterface().getLogs({
|
@@ -21,16 +20,14 @@ function syncMarkets() {
|
|
21
20
|
fromBlock: 1,
|
22
21
|
toBlock: 'latest'
|
23
22
|
}).then((logs) => {
|
24
|
-
console.log('Found logs.. Processing...');
|
25
|
-
console.log(logs);
|
26
23
|
logs.forEach(log => {
|
27
24
|
if (log && Array.isArray(log.topics) && log.topics.length) {
|
28
25
|
processLog(log); // keccashinside here
|
29
26
|
}
|
30
27
|
});
|
31
28
|
})
|
32
|
-
.catch(
|
33
|
-
console.log(
|
29
|
+
.catch(error => {
|
30
|
+
console.log(error);
|
34
31
|
});
|
35
32
|
}
|
36
33
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sync-markets.js","sourceRoot":"","sources":["../../src/sync/sync-markets.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,UAAU,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,SAAe,WAAW;;
|
1
|
+
{"version":3,"file":"sync-markets.js","sourceRoot":"","sources":["../../src/sync/sync-markets.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,UAAU,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,SAAe,WAAW;;QACrB,IAAI,kBAAkB,CAAC,oBAAoB,EAAE,EAAE;YAC/C,cAAc;YACd,MAAM,kBAAkB,CAAC,oBAAoB,EAAE,CAAC,OAAO,CAAC;gBACrD,OAAO,EAAE,UAAU,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC;gBACjF,SAAS,EAAE,CAAC;gBACZ,OAAO,EAAE,QAAQ;aACpB,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;gBAEb,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;oBACf,IAAI,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE;wBACvD,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,qBAAqB;qBACzC;gBACL,CAAC,CAAC,CAAA;YACN,CAAC,CAAC;iBACD,KAAK,CAAC,KAAK,CAAC,EAAE;gBACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YACtB,CAAC,CAAC,CAAA;SACD;IACL,CAAC;CAAA;AAED,eAAe,WAAW,CAAC"}
|
package/package.json
CHANGED
@@ -45,7 +45,6 @@ class OpportunityService {
|
|
45
45
|
this.ethNetwork = 'mainnet'
|
46
46
|
|
47
47
|
this.opportunityProvider = new ethers.providers.JsonRpcProvider(/*process.env.NODE_ENV == 'dev' ? "https://eth-mainnet.alchemyapi.io/v2/JKVeBInuvm4wq9_8fECUmazLbm7Vpv5V" : "https://eth-mainnet.alchemyapi.io/v2/7d2CRio84usjQwU8tRPG75rqV1wJmX_W"*/)
|
48
|
-
console.log(this.opportunityProvider)
|
49
48
|
}
|
50
49
|
|
51
50
|
/**
|
@@ -94,8 +93,6 @@ class OpportunityService {
|
|
94
93
|
this.ethNetwork = 'rinkeby'
|
95
94
|
}
|
96
95
|
|
97
|
-
console.log(networkId)
|
98
|
-
|
99
96
|
//this.storageProvider = new OpportunityStorageProvider(dbAddress)
|
100
97
|
}
|
101
98
|
|
@@ -110,10 +107,8 @@ class OpportunityService {
|
|
110
107
|
async startService() {
|
111
108
|
if (this.running) { return; }
|
112
109
|
|
113
|
-
console.log('Starting service...');
|
114
110
|
this.sync();
|
115
111
|
this.running = true;
|
116
|
-
console.log('Finished starting service...')
|
117
112
|
}
|
118
113
|
|
119
114
|
shutdownService() {
|
@@ -133,11 +128,9 @@ class OpportunityService {
|
|
133
128
|
.then(() => {
|
134
129
|
this.syncing = false;
|
135
130
|
this.eventEmitter.emit(RPCEvents.StopSyncing);
|
136
|
-
console.log('Finished syncing ethereum node.')
|
137
131
|
this.syncing = false;
|
138
132
|
})
|
139
133
|
.catch(err => {
|
140
|
-
console.log('Error while syncing ethereum node: ' + err)
|
141
134
|
this.syncing = false;
|
142
135
|
})
|
143
136
|
}
|
@@ -152,12 +145,8 @@ class OpportunityService {
|
|
152
145
|
|
153
146
|
getProviderInterface() : providers.JsonRpcProvider {
|
154
147
|
if (this.opportunityProvider) {
|
155
|
-
console.log('Provider is not null')
|
156
|
-
console.log(this.opportunityProvider)
|
157
148
|
return this.opportunityProvider
|
158
|
-
}
|
159
|
-
console.log('provider is null')
|
160
|
-
}
|
149
|
+
}
|
161
150
|
|
162
151
|
return this.ethersProvider;
|
163
152
|
}
|
@@ -19,10 +19,6 @@ export async function sendAsync(method, params, from) {
|
|
19
19
|
const s = '0x' + realResult.slice(64, 128);
|
20
20
|
const v = parseInt(realResult.substring(128, 130), 16);
|
21
21
|
|
22
|
-
console.log('Service: ' + realResult)
|
23
|
-
console.log('R: ' + r)
|
24
|
-
console.log('S: ' + s)
|
25
|
-
console.log('V: ' + v)
|
26
22
|
resolve({
|
27
23
|
v, r, s
|
28
24
|
})
|
@@ -1,41 +0,0 @@
|
|
1
|
-
import { FakeTransaction, Transaction, TxData } from "ethereumjs-tx";
|
2
|
-
import { Contracts, ContractType } from "../../constants";
|
3
|
-
import opportunityEventEmitter from "../../events/OpportunityEventEmitter";
|
4
|
-
import { ParamObject } from "../../types";
|
5
|
-
|
6
|
-
import * as abiMap from '../../blockchain/abi.json';
|
7
|
-
import * as bytecodeMap from '../../blockchain/bytecode.json';
|
8
|
-
import opportunityService from "../../OpportunityService";
|
9
|
-
import { ethers, ContractFactory } from 'ethers';
|
10
|
-
import opportunityStorageProvider from "../../modules/storage/OpportunityStorageProvider";
|
11
|
-
import { Result } from "ethers/lib/utils";
|
12
|
-
|
13
|
-
const Tx = require("ethereumjs-tx").Transaction;
|
14
|
-
|
15
|
-
async function createDispute(data) : Promise<void> {
|
16
|
-
//createData(data)
|
17
|
-
|
18
|
-
const parsedData = JSON.parse(data)
|
19
|
-
const abi = abiMap[Contracts.DISPUTE]
|
20
|
-
|
21
|
-
const complaintMetadataPointer = parsedData['complaintMetadataPointer']
|
22
|
-
const complaintResponseMetadataPointer = parsedData['complaintResponseMetadataPointer']
|
23
|
-
const relationshipAddress = parsedData['relationshipAddress']
|
24
|
-
|
25
|
-
console.log(abi)
|
26
|
-
console.log(parsedData)
|
27
|
-
|
28
|
-
try {
|
29
|
-
// The factory we use for deploying contracts
|
30
|
-
const disputeContractfactory = new ContractFactory(abi, bytecodeMap[Contracts.DISPUTE], opportunityService.getSignersInterface())
|
31
|
-
|
32
|
-
// Deploy an instance of the contract
|
33
|
-
const disputeContract = await disputeContractfactory.deploy(relationshipAddress, complaintMetadataPointer, complaintResponseMetadataPointer);
|
34
|
-
const txReceipt = await disputeContract.deployTransaction.wait()
|
35
|
-
console.log(txReceipt)
|
36
|
-
} catch(error) {
|
37
|
-
console.log('Service: Caught error creating new job: ' + error);
|
38
|
-
}
|
39
|
-
}
|
40
|
-
|
41
|
-
export { createDispute }
|
@@ -14,37 +14,25 @@ import { Result } from "ethers/lib/utils";
|
|
14
14
|
const Tx = require("ethereumjs-tx").Transaction;
|
15
15
|
|
16
16
|
async function createTask(data) : Promise<void> {
|
17
|
-
console.log('a')
|
18
17
|
const parsedData = JSON.parse(data);
|
19
18
|
const abi = abiMap[Contracts.MARKET];
|
20
|
-
console.log(abi)
|
21
|
-
console.log(parsedData)
|
22
19
|
|
23
20
|
const taskOwner = parsedData["taskOwner"];
|
24
21
|
const taskMarket = parsedData["taskMarket"]
|
25
22
|
const taskBounty = Number(parsedData["taskBounty"])
|
26
23
|
const taskMetadataPointer = parsedData["taskMetadataPointer"]
|
27
|
-
|
28
|
-
console.log(taskOwner)
|
29
|
-
console.log(taskMarket)
|
30
|
-
console.log('h')
|
31
|
-
console.log(taskBounty)
|
32
|
-
console.log(taskMetadataPointer)
|
24
|
+
const registrar = addressMap[opportunityService.getEthNetwork()][Contracts.USER_REGISTRATION]
|
33
25
|
|
34
26
|
if (taskOwner == null || taskMarket == 0 || taskBounty == 0 || taskMetadataPointer == '' ) {
|
35
27
|
throw new Error('Null value in data')
|
36
28
|
}
|
37
29
|
|
38
|
-
console.log('C')
|
39
30
|
try {
|
40
|
-
console.log('d')
|
41
31
|
const contract = await new ethers.Contract(taskMarket, abi).connect(opportunityService.getSignersInterface());
|
42
|
-
|
43
|
-
const txResponse = await contract.functions.createJob(ContractType.NORMAL, taskMetadataPointer, addressMap[opportunityService.getEthNetwork()][Contracts.DAI])
|
32
|
+
const txResponse = await contract.functions.createJob(registrar, ContractType.NORMAL, taskMetadataPointer, addressMap[opportunityService.getEthNetwork()][Contracts.DAI])
|
44
33
|
const txReceipt = await txResponse.wait()
|
45
|
-
console.log(txReceipt)
|
46
34
|
} catch(error) {
|
47
|
-
console.log(
|
35
|
+
console.log(error);
|
48
36
|
}
|
49
37
|
}
|
50
38
|
|
@@ -1,61 +0,0 @@
|
|
1
|
-
function enterWorkRelationship(relationshipAddress, evaluationState, callback) {
|
2
|
-
/*const abi = Contract.Market.WorkRelationship.abi;
|
3
|
-
const bytecode = '608060405234801561001057600080fd5b50606460008190555060ca806100276000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c806380219655146037578063ed0109a5146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b6068608c565b6040518082815260200191505060405180910390f35b806000540160008190555050565b6000805490509056fea265627a7a7230582002f975dfd70c1b1f649671805826a83fc9b92457fe7dd245527f56b7776d043464736f6c634300050a0032';
|
4
|
-
|
5
|
-
const contract = opportunityConnectionProvider.getProviderInterface().web3.eth.Contract(JSON.parse(abi)); //web3.eth.Contract(JSON.parse(abi));
|
6
|
-
|
7
|
-
const txParameter : FakeTransaction = {
|
8
|
-
from: opportunityConnectionProvider.getProviderInterface().web3.eth.getAccounts()[0],
|
9
|
-
gasPrice: opportunityConnectionProvider.getProviderInterface().web3.utils.toHex(opportunityConnectionProvider.getProviderInterface().web3.utils.toWei('30', 'gwei'))
|
10
|
-
}
|
11
|
-
|
12
|
-
const isValidWorker = opportunityConnectionProvider.getProviderInterface().web3.eth.Contract(
|
13
|
-
contract,
|
14
|
-
relationshipAddress)
|
15
|
-
.methods
|
16
|
-
.checkWorkerEvaluation(opportunityConnectionProvider.getProviderInterface().web3.accounts.getAccounts()[0], evaluationState)
|
17
|
-
.send(txParameter, callback)
|
18
|
-
.on('transactionHash', hash => {
|
19
|
-
|
20
|
-
})
|
21
|
-
.on('confirmation', (confirmationNumber, receipt) => {
|
22
|
-
|
23
|
-
})
|
24
|
-
.on('receipt', receipt => {
|
25
|
-
// receipt example
|
26
|
-
console.log(receipt);
|
27
|
-
})
|
28
|
-
.on('error', (error, receipt) => { // If the transaction was rejected by the network with a receipt, the second parameter will be the receipt.
|
29
|
-
|
30
|
-
})
|
31
|
-
.then( receipt => {
|
32
|
-
// receipt can also be a new contract instance, when coming from a "contract.deploy({...}).send()"
|
33
|
-
});
|
34
|
-
|
35
|
-
if (isValidWorker === true) {
|
36
|
-
opportunityConnectionProvider.getProviderInterface().web3.eth.Contract(
|
37
|
-
contract,
|
38
|
-
relationshipAddress)
|
39
|
-
.methods
|
40
|
-
.createWorkExchange(opportunityConnectionProvider.getProviderInterface().web3.accounts.getAccounts()[0], true)
|
41
|
-
.send(txParameter, callback)
|
42
|
-
.on('transactionHash', hash => {
|
43
|
-
|
44
|
-
})
|
45
|
-
.on('confirmation', (confirmationNumber, receipt) => {
|
46
|
-
|
47
|
-
})
|
48
|
-
.on('receipt', receipt => {
|
49
|
-
// receipt example
|
50
|
-
console.log(receipt);
|
51
|
-
})
|
52
|
-
.on('error', (error, receipt) => { // If the transaction was rejected by the network with a receipt, the second parameter will be the receipt.
|
53
|
-
|
54
|
-
})
|
55
|
-
.then( receipt => {
|
56
|
-
// receipt can also be a new contract instance, when coming from a "contract.deploy({...}).send()"
|
57
|
-
});
|
58
|
-
}*/
|
59
|
-
}
|
60
|
-
|
61
|
-
export { enterWorkRelationship };
|
@@ -17,14 +17,10 @@ async function registerNewUser() {
|
|
17
17
|
if (typeof msgSender == 'undefined') throw new Error('Message sender is undefined')
|
18
18
|
|
19
19
|
const userRegistrationInstance = new ethers.Contract(userRegistrationAddress, userRegistrationInterface, opportunityService.getProviderInterface())
|
20
|
-
|
21
|
-
console.log('Checking true identificaiton of msgSender: ' + msgSender)
|
22
20
|
const id = await userRegistrationInstance.getTrueIdentification(msgSender)
|
23
|
-
console.log('The true identificaiton is: ' + id)
|
24
21
|
|
25
22
|
if (id == '0x0000000000000000000000000000000000000000')
|
26
23
|
{
|
27
|
-
console.log('Registering new user: ' + msgSender)
|
28
24
|
const tx : TransactionResponse = await new Contract(
|
29
25
|
addressMap[opportunityService.getEthNetwork()][Contracts.USER_REGISTRATION], abiMap[Contracts.USER_REGISTRATION])
|
30
26
|
.connect(opportunityService.getSignersInterface())
|
@@ -32,27 +28,19 @@ async function registerNewUser() {
|
|
32
28
|
from: msgSender
|
33
29
|
})
|
34
30
|
|
35
|
-
console.log(tx)
|
36
|
-
|
37
31
|
const receipt = await tx.wait()
|
38
|
-
console.log('the receipt')
|
39
|
-
console.log(receipt)
|
40
32
|
|
41
33
|
if (Number(receipt.status) === 1) {
|
42
|
-
console.log('transaction succeeded')
|
43
34
|
resolve(true);
|
44
35
|
} else {
|
45
|
-
console.log('Transaction failed')
|
46
36
|
resolve(false)
|
47
37
|
}
|
48
38
|
} else {
|
49
|
-
console.log('User already registered')
|
50
39
|
resolve(false)
|
51
40
|
}
|
52
41
|
|
53
42
|
|
54
43
|
} catch(error) {
|
55
|
-
console.log(error)
|
56
44
|
reject('An error occurred while trying to complete the registration.')
|
57
45
|
}
|
58
46
|
})
|
package/src/api/index.ts
CHANGED
@@ -3,7 +3,6 @@ import syncJobs from "../sync/sync-jobs";
|
|
3
3
|
import syncMarkets from "../sync/sync-markets";
|
4
4
|
import { completeRelationship } from "./exchange/complete-relationship";
|
5
5
|
import { createTask } from "./exchange/create-task";
|
6
|
-
import { enterWorkRelationship } from "./exchange/enter-work-relationship";
|
7
6
|
import registerNewUser from "./identity/register-new-user";
|
8
7
|
import { createMarket } from "./market/create-market";
|
9
8
|
|
@@ -16,8 +15,6 @@ import { decryptByPrivateKey, encryptByPublicKey } from "./util/encrypt-by-publi
|
|
16
15
|
import { createEthCryptoCreds } from "./other/create-eth-crypto-creds";
|
17
16
|
import { encrypt } from "./provider/encrypt";
|
18
17
|
import { decrypt } from "./provider/decrypt";
|
19
|
-
import syncCreatedDisputes from "../sync/sync-disputes";
|
20
|
-
import syncMarketDisputes from "../sync/sync-market-disputes";
|
21
18
|
|
22
19
|
function generateAPI() {
|
23
20
|
return {
|
@@ -33,16 +30,7 @@ function generateAPI() {
|
|
33
30
|
},
|
34
31
|
exchange: {
|
35
32
|
completeRelationship,
|
36
|
-
createTask
|
37
|
-
enterWorkRelationship
|
38
|
-
},
|
39
|
-
dispute: {
|
40
|
-
connectGateways: () => {},
|
41
|
-
getOracleClient: () => {},
|
42
|
-
checkVoteResults: () => {},
|
43
|
-
ensureEntityMetadata: () => {},
|
44
|
-
launchNewVote: () => {},
|
45
|
-
submitVote: () => {}
|
33
|
+
createTask
|
46
34
|
},
|
47
35
|
identity: {
|
48
36
|
registerNewUser
|
@@ -54,9 +42,7 @@ function generateAPI() {
|
|
54
42
|
sync: {
|
55
43
|
syncWithEthereum: syncWithEthereumNode,
|
56
44
|
syncMarkets,
|
57
|
-
syncJobs
|
58
|
-
syncCreatedDisputes,
|
59
|
-
syncMarketDisputes
|
45
|
+
syncJobs
|
60
46
|
}
|
61
47
|
},
|
62
48
|
provider: {
|
package/src/api/internal/abis.ts
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
import abiMap from '../../blockchain/abi.json';
|
3
3
|
|
4
4
|
function getContractInterface(contract: string) {
|
5
|
-
console.log(abiMap)
|
6
5
|
return abiMap[contract]
|
7
6
|
}
|
8
7
|
|
@@ -12,7 +11,5 @@ export default {
|
|
12
11
|
'MarketFactory': abiMap['MarketFactory'],
|
13
12
|
'WorkRelationship': abiMap['WorkRelationship'],
|
14
13
|
'Market': abiMap['Market'],
|
15
|
-
'UserRegistration': abiMap['UserRegistration']
|
16
|
-
'Dispute': abiMap['Dispute'],
|
17
|
-
'Participation': abiMap['Participation']
|
14
|
+
'UserRegistration': abiMap['UserRegistration']
|
18
15
|
}
|