Skip to content

Commit

Permalink
Merge pull request #1868 from humanprotocol/develop
Browse files Browse the repository at this point in the history
Release Sprint 8 W2 2024
  • Loading branch information
portuu3 committed Apr 16, 2024
2 parents 62ecbc2 + 350fca5 commit e7325db
Show file tree
Hide file tree
Showing 96 changed files with 3,943 additions and 387 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/cd-deploy-contracts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
env:
ETH_GOERLI_TESTNET_URL: ${{ secrets.ETH_GOERLI_TESTNET_URL }}
ETH_POLYGON_URL: ${{ secrets.ETH_POLYGON_URL }}
ETH_POLYGON_MUMBAI_URL: ${{ secrets.ETH_POLYGON_MUMBAI_URL }}
ETH_POLYGON_AMOY_URL: ${{ secrets.ETH_POLYGON_AMOY_URL }}
ETH_BSC_URL: ${{ secrets.ETH_BSC_URL }}
ETH_BSC_TESTNET_URL: ${{ secrets.ETH_BSC_TESTNET_URL }}
ETH_MOONBEAM_URL: ${{ secrets.ETH_MOONBEAM_URL }}
Expand Down Expand Up @@ -62,10 +62,10 @@ jobs:
echo "reward_pool=0x1371057BAec59944B924A7963F2EeCF43ff94CE4" >> $GITHUB_OUTPUT
echo "private_key=MAINNET_PRIVATE_KEY" >> $GITHUB_OUTPUT
;;
"polygonMumbai")
echo "escrow_factory=0xA8D927C4DA17A6b71675d2D49dFda4E9eBE58f2d" >> $GITHUB_OUTPUT
echo "staking=0x7Fd3dF914E7b6Bd96B4c744Df32183b51368Bfac" >> $GITHUB_OUTPUT
echo "reward_pool=0xf0145eD99AC3c4f877aDa7dA4D1E059ec9116BAE" >> $GITHUB_OUTPUT
"polygonAmoy")
echo "escrow_factory=0xAFf5a986A530ff839d49325A5dF69F96627E8D29" >> $GITHUB_OUTPUT
echo "staking=0xCc0AF0635aa19fE799B6aFDBe28fcFAeA7f00a60" >> $GITHUB_OUTPUT
echo "reward_pool=0xd866bCEFf6D0F77E1c3EAE28230AE6C79b03fDa7" >> $GITHUB_OUTPUT
echo "private_key=TESTNET_PRIVATE_KEY" >> $GITHUB_OUTPUT
;;
"bsc")
Expand Down
4 changes: 4 additions & 0 deletions docs/sdk/python/human_protocol_sdk.constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Enum for chain IDs.

#### POLYGON *= 137*

#### POLYGON_AMOY *= 80002*

#### POLYGON_MUMBAI *= 80001*

#### RINKEBY *= 4*
Expand All @@ -44,6 +46,8 @@ Enum for KVStore keys

#### fee *= 'fee'*

#### job_types *= 'job_types'*

#### public_key *= 'public_key'*

