@human-protocol/sdk 4.1.0 → 4.1.2
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 +6 -6
- package/dist/escrow.d.ts +10 -10
- package/dist/escrow.d.ts.map +1 -1
- package/dist/escrow.js +6 -6
- package/dist/graphql/queries/escrow.d.ts.map +1 -1
- package/dist/graphql/queries/hmtoken.d.ts.map +1 -1
- package/dist/graphql/queries/operator.d.ts.map +1 -1
- package/dist/graphql/queries/payout.d.ts.map +1 -1
- package/dist/graphql/queries/statistics.d.ts.map +1 -1
- package/dist/graphql/queries/statistics.js +1 -1
- package/dist/graphql/queries/transaction.d.ts.map +1 -1
- package/dist/graphql/queries/transaction.js +7 -1
- package/dist/graphql/queries/worker.d.ts.map +1 -1
- package/dist/graphql/queries/worker.js +2 -2
- package/dist/graphql/types.d.ts +1 -8
- package/dist/graphql/types.d.ts.map +1 -1
- package/dist/interfaces.d.ts +25 -1
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/statistics.js +2 -2
- package/dist/transaction.d.ts +25 -2
- package/dist/transaction.d.ts.map +1 -1
- package/dist/transaction.js +28 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +2 -1
- package/dist/worker.d.ts +1 -1
- package/dist/worker.js +1 -1
- package/package.json +12 -8
- package/src/constants.ts +6 -6
- package/src/escrow.ts +9 -10
- package/src/graphql/queries/statistics.ts +1 -1
- package/src/graphql/queries/transaction.ts +17 -2
- package/src/graphql/queries/worker.ts +2 -2
- package/src/graphql/types.ts +1 -9
- package/src/interfaces.ts +26 -1
- package/src/statistics.ts +2 -2
- package/src/transaction.ts +28 -2
- package/src/utils.ts +2 -1
- package/src/worker.ts +1 -1
package/dist/constants.js
CHANGED
|
@@ -28,7 +28,7 @@ exports.NETWORKS = {
|
|
|
28
28
|
stakingAddress: '0xEf6Da3aB52c33925Be3F84038193a7e1331F51E6',
|
|
29
29
|
kvstoreAddress: '0xB6d36B1CDaD50302BCB3DB43bAb0D349458e1b8D',
|
|
30
30
|
subgraphUrl: 'https://api.studio.thegraph.com/query/74256/ethereum/version/latest',
|
|
31
|
-
subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/
|
|
31
|
+
subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmZEF1exsjDwjDXy1kmN3MbdZKxfkkoTj2MbEPUyhLfEG3',
|
|
32
32
|
oldSubgraphUrl: '',
|
|
33
33
|
oldFactoryAddress: '',
|
|
34
34
|
},
|
|
@@ -41,7 +41,7 @@ exports.NETWORKS = {
|
|
|
41
41
|
stakingAddress: '0x2163e3A40032Af1C359ac731deaB48258b317890',
|
|
42
42
|
kvstoreAddress: '0xCc0AF0635aa19fE799B6aFDBe28fcFAeA7f00a60',
|
|
43
43
|
subgraphUrl: 'https://api.studio.thegraph.com/query/74256/sepolia/version/latest',
|
|
44
|
-
subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/
|
|
44
|
+
subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmeHhtntEYGdgTqHQTJu5mUXHS8JPt3RiwidLYeeEu6VpP',
|
|
45
45
|
oldSubgraphUrl: '',
|
|
46
46
|
oldFactoryAddress: '',
|
|
47
47
|
},
|
|
@@ -54,7 +54,7 @@ exports.NETWORKS = {
|
|
|
54
54
|
stakingAddress: '0xE24e5C08E28331D24758b69A5E9f383D2bDD1c98',
|
|
55
55
|
kvstoreAddress: '0x21A0C4CED7aE447fCf87D9FE3A29FA9B3AB20Ff1',
|
|
56
56
|
subgraphUrl: 'https://api.studio.thegraph.com/query/74256/bsc/version/latest',
|
|
57
|
-
subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/
|
|
57
|
+
subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmWsXVhdFuZZcXDjXrv1QLSBYcjNShazFQmNUdpAErjQqD',
|
|
58
58
|
oldSubgraphUrl: 'https://api.thegraph.com/subgraphs/name/humanprotocol/bsc',
|
|
59
59
|
oldFactoryAddress: '0xc88bC422cAAb2ac8812de03176402dbcA09533f4',
|
|
60
60
|
},
|
|
@@ -67,7 +67,7 @@ exports.NETWORKS = {
|
|
|
67
67
|
stakingAddress: '0xD6D347ba6987519B4e42EcED43dF98eFf5465a23',
|
|
68
68
|
kvstoreAddress: '0x32e27177BA6Ea91cf28dfd91a0Da9822A4b74EcF',
|
|
69
69
|
subgraphUrl: 'https://api.studio.thegraph.com/query/74256/bsc-testnet/version/latest',
|
|
70
|
-
subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/
|
|
70
|
+
subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmPv7asd21BA5LZJxjDPfoL5ZJkEGMvahrdMqgNQnP5sxn',
|
|
71
71
|
oldSubgraphUrl: 'https://api.thegraph.com/subgraphs/name/humanprotocol/bsctest',
|
|
72
72
|
oldFactoryAddress: '0xaae6a2646c1f88763e62e0cd08ad050ea66ac46f',
|
|
73
73
|
},
|
|
@@ -80,7 +80,7 @@ exports.NETWORKS = {
|
|
|
80
80
|
stakingAddress: '0x01D115E9E8bF0C58318793624CC662a030D07F1D',
|
|
81
81
|
kvstoreAddress: '0xbcB28672F826a50B03EE91B28145EAbddA73B2eD',
|
|
82
82
|
subgraphUrl: 'https://api.studio.thegraph.com/query/74256/polygon/version/latest',
|
|
83
|
-
subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/
|
|
83
|
+
subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmZSsJn5TERyEfRrrbY926hLHD321ijoMynrxWxc3boRa6',
|
|
84
84
|
oldSubgraphUrl: 'https://api.thegraph.com/subgraphs/name/humanprotocol/polygon',
|
|
85
85
|
oldFactoryAddress: '0x45eBc3eAE6DA485097054ae10BA1A0f8e8c7f794',
|
|
86
86
|
},
|
|
@@ -93,7 +93,7 @@ exports.NETWORKS = {
|
|
|
93
93
|
stakingAddress: '0xffE496683F842a923110415b7278ded3F265f2C5',
|
|
94
94
|
kvstoreAddress: '0x724AeFC243EdacCA27EAB86D3ec5a76Af4436Fc7',
|
|
95
95
|
subgraphUrl: 'https://api.studio.thegraph.com/query/74256/amoy/version/latest',
|
|
96
|
-
subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/
|
|
96
|
+
subgraphUrlApiKey: 'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmYWc4ciJbAvTvcjoBzRSTWZrf1xD8WPRqEk3xtJZUKZqY',
|
|
97
97
|
oldSubgraphUrl: '',
|
|
98
98
|
oldFactoryAddress: '',
|
|
99
99
|
},
|
package/dist/escrow.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ContractRunner, Overrides } from 'ethers';
|
|
2
2
|
import { BaseEthersClient } from './base';
|
|
3
3
|
import { ChainId } from './enums';
|
|
4
|
-
import {
|
|
5
|
-
import { IEscrowConfig, IEscrowsFilter, IPayoutFilter, IStatusEventFilter } from './interfaces';
|
|
4
|
+
import { StatusEvent } from './graphql';
|
|
5
|
+
import { IEscrow, IEscrowConfig, IEscrowsFilter, IPayoutFilter, IStatusEventFilter } from './interfaces';
|
|
6
6
|
import { EscrowCancel, EscrowStatus, EscrowWithdraw, NetworkData, TransactionLikeWithNonce, Payout } from './types';
|
|
7
7
|
/**
|
|
8
8
|
* ## Introduction
|
|
@@ -760,7 +760,7 @@ export declare class EscrowUtils {
|
|
|
760
760
|
* ```
|
|
761
761
|
*
|
|
762
762
|
* ```ts
|
|
763
|
-
*
|
|
763
|
+
* interface IEscrow {
|
|
764
764
|
* id: string;
|
|
765
765
|
* address: string;
|
|
766
766
|
* amountPaid: string;
|
|
@@ -785,7 +785,7 @@ export declare class EscrowUtils {
|
|
|
785
785
|
*
|
|
786
786
|
*
|
|
787
787
|
* @param {IEscrowsFilter} filter Filter parameters.
|
|
788
|
-
* @returns {
|
|
788
|
+
* @returns {IEscrow[]} List of escrows that match the filter.
|
|
789
789
|
*
|
|
790
790
|
* **Code example**
|
|
791
791
|
*
|
|
@@ -798,10 +798,10 @@ export declare class EscrowUtils {
|
|
|
798
798
|
* to: new Date(2023, 5, 8),
|
|
799
799
|
* chainId: ChainId.POLYGON_AMOY
|
|
800
800
|
* };
|
|
801
|
-
* const
|
|
801
|
+
* const escrows = await EscrowUtils.getEscrows(filters);
|
|
802
802
|
* ```
|
|
803
803
|
*/
|
|
804
|
-
static getEscrows(filter: IEscrowsFilter): Promise<
|
|
804
|
+
static getEscrows(filter: IEscrowsFilter): Promise<IEscrow[]>;
|
|
805
805
|
/**
|
|
806
806
|
* This function returns the escrow data for a given address.
|
|
807
807
|
*
|
|
@@ -823,7 +823,7 @@ export declare class EscrowUtils {
|
|
|
823
823
|
* ```
|
|
824
824
|
*
|
|
825
825
|
* ```ts
|
|
826
|
-
*
|
|
826
|
+
* interface IEscrow {
|
|
827
827
|
* id: string;
|
|
828
828
|
* address: string;
|
|
829
829
|
* amountPaid: string;
|
|
@@ -849,17 +849,17 @@ export declare class EscrowUtils {
|
|
|
849
849
|
*
|
|
850
850
|
* @param {ChainId} chainId Network in which the escrow has been deployed
|
|
851
851
|
* @param {string} escrowAddress Address of the escrow
|
|
852
|
-
* @returns {
|
|
852
|
+
* @returns {IEscrow} Escrow data
|
|
853
853
|
*
|
|
854
854
|
* **Code example**
|
|
855
855
|
*
|
|
856
856
|
* ```ts
|
|
857
857
|
* import { ChainId, EscrowUtils } from '@human-protocol/sdk';
|
|
858
858
|
*
|
|
859
|
-
* const
|
|
859
|
+
* const escrow = new EscrowUtils.getEscrow(ChainId.POLYGON_AMOY, "0x1234567890123456789012345678901234567890");
|
|
860
860
|
* ```
|
|
861
861
|
*/
|
|
862
|
-
static getEscrow(chainId: ChainId, escrowAddress: string): Promise<
|
|
862
|
+
static getEscrow(chainId: ChainId, escrowAddress: string): Promise<IEscrow>;
|
|
863
863
|
/**
|
|
864
864
|
* This function returns the status events for a given set of networks within an optional date range.
|
|
865
865
|
*
|
package/dist/escrow.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escrow.d.ts","sourceRoot":"","sources":["../src/escrow.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,cAAc,EAAY,SAAS,EAAkB,MAAM,QAAQ,CAAC;AAE7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAG1C,OAAO,EAAE,OAAO,EAAkB,MAAM,SAAS,CAAC;AA0BlD,OAAO,
|
|
1
|
+
{"version":3,"file":"escrow.d.ts","sourceRoot":"","sources":["../src/escrow.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,cAAc,EAAY,SAAS,EAAkB,MAAM,QAAQ,CAAC;AAE7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAG1C,OAAO,EAAE,OAAO,EAAkB,MAAM,SAAS,CAAC;AA0BlD,OAAO,EAML,WAAW,EACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,OAAO,EACP,aAAa,EACb,cAAc,EACd,aAAa,EACb,kBAAkB,EACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,WAAW,EACX,wBAAwB,EACxB,MAAM,EACP,MAAM,SAAS,CAAC;AAQjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;A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,OAAO,EAAE,CAAC;IA2D1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwDG;WACiB,SAAS,CAC3B,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,OAAO,CAAC;IAoBnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuDG;WACiB,eAAe,CACjC,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,WAAW,EAAE,CAAC;IA+DzB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;WACiB,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAiCzE"}
|
package/dist/escrow.js
CHANGED
|
@@ -1351,7 +1351,7 @@ class EscrowUtils {
|
|
|
1351
1351
|
* ```
|
|
1352
1352
|
*
|
|
1353
1353
|
* ```ts
|
|
1354
|
-
*
|
|
1354
|
+
* interface IEscrow {
|
|
1355
1355
|
* id: string;
|
|
1356
1356
|
* address: string;
|
|
1357
1357
|
* amountPaid: string;
|
|
@@ -1376,7 +1376,7 @@ class EscrowUtils {
|
|
|
1376
1376
|
*
|
|
1377
1377
|
*
|
|
1378
1378
|
* @param {IEscrowsFilter} filter Filter parameters.
|
|
1379
|
-
* @returns {
|
|
1379
|
+
* @returns {IEscrow[]} List of escrows that match the filter.
|
|
1380
1380
|
*
|
|
1381
1381
|
* **Code example**
|
|
1382
1382
|
*
|
|
@@ -1389,7 +1389,7 @@ class EscrowUtils {
|
|
|
1389
1389
|
* to: new Date(2023, 5, 8),
|
|
1390
1390
|
* chainId: ChainId.POLYGON_AMOY
|
|
1391
1391
|
* };
|
|
1392
|
-
* const
|
|
1392
|
+
* const escrows = await EscrowUtils.getEscrows(filters);
|
|
1393
1393
|
* ```
|
|
1394
1394
|
*/
|
|
1395
1395
|
static async getEscrows(filter) {
|
|
@@ -1454,7 +1454,7 @@ class EscrowUtils {
|
|
|
1454
1454
|
* ```
|
|
1455
1455
|
*
|
|
1456
1456
|
* ```ts
|
|
1457
|
-
*
|
|
1457
|
+
* interface IEscrow {
|
|
1458
1458
|
* id: string;
|
|
1459
1459
|
* address: string;
|
|
1460
1460
|
* amountPaid: string;
|
|
@@ -1480,14 +1480,14 @@ class EscrowUtils {
|
|
|
1480
1480
|
*
|
|
1481
1481
|
* @param {ChainId} chainId Network in which the escrow has been deployed
|
|
1482
1482
|
* @param {string} escrowAddress Address of the escrow
|
|
1483
|
-
* @returns {
|
|
1483
|
+
* @returns {IEscrow} Escrow data
|
|
1484
1484
|
*
|
|
1485
1485
|
* **Code example**
|
|
1486
1486
|
*
|
|
1487
1487
|
* ```ts
|
|
1488
1488
|
* import { ChainId, EscrowUtils } from '@human-protocol/sdk';
|
|
1489
1489
|
*
|
|
1490
|
-
* const
|
|
1490
|
+
* const escrow = new EscrowUtils.getEscrow(ChainId.POLYGON_AMOY, "0x1234567890123456789012345678901234567890");
|
|
1491
1491
|
* ```
|
|
1492
1492
|
*/
|
|
1493
1493
|
static async getEscrow(chainId, escrowAddress) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escrow.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/escrow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA0BlD,eAAO,MAAM,2BAA2B,sCAOvC,CAAC;AAEF,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"escrow.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/escrow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA0BlD,eAAO,MAAM,2BAA2B,sCAOvC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,QAAQ,cAAc,mCAmDvD,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,OAAO,IAAI,EACX,KAAK,IAAI,EACT,WAAW,MAAM,mCAiClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmtoken.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/hmtoken.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"hmtoken.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/hmtoken.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,mCAuBjD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/operator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AA4BlD,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/operator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AA4BlD,eAAO,MAAM,iBAAiB,GAAI,QAAQ,gBAAgB,mCA+BzD,CAAC;AAEF,eAAO,MAAM,4BAA4B,GAAI,OAAO,MAAM,mCAsBzD,CAAC;AAEF,eAAO,MAAM,gBAAgB,gCAO5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payout.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/payout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAY/C,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"payout.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/payout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAY/C,eAAO,MAAM,iBAAiB,GAAI,QAAQ,aAAa,mCAkCtD,CAAC"}
|
|
@@ -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;AAIF,eAAO,MAAM,2BAA2B,gCAOvC,CAAC;AAEF,eAAO,MAAM,wBAAwB,
|
|
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;AAIF,eAAO,MAAM,2BAA2B,gCAOvC,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,QAAQ,iBAAiB,mCA6BjE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AA2B9D,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AA2B9D,eAAO,MAAM,sBAAsB,GAAI,QAAQ,mBAAmB,mCAiEjE,CAAC;AAEF,eAAO,MAAM,qBAAqB,gCAOjC,CAAC"}
|
|
@@ -30,7 +30,7 @@ const TRANSACTION_FRAGMENT = (0, graphql_tag_1.default) `
|
|
|
30
30
|
}
|
|
31
31
|
`;
|
|
32
32
|
const GET_TRANSACTIONS_QUERY = (filter) => {
|
|
33
|
-
const { startDate, endDate, startBlock, endBlock, fromAddress, toAddress } = filter;
|
|
33
|
+
const { startDate, endDate, startBlock, endBlock, fromAddress, toAddress, method, escrow, token, } = filter;
|
|
34
34
|
const addressCondition = fromAddress === toAddress
|
|
35
35
|
? `
|
|
36
36
|
${fromAddress ? `{ from: $fromAddress }` : ''}
|
|
@@ -48,6 +48,9 @@ const GET_TRANSACTIONS_QUERY = (filter) => {
|
|
|
48
48
|
${endDate ? `{timestamp_lte: $endDate},` : ''}
|
|
49
49
|
${startBlock ? `{block_gte: $startBlock},` : ''}
|
|
50
50
|
${endBlock ? `{block_lte: $endBlock},` : ''}
|
|
51
|
+
${method ? `{ method: $method },` : ''}
|
|
52
|
+
${escrow ? `{ escrow: $escrow },` : ''}
|
|
53
|
+
${token ? `{ token: $token },` : ''}
|
|
51
54
|
]
|
|
52
55
|
}
|
|
53
56
|
`;
|
|
@@ -59,6 +62,9 @@ const GET_TRANSACTIONS_QUERY = (filter) => {
|
|
|
59
62
|
$endDate: Int
|
|
60
63
|
$startBlock: Int
|
|
61
64
|
$endBlock: Int
|
|
65
|
+
$method: String
|
|
66
|
+
$escrow: String
|
|
67
|
+
$token: String
|
|
62
68
|
$orderDirection: String
|
|
63
69
|
$first: Int
|
|
64
70
|
$skip: Int
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/worker.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,eAAO,MAAM,gBAAgB,gCAS5B,CAAC;AAEF,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/graphql/queries/worker.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,eAAO,MAAM,gBAAgB,gCAS5B,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,QAAQ,cAAc,mCA0BvD,CAAC"}
|
|
@@ -10,7 +10,7 @@ exports.GET_WORKER_QUERY = (0, graphql_tag_1.default) `
|
|
|
10
10
|
worker(id: $address) {
|
|
11
11
|
id
|
|
12
12
|
address
|
|
13
|
-
|
|
13
|
+
totalHMTAmountReceived
|
|
14
14
|
payoutCount
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -36,7 +36,7 @@ const GET_WORKERS_QUERY = (filter) => {
|
|
|
36
36
|
) {
|
|
37
37
|
id
|
|
38
38
|
address
|
|
39
|
-
|
|
39
|
+
totalHMTAmountReceived
|
|
40
40
|
payoutCount
|
|
41
41
|
}
|
|
42
42
|
}`;
|
package/dist/graphql/types.d.ts
CHANGED
|
@@ -20,13 +20,6 @@ export type EscrowData = {
|
|
|
20
20
|
createdAt: string;
|
|
21
21
|
chainId: number;
|
|
22
22
|
};
|
|
23
|
-
export type PayoutData = {
|
|
24
|
-
id: string;
|
|
25
|
-
escrowAddress: string;
|
|
26
|
-
recipient: string;
|
|
27
|
-
amount: string;
|
|
28
|
-
createdAt: string;
|
|
29
|
-
};
|
|
30
23
|
export type HMTStatisticsData = {
|
|
31
24
|
totalTransferEventCount: string;
|
|
32
25
|
totalBulkTransferEventCount: string;
|
|
@@ -61,7 +54,7 @@ export type EventDayData = {
|
|
|
61
54
|
dailyEscrowCount: string;
|
|
62
55
|
dailyWorkerCount: string;
|
|
63
56
|
dailyPayoutCount: string;
|
|
64
|
-
|
|
57
|
+
dailyHMTPayoutAmount: string;
|
|
65
58
|
dailyHMTTransferCount: string;
|
|
66
59
|
dailyHMTTransferAmount: string;
|
|
67
60
|
dailyUniqueSenders: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/graphql/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAA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ions?: string;
|
|
58
58
|
}
|
|
59
|
+
export interface IEscrow {
|
|
60
|
+
id: string;
|
|
61
|
+
address: string;
|
|
62
|
+
amountPaid: string;
|
|
63
|
+
balance: string;
|
|
64
|
+
count: string;
|
|
65
|
+
factoryAddress: string;
|
|
66
|
+
finalResultsUrl?: string;
|
|
67
|
+
intermediateResultsUrl?: string;
|
|
68
|
+
launcher: string;
|
|
69
|
+
manifestHash?: string;
|
|
70
|
+
manifestUrl?: string;
|
|
71
|
+
recordingOracle?: string;
|
|
72
|
+
reputationOracle?: string;
|
|
73
|
+
exchangeOracle?: string;
|
|
74
|
+
status: string;
|
|
75
|
+
token: string;
|
|
76
|
+
totalFundedAmount: string;
|
|
77
|
+
createdAt: string;
|
|
78
|
+
chainId: number;
|
|
79
|
+
}
|
|
59
80
|
export interface IEscrowsFilter extends IPagination {
|
|
60
81
|
launcher?: string;
|
|
61
82
|
reputationOracle?: string;
|
|
@@ -131,6 +152,9 @@ export interface ITransactionsFilter extends IPagination {
|
|
|
131
152
|
endDate?: Date;
|
|
132
153
|
fromAddress?: string;
|
|
133
154
|
toAddress?: string;
|
|
155
|
+
method?: string;
|
|
156
|
+
escrow?: string;
|
|
157
|
+
token?: string;
|
|
134
158
|
}
|
|
135
159
|
export interface IPagination {
|
|
136
160
|
first?: number;
|
|
@@ -153,7 +177,7 @@ export interface IStatusEventFilter extends IPagination {
|
|
|
153
177
|
export interface IWorker {
|
|
154
178
|
id: string;
|
|
155
179
|
address: string;
|
|
156
|
-
|
|
180
|
+
totalHMTAmountReceived: number;
|
|
157
181
|
payoutCount: number;
|
|
158
182
|
}
|
|
159
183
|
export interface IWorkersFilter extends IPagination {
|
package/dist/interfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAA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isticsClient {
|
|
|
278
278
|
return {
|
|
279
279
|
dailyPaymentsData: eventDayDatas.map((eventDayData) => ({
|
|
280
280
|
timestamp: new Date(+eventDayData.timestamp * 1000),
|
|
281
|
-
totalAmountPaid: ethers_1.ethers.toBigInt(eventDayData.
|
|
281
|
+
totalAmountPaid: ethers_1.ethers.toBigInt(eventDayData.dailyHMTPayoutAmount),
|
|
282
282
|
totalCount: +eventDayData.dailyPayoutCount,
|
|
283
283
|
averageAmountPerWorker: eventDayData.dailyWorkerCount === '0'
|
|
284
284
|
? ethers_1.ethers.toBigInt(0)
|
|
285
|
-
: ethers_1.ethers.toBigInt(eventDayData.
|
|
285
|
+
: ethers_1.ethers.toBigInt(eventDayData.dailyHMTPayoutAmount) /
|
|
286
286
|
ethers_1.ethers.toBigInt(eventDayData.dailyWorkerCount),
|
|
287
287
|
})),
|
|
288
288
|
};
|
package/dist/transaction.d.ts
CHANGED
|
@@ -4,6 +4,22 @@ export declare class TransactionUtils {
|
|
|
4
4
|
/**
|
|
5
5
|
* This function returns the transaction data for the given hash.
|
|
6
6
|
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* type ITransaction = {
|
|
9
|
+
* block: bigint;
|
|
10
|
+
* txHash: string;
|
|
11
|
+
* from: string;
|
|
12
|
+
* to: string;
|
|
13
|
+
* timestamp: bigint;
|
|
14
|
+
* value: string;
|
|
15
|
+
* method: string;
|
|
16
|
+
* receiver?: string;
|
|
17
|
+
* escrow?: string;
|
|
18
|
+
* token?: string;
|
|
19
|
+
* internalTransactions: InternalTransaction[];
|
|
20
|
+
* };
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
7
23
|
* @param {ChainId} chainId The chain ID.
|
|
8
24
|
* @param {string} hash The transaction hash.
|
|
9
25
|
* @returns {Promise<ITransaction>} Returns the transaction details.
|
|
@@ -29,6 +45,9 @@ export declare class TransactionUtils {
|
|
|
29
45
|
* chainId: ChainId; // List of chain IDs to query.
|
|
30
46
|
* fromAddress?: string; // (Optional) The address from which transactions are sent.
|
|
31
47
|
* toAddress?: string; // (Optional) The address to which transactions are sent.
|
|
48
|
+
* method?: string; // (Optional) The method of the transaction to filter by.
|
|
49
|
+
* escrow?: string; // (Optional) The escrow address to filter transactions.
|
|
50
|
+
* token?: string; // (Optional) The token address to filter transactions.
|
|
32
51
|
* startDate?: Date; // (Optional) The start date to filter transactions (inclusive).
|
|
33
52
|
* endDate?: Date; // (Optional) The end date to filter transactions (inclusive).
|
|
34
53
|
* startBlock?: number; // (Optional) The start block number to filter transactions (inclusive).
|
|
@@ -41,13 +60,17 @@ export declare class TransactionUtils {
|
|
|
41
60
|
*
|
|
42
61
|
* ```ts
|
|
43
62
|
* type ITransaction = {
|
|
44
|
-
* block:
|
|
63
|
+
* block: bigint;
|
|
45
64
|
* txHash: string;
|
|
46
65
|
* from: string;
|
|
47
66
|
* to: string;
|
|
48
|
-
* timestamp:
|
|
67
|
+
* timestamp: bigint;
|
|
49
68
|
* value: string;
|
|
50
69
|
* method: string;
|
|
70
|
+
* receiver?: string;
|
|
71
|
+
* escrow?: string;
|
|
72
|
+
* token?: string;
|
|
73
|
+
* internalTransactions: InternalTransaction[];
|
|
51
74
|
* };
|
|
52
75
|
* ```
|
|
53
76
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAkB,MAAM,SAAS,CAAC;AAUlD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGjE,qBAAa,gBAAgB;IAC3B
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAkB,MAAM,SAAS,CAAC;AAUlD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGjE,qBAAa,gBAAgB;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;WACiB,cAAc,CAChC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,YAAY,CAAC;IAmBxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2DG;WACiB,eAAe,CACjC,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,YAAY,EAAE,CAAC;CA2C3B"}
|
package/dist/transaction.js
CHANGED
|
@@ -16,6 +16,22 @@ class TransactionUtils {
|
|
|
16
16
|
/**
|
|
17
17
|
* This function returns the transaction data for the given hash.
|
|
18
18
|
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* type ITransaction = {
|
|
21
|
+
* block: bigint;
|
|
22
|
+
* txHash: string;
|
|
23
|
+
* from: string;
|
|
24
|
+
* to: string;
|
|
25
|
+
* timestamp: bigint;
|
|
26
|
+
* value: string;
|
|
27
|
+
* method: string;
|
|
28
|
+
* receiver?: string;
|
|
29
|
+
* escrow?: string;
|
|
30
|
+
* token?: string;
|
|
31
|
+
* internalTransactions: InternalTransaction[];
|
|
32
|
+
* };
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
19
35
|
* @param {ChainId} chainId The chain ID.
|
|
20
36
|
* @param {string} hash The transaction hash.
|
|
21
37
|
* @returns {Promise<ITransaction>} Returns the transaction details.
|
|
@@ -53,6 +69,9 @@ class TransactionUtils {
|
|
|
53
69
|
* chainId: ChainId; // List of chain IDs to query.
|
|
54
70
|
* fromAddress?: string; // (Optional) The address from which transactions are sent.
|
|
55
71
|
* toAddress?: string; // (Optional) The address to which transactions are sent.
|
|
72
|
+
* method?: string; // (Optional) The method of the transaction to filter by.
|
|
73
|
+
* escrow?: string; // (Optional) The escrow address to filter transactions.
|
|
74
|
+
* token?: string; // (Optional) The token address to filter transactions.
|
|
56
75
|
* startDate?: Date; // (Optional) The start date to filter transactions (inclusive).
|
|
57
76
|
* endDate?: Date; // (Optional) The end date to filter transactions (inclusive).
|
|
58
77
|
* startBlock?: number; // (Optional) The start block number to filter transactions (inclusive).
|
|
@@ -65,13 +84,17 @@ class TransactionUtils {
|
|
|
65
84
|
*
|
|
66
85
|
* ```ts
|
|
67
86
|
* type ITransaction = {
|
|
68
|
-
* block:
|
|
87
|
+
* block: bigint;
|
|
69
88
|
* txHash: string;
|
|
70
89
|
* from: string;
|
|
71
90
|
* to: string;
|
|
72
|
-
* timestamp:
|
|
91
|
+
* timestamp: bigint;
|
|
73
92
|
* value: string;
|
|
74
93
|
* method: string;
|
|
94
|
+
* receiver?: string;
|
|
95
|
+
* escrow?: string;
|
|
96
|
+
* token?: string;
|
|
97
|
+
* internalTransactions: InternalTransaction[];
|
|
75
98
|
* };
|
|
76
99
|
* ```
|
|
77
100
|
*
|
|
@@ -115,6 +138,9 @@ class TransactionUtils {
|
|
|
115
138
|
endDate: filter.endDate ? (0, utils_1.getUnixTimestamp)(filter.endDate) : undefined,
|
|
116
139
|
startBlock: filter.startBlock ? filter.startBlock : undefined,
|
|
117
140
|
endBlock: filter.endBlock ? filter.endBlock : undefined,
|
|
141
|
+
method: filter.method ? filter.method : undefined,
|
|
142
|
+
escrow: filter.escrow ? filter.escrow : undefined,
|
|
143
|
+
token: filter.token ? filter.token : undefined,
|
|
118
144
|
orderDirection: orderDirection,
|
|
119
145
|
first: first,
|
|
120
146
|
skip: skip,
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,GAAG,GAAG,UAgBhC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,YAOrC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,aAAa,WAAW,WAatD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,IAAI,KAAG,MAE7C,CAAC"}
|
package/dist/utils.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getUnixTimestamp = exports.getSubgraphUrl = exports.isValidUrl = exports.throwError = void 0;
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
5
|
const ethers_1 = require("ethers");
|
|
6
|
+
const enums_1 = require("./enums");
|
|
6
7
|
const error_1 = require("./error");
|
|
7
8
|
const constants_1 = require("./constants");
|
|
8
9
|
/**
|
|
@@ -62,7 +63,7 @@ const getSubgraphUrl = (networkData) => {
|
|
|
62
63
|
if (process.env.SUBGRAPH_API_KEY) {
|
|
63
64
|
subgraphUrl = networkData.subgraphUrlApiKey.replace(constants_1.SUBGRAPH_API_KEY_PLACEHOLDER, process.env.SUBGRAPH_API_KEY);
|
|
64
65
|
}
|
|
65
|
-
else {
|
|
66
|
+
else if (networkData.chainId !== enums_1.ChainId.LOCALHOST) {
|
|
66
67
|
// eslint-disable-next-line no-console
|
|
67
68
|
console.warn(error_1.WarnSubgraphApiKeyNotProvided);
|
|
68
69
|
}
|
package/dist/worker.d.ts
CHANGED
package/dist/worker.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@human-protocol/sdk",
|
|
3
3
|
"description": "Human Protocol SDK",
|
|
4
|
-
"version": "4.1.
|
|
4
|
+
"version": "4.1.2",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
7
7
|
"dist"
|
|
@@ -9,11 +9,10 @@
|
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"types": "dist/index.d.ts",
|
|
11
11
|
"scripts": {
|
|
12
|
-
"clean": "rm -rf ./dist",
|
|
12
|
+
"clean": "tsc --build --clean && rm -rf ./dist",
|
|
13
13
|
"clean:doc": "rm -rf ../../../../docs/sdk/typescript/",
|
|
14
|
-
"
|
|
15
|
-
"build": "yarn clean &&
|
|
16
|
-
"build:doc": "yarn clean:doc && npx typedoc --plugin typedoc-plugin-markdown --out ../../../../docs/sdk/typescript/",
|
|
14
|
+
"build": "tsc --build",
|
|
15
|
+
"build:doc": "yarn clean:doc && typedoc --plugin typedoc-plugin-markdown --out ../../../../docs/sdk/typescript/",
|
|
17
16
|
"prepublish": "yarn build",
|
|
18
17
|
"test": "vitest -u",
|
|
19
18
|
"lint": "eslint .",
|
|
@@ -39,8 +38,9 @@
|
|
|
39
38
|
]
|
|
40
39
|
},
|
|
41
40
|
"dependencies": {
|
|
42
|
-
"@human-protocol/core": "
|
|
41
|
+
"@human-protocol/core": "x",
|
|
43
42
|
"axios": "^1.4.0",
|
|
43
|
+
"ethers": "~6.13.5",
|
|
44
44
|
"graphql": "^16.8.1",
|
|
45
45
|
"graphql-request": "^6.1.0",
|
|
46
46
|
"graphql-tag": "^2.12.6",
|
|
@@ -50,8 +50,12 @@
|
|
|
50
50
|
"vitest": "^3.0.9"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"
|
|
54
|
-
"
|
|
53
|
+
"eslint": "^8.55.0",
|
|
54
|
+
"prettier": "^3.4.2",
|
|
55
|
+
"ts-node": "^10.9.2",
|
|
56
|
+
"typedoc": "^0.28.4",
|
|
57
|
+
"typedoc-plugin-markdown": "^4.2.3",
|
|
58
|
+
"typescript": "^5.8.3"
|
|
55
59
|
},
|
|
56
60
|
"typedocOptions": {
|
|
57
61
|
"entryPoints": [
|
package/src/constants.ts
CHANGED
|
@@ -36,7 +36,7 @@ export const NETWORKS: {
|
|
|
36
36
|
subgraphUrl:
|
|
37
37
|
'https://api.studio.thegraph.com/query/74256/ethereum/version/latest',
|
|
38
38
|
subgraphUrlApiKey:
|
|
39
|
-
'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/
|
|
39
|
+
'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmZEF1exsjDwjDXy1kmN3MbdZKxfkkoTj2MbEPUyhLfEG3',
|
|
40
40
|
oldSubgraphUrl: '',
|
|
41
41
|
oldFactoryAddress: '',
|
|
42
42
|
},
|
|
@@ -51,7 +51,7 @@ export const NETWORKS: {
|
|
|
51
51
|
subgraphUrl:
|
|
52
52
|
'https://api.studio.thegraph.com/query/74256/sepolia/version/latest',
|
|
53
53
|
subgraphUrlApiKey:
|
|
54
|
-
'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/
|
|
54
|
+
'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmeHhtntEYGdgTqHQTJu5mUXHS8JPt3RiwidLYeeEu6VpP',
|
|
55
55
|
oldSubgraphUrl: '',
|
|
56
56
|
oldFactoryAddress: '',
|
|
57
57
|
},
|
|
@@ -66,7 +66,7 @@ export const NETWORKS: {
|
|
|
66
66
|
subgraphUrl:
|
|
67
67
|
'https://api.studio.thegraph.com/query/74256/bsc/version/latest',
|
|
68
68
|
subgraphUrlApiKey:
|
|
69
|
-
'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/
|
|
69
|
+
'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmWsXVhdFuZZcXDjXrv1QLSBYcjNShazFQmNUdpAErjQqD',
|
|
70
70
|
oldSubgraphUrl: 'https://api.thegraph.com/subgraphs/name/humanprotocol/bsc',
|
|
71
71
|
oldFactoryAddress: '0xc88bC422cAAb2ac8812de03176402dbcA09533f4',
|
|
72
72
|
},
|
|
@@ -81,7 +81,7 @@ export const NETWORKS: {
|
|
|
81
81
|
subgraphUrl:
|
|
82
82
|
'https://api.studio.thegraph.com/query/74256/bsc-testnet/version/latest',
|
|
83
83
|
subgraphUrlApiKey:
|
|
84
|
-
'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/
|
|
84
|
+
'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmPv7asd21BA5LZJxjDPfoL5ZJkEGMvahrdMqgNQnP5sxn',
|
|
85
85
|
oldSubgraphUrl:
|
|
86
86
|
'https://api.thegraph.com/subgraphs/name/humanprotocol/bsctest',
|
|
87
87
|
oldFactoryAddress: '0xaae6a2646c1f88763e62e0cd08ad050ea66ac46f',
|
|
@@ -97,7 +97,7 @@ export const NETWORKS: {
|
|
|
97
97
|
subgraphUrl:
|
|
98
98
|
'https://api.studio.thegraph.com/query/74256/polygon/version/latest',
|
|
99
99
|
subgraphUrlApiKey:
|
|
100
|
-
'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/
|
|
100
|
+
'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmZSsJn5TERyEfRrrbY926hLHD321ijoMynrxWxc3boRa6',
|
|
101
101
|
oldSubgraphUrl:
|
|
102
102
|
'https://api.thegraph.com/subgraphs/name/humanprotocol/polygon',
|
|
103
103
|
oldFactoryAddress: '0x45eBc3eAE6DA485097054ae10BA1A0f8e8c7f794',
|
|
@@ -113,7 +113,7 @@ export const NETWORKS: {
|
|
|
113
113
|
subgraphUrl:
|
|
114
114
|
'https://api.studio.thegraph.com/query/74256/amoy/version/latest',
|
|
115
115
|
subgraphUrlApiKey:
|
|
116
|
-
'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/
|
|
116
|
+
'https://gateway-arbitrum.network.thegraph.com/api/[SUBGRAPH_API_KEY]/deployments/id/QmYWc4ciJbAvTvcjoBzRSTWZrf1xD8WPRqEk3xtJZUKZqY',
|
|
117
117
|
oldSubgraphUrl: '',
|
|
118
118
|
oldFactoryAddress: '',
|
|
119
119
|
},
|
package/src/escrow.ts
CHANGED
|
@@ -49,6 +49,7 @@ import {
|
|
|
49
49
|
StatusEvent,
|
|
50
50
|
} from './graphql';
|
|
51
51
|
import {
|
|
52
|
+
IEscrow,
|
|
52
53
|
IEscrowConfig,
|
|
53
54
|
IEscrowsFilter,
|
|
54
55
|
IPayoutFilter,
|
|
@@ -1618,7 +1619,7 @@ export class EscrowUtils {
|
|
|
1618
1619
|
* ```
|
|
1619
1620
|
*
|
|
1620
1621
|
* ```ts
|
|
1621
|
-
*
|
|
1622
|
+
* interface IEscrow {
|
|
1622
1623
|
* id: string;
|
|
1623
1624
|
* address: string;
|
|
1624
1625
|
* amountPaid: string;
|
|
@@ -1643,7 +1644,7 @@ export class EscrowUtils {
|
|
|
1643
1644
|
*
|
|
1644
1645
|
*
|
|
1645
1646
|
* @param {IEscrowsFilter} filter Filter parameters.
|
|
1646
|
-
* @returns {
|
|
1647
|
+
* @returns {IEscrow[]} List of escrows that match the filter.
|
|
1647
1648
|
*
|
|
1648
1649
|
* **Code example**
|
|
1649
1650
|
*
|
|
@@ -1656,12 +1657,10 @@ export class EscrowUtils {
|
|
|
1656
1657
|
* to: new Date(2023, 5, 8),
|
|
1657
1658
|
* chainId: ChainId.POLYGON_AMOY
|
|
1658
1659
|
* };
|
|
1659
|
-
* const
|
|
1660
|
+
* const escrows = await EscrowUtils.getEscrows(filters);
|
|
1660
1661
|
* ```
|
|
1661
1662
|
*/
|
|
1662
|
-
public static async getEscrows(
|
|
1663
|
-
filter: IEscrowsFilter
|
|
1664
|
-
): Promise<EscrowData[]> {
|
|
1663
|
+
public static async getEscrows(filter: IEscrowsFilter): Promise<IEscrow[]> {
|
|
1665
1664
|
if (filter.launcher && !ethers.isAddress(filter.launcher)) {
|
|
1666
1665
|
throw ErrorInvalidAddress;
|
|
1667
1666
|
}
|
|
@@ -1741,7 +1740,7 @@ export class EscrowUtils {
|
|
|
1741
1740
|
* ```
|
|
1742
1741
|
*
|
|
1743
1742
|
* ```ts
|
|
1744
|
-
*
|
|
1743
|
+
* interface IEscrow {
|
|
1745
1744
|
* id: string;
|
|
1746
1745
|
* address: string;
|
|
1747
1746
|
* amountPaid: string;
|
|
@@ -1767,20 +1766,20 @@ export class EscrowUtils {
|
|
|
1767
1766
|
*
|
|
1768
1767
|
* @param {ChainId} chainId Network in which the escrow has been deployed
|
|
1769
1768
|
* @param {string} escrowAddress Address of the escrow
|
|
1770
|
-
* @returns {
|
|
1769
|
+
* @returns {IEscrow} Escrow data
|
|
1771
1770
|
*
|
|
1772
1771
|
* **Code example**
|
|
1773
1772
|
*
|
|
1774
1773
|
* ```ts
|
|
1775
1774
|
* import { ChainId, EscrowUtils } from '@human-protocol/sdk';
|
|
1776
1775
|
*
|
|
1777
|
-
* const
|
|
1776
|
+
* const escrow = new EscrowUtils.getEscrow(ChainId.POLYGON_AMOY, "0x1234567890123456789012345678901234567890");
|
|
1778
1777
|
* ```
|
|
1779
1778
|
*/
|
|
1780
1779
|
public static async getEscrow(
|
|
1781
1780
|
chainId: ChainId,
|
|
1782
1781
|
escrowAddress: string
|
|
1783
|
-
): Promise<
|
|
1782
|
+
): Promise<IEscrow> {
|
|
1784
1783
|
const networkData = NETWORKS[chainId];
|
|
1785
1784
|
|
|
1786
1785
|
if (!networkData) {
|
|
@@ -27,8 +27,17 @@ const TRANSACTION_FRAGMENT = gql`
|
|
|
27
27
|
`;
|
|
28
28
|
|
|
29
29
|
export const GET_TRANSACTIONS_QUERY = (filter: ITransactionsFilter) => {
|
|
30
|
-
const {
|
|
31
|
-
|
|
30
|
+
const {
|
|
31
|
+
startDate,
|
|
32
|
+
endDate,
|
|
33
|
+
startBlock,
|
|
34
|
+
endBlock,
|
|
35
|
+
fromAddress,
|
|
36
|
+
toAddress,
|
|
37
|
+
method,
|
|
38
|
+
escrow,
|
|
39
|
+
token,
|
|
40
|
+
} = filter;
|
|
32
41
|
const addressCondition =
|
|
33
42
|
fromAddress === toAddress
|
|
34
43
|
? `
|
|
@@ -48,6 +57,9 @@ export const GET_TRANSACTIONS_QUERY = (filter: ITransactionsFilter) => {
|
|
|
48
57
|
${endDate ? `{timestamp_lte: $endDate},` : ''}
|
|
49
58
|
${startBlock ? `{block_gte: $startBlock},` : ''}
|
|
50
59
|
${endBlock ? `{block_lte: $endBlock},` : ''}
|
|
60
|
+
${method ? `{ method: $method },` : ''}
|
|
61
|
+
${escrow ? `{ escrow: $escrow },` : ''}
|
|
62
|
+
${token ? `{ token: $token },` : ''}
|
|
51
63
|
]
|
|
52
64
|
}
|
|
53
65
|
`;
|
|
@@ -60,6 +72,9 @@ export const GET_TRANSACTIONS_QUERY = (filter: ITransactionsFilter) => {
|
|
|
60
72
|
$endDate: Int
|
|
61
73
|
$startBlock: Int
|
|
62
74
|
$endBlock: Int
|
|
75
|
+
$method: String
|
|
76
|
+
$escrow: String
|
|
77
|
+
$token: String
|
|
63
78
|
$orderDirection: String
|
|
64
79
|
$first: Int
|
|
65
80
|
$skip: Int
|
|
@@ -6,7 +6,7 @@ export const GET_WORKER_QUERY = gql`
|
|
|
6
6
|
worker(id: $address) {
|
|
7
7
|
id
|
|
8
8
|
address
|
|
9
|
-
|
|
9
|
+
totalHMTAmountReceived
|
|
10
10
|
payoutCount
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -34,7 +34,7 @@ export const GET_WORKERS_QUERY = (filter: IWorkersFilter) => {
|
|
|
34
34
|
) {
|
|
35
35
|
id
|
|
36
36
|
address
|
|
37
|
-
|
|
37
|
+
totalHMTAmountReceived
|
|
38
38
|
payoutCount
|
|
39
39
|
}
|
|
40
40
|
}`;
|
package/src/graphql/types.ts
CHANGED
|
@@ -22,14 +22,6 @@ export type EscrowData = {
|
|
|
22
22
|
chainId: number;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
export type PayoutData = {
|
|
26
|
-
id: string;
|
|
27
|
-
escrowAddress: string;
|
|
28
|
-
recipient: string;
|
|
29
|
-
amount: string;
|
|
30
|
-
createdAt: string;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
25
|
export type HMTStatisticsData = {
|
|
34
26
|
totalTransferEventCount: string;
|
|
35
27
|
totalBulkTransferEventCount: string;
|
|
@@ -66,7 +58,7 @@ export type EventDayData = {
|
|
|
66
58
|
dailyEscrowCount: string;
|
|
67
59
|
dailyWorkerCount: string;
|
|
68
60
|
dailyPayoutCount: string;
|
|
69
|
-
|
|
61
|
+
dailyHMTPayoutAmount: string;
|
|
70
62
|
dailyHMTTransferCount: string;
|
|
71
63
|
dailyHMTTransferAmount: string;
|
|
72
64
|
dailyUniqueSenders: string;
|
package/src/interfaces.ts
CHANGED
|
@@ -64,6 +64,28 @@ export interface IOperator {
|
|
|
64
64
|
registrationInstructions?: string;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
export interface IEscrow {
|
|
68
|
+
id: string;
|
|
69
|
+
address: string;
|
|
70
|
+
amountPaid: string;
|
|
71
|
+
balance: string;
|
|
72
|
+
count: string;
|
|
73
|
+
factoryAddress: string;
|
|
74
|
+
finalResultsUrl?: string;
|
|
75
|
+
intermediateResultsUrl?: string;
|
|
76
|
+
launcher: string;
|
|
77
|
+
manifestHash?: string;
|
|
78
|
+
manifestUrl?: string;
|
|
79
|
+
recordingOracle?: string;
|
|
80
|
+
reputationOracle?: string;
|
|
81
|
+
exchangeOracle?: string;
|
|
82
|
+
status: string;
|
|
83
|
+
token: string;
|
|
84
|
+
totalFundedAmount: string;
|
|
85
|
+
createdAt: string;
|
|
86
|
+
chainId: number;
|
|
87
|
+
}
|
|
88
|
+
|
|
67
89
|
export interface IEscrowsFilter extends IPagination {
|
|
68
90
|
launcher?: string;
|
|
69
91
|
reputationOracle?: string;
|
|
@@ -148,6 +170,9 @@ export interface ITransactionsFilter extends IPagination {
|
|
|
148
170
|
endDate?: Date;
|
|
149
171
|
fromAddress?: string;
|
|
150
172
|
toAddress?: string;
|
|
173
|
+
method?: string;
|
|
174
|
+
escrow?: string;
|
|
175
|
+
token?: string;
|
|
151
176
|
}
|
|
152
177
|
|
|
153
178
|
export interface IPagination {
|
|
@@ -174,7 +199,7 @@ export interface IStatusEventFilter extends IPagination {
|
|
|
174
199
|
export interface IWorker {
|
|
175
200
|
id: string;
|
|
176
201
|
address: string;
|
|
177
|
-
|
|
202
|
+
totalHMTAmountReceived: number;
|
|
178
203
|
payoutCount: number;
|
|
179
204
|
}
|
|
180
205
|
|
package/src/statistics.ts
CHANGED
|
@@ -319,12 +319,12 @@ export class StatisticsClient {
|
|
|
319
319
|
return {
|
|
320
320
|
dailyPaymentsData: eventDayDatas.map((eventDayData) => ({
|
|
321
321
|
timestamp: new Date(+eventDayData.timestamp * 1000),
|
|
322
|
-
totalAmountPaid: ethers.toBigInt(eventDayData.
|
|
322
|
+
totalAmountPaid: ethers.toBigInt(eventDayData.dailyHMTPayoutAmount),
|
|
323
323
|
totalCount: +eventDayData.dailyPayoutCount,
|
|
324
324
|
averageAmountPerWorker:
|
|
325
325
|
eventDayData.dailyWorkerCount === '0'
|
|
326
326
|
? ethers.toBigInt(0)
|
|
327
|
-
: ethers.toBigInt(eventDayData.
|
|
327
|
+
: ethers.toBigInt(eventDayData.dailyHMTPayoutAmount) /
|
|
328
328
|
ethers.toBigInt(eventDayData.dailyWorkerCount),
|
|
329
329
|
})),
|
|
330
330
|
};
|
package/src/transaction.ts
CHANGED
|
@@ -19,6 +19,22 @@ export class TransactionUtils {
|
|
|
19
19
|
/**
|
|
20
20
|
* This function returns the transaction data for the given hash.
|
|
21
21
|
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* type ITransaction = {
|
|
24
|
+
* block: bigint;
|
|
25
|
+
* txHash: string;
|
|
26
|
+
* from: string;
|
|
27
|
+
* to: string;
|
|
28
|
+
* timestamp: bigint;
|
|
29
|
+
* value: string;
|
|
30
|
+
* method: string;
|
|
31
|
+
* receiver?: string;
|
|
32
|
+
* escrow?: string;
|
|
33
|
+
* token?: string;
|
|
34
|
+
* internalTransactions: InternalTransaction[];
|
|
35
|
+
* };
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
22
38
|
* @param {ChainId} chainId The chain ID.
|
|
23
39
|
* @param {string} hash The transaction hash.
|
|
24
40
|
* @returns {Promise<ITransaction>} Returns the transaction details.
|
|
@@ -65,6 +81,9 @@ export class TransactionUtils {
|
|
|
65
81
|
* chainId: ChainId; // List of chain IDs to query.
|
|
66
82
|
* fromAddress?: string; // (Optional) The address from which transactions are sent.
|
|
67
83
|
* toAddress?: string; // (Optional) The address to which transactions are sent.
|
|
84
|
+
* method?: string; // (Optional) The method of the transaction to filter by.
|
|
85
|
+
* escrow?: string; // (Optional) The escrow address to filter transactions.
|
|
86
|
+
* token?: string; // (Optional) The token address to filter transactions.
|
|
68
87
|
* startDate?: Date; // (Optional) The start date to filter transactions (inclusive).
|
|
69
88
|
* endDate?: Date; // (Optional) The end date to filter transactions (inclusive).
|
|
70
89
|
* startBlock?: number; // (Optional) The start block number to filter transactions (inclusive).
|
|
@@ -77,13 +96,17 @@ export class TransactionUtils {
|
|
|
77
96
|
*
|
|
78
97
|
* ```ts
|
|
79
98
|
* type ITransaction = {
|
|
80
|
-
* block:
|
|
99
|
+
* block: bigint;
|
|
81
100
|
* txHash: string;
|
|
82
101
|
* from: string;
|
|
83
102
|
* to: string;
|
|
84
|
-
* timestamp:
|
|
103
|
+
* timestamp: bigint;
|
|
85
104
|
* value: string;
|
|
86
105
|
* method: string;
|
|
106
|
+
* receiver?: string;
|
|
107
|
+
* escrow?: string;
|
|
108
|
+
* token?: string;
|
|
109
|
+
* internalTransactions: InternalTransaction[];
|
|
87
110
|
* };
|
|
88
111
|
* ```
|
|
89
112
|
*
|
|
@@ -137,6 +160,9 @@ export class TransactionUtils {
|
|
|
137
160
|
endDate: filter.endDate ? getUnixTimestamp(filter.endDate) : undefined,
|
|
138
161
|
startBlock: filter.startBlock ? filter.startBlock : undefined,
|
|
139
162
|
endBlock: filter.endBlock ? filter.endBlock : undefined,
|
|
163
|
+
method: filter.method ? filter.method : undefined,
|
|
164
|
+
escrow: filter.escrow ? filter.escrow : undefined,
|
|
165
|
+
token: filter.token ? filter.token : undefined,
|
|
140
166
|
orderDirection: orderDirection,
|
|
141
167
|
first: first,
|
|
142
168
|
skip: skip,
|
package/src/utils.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import { ethers } from 'ethers';
|
|
3
3
|
|
|
4
|
+
import { ChainId } from './enums';
|
|
4
5
|
import {
|
|
5
6
|
ContractExecutionError,
|
|
6
7
|
EthereumError,
|
|
@@ -66,7 +67,7 @@ export const getSubgraphUrl = (networkData: NetworkData) => {
|
|
|
66
67
|
SUBGRAPH_API_KEY_PLACEHOLDER,
|
|
67
68
|
process.env.SUBGRAPH_API_KEY
|
|
68
69
|
);
|
|
69
|
-
} else {
|
|
70
|
+
} else if (networkData.chainId !== ChainId.LOCALHOST) {
|
|
70
71
|
// eslint-disable-next-line no-console
|
|
71
72
|
console.warn(WarnSubgraphApiKeyNotProvided);
|
|
72
73
|
}
|