@human-protocol/sdk 3.0.2 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/constants.js CHANGED
@@ -54,7 +54,7 @@ exports.NETWORKS = {
54
54
  rewardPoolAddress: '0x4A5963Dd6792692e9147EdC7659936b96251917a',
55
55
  kvstoreAddress: '0xB6d36B1CDaD50302BCB3DB43bAb0D349458e1b8D',
56
56
  subgraphUrl: 'https://api.studio.thegraph.com/query/74256/ethereum/version/latest',
57
- subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/BtC96WCK6ZpZ35v94MK6rZNiBzDEZYHFzDmhMYyZ369D',
57
+ subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmWGUDcQG1e8bjp9LRcyWCo4xfWcVCdgApi59sY6rgdRkS',
58
58
  oldSubgraphUrl: '',
59
59
  oldFactoryAddress: '',
60
60
  },
@@ -96,7 +96,7 @@ exports.NETWORKS = {
96
96
  rewardPoolAddress: '0xAFf5a986A530ff839d49325A5dF69F96627E8D29',
97
97
  kvstoreAddress: '0xCc0AF0635aa19fE799B6aFDBe28fcFAeA7f00a60',
98
98
  subgraphUrl: 'https://api.studio.thegraph.com/query/74256/sepolia/version/latest',
99
- subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/UMLaZHtLE9LxzDyvBLBgfWj4erzYzYMeGUbQtxtyMaE',
99
+ subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmfCCRC1cGKWuoRtaj2ZJKyaw97Ry15TbGiC4u3veTq8iX',
100
100
  oldSubgraphUrl: '',
101
101
  oldFactoryAddress: '',
102
102
  },
@@ -110,7 +110,7 @@ exports.NETWORKS = {
110
110
  rewardPoolAddress: '0xf376443BCc6d4d4D63eeC086bc4A9E4a83878e0e',
111
111
  kvstoreAddress: '0x21A0C4CED7aE447fCf87D9FE3A29FA9B3AB20Ff1',
112
112
  subgraphUrl: 'https://api.studio.thegraph.com/query/74256/bsc/version/latest',
113
- subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/JBJPC3YmRSNjyjRTTpazhhSX5CCZ4CeBx6ptRsM8PCBb',
113
+ subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmWNVgcdzBkDyCNBYd7jBp1vChj9B3ah7nKMSXoDkzzXYm',
114
114
  oldSubgraphUrl: 'https://api.thegraph.com/subgraphs/name/humanprotocol/bsc',
115
115
  oldFactoryAddress: '0xc88bC422cAAb2ac8812de03176402dbcA09533f4',
116
116
  },
@@ -124,7 +124,7 @@ exports.NETWORKS = {
124
124
  rewardPoolAddress: '0xB0A0500103eCEc431b73F6BAd923F0a2774E6e29',
125
125
  kvstoreAddress: '0x32e27177BA6Ea91cf28dfd91a0Da9822A4b74EcF',
126
126
  subgraphUrl: 'https://api.studio.thegraph.com/query/74256/bsc-testnet/version/latest',
127
- subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/BnaC4CDqgdbGvcgM7KoZ6d7Yeebsm7NvLFrr61Lxg6Ao',
127
+ subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmaEPv3KDMJJJ8EWfcKWX7FJGDBudHhuHDCMR2LkbYhdNR',
128
128
  oldSubgraphUrl: 'https://api.thegraph.com/subgraphs/name/humanprotocol/bsctest',
129
129
  oldFactoryAddress: '0xaae6a2646c1f88763e62e0cd08ad050ea66ac46f',
130
130
  },
@@ -138,7 +138,7 @@ exports.NETWORKS = {
138
138
  rewardPoolAddress: '0xa8e32d777a3839440cc7c24D591A64B9481753B3',
139
139
  kvstoreAddress: '0xbcB28672F826a50B03EE91B28145EAbddA73B2eD',
140
140
  subgraphUrl: 'https://api.studio.thegraph.com/query/74256/polygon/version/latest',
141
- subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/HHYwCHBvDrjckpNB4jbB8k63pSot6rGtBYLBygGji3vD',
141
+ subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmS2jKUstRaGWyAhytjA2b84grhXFKouZ3fzP9fPp2etum',
142
142
  oldSubgraphUrl: 'https://api.thegraph.com/subgraphs/name/humanprotocol/polygon',
143
143
  oldFactoryAddress: '0x45eBc3eAE6DA485097054ae10BA1A0f8e8c7f794',
144
144
  },