#### role *= 'role'*
Expand Down
6 changes: 3 additions & 3 deletions docs/sdk/python/human_protocol_sdk.escrow.escrow_utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ from human_protocol_sdk.escrow import EscrowUtils, EscorwFilter, Status
print(
EscrowUtils.get_escrows(
EscrowFilter(
networks=[ChainId.POLYGON_MUMBAI],
networks=[ChainId.POLYGON_AMOY],
status=Status.Pending,
date_from=datetime.datetime(2023, 5, 8),
date_to=datetime.datetime(2023, 6, 8),
Expand Down Expand Up @@ -78,7 +78,7 @@ Returns the escrow for a given address.

print(
EscrowUtils.get_escrow(
ChainId.POLYGON_MUMBAI,
ChainId.POLYGON_AMOY,
"0x1234567890123456789012345678901234567890"
)
)
Expand All @@ -102,7 +102,7 @@ Get an array of escrow addresses based on the specified filter parameters.
print(
EscrowUtils.get_escrows(
EscrowFilter(
networks=[ChainId.POLYGON_MUMBAI],
networks=[ChainId.POLYGON_AMOY],
status=Status.Pending,
date_from=datetime.datetime(2023, 5, 8),
date_to=datetime.datetime(2023, 6, 8),
Expand Down
2 changes: 2 additions & 0 deletions docs/sdk/python/human_protocol_sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,13 @@
* [`ChainId.MOONBASE_ALPHA`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.MOONBASE_ALPHA)
* [`ChainId.MOONBEAM`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.MOONBEAM)
* [`ChainId.POLYGON`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.POLYGON)
* [`ChainId.POLYGON_AMOY`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.POLYGON_AMOY)
* [`ChainId.POLYGON_MUMBAI`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.POLYGON_MUMBAI)
* [`ChainId.RINKEBY`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.RINKEBY)
* [`ChainId.SKALE`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.SKALE)
* [`KVStoreKeys`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys)
* [`KVStoreKeys.fee`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.fee)
* [`KVStoreKeys.job_types`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.job_types)
* [`KVStoreKeys.public_key`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.public_key)
* [`KVStoreKeys.role`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.role)
* [`KVStoreKeys.url`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.url)
Expand Down
21 changes: 12 additions & 9 deletions docs/sdk/python/human_protocol_sdk.operator.operator_utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ from human_protocol_sdk.operator import OperatorUtils, LeaderFilter

print(
OperatorUtils.get_leaders(
LeaderFilter(networks=[ChainId.POLYGON_MUMBAI], role="Job Launcher")
LeaderFilter(networks=[ChainId.POLYGON_AMOY], role="Job Launcher")
)
)
```

## Module

### *class* human_protocol_sdk.operator.operator_utils.LeaderData(chain_id, id, address, amount_staked, amount_allocated, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reputation, reward, amount_jobs_launched, role=None, fee=None, public_key=None, webhook_url=None, url=None)
### *class* human_protocol_sdk.operator.operator_utils.LeaderData(chain_id, id, address, amount_staked, amount_allocated, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reputation, reward, amount_jobs_launched, role=None, fee=None, public_key=None, webhook_url=None, url=None, job_types=None)

Bases: `object`

#### \_\_init_\_(chain_id, id, address, amount_staked, amount_allocated, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reputation, reward, amount_jobs_launched, role=None, fee=None, public_key=None, webhook_url=None, url=None)
#### \_\_init_\_(chain_id, id, address, amount_staked, amount_allocated, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reputation, reward, amount_jobs_launched, role=None, fee=None, public_key=None, webhook_url=None, url=None, job_types=None)

Initializes an LeaderData instance.

Expand All @@ -43,6 +43,7 @@ Initializes an LeaderData instance.
* **public_key** (`Optional`[`str`]) – Public key
* **webhook_url** (`Optional`[`str`]) – Webhook url
* **url** (`Optional`[`str`]) – Url
* **job_types** (`Optional`[`str`]) – Job types

### *class* human_protocol_sdk.operator.operator_utils.LeaderFilter(networks, role=None)

Expand All @@ -58,11 +59,11 @@ Initializes a LeaderFilter instance.
* **networks** (`List`[[`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)]) – Networks to request data
* **role** (`Optional`[`str`]) – Leader role

### *class* human_protocol_sdk.operator.operator_utils.Operator(address, role)
### *class* human_protocol_sdk.operator.operator_utils.Operator(address, role, url='', job_types='')

Bases: `object`

#### \_\_init_\_(address, role)
#### \_\_init_\_(address, role, url='', job_types='')

Initializes an Operator instance.

Expand Down Expand Up @@ -93,7 +94,7 @@ Get the leader details.
from human_protocol_sdk.operator import OperatorUtils

leader = OperatorUtils.get_leader(
ChainId.POLYGON_MUMBAI,
ChainId.POLYGON_AMOY,
'0x62dD51230A30401C455c8398d06F85e4EaB6309f'
)
```
Expand All @@ -115,7 +116,7 @@ Get leaders data of the protocol

print(
OperatorUtils.get_leaders(
LeaderFilter(networks=[ChainId.POLYGON_MUMBAI])
LeaderFilter(networks=[ChainId.POLYGON_AMOY])
)
)
```
Expand All @@ -128,6 +129,8 @@ Get the reputation network operators of the specified address.
* **chain_id** ([`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)) – Network in which the reputation network exists
* **address** (`str`) – Address of the reputation oracle
* **role** (`Optional`[`str`]) – (Optional) Role of the operator
* **Parem job_types:**
(Optional) Job types of the operator
* **Return type:**
`List`[[`Operator`](#human_protocol_sdk.operator.operator_utils.Operator)]
* **Returns:**
Expand All @@ -138,7 +141,7 @@ Get the reputation network operators of the specified address.
from human_protocol_sdk.operator import OperatorUtils

leader = OperatorUtils.get_reputation_network_operators(
ChainId.POLYGON_MUMBAI,
ChainId.POLYGON_AMOY,
'0x62dD51230A30401C455c8398d06F85e4EaB6309f'
)
```
Expand All @@ -160,7 +163,7 @@ Get rewards of the given slasher
from human_protocol_sdk.operator import OperatorUtils

rewards_info = OperatorUtils.get_rewards_info(
ChainId.POLYGON_MUMBAI,
ChainId.POLYGON_AMOY,
'0x62dD51230A30401C455c8398d06F85e4EaB6309f'
)
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This client enables to obtain statistical information from the subgraph.
from human_protocol_sdk.constants import ChainId
from human_protocol_sdk.statistics import StatisticsClient

statistics_client = StatisticsClient(ChainId.POLYGON_MUMBAI)
statistics_client = StatisticsClient(ChainId.POLYGON_AMOY)
```

## Module
Expand Down Expand Up @@ -134,13 +134,13 @@ Initializes a PaymentStatistics instance.
* **Parameters:**
**daily_payments_data** (`List`[[`DailyPaymentData`](#human_protocol_sdk.statistics.statistics_client.DailyPaymentData)]) – Daily payments data

### *class* human_protocol_sdk.statistics.statistics_client.StatisticsClient(chain_id=ChainId.POLYGON_MUMBAI)
### *class* human_protocol_sdk.statistics.statistics_client.StatisticsClient(chain_id=ChainId.POLYGON_AMOY)

Bases: `object`

A client used to get statistical data.

#### \_\_init_\_(chain_id=ChainId.POLYGON_MUMBAI)
#### \_\_init_\_(chain_id=ChainId.POLYGON_AMOY)

Initializes a Statistics instance

Expand All @@ -162,7 +162,7 @@ Get escrow statistics data for the given date range.
from human_protocol_sdk.contants import ChainId
from human_protocol_sdk.statistics import StatisticsClient, StatisticsParam

statistics_client = StatisticsClient(ChainId.POLYGON_MUMBAI)
statistics_client = StatisticsClient(ChainId.POLYGON_AMOY)

print(statistics_client.get_escrow_statistics())
print(
Expand Down Expand Up @@ -190,7 +190,7 @@ Get HMT statistics data for the given date range.
from human_protocol_sdk.contants import ChainId
from human_protocol_sdk.statistics import StatisticsClient, StatisticsParam

statistics_client = StatisticsClient(ChainId.POLYGON_MUMBAI)
statistics_client = StatisticsClient(ChainId.POLYGON_AMOY)

print(statistics_client.get_hmt_statistics())
print(
Expand Down Expand Up @@ -218,7 +218,7 @@ Get payment statistics data for the given date range.
from human_protocol_sdk.contants import ChainId
from human_protocol_sdk.statistics import StatisticsClient, StatisticsParam

statistics_client = StatisticsClient(ChainId.POLYGON_MUMBAI)
statistics_client = StatisticsClient(ChainId.POLYGON_AMOY)

print(statistics_client.get_payment_statistics())
print(
Expand Down Expand Up @@ -246,7 +246,7 @@ Get worker statistics data for the given date range.
from human_protocol_sdk.contants import ChainId
from human_protocol_sdk.statistics import StatisticsClient, StatisticsParam

statistics_client = StatisticsClient(ChainId.POLYGON_MUMBAI)
statistics_client = StatisticsClient(ChainId.POLYGON_AMOY)

print(statistics_client.get_worker_statistics())
print(
Expand Down
18 changes: 15 additions & 3 deletions docs/sdk/typescript/classes/base.BaseEthersClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ This class is used as a base class for other clients making on-chain calls.

#### Defined in

[base.ts:20](https://github.com/humanprotocol/human-protocol/blob/48066071/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20)
<<<<<<< HEAD
[base.ts:20](https://github.com/humanprotocol/human-protocol/blob/4a01940c/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20)
=======
[base.ts:20](https://github.com/humanprotocol/human-protocol/blob/e4b60ab1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20)
>>>>>>> develop
## Properties

Expand All @@ -60,7 +64,11 @@ This class is used as a base class for other clients making on-chain calls.

#### Defined in

[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/48066071/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12)
<<<<<<< HEAD
[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/4a01940c/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12)
=======
[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/e4b60ab1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12)
>>>>>>> develop
___

Expand All @@ -70,4 +78,8 @@ ___

#### Defined in

[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/48066071/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11)
<<<<<<< HEAD
[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/4a01940c/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11)
=======
[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/e4b60ab1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11)
>>>>>>> develop
36 changes: 30 additions & 6 deletions docs/sdk/typescript/classes/encryption.Encryption.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ Constructor for the Encryption class.

#### Defined in

[encryption.ts:53](https://github.com/humanprotocol/human-protocol/blob/48066071/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L53)
<<<<<<< HEAD
[encryption.ts:53](https://github.com/humanprotocol/human-protocol/blob/4a01940c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L53)
=======
[encryption.ts:53](https://github.com/humanprotocol/human-protocol/blob/e4b60ab1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L53)
>>>>>>> develop
## Properties

Expand All @@ -91,7 +95,11 @@ Constructor for the Encryption class.

#### Defined in

[encryption.ts:46](https://github.com/humanprotocol/human-protocol/blob/48066071/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L46)
<<<<<<< HEAD
[encryption.ts:46](https://github.com/humanprotocol/human-protocol/blob/4a01940c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L46)
=======
[encryption.ts:46](https://github.com/humanprotocol/human-protocol/blob/e4b60ab1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L46)
>>>>>>> develop
## Methods

Expand Down Expand Up @@ -140,7 +148,11 @@ const resultMessage = await encription.decrypt('message');

#### Defined in

[encryption.ts:180](https://github.com/humanprotocol/human-protocol/blob/48066071/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L180)
<<<<<<< HEAD
[encryption.ts:180](https://github.com/humanprotocol/human-protocol/blob/4a01940c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L180)
=======
[encryption.ts:180](https://github.com/humanprotocol/human-protocol/blob/e4b60ab1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L180)
>>>>>>> develop
___

Expand Down Expand Up @@ -176,7 +188,11 @@ const resultMessage = await encription.sign('message');

#### Defined in

[encryption.ts:217](https://github.com/humanprotocol/human-protocol/blob/48066071/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L217)
<<<<<<< HEAD
[encryption.ts:217](https://github.com/humanprotocol/human-protocol/blob/4a01940c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L217)
=======
[encryption.ts:217](https://github.com/humanprotocol/human-protocol/blob/e4b60ab1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L217)
>>>>>>> develop
___

Expand Down Expand Up @@ -238,7 +254,11 @@ const resultMessage = await encription.signAndEncrypt('message', publicKeys);

#### Defined in

[encryption.ts:129](https://github.com/humanprotocol/human-protocol/blob/48066071/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L129)
<<<<<<< HEAD
[encryption.ts:129](https://github.com/humanprotocol/human-protocol/blob/4a01940c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L129)
=======
[encryption.ts:129](https://github.com/humanprotocol/human-protocol/blob/e4b60ab1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L129)
>>>>>>> develop
___

Expand All @@ -263,4 +283,8 @@ Builds an Encryption instance by decrypting the private key from an encrypted pr

#### Defined in

[encryption.ts:64](https://github.com/humanprotocol/human-protocol/blob/48066071/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L64)
<<<<<<< HEAD
[encryption.ts:64](https://github.com/humanprotocol/human-protocol/blob/4a01940c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L64)
=======
[encryption.ts:64](https://github.com/humanprotocol/human-protocol/blob/e4b60ab1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L64)
>>>>>>> develop
Loading

0 comments on commit e7325db

Please sign in to comment.