opportunity-service 0.0.656 → 0.0.660
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 +1 -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 +7 -3
- 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 +1 -11
- 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 +6 -4
- 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,33 +0,0 @@
|
|
1
|
-
import { Contracts, ExchangeEvents } from '../../constants';
|
2
|
-
import * as abiMap from '../../blockchain/abi.json';
|
3
|
-
import { ethers } from 'ethers';
|
4
|
-
import opportunityEventEmitter from '../../events/OpportunityEventEmitter';
|
5
|
-
/**
|
6
|
-
* WorkRelationshipCreated(address owner, address relationship, address market)
|
7
|
-
* @param log
|
8
|
-
* @returns
|
9
|
-
*/
|
10
|
-
function processDisputeInvolvement(log) {
|
11
|
-
try {
|
12
|
-
const iface = new ethers.utils.Interface(abiMap[Contracts.DISPUTE]);
|
13
|
-
const decodedLog = iface.parseLog(log);
|
14
|
-
const { args, signature } = decodedLog;
|
15
|
-
const employer = args[0];
|
16
|
-
const worker = args[1];
|
17
|
-
const relationship = args[2];
|
18
|
-
const disputeAddress = args[3];
|
19
|
-
const disputeData = {
|
20
|
-
employer,
|
21
|
-
worker,
|
22
|
-
relationship,
|
23
|
-
address: disputeAddress
|
24
|
-
};
|
25
|
-
console.log("Processing a dispute created event with address: " + disputeData);
|
26
|
-
opportunityEventEmitter.emit(ExchangeEvents.DisputeInvolvement, disputeData);
|
27
|
-
}
|
28
|
-
catch (error) {
|
29
|
-
console.log(error);
|
30
|
-
}
|
31
|
-
}
|
32
|
-
export { processDisputeInvolvement };
|
33
|
-
//# sourceMappingURL=processDisputeInvolvement.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"processDisputeInvolvement.js","sourceRoot":"","sources":["../../../src/sync/process/processDisputeInvolvement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAgB,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAIpD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,uBAAuB,MAAM,sCAAsC,CAAC;AAG3E;;;;GAIG;AACH,SAAS,yBAAyB,CAAC,GAAG;IAClC,IAAI;QACJ,MAAM,KAAK,GAAe,IAAI,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;QAChF,MAAM,UAAU,GAAoB,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACxD,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC;QAEvC,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QACtB,MAAM,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QAC5B,MAAM,cAAc,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAE/B,MAAM,WAAW,GAAG;YAChB,QAAQ;YACR,MAAM;YACN,YAAY;YACZ,OAAO,EAAE,cAAc;SAC1B,CAAA;QAED,OAAO,CAAC,GAAG,CAAC,mDAAmD,GAAG,WAAW,CAAC,CAAA;QAE9E,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;KAChF;IAAC,OAAM,KAAK,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;KACrB;AACD,CAAC;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
|
@@ -1,34 +0,0 @@
|
|
1
|
-
import { Contracts, ExchangeEvents } from '../../constants';
|
2
|
-
import * as abiMap from '../../blockchain/abi.json';
|
3
|
-
import { ethers } from 'ethers';
|
4
|
-
import opportunityEventEmitter from '../../events/OpportunityEventEmitter';
|
5
|
-
/**
|
6
|
-
* WorkRelationshipCreated(address owner, address relationship, address market)
|
7
|
-
* @param log
|
8
|
-
* @returns
|
9
|
-
*/
|
10
|
-
function processMarketDispute(log) {
|
11
|
-
try {
|
12
|
-
const iface = new ethers.utils.Interface(abiMap[Contracts.DISPUTE]);
|
13
|
-
const decodedLog = iface.parseLog(log);
|
14
|
-
const { args, signature } = decodedLog;
|
15
|
-
const employer = args[0];
|
16
|
-
const worker = args[1];
|
17
|
-
const relationship = args[2];
|
18
|
-
const disputeAddress = args[3];
|
19
|
-
const marketAddress = args[4];
|
20
|
-
const disputeData = {
|
21
|
-
employer,
|
22
|
-
worker,
|
23
|
-
relationship,
|
24
|
-
address: disputeAddress
|
25
|
-
};
|
26
|
-
console.log("Processing a dispute created in the market: " + marketAddress);
|
27
|
-
opportunityEventEmitter.emit(ExchangeEvents.MarketDispute, disputeData);
|
28
|
-
}
|
29
|
-
catch (error) {
|
30
|
-
console.log(error);
|
31
|
-
}
|
32
|
-
}
|
33
|
-
export { processMarketDispute };
|
34
|
-
//# sourceMappingURL=processMarketDisputes.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"processMarketDisputes.js","sourceRoot":"","sources":["../../../src/sync/process/processMarketDisputes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAgB,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAIpD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,uBAAuB,MAAM,sCAAsC,CAAC;AAG3E;;;;GAIG;AACH,SAAS,oBAAoB,CAAC,GAAG;IAC7B,IAAI;QACJ,MAAM,KAAK,GAAe,IAAI,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;QAChF,MAAM,UAAU,GAAoB,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACxD,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC;QAEvC,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QACtB,MAAM,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QAC5B,MAAM,cAAc,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,aAAa,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QAE7B,MAAM,WAAW,GAAG;YAChB,QAAQ;YACR,MAAM;YACN,YAAY;YACZ,OAAO,EAAE,cAAc;SAC1B,CAAA;QAED,OAAO,CAAC,GAAG,CAAC,8CAA8C,GAAG,aAAa,CAAC,CAAA;QAE3E,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;KAC3E;IAAC,OAAM,KAAK,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;KACrB;AACD,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
@@ -1,37 +0,0 @@
|
|
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 syncCreatedDisputes(userSummaryAddress) {
|
13
|
-
return __awaiter(this, void 0, void 0, function* () {
|
14
|
-
if (opportunityService.getProviderInterface()) {
|
15
|
-
yield opportunityService.getProviderInterface().getLogs({
|
16
|
-
address: userSummaryAddress,
|
17
|
-
fromBlock: 1,
|
18
|
-
toBlock: 'latest',
|
19
|
-
topics: [
|
20
|
-
'DisputeCreated(address,address,address,address)'
|
21
|
-
]
|
22
|
-
}).then((logs) => {
|
23
|
-
console.log('Found logs.. Processing sync disputes');
|
24
|
-
logs.forEach(log => {
|
25
|
-
if (log && Array.isArray(log.topics) && log.topics.length) {
|
26
|
-
processLog(log); // keccashinside here
|
27
|
-
}
|
28
|
-
});
|
29
|
-
})
|
30
|
-
.catch(err => {
|
31
|
-
console.log('Err on fetching logs from blockchain: ' + err);
|
32
|
-
});
|
33
|
-
}
|
34
|
-
});
|
35
|
-
}
|
36
|
-
export default syncCreatedDisputes;
|
37
|
-
//# sourceMappingURL=sync-disputes.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"sync-disputes.js","sourceRoot":"","sources":["../../src/sync/sync-disputes.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAInD,SAAe,mBAAmB,CAAC,kBAAkB;;QACjD,IAAI,kBAAkB,CAAC,oBAAoB,EAAE,EAAE;YAC9C,MAAM,kBAAkB,CAAC,oBAAoB,EAAE,CAAC,OAAO,CAAC;gBACrD,OAAO,EAAE,kBAAkB;gBAC3B,SAAS,EAAE,CAAC;gBACZ,OAAO,EAAE,QAAQ;gBACjB,MAAM,EAAE;oBACJ,iDAAiD;iBACpD;aACJ,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;gBACb,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAA;gBACpD,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,GAAG,CAAC,EAAE;gBACT,OAAO,CAAC,GAAG,CAAC,wCAAwC,GAAG,GAAG,CAAC,CAAA;YAC/D,CAAC,CAAC,CAAA;SACL;IACD,CAAC;CAAA;AAED,eAAe,mBAAmB,CAAC"}
|
@@ -1,42 +0,0 @@
|
|
1
|
-
import { Contracts, ExchangeEvents, MarketEvents } from '../../constants';
|
2
|
-
import * as abiMap from '../../blockchain/abi.json';
|
3
|
-
import * as addressMap from '../../blockchain/addresses.json';
|
4
|
-
import opportunityService from '../../OpportunityService';
|
5
|
-
import { Contract } from '@ethersproject/contracts';
|
6
|
-
import { ethers } from 'ethers';
|
7
|
-
import { AbiCoder, EventFragment, Interface, LogDescription, Result } from '@ethersproject/abi';
|
8
|
-
import opportunityEventEmitter from '../../events/OpportunityEventEmitter';
|
9
|
-
|
10
|
-
|
11
|
-
/**
|
12
|
-
* WorkRelationshipCreated(address owner, address relationship, address market)
|
13
|
-
* @param log
|
14
|
-
* @returns
|
15
|
-
*/
|
16
|
-
function processDisputeInvolvement(log) {
|
17
|
-
try {
|
18
|
-
const iface : Interface = new ethers.utils.Interface(abiMap[Contracts.DISPUTE]);
|
19
|
-
const decodedLog : LogDescription = iface.parseLog(log);
|
20
|
-
const { args, signature } = decodedLog;
|
21
|
-
|
22
|
-
const employer = args[0]
|
23
|
-
const worker = args[1]
|
24
|
-
const relationship = args[2]
|
25
|
-
const disputeAddress = args[3];
|
26
|
-
|
27
|
-
const disputeData = {
|
28
|
-
employer,
|
29
|
-
worker,
|
30
|
-
relationship,
|
31
|
-
address: disputeAddress
|
32
|
-
}
|
33
|
-
|
34
|
-
console.log("Processing a dispute created event with address: " + disputeData)
|
35
|
-
|
36
|
-
opportunityEventEmitter.emit(ExchangeEvents.DisputeInvolvement, disputeData);
|
37
|
-
} catch(error) {
|
38
|
-
console.log(error)
|
39
|
-
}
|
40
|
-
}
|
41
|
-
|
42
|
-
export { processDisputeInvolvement };
|
@@ -1,43 +0,0 @@
|
|
1
|
-
import { Contracts, ExchangeEvents, MarketEvents } from '../../constants';
|
2
|
-
import * as abiMap from '../../blockchain/abi.json';
|
3
|
-
import * as addressMap from '../../blockchain/addresses.json';
|
4
|
-
import opportunityService from '../../OpportunityService';
|
5
|
-
import { Contract } from '@ethersproject/contracts';
|
6
|
-
import { ethers } from 'ethers';
|
7
|
-
import { AbiCoder, EventFragment, Interface, LogDescription, Result } from '@ethersproject/abi';
|
8
|
-
import opportunityEventEmitter from '../../events/OpportunityEventEmitter';
|
9
|
-
|
10
|
-
|
11
|
-
/**
|
12
|
-
* WorkRelationshipCreated(address owner, address relationship, address market)
|
13
|
-
* @param log
|
14
|
-
* @returns
|
15
|
-
*/
|
16
|
-
function processMarketDispute(log) {
|
17
|
-
try {
|
18
|
-
const iface : Interface = new ethers.utils.Interface(abiMap[Contracts.DISPUTE]);
|
19
|
-
const decodedLog : LogDescription = iface.parseLog(log);
|
20
|
-
const { args, signature } = decodedLog;
|
21
|
-
|
22
|
-
const employer = args[0]
|
23
|
-
const worker = args[1]
|
24
|
-
const relationship = args[2]
|
25
|
-
const disputeAddress = args[3];
|
26
|
-
const marketAddress = args[4]
|
27
|
-
|
28
|
-
const disputeData = {
|
29
|
-
employer,
|
30
|
-
worker,
|
31
|
-
relationship,
|
32
|
-
address: disputeAddress
|
33
|
-
}
|
34
|
-
|
35
|
-
console.log("Processing a dispute created in the market: " + marketAddress)
|
36
|
-
|
37
|
-
opportunityEventEmitter.emit(ExchangeEvents.MarketDispute, disputeData);
|
38
|
-
} catch(error) {
|
39
|
-
console.log(error)
|
40
|
-
}
|
41
|
-
}
|
42
|
-
|
43
|
-
export { processMarketDispute };
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import opportunityService from "../OpportunityService";
|
2
|
-
import { processLog } from './process/process-log';
|
3
|
-
import * as addressMap from '../blockchain/addresses.json';
|
4
|
-
import { Contracts } from '../constants';
|
5
|
-
|
6
|
-
async function syncCreatedDisputes(userSummaryAddress) {
|
7
|
-
if (opportunityService.getProviderInterface()) {
|
8
|
-
await opportunityService.getProviderInterface().getLogs({
|
9
|
-
address: userSummaryAddress,
|
10
|
-
fromBlock: 1,
|
11
|
-
toBlock: 'latest',
|
12
|
-
topics: [
|
13
|
-
'DisputeCreated(address,address,address,address)'
|
14
|
-
]
|
15
|
-
}).then((logs) => {
|
16
|
-
console.log('Found logs.. Processing sync disputes')
|
17
|
-
logs.forEach(log => {
|
18
|
-
if (log && Array.isArray(log.topics) && log.topics.length) {
|
19
|
-
processLog(log); // keccashinside here
|
20
|
-
}
|
21
|
-
})
|
22
|
-
})
|
23
|
-
.catch(err => {
|
24
|
-
console.log('Err on fetching logs from blockchain: ' + err)
|
25
|
-
})
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
|
-
export default syncCreatedDisputes;
|