@@ -166,7 +166,7 @@ exports.NETWORKS = {
166
166
  rewardPoolAddress: '0xd866bCEFf6D0F77E1c3EAE28230AE6C79b03fDa7',
167
167
  kvstoreAddress: '0x724AeFC243EdacCA27EAB86D3ec5a76Af4436Fc7',
168
168
  subgraphUrl: 'https://api.studio.thegraph.com/query/74256/amoy/version/latest',
169
- subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/FmdCVzHV3bB4abPVYtBALtBHr7ZRZmZ67m5c432S7GZH',
169
+ subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmVfssyiU81KwrTVL1QRjj4LPpTkA1ZmexHTRVg51J5YxP',
170
170
  oldSubgraphUrl: '',
171
171
  oldFactoryAddress: '',
172
172
  },
@@ -180,7 +180,7 @@ exports.NETWORKS = {
180
180
  rewardPoolAddress: '0x4A5963Dd6792692e9147EdC7659936b96251917a',
181
181
  kvstoreAddress: '0x2B95bEcb6EBC4589f64CB000dFCF716b4aeF8aA6',
182
182
  subgraphUrl: 'https://api.studio.thegraph.com/query/74256/moonbeam/version/latest',
183
- subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/BH5Sm6exn76o5frV5VeCufChB43DCfMXCQsdtWt4AuQP',
183
+ subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmU5hSFUvu2fp8EWU3uqxcz477gWjXjRq3jnpMT3KG14Sg',
184
184
  oldSubgraphUrl: 'https://api.thegraph.com/subgraphs/name/humanprotocol/moonbeam',
185
185
  oldFactoryAddress: '0x98108c28B7767a52BE38B4860832dd4e11A7ecad',
186
186
  },
@@ -194,7 +194,7 @@ exports.NETWORKS = {
194
194
  rewardPoolAddress: '0xf46B45Df3d956369726d8Bd93Ba33963Ab692920',
195
195
  kvstoreAddress: '0xcC561f4482f4Ff051D2Dcc65c2cE1A0f291bbA46',
196
196
  subgraphUrl: 'https://api.studio.thegraph.com/query/74256/moonbase-alpha/version/latest',
197
- subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/AmmRkJszUbjfUwHubcRkU6CfG1Q9psRWRbbHADVmsLjE',
197
+ subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/Qmf9qH6CCxBzxkruDLLJzJTm4ig8LkSZYErGCNfJC5vsgQ',
198
198
  oldSubgraphUrl: '',
199
199
  oldFactoryAddress: '',
200
200
  },
@@ -208,7 +208,7 @@ exports.NETWORKS = {
208
208
  rewardPoolAddress: '0x5517fE916Fe9F8dB15B0DDc76ebDf0BdDCd4ed18',
209
209
  kvstoreAddress: '0x3aD4B091E054f192a822D1406f4535eAd38580e4',
210
210
  subgraphUrl: 'https://api.studio.thegraph.com/query/74256/fuji/version/latest',
211
- subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/CnZCDsWziQF3jNoqgQMkmJbF9frof5osM3hN5eUgyL5u',
211
+ subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmXcSyzYPk4AFyWq4wubxrgVNYuse8zHiQYUZR7WFinRSj',
212
212
  oldSubgraphUrl: 'https://api.thegraph.com/subgraphs/name/humanprotocol/fuji',
213
213
  oldFactoryAddress: '0xfb4469201951C3B9a7F1996c477cb7BDBEcE0A88',
214
214
  },
@@ -222,7 +222,7 @@ exports.NETWORKS = {
222
222
  rewardPoolAddress: '0x4A5963Dd6792692e9147EdC7659936b96251917a',
223
223
  kvstoreAddress: '0x9Bc7bff35B2Be2413708d48c3B0aEF5c43646728',
224
224
  subgraphUrl: 'https://api.studio.thegraph.com/query/74256/avalanche/version/latest',
225
- subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/FweDaDWZ6ZDcsA63wsjnWgdgw4aCbkiVQYMYvtcP5p2u',
225
+ subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmbKoD9diMdiLoVgAzJmjM4Qj6jeUQAD8ztquPMMcaZVFA',
226
226
  oldSubgraphUrl: 'https://api.thegraph.com/subgraphs/name/humanprotocol/avalanche',
227
227
  oldFactoryAddress: '0x9767a578ba7a5FA1563c8229943cB01cd8446BB4',
228
228
  },
@@ -236,7 +236,7 @@ exports.NETWORKS = {
236
236
  rewardPoolAddress: '0xA9545C2530BD5bdb464d5E274F59ACceAa73eD86',
237
237
  kvstoreAddress: '0x938335006ea6F9Eb0e8020969cFF94404425e298',
238
238
  subgraphUrl: 'https://api.studio.thegraph.com/query/74256/celo-alfajores/version/latest',
239
- subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/EGWCWuzBNkbypW8ipRKuyGwq8azoCy6LKKosGgSPMGRD',
239
+ subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmWSLvacfR6xiJ8dYJbABtMg3r2TuoKBSjMGSofJVh2uoR',
240
240
  oldSubgraphUrl: '',
241
241
  oldFactoryAddress: '',
242
242
  },
@@ -250,7 +250,7 @@ exports.NETWORKS = {
250
250
  rewardPoolAddress: '0xb9344bAD98E3d26a4d83900922baf395a2Ec154c',
251
251
  kvstoreAddress: '0x86Af9f6Cd34B69Db1B202223C6d6D109f2491569',
252
252
  subgraphUrl: 'https://api.studio.thegraph.com/query/74256/celo/version/latest',
253
- subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/HTgMnYWGsdsw41o8dyph1bwhotuXh6va3L8r8DGgLjsA',
253
+ subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmXCUVfazFdQ9s1gWHyr7eNGTUY1zLVhmVGoVYhLbkT4ib',
254
254
  oldSubgraphUrl: '',
255
255
  oldFactoryAddress: '',
256
256
  },
@@ -264,7 +264,7 @@ exports.NETWORKS = {
264
264
  rewardPoolAddress: '0x7ABa5F75b2b530cB0c8927C86591c21dF44f06b6',
265
265
  kvstoreAddress: '0x6512d894cc3d3FE93Da9d0420430136fA889FaB9',
266
266
  subgraphUrl: 'https://api.studio.thegraph.com/query/74256/xlayer/version/latest',
267
- subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/CrratkbjCraj1BZLgJmck1GGxbMb2Y2iPZiW4Lh5DdcX',
267
+ subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmY7z7abXHxFBSqzeM67q5AYxF4uRLFvpVrQQQpwVJqMkQ',
268
268
  oldSubgraphUrl: '',
269
269
  oldFactoryAddress: '',
270
270
  },
@@ -278,7 +278,7 @@ exports.NETWORKS = {
278
278
  rewardPoolAddress: '0x6daccd1f3a68945f8a7ac6d20260953f7a97fae4',
279
279
  kvstoreAddress: '0xdE8BE9E3C12E9F546309A429cd88d026a25EaF8C',
280
280
  subgraphUrl: 'https://api.studio.thegraph.com/query/74256/xlayer-testnet/version/latest',
281
- subgraphUrlApiKey: 'https://gateway-testnet-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/9zd1LcywWjuSUtde4ofC8oyyzpawPwGUiPsvqTq247xk',
281
+ subgraphUrlApiKey: 'https://gateway-testnet-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmVw3K8cdbommhhH6jhmkLGQAbPjgWuYYeUfBCQv6rmJTr',
282
282
  oldSubgraphUrl: '',
283
283
  oldFactoryAddress: '',
284
284
  },
@@ -1 +1 @@
1
- {"version":3,"file":"statistics.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/statistics.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAqDrD,eAAO,MAAM,4BAA4B,gCAOxC,CAAC;AAEF,eAAO,MAAM,2BAA2B,gCAOvC,CAAC;AAEF,eAAO,MAAM,wBAAwB,WAAY,iBAAiB,mCA6BjE,CAAC"}
1
+ {"version":3,"file":"statistics.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/statistics.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAuDrD,eAAO,MAAM,4BAA4B,gCAOxC,CAAC;AAIF,eAAO,MAAM,2BAA2B,gCAOvC,CAAC;AAEF,eAAO,MAAM,wBAAwB,WAAY,iBAAiB,mCA6BjE,CAAC"}
@@ -53,17 +53,19 @@ const EVENT_DAY_DATA_FRAGMENT = (0, graphql_tag_1.default) `
53
53
  dailyUniqueReceivers
54
54
  }
55
55
  `;
56
+ const hmtStatisticsId = Buffer.from('hmt-statistics-id').toString('hex');
56
57
  exports.GET_HMTOKEN_STATISTICS_QUERY = (0, graphql_tag_1.default) `
57
58
  query GetHMTokenStatistics {
58
- hmtokenStatistics(id: "hmt-statistics-id") {
59
+ hmtokenStatistics(id: "${hmtStatisticsId}") {
59
60
  ...HMTokenStatisticsFields
60
61
  }
61
62
  }
62
63
  ${HMTOKEN_STATISTICS_FRAGMENT}
63
64
  `;
65
+ const escrowStatisticsId = Buffer.from('escrow-statistics-id').toString('hex');
64
66
  exports.GET_ESCROW_STATISTICS_QUERY = (0, graphql_tag_1.default) `
65
67
  query GetEscrowStatistics {
66
- escrowStatistics(id: "escrow-statistics-id") {
68
+ escrowStatistics(id: "${escrowStatisticsId}") {
67
69
  ...EscrowStatisticsFields
68
70
  }
69
71
  }
@@ -1 +1 @@
1
- {"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../src/operator.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EAEP,cAAc,EACd,SAAS,EAET,OAAO,EACR,MAAM,cAAc,CAAC;AAetB,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGlC,qBAAa,aAAa;IACxB;;;;;;;;;;;;;;OAcG;WACiB,SAAS,CAC3B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,OAAO,CAAC;IAkCnB;;;;;;;;;;;;;;;;;OAiBG;WACiB,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAsC1E;;;;;;;;;;;;;OAaG;WACiB,6BAA6B,CAC/C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,SAAS,EAAE,CAAC;IA6BvB;;;;;;;;;;;;;;OAcG;WACiB,UAAU,CAC5B,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,OAAO,EAAE,CAAC;CAuBtB"}
1
+ {"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../src/operator.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EAEP,cAAc,EACd,SAAS,EAET,OAAO,EACR,MAAM,cAAc,CAAC;AAetB,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGlC,qBAAa,aAAa;IACxB;;;;;;;;;;;;;;OAcG;WACiB,SAAS,CAC3B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,OAAO,CAAC;IAkCnB;;;;;;;;;;;;;;;;;OAiBG;WACiB,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAsC1E;;;;;;;;;;;;;OAaG;WACiB,6BAA6B,CAC/C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,SAAS,EAAE,CAAC;IA+BvB;;;;;;;;;;;;;;OAcG;WACiB,UAAU,CAC5B,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,OAAO,EAAE,CAAC;CAyBtB"}
package/dist/operator.js CHANGED
@@ -122,6 +122,8 @@ class OperatorUtils {
122
122
  address: address.toLowerCase(),
123
123
  role: role,
124
124
  });
125
+ if (!reputationNetwork)
126
+ return [];
125
127
  return reputationNetwork.operators.map((operator) => {
126
128
  let jobTypes = [];
127
129
  if (typeof operator.jobTypes === 'string') {
@@ -162,6 +164,8 @@ class OperatorUtils {
162
164
  const { rewardAddedEvents } = await (0, graphql_request_1.default)((0, utils_1.getSubgraphUrl)(networkData), reward_1.GET_REWARD_ADDED_EVENTS_QUERY, {
163
165
  slasherAddress: slasherAddress.toLowerCase(),
164
166
  });
167
+ if (!rewardAddedEvents)
168
+ return [];
165
169
  return rewardAddedEvents.map((reward) => {
166
170
  return {
167
171
  escrowAddress: reward.escrow,
@@ -39,7 +39,7 @@ class TransactionUtils {
39
39
  const { transaction } = await (0, graphql_request_1.default)((0, utils_1.getSubgraphUrl)(networkData), transaction_1.GET_TRANSACTION_QUERY, {
40
40
  hash: hash.toLowerCase(),
41
41
  });
42
- return transaction;
42
+ return transaction || null;
43
43
  }
44
44
  /**
45
45
  * This function returns all transaction details based on the provided filter.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@human-protocol/sdk",
3
3
  "description": "Human Protocol SDK",
4
- "version": "3.0.2",
4
+ "version": "3.0.4",
5
5
  "files": [
6
6
  "src",
7
7
  "dist"
@@ -40,7 +40,6 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@human-protocol/core": "*",
43
- "aws-sdk": "^2.1528.0",
44
43
  "axios": "^1.4.0",
45
44
  "graphql": "^16.8.1",
46
45
  "graphql-request": "^6.1.0",
@@ -48,8 +47,7 @@
48
47
  "minio": "7.1.3",
49
48
  "openpgp": "^5.11.1",
50
49
  "secp256k1": "^4.0.3",
51
- "vitest": "^1.6.0",
52
- "winston": "^3.13.0"
50
+ "vitest": "^1.6.0"
53
51
  },
54
52
  "devDependencies": {
55
53
  "typedoc": "^0.26.5",
package/src/constants.ts CHANGED
@@ -63,7 +63,7 @@ export const NETWORKS: {
63
63
  subgraphUrl:
64
64
  'https://api.studio.thegraph.com/query/74256/ethereum/version/latest',
65
65
  subgraphUrlApiKey:
66
- 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/BtC96WCK6ZpZ35v94MK6rZNiBzDEZYHFzDmhMYyZ369D',
66
+ 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmWGUDcQG1e8bjp9LRcyWCo4xfWcVCdgApi59sY6rgdRkS',
67
67
  oldSubgraphUrl: '',
68
68
  oldFactoryAddress: '',
69
69
  },
@@ -109,7 +109,7 @@ export const NETWORKS: {
109
109
  subgraphUrl:
110
110
  'https://api.studio.thegraph.com/query/74256/sepolia/version/latest',
111
111
  subgraphUrlApiKey:
112
- 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/UMLaZHtLE9LxzDyvBLBgfWj4erzYzYMeGUbQtxtyMaE',
112
+ 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmfCCRC1cGKWuoRtaj2ZJKyaw97Ry15TbGiC4u3veTq8iX',
113
113
  oldSubgraphUrl: '',
114
114
  oldFactoryAddress: '',
115
115
  },
@@ -125,7 +125,7 @@ export const NETWORKS: {
125
125
  subgraphUrl:
126
126
  'https://api.studio.thegraph.com/query/74256/bsc/version/latest',
127
127
  subgraphUrlApiKey:
128
- 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/JBJPC3YmRSNjyjRTTpazhhSX5CCZ4CeBx6ptRsM8PCBb',
128
+ 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmWNVgcdzBkDyCNBYd7jBp1vChj9B3ah7nKMSXoDkzzXYm',
129
129
  oldSubgraphUrl: 'https://api.thegraph.com/subgraphs/name/humanprotocol/bsc',
130
130
  oldFactoryAddress: '0xc88bC422cAAb2ac8812de03176402dbcA09533f4',
131
131
  },
@@ -141,7 +141,7 @@ export const NETWORKS: {
141
141
  subgraphUrl:
142
142
  'https://api.studio.thegraph.com/query/74256/bsc-testnet/version/latest',
143
143
  subgraphUrlApiKey:
144
- 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/BnaC4CDqgdbGvcgM7KoZ6d7Yeebsm7NvLFrr61Lxg6Ao',
144
+ 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmaEPv3KDMJJJ8EWfcKWX7FJGDBudHhuHDCMR2LkbYhdNR',
145
145
  oldSubgraphUrl:
146
146
  'https://api.thegraph.com/subgraphs/name/humanprotocol/bsctest',
147
147
  oldFactoryAddress: '0xaae6a2646c1f88763e62e0cd08ad050ea66ac46f',
@@ -158,7 +158,7 @@ export const NETWORKS: {
158
158
  subgraphUrl:
159
159
  'https://api.studio.thegraph.com/query/74256/polygon/version/latest',
160
160
  subgraphUrlApiKey:
161
- 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/HHYwCHBvDrjckpNB4jbB8k63pSot6rGtBYLBygGji3vD',
161
+ 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmS2jKUstRaGWyAhytjA2b84grhXFKouZ3fzP9fPp2etum',
162
162
  oldSubgraphUrl:
163
163
  'https://api.thegraph.com/subgraphs/name/humanprotocol/polygon',
164
164
  oldFactoryAddress: '0x45eBc3eAE6DA485097054ae10BA1A0f8e8c7f794',
@@ -191,7 +191,7 @@ export const NETWORKS: {
191
191
  subgraphUrl:
192
192
  'https://api.studio.thegraph.com/query/74256/amoy/version/latest',
193
193
  subgraphUrlApiKey:
194
- 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/FmdCVzHV3bB4abPVYtBALtBHr7ZRZmZ67m5c432S7GZH',
194
+ 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmVfssyiU81KwrTVL1QRjj4LPpTkA1ZmexHTRVg51J5YxP',
195
195
  oldSubgraphUrl: '',
196
196
  oldFactoryAddress: '',
197
197
  },
@@ -207,7 +207,7 @@ export const NETWORKS: {
207
207
  subgraphUrl:
208
208
  'https://api.studio.thegraph.com/query/74256/moonbeam/version/latest',
209
209
  subgraphUrlApiKey:
210
- 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/BH5Sm6exn76o5frV5VeCufChB43DCfMXCQsdtWt4AuQP',
210
+ 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmU5hSFUvu2fp8EWU3uqxcz477gWjXjRq3jnpMT3KG14Sg',
211
211
  oldSubgraphUrl:
212
212
  'https://api.thegraph.com/subgraphs/name/humanprotocol/moonbeam',
213
213
  oldFactoryAddress: '0x98108c28B7767a52BE38B4860832dd4e11A7ecad',
@@ -224,7 +224,7 @@ export const NETWORKS: {
224
224
  subgraphUrl:
225
225
  'https://api.studio.thegraph.com/query/74256/moonbase-alpha/version/latest',
226
226
  subgraphUrlApiKey:
227
- 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/AmmRkJszUbjfUwHubcRkU6CfG1Q9psRWRbbHADVmsLjE',
227
+ 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/Qmf9qH6CCxBzxkruDLLJzJTm4ig8LkSZYErGCNfJC5vsgQ',
228
228
  oldSubgraphUrl: '',
229
229
  oldFactoryAddress: '',
230
230
  },
@@ -240,7 +240,7 @@ export const NETWORKS: {
240
240
  subgraphUrl:
241
241
  'https://api.studio.thegraph.com/query/74256/fuji/version/latest',
242
242
  subgraphUrlApiKey:
243
- 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/CnZCDsWziQF3jNoqgQMkmJbF9frof5osM3hN5eUgyL5u',
243
+ 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmXcSyzYPk4AFyWq4wubxrgVNYuse8zHiQYUZR7WFinRSj',
244
244
  oldSubgraphUrl:
245
245
  'https://api.thegraph.com/subgraphs/name/humanprotocol/fuji',
246
246
  oldFactoryAddress: '0xfb4469201951C3B9a7F1996c477cb7BDBEcE0A88',
@@ -257,7 +257,7 @@ export const NETWORKS: {
257
257
  subgraphUrl:
258
258
  'https://api.studio.thegraph.com/query/74256/avalanche/version/latest',
259
259
  subgraphUrlApiKey:
260
- 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/FweDaDWZ6ZDcsA63wsjnWgdgw4aCbkiVQYMYvtcP5p2u',
260
+ 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmbKoD9diMdiLoVgAzJmjM4Qj6jeUQAD8ztquPMMcaZVFA',
261
261
  oldSubgraphUrl:
262
262
  'https://api.thegraph.com/subgraphs/name/humanprotocol/avalanche',
263
263
  oldFactoryAddress: '0x9767a578ba7a5FA1563c8229943cB01cd8446BB4',
@@ -274,7 +274,7 @@ export const NETWORKS: {
274
274
  subgraphUrl:
275
275
  'https://api.studio.thegraph.com/query/74256/celo-alfajores/version/latest',
276
276
  subgraphUrlApiKey:
277
- 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/EGWCWuzBNkbypW8ipRKuyGwq8azoCy6LKKosGgSPMGRD',
277
+ 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmWSLvacfR6xiJ8dYJbABtMg3r2TuoKBSjMGSofJVh2uoR',
278
278
  oldSubgraphUrl: '',
279
279
  oldFactoryAddress: '',
280
280
  },
@@ -290,7 +290,7 @@ export const NETWORKS: {
290
290
  subgraphUrl:
291
291
  'https://api.studio.thegraph.com/query/74256/celo/version/latest',
292
292
  subgraphUrlApiKey:
293
- 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/HTgMnYWGsdsw41o8dyph1bwhotuXh6va3L8r8DGgLjsA',
293
+ 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmXCUVfazFdQ9s1gWHyr7eNGTUY1zLVhmVGoVYhLbkT4ib',
294
294
  oldSubgraphUrl: '',
295
295
  oldFactoryAddress: '',
296
296
  },
@@ -306,7 +306,7 @@ export const NETWORKS: {
306
306
  subgraphUrl:
307
307
  'https://api.studio.thegraph.com/query/74256/xlayer/version/latest',
308
308
  subgraphUrlApiKey:
309
- 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/CrratkbjCraj1BZLgJmck1GGxbMb2Y2iPZiW4Lh5DdcX',
309
+ 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmY7z7abXHxFBSqzeM67q5AYxF4uRLFvpVrQQQpwVJqMkQ',
310
310
  oldSubgraphUrl: '',
311
311
  oldFactoryAddress: '',
312
312
  },
@@ -322,7 +322,7 @@ export const NETWORKS: {
322
322
  subgraphUrl:
323
323
  'https://api.studio.thegraph.com/query/74256/xlayer-testnet/version/latest',
324
324
  subgraphUrlApiKey:
325
- 'https://gateway-testnet-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/subgraphs/id/9zd1LcywWjuSUtde4ofC8oyyzpawPwGUiPsvqTq247xk',
325
+ 'https://gateway-testnet-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmVw3K8cdbommhhH6jhmkLGQAbPjgWuYYeUfBCQv6rmJTr',
326
326
  oldSubgraphUrl: '',
327
327
  oldFactoryAddress: '',
328
328
  },
@@ -52,18 +52,22 @@ const EVENT_DAY_DATA_FRAGMENT = gql`
52
52
  }
53
53
  `;
54
54
 
55
+ const hmtStatisticsId = Buffer.from('hmt-statistics-id').toString('hex');
56
+
55
57
  export const GET_HMTOKEN_STATISTICS_QUERY = gql`
56
58
  query GetHMTokenStatistics {
57
- hmtokenStatistics(id: "hmt-statistics-id") {
59
+ hmtokenStatistics(id: "${hmtStatisticsId}") {
58
60
  ...HMTokenStatisticsFields
59
61
  }
60
62
  }
61
63
  ${HMTOKEN_STATISTICS_FRAGMENT}
62
64
  `;
63
65
 
66
+ const escrowStatisticsId = Buffer.from('escrow-statistics-id').toString('hex');
67
+
64
68
  export const GET_ESCROW_STATISTICS_QUERY = gql`
65
69
  query GetEscrowStatistics {
66
- escrowStatistics(id: "escrow-statistics-id") {
70
+ escrowStatistics(id: "${escrowStatisticsId}") {
67
71
  ...EscrowStatisticsFields
68
72
  }
69
73
  }
package/src/operator.ts CHANGED
@@ -165,6 +165,8 @@ export class OperatorUtils {
165
165
  role: role,
166
166
  });
167
167
 
168
+ if (!reputationNetwork) return [];
169
+
168
170
  return reputationNetwork.operators.map((operator) => {
169
171
  let jobTypes: string[] = [];
170
172
 
@@ -215,6 +217,8 @@ export class OperatorUtils {
215
217
  slasherAddress: slasherAddress.toLowerCase(),
216
218
  });
217
219
 
220
+ if (!rewardAddedEvents) return [];
221
+
218
222
  return rewardAddedEvents.map((reward: any) => {
219
223
  return {
220
224
  escrowAddress: reward.escrow,
@@ -50,7 +50,7 @@ export class TransactionUtils {
50
50
  hash: hash.toLowerCase(),
51
51
  });
52
52
 
53
- return transaction;
53
+ return transaction || null;
54
54
  }
55
55
 
56
56
  /**