Skip to content
Merged

Release #2876

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
a9a639d
[Human App] feat: implement loading state on resign btn for a specifi…
adrian-oleskiewicz Nov 22, 2024
44638af
[Exchange Oracle] Add `iou_threshold` for polygon tasks and enable si…
Bobronium Nov 22, 2024
6fd2bc9
Remove unused fields from job details (#2836)
flopez7 Nov 25, 2024
1887cb0
[Human App] feat: adjust status chip colors on my jobs table (#2734)
KacperKoza343 Nov 25, 2024
ce752b2
chore(deps): bump actions/dependency-review-action from 4.4.0 to 4.5.…
dependabot[bot] Nov 25, 2024
c76b33d
chore(deps-dev): bump xdeployer from 3.0.0 to 3.1.6 (#2838)
dependabot[bot] Nov 25, 2024
ccdc1b3
chore(deps): bump stripe from 17.3.1 to 17.4.0 (#2839)
dependabot[bot] Nov 25, 2024
f503317
chore(deps): bump react-hook-form from 7.53.1 to 7.53.2 (#2840)
dependabot[bot] Nov 25, 2024
bc2e6a4
[Human App] fix: refresh token race condition (#2824)
mpblocky Nov 25, 2024
b5886e3
[Human App] fix: metamask error from walletconnect (#2794)
mpblocky Nov 25, 2024
6868a0d
[Human App] fix: invalid imports of auth schema (#2842)
dnechay Nov 25, 2024
ab36747
[Human App] feat: ui-configuration endpoint (#2841)
dnechay Nov 25, 2024
e407237
[Human App] Implemented oracle filter (#2697)
0xVoronov Nov 26, 2024
49ffa9e
[Dashboard] Available networks endpoint (#2779)
0xVoronov Nov 26, 2024
d38e1d9
[Human App] fix: ui configuration response dto (#2846)
0xVoronov Nov 26, 2024
ebc4df6
fix start:prod script (#2849)
portuu3 Nov 26, 2024
f745ece
[Human App] fix: remove token clearing on welcome page render (#2844)
mpblocky Nov 26, 2024
470bf0d
[CVAT] Allow manifest changes in recording oracle (#2850)
zhiltsov-max Nov 26, 2024
2b49179
[Dashboard] fix: properly filter dashboard stats values (#2847)
dnechay Nov 27, 2024
efe591b
Integrate Dashboard Metrics (#2853)
flopez7 Nov 27, 2024
a8b0f9b
[CVAT] Fix moving projects to validation (#2852)
zhiltsov-max Nov 27, 2024
903e0e1
[Job Launcher] Implemented image polygons job type (#2845)
0xVoronov Nov 28, 2024
34269a2
feat: add image_polygons to human-app and repo (#2854)
dnechay Nov 28, 2024
430d1d3
[Job Launcher] Billing system (#2485)
flopez7 Nov 28, 2024
1b5faa9
[CVAT] Refactor and fix honeypot rerolls (#2860)
zhiltsov-max Nov 28, 2024
245f1ad
[render preview] Subgraph and contract upgrades (#2576)
portuu3 Nov 28, 2024
9e3c26a
[Human App] fix: adjust network names and filters (#2856)
adrian-oleskiewicz Nov 29, 2024
d8227f8
[Human App] fix: base url for refreshToken fn (#2864)
dnechay Nov 29, 2024
1b66b1f
[Human App] fix: remove status filter for available jobs on mobile (#…
adrian-oleskiewicz Nov 29, 2024
f8d85a1
[Human App] fix: type assertion in web3 provider hook (#2865)
mpblocky Dec 2, 2024
b29d498
[Fortune Exchange Oracle] Implemented rewardToken (#2869)
0xVoronov Dec 2, 2024
1050b62
[Subgraph] Events indexing issue (#2870)
portuu3 Dec 2, 2024
16d740b
[Dashboard] feat: add close button for menu drawer (#2866)
adrian-oleskiewicz Dec 2, 2024
7c6e1a3
fix: change yarn workspaces pattern (#2858)
dnechay Dec 4, 2024
ab22ac0
chore(deps): bump pg from 8.12.0 to 8.13.1 (#2873)
dependabot[bot] Dec 4, 2024
6587304
chore(deps): bump secp256k1 from 4.0.4 to 5.0.1 (#2872)
dependabot[bot] Dec 4, 2024
80b7863
chore(deps): bump @stripe/react-stripe-js from 2.9.0 to 3.0.0 (#2871)
dependabot[bot] Dec 4, 2024
28db5f8
chore(deps-dev): bump @types/express from 4.17.21 to 5.0.0 (#2809)
dependabot[bot] Dec 4, 2024
e407b2a
Revert "chore(deps-dev): bump @types/express from 4.17.21 to 5.0.0 (#…
portuu3 Dec 4, 2024
e4053d1
[Dashboard Server] Fixed roles values (#2881)
0xVoronov Dec 5, 2024
0142f29
[Dashboard] fix: address search component hover/active state fix (#2868)
adrian-oleskiewicz Dec 5, 2024
f27e0ae
[Dashboard] fix: double footer scroll (#2867)
adrian-oleskiewicz Dec 5, 2024
c9caeda
[Dashboard] feat: use BE sort order by default (#2883)
adrian-oleskiewicz Dec 6, 2024
e939332
[Dashboard] feat: update link colors for hover/visited states (#2880)
adrian-oleskiewicz Dec 6, 2024
b3335c6
enable whitelist and fix some UI issues for billing system (#2884)
portuu3 Dec 9, 2024
00df1db
[Reputation Oracle] Refactoring Cron Module (#2834)
0xVoronov Dec 9, 2024
d7c2163
[Dashboard] Dashboard fixes after subgraph and contract upgrades (#2879)
portuu3 Dec 9, 2024
fc09b6c
[Dashboard] feat: remove address search from header (#2885)
adrian-oleskiewicz Dec 10, 2024
245fb6e
Show network name in job details (#2897)
flopez7 Dec 11, 2024
c16c923
Allow direct call to complete after bulkPayOut (#2896)
flopez7 Dec 11, 2024
92f42e7
chore(deps-dev): bump ts-jest from 29.2.2 to 29.2.5 (#2889)
dependabot[bot] Dec 11, 2024
7d16ddf
chore(deps-dev): bump typedoc from 0.26.11 to 0.27.4 (#2890)
dependabot[bot] Dec 11, 2024
4a42529
chore(deps-dev): bump eslint-plugin-react-hooks from 4.6.2 to 5.1.0 (…
dependabot[bot] Dec 11, 2024
fb44b26
chore(deps-dev): bump eslint-import-resolver-typescript (#2892)
dependabot[bot] Dec 11, 2024
3d163ed
chore(deps-dev): bump @types/react-test-renderer from 18.3.0 to 19.0.…
dependabot[bot] Dec 11, 2024
aa106a7
Add debug.py for ease of local development (#2763)
Bobronium Dec 11, 2024
1398bb0
Add circular progress when loading card data and refactor billing det…
flopez7 Dec 11, 2024
c68acfb
fix: hcaptcha stats request (#2900)
dnechay Dec 12, 2024
9caf81b
[Human App] feat: filter out oracle jobs as per enabled chain id (#2886)
dnechay Dec 12, 2024
6b705c7
[Dashboard] feat: wrap white space for network column (#2887)
adrian-oleskiewicz Dec 12, 2024
bdf5535
[Human App] feat: set max width for solve button (#2888)
adrian-oleskiewicz Dec 12, 2024
faa8060
Upgrade uvicorn dep (#2910)
zhiltsov-max Dec 12, 2024
12f0dd1
Fix some old configuration for core scripts (#2911)
flopez7 Dec 13, 2024
772b66b
[CVAT Recording Oracle] Fix blockchain-node healthcheck (#2914)
flopez7 Dec 13, 2024
1957372
[CVAT] Fix parallel escrow validations (#2915)
zhiltsov-max Dec 13, 2024
d71ce0d
[Dashboard] Transactions table (#2902)
flopez7 Dec 16, 2024
29f70a5
change dist filename to snake case (#2917)
portuu3 Dec 16, 2024
1b44f4f
chore(deps): bump @mui/icons-material from 6.1.9 to 6.2.0 (#2918)
dependabot[bot] Dec 16, 2024
014216c
chore(deps-dev): bump typedoc from 0.27.4 to 0.27.5 (#2919)
dependabot[bot] Dec 16, 2024
3cc7ed4
chore(deps): bump @reduxjs/toolkit from 2.3.0 to 2.5.0 (#2921)
dependabot[bot] Dec 16, 2024
73d7779
Use networks avialable TTL in seconds (#2924)
portuu3 Dec 16, 2024
3ed8302
chore(deps): bump @mui/x-data-grid from 7.22.3 to 7.23.2 (#2920)
dependabot[bot] Dec 16, 2024
a3038c4
chore(deps-dev): bump prettier from 2.8.8 to 3.4.2 (#2922)
dependabot[bot] Dec 17, 2024
25f118d
fix to use CACHE_TTL_JOB_TYPES in seconds (#2929)
portuu3 Dec 17, 2024
4e6fab7
[Exchange Oracle] Refactor JwtHttpStrategy (#2930)
flopez7 Dec 17, 2024
777dd09
Bump human sdk to 3.0.8b0 (#2925)
zhiltsov-max Dec 17, 2024
c3d2709
fix: unhandled errors from updateAssigmentsCache (#2932)
dnechay Dec 17, 2024
794b9a2
[Dashboard] feat: remove tabs implementation from charts page (#2926)
adrian-oleskiewicz Dec 17, 2024
396c69f
[Job Launcher] fix: get rid of job types mapping in job creation (#2907)
dnechay Dec 17, 2024
513461f
[Dashboard] Implemented Network module with get operating networks lo…
0xVoronov Dec 17, 2024
c9d8688
[Dashboard] feat: added EVM address validation to search (#2908)
adrian-oleskiewicz Dec 18, 2024
9b2e2ef
Added role to reputation endpoint (#2935)
0xVoronov Dec 18, 2024
3877a6f
change balance label from balance of to balance (#2939)
portuu3 Dec 18, 2024
296c985
[Reputation Oracle] refactoring: exception handling for `kyc` module …
Dzeranov Dec 19, 2024
31b29a6
[Job Launcher] Disable fortune jobs creation in mainnets (#2942)
flopez7 Dec 19, 2024
3b77496
[Job Launcher] Show most recent jobs first (#2943)
flopez7 Dec 19, 2024
3603ff6
Disable billing system (#2941)
flopez7 Dec 19, 2024
54a4409
[Reputation Oracle] refactoring: error handling for `qualification` m…
Dzeranov Dec 20, 2024
e8bf6c6
[Reputation Oracle] Error handling for `reputation`module (#2947)
flopez7 Dec 23, 2024
d5af0b7
Contracts deployment 20241219 (#2951)
portuu3 Dec 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
42 changes: 2 additions & 40 deletions .github/workflows/cd-deploy-contracts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ on:
escrowFactory:
description: 'deploy escrow factory'
required: true
staking:
description: 'deploy staking'
required: true
rewardPool:
description: 'deploy reward pool'
required: true

jobs:
deploy-contracts:
Expand Down Expand Up @@ -51,63 +45,43 @@ jobs:
run: |
case ${{ github.event.inputs.network }} in
"sepolia")
echo "escrow_factory=0xD6D347ba6987519B4e42EcED43dF98eFf5465a23" >> $GITHUB_OUTPUT
echo "staking=0x2B9C5EC6220BA8Ad08CB51A60FFdbC6a6235B203" >> $GITHUB_OUTPUT
echo "reward_pool=0xAFf5a986A530ff839d49325A5dF69F96627E8D29" >> $GITHUB_OUTPUT
echo "escrow_factory=0x5987A5558d961ee674efe4A8c8eB7B1b5495D3bf" >> $GITHUB_OUTPUT
echo "private_key=TESTNET_PRIVATE_KEY" >> $GITHUB_OUTPUT
;;
"polygon")
echo "escrow_factory=0xBDBfD2cC708199C5640C6ECdf3B0F4A4C67AdfcB" >> $GITHUB_OUTPUT
echo "staking=0xcbAd56bE3f504E98bd70875823d3CC0242B7bB29" >> $GITHUB_OUTPUT
echo "reward_pool=0x1371057BAec59944B924A7963F2EeCF43ff94CE4" >> $GITHUB_OUTPUT
echo "private_key=MAINNET_PRIVATE_KEY" >> $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")
echo "escrow_factory=0x92FD968AcBd521c232f5fB8c33b342923cC72714" >> $GITHUB_OUTPUT
echo "staking=0xdFbB79dC35a3A53741be54a2C9b587d6BafAbd1C" >> $GITHUB_OUTPUT
echo "reward_pool=0xf376443BCc6d4d4D63eeC086bc4A9E4a83878e0e" >> $GITHUB_OUTPUT
echo "private_key=MAINNET_PRIVATE_KEY" >> $GITHUB_OUTPUT
;;
"bscTestnet")
echo "escrow_factory=0x2bfA592DBDaF434DDcbb893B1916120d181DAD18" >> $GITHUB_OUTPUT
echo "staking=0x5517fE916Fe9F8dB15B0DDc76ebDf0BdDCd4ed18" >> $GITHUB_OUTPUT
echo "reward_pool=0xB0A0500103eCEc431b73F6BAd923F0a2774E6e29" >> $GITHUB_OUTPUT
echo "private_key=TESTNET_PRIVATE_KEY" >> $GITHUB_OUTPUT
;;
"moonbeam")
echo "escrow_factory=0xD9c75a1Aa4237BB72a41E5E26bd8384f10c1f55a" >> $GITHUB_OUTPUT
echo "staking=0x05398211bA2046E296fBc9a9D3EB49e3F15C3123" >> $GITHUB_OUTPUT
echo "reward_pool=0x4A5963Dd6792692e9147EdC7659936b96251917a" >> $GITHUB_OUTPUT
echo "private_key=MAINNET_PRIVATE_KEY" >> $GITHUB_OUTPUT
;;
"moonbaseAlpha")
echo "escrow_factory=0x5e622FF522D81aa426f082bDD95210BC25fCA7Ed" >> $GITHUB_OUTPUT
echo "staking=0xBFC7009F3371F93F3B54DdC8caCd02914a37495c" >> $GITHUB_OUTPUT
echo "reward_pool=0xf46B45Df3d956369726d8Bd93Ba33963Ab692920" >> $GITHUB_OUTPUT
echo "private_key=TESTNET_PRIVATE_KEY" >> $GITHUB_OUTPUT
;;
"mainnet")
echo "escrow_factory=0xD9c75a1Aa4237BB72a41E5E26bd8384f10c1f55a" >> $GITHUB_OUTPUT
echo "staking=0x05398211bA2046E296fBc9a9D3EB49e3F15C3123" >> $GITHUB_OUTPUT
echo "reward_pool=0x4A5963Dd6792692e9147EdC7659936b96251917a" >> $GITHUB_OUTPUT
echo "private_key=MAINNET_PRIVATE_KEY" >> $GITHUB_OUTPUT
;;
"avalanche")
echo "escrow_factory=0xD9c75a1Aa4237BB72a41E5E26bd8384f10c1f55a" >> $GITHUB_OUTPUT
echo "staking=0x05398211bA2046E296fBc9a9D3EB49e3F15C3123" >> $GITHUB_OUTPUT
echo "reward_pool=0x4A5963Dd6792692e9147EdC7659936b96251917a" >> $GITHUB_OUTPUT
echo "private_key=MAINNET_PRIVATE_KEY" >> $GITHUB_OUTPUT
;;
"avalancheFujiTestnet")
echo "escrow_factory=0x56C2ba540726ED4f46E7a134b6b9Ee9C867FcF92" >> $GITHUB_OUTPUT
echo "staking=0x9890473B0b93E24d6D1a8Dfb739D577C6f25FFd3" >> $GITHUB_OUTPUT
echo "reward_pool=0x5517fE916Fe9F8dB15B0DDc76ebDf0BdDCd4ed18" >> $GITHUB_OUTPUT
echo "private_key=TESTNET_PRIVATE_KEY" >> $GITHUB_OUTPUT
;;
*)
Expand All @@ -116,30 +90,18 @@ jobs:
;;
esac
- name: Upgrade Proxies
if: github.event.inputs.escrowFactory == 'true' || github.event.inputs.staking == 'true' || github.event.inputs.rewardPool== 'true'
if: github.event.inputs.escrowFactory == 'true'
run: yarn upgrade:proxy --network ${{ github.event.inputs.network }}
working-directory: ./packages/core
env:
PRIVATE_KEY: ${{ secrets[steps.networks.outputs.private_key] }}
DEPLOY_ESCROW_FACTORY: ${{ github.event.inputs.escrowFactory }}
DEPLOY_STAKING: ${{ github.event.inputs.staking }}
DEPLOY_REWARD_POOL: ${{ github.event.inputs.rewardPool }}
ESCROW_FACTORY_ADDRESS: ${{ steps.networks.outputs.escrow_factory }}
STAKING_ADDRESS: ${{ steps.networks.outputs.staking }}
REWARD_POOL_ADDRESS: ${{ steps.networks.outputs.reward_pool }}

- name: Verify Escrow Factory Proxy
if: always() && github.event.inputs.escrowFactory == 'true'
run: npx hardhat verify --network ${{ github.event.inputs.network }} ${{ steps.networks.outputs.escrow_factory }}
working-directory: ./packages/core
- name: Verify Staking Proxy
if: always() && github.event.inputs.staking == 'true'
run: npx hardhat verify --network ${{ github.event.inputs.network }} ${{ steps.networks.outputs.staking }}
working-directory: ./packages/core
- name: Verify Reward Pool Proxy
if: always() && github.event.inputs.rewardPool== 'true'
run: npx hardhat verify --network ${{ github.event.inputs.network }} ${{ steps.networks.outputs.reward_pool }}
working-directory: ./packages/core
#Commit changes to develop
- name: Check for Changes
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-dependency-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
- name: "Checkout Repository"
uses: actions/checkout@v4.1.1
- name: "Dependency Review"
uses: actions/dependency-review-action@v4.4.0
uses: actions/dependency-review-action@v4.5.0
6 changes: 3 additions & 3 deletions docs/sdk/python/human_protocol_sdk.encryption.encryption.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Decrypts a message using the private key.
* **message** (`str`) – Armored message to decrypt
* **public_key** (`Optional`[`str`]) – Armored public key used for signature verification. Defaults to None.
* **Return type:**
`str`
`bytes`
* **Returns:**
Decrypted message
* **Example:**
Expand Down Expand Up @@ -94,7 +94,7 @@ Decrypts a message using the private key.
Signs a message using the private key.

* **Parameters:**
**message** (`str`) – Message to sign
**message** (`Union`[`str`, `bytes`]) – Message to sign
* **Return type:**
`str`
* **Returns:**
Expand Down Expand Up @@ -130,7 +130,7 @@ Signs a message using the private key.
Signs and encrypts a message using the private key and recipient’s public keys.

* **Parameters:**
* **message** (`str`) – Message to sign and encrypt
* **message** (`Union`[`str`, `bytes`]) – Message to sign and encrypt
* **public_keys** (`List`[`str`]) – List of armored public keys of the recipients
* **Return type:**
`str`
Expand Down
162 changes: 61 additions & 101 deletions docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,45 +73,6 @@ Initializes a Escrow instance.
* **Parameters:**
**web3** (`Web3`) – The Web3 object

#### abort(escrow_address, tx_options=None)

Cancels the specified escrow,
sends the balance to the canceler and selfdestructs the escrow contract.

* **Parameters:**
* **escrow_address** (`str`) – Address of the escrow to abort
* **tx_options** (`Optional`[`TxParams`]) – (Optional) Additional transaction parameters
* **Return type:**
`None`
* **Returns:**
None
* **Raises:**
[**EscrowClientError**](#human_protocol_sdk.escrow.escrow_client.EscrowClientError) – If an error occurs while checking the parameters
* **Example:**
```python
from eth_typing import URI
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.providers.auto import load_provider_from_uri

from human_protocol_sdk.escrow import EscrowClient

def get_w3_with_priv_key(priv_key: str):
w3 = Web3(load_provider_from_uri(URI("http://localhost:8545")))
gas_payer = w3.eth.account.from_key(priv_key)
w3.eth.default_account = gas_payer.address
w3.middleware_onion.add(
construct_sign_and_send_raw_middleware(gas_payer),
"construct_sign_and_send_raw_middleware",
)
return (w3, gas_payer)

(w3, gas_payer) = get_w3_with_priv_key('YOUR_PRIVATE_KEY')
escrow_client = EscrowClient(w3)

escrow_client.abort("0x62dD51230A30401C455c8398d06F85e4EaB6309f")
```

#### add_trusted_handlers(escrow_address, handlers, tx_options=None)

Adds an array of addresses to the trusted handlers list.
Expand Down Expand Up @@ -158,7 +119,7 @@ Adds an array of addresses to the trusted handlers list.
)
```

#### bulk_payout(escrow_address, recipients, amounts, final_results_url, final_results_hash, txId, tx_options=None)
#### bulk_payout(escrow_address, recipients, amounts, final_results_url, final_results_hash, txId, force_complete=False, tx_options=None)

Pays out the amounts specified to the workers and sets the URL of the final results file.

Expand All @@ -169,6 +130,7 @@ Pays out the amounts specified to the workers and sets the URL of the final resu
* **final_results_url** (`str`) – Final results file url
* **final_results_hash** (`str`) – Final results file hash
* **txId** (`Decimal`) – Serial number of the bulks
* **force_complete** (`Optional`[`bool`]) – (Optional) Indicates if remaining balance should be transferred to the escrow creator
* **tx_options** (`Optional`[`TxParams`]) – (Optional) Additional transaction parameters
* **Return type:**
`None`
Expand Down Expand Up @@ -301,67 +263,6 @@ Sets the status of an escrow to completed.
escrow_client.complete("0x62dD51230A30401C455c8398d06F85e4EaB6309f")
```

#### create_and_setup_escrow(token_address, trusted_handlers, job_requester_id, escrow_config)

Creates and sets up an escrow.

* **Parameters:**
* **token_address** (`str`) – Token to use for pay outs
* **trusted_handlers** (`List`[`str`]) – Array of addresses that can perform actions on the contract
* **job_requester_id** (`str`) – The id of the job requester
* **escrow_config** ([`EscrowConfig`](#human_protocol_sdk.escrow.escrow_client.EscrowConfig)) – Object containing all the necessary information to setup an escrow
* **Return type:**
`str`
* **Returns:**
The address of the escrow created
* **Raises:**
[**EscrowClientError**](#human_protocol_sdk.escrow.escrow_client.EscrowClientError) – If an error occurs while checking the parameters
* **Example:**
```python
from eth_typing import URI
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.providers.auto import load_provider_from_uri

from human_protocol_sdk.escrow import EscrowClient

def get_w3_with_priv_key(priv_key: str):
w3 = Web3(load_provider_from_uri(URI("http://localhost:8545")))
gas_payer = w3.eth.account.from_key(priv_key)
w3.eth.default_account = gas_payer.address
w3.middleware_onion.add(
construct_sign_and_send_raw_middleware(gas_payer),
"construct_sign_and_send_raw_middleware",
)
return (w3, gas_payer)

(w3, gas_payer) = get_w3_with_priv_key('YOUR_PRIVATE_KEY')
escrow_client = EscrowClient(w3)

token_address = '0x0376D26246Eb35FF4F9924cF13E6C05fd0bD7Fb4'
trusted_handlers = [
'0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
'0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
]
job_requester_id = 'job-requester'
escrow_config = EscrowConfig(
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
10,
10,
10,
"htttp://localhost/manifest.json",
"b5dad76bf6772c0f07fd5e048f6e75a5f86ee079",
)
escrow_address = escrow_client.create_and_setup_escrow(
token_address,
trusted_handlers,
job_requester_id,
escrow_config
)
```

#### create_escrow(token_address, trusted_handlers, job_requester_id, tx_options=None)

Creates an escrow contract that uses the token passed to pay oracle fees and reward workers.
Expand Down Expand Up @@ -882,6 +783,52 @@ Stores the results url.
)
```

#### withdraw(escrow_address, token_address, tx_options=None)

Withdraws additional tokens in the escrow to the canceler.

* **Parameters:**
* **escrow_address** (`str`) – Address of the escrow to withdraw
* **token_address** (`str`) – Address of the token to withdraw
* **tx_options** (`Optional`[`TxParams`]) – (Optional) Additional transaction parameters
* **Return type:**
[`EscrowWithdraw`](#human_protocol_sdk.escrow.escrow_client.EscrowWithdraw)
* **Returns:**
EscrowWithdraw:
An instance of the EscrowWithdraw class containing details of the withdrawal transaction,
including the transaction hash and the token address and amount withdrawn.
* **Raises:**
* [**EscrowClientError**](#human_protocol_sdk.escrow.escrow_client.EscrowClientError) – If an error occurs while checking the parameters
* [**EscrowClientError**](#human_protocol_sdk.escrow.escrow_client.EscrowClientError) – If the transfer event associated with the withdrawal
is not found in the transaction logs
* **Example:**
```python
from eth_typing import URI
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.providers.auto import load_provider_from_uri

from human_protocol_sdk.escrow import EscrowClient

def get_w3_with_priv_key(priv_key: str):
w3 = Web3(load_provider_from_uri(URI("http://localhost:8545")))
gas_payer = w3.eth.account.from_key(priv_key)
w3.eth.default_account = gas_payer.address
w3.middleware_onion.add(
construct_sign_and_send_raw_middleware(gas_payer),
"construct_sign_and_send_raw_middleware",
)
return (w3, gas_payer)

(w3, gas_payer) = get_w3_with_priv_key('YOUR_PRIVATE_KEY')
escrow_client = EscrowClient(w3)

escrow_cancel_data = escrow_client.withdraw(
"0x62dD51230A30401C455c8398d06F85e4EaB6309f",
"0x0376D26246Eb35FF4F9924cF13E6C05fd0bD7Fb4"
)
```

### *exception* human_protocol_sdk.escrow.escrow_client.EscrowClientError

Bases: `Exception`
Expand All @@ -905,3 +852,16 @@ Initializes a Escrow instance.
* **reputation_oracle_fee** (`Decimal`) – Fee percentage of the Reputation Oracle
* **manifest_url** (`str`) – Manifest file url
* **hash** (`str`) – Manifest file hash

### *class* human_protocol_sdk.escrow.escrow_client.EscrowWithdraw(tx_hash, token_address, amount_withdrawn)

Bases: `object`

#### \_\_init_\_(tx_hash, token_address, amount_withdrawn)

Represents the result of an escrow cancellation transaction.

* **Parameters:**
* **tx_hash** (`str`) – The hash of the transaction associated with the escrow withdrawal.
* **token_address** (`str`) – The address of the token used for the withdrawal.
* **amount_withdrawn** (`any`) – The amount withdrawn from the escrow.
5 changes: 3 additions & 2 deletions docs/sdk/python/human_protocol_sdk.escrow.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ obtain information from both the contracts and subgraph.
* [`EscrowCancel.__init__()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowCancel.__init__)
* [`EscrowClient`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient)
* [`EscrowClient.__init__()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.__init__)
* [`EscrowClient.abort()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.abort)
* [`EscrowClient.add_trusted_handlers()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.add_trusted_handlers)
* [`EscrowClient.bulk_payout()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.bulk_payout)
* [`EscrowClient.cancel()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.cancel)
* [`EscrowClient.complete()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.complete)
* [`EscrowClient.create_and_setup_escrow()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.create_and_setup_escrow)
* [`EscrowClient.create_escrow()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.create_escrow)
* [`EscrowClient.fund()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.fund)
* [`EscrowClient.get_balance()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_balance)
Expand All @@ -34,9 +32,12 @@ obtain information from both the contracts and subgraph.
* [`EscrowClient.get_token_address()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_token_address)
* [`EscrowClient.setup()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.setup)
* [`EscrowClient.store_results()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.store_results)
* [`EscrowClient.withdraw()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.withdraw)
* [`EscrowClientError`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClientError)
* [`EscrowConfig`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowConfig)
* [`EscrowConfig.__init__()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowConfig.__init__)
* [`EscrowWithdraw`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowWithdraw)
* [`EscrowWithdraw.__init__()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowWithdraw.__init__)
* [human_protocol_sdk.escrow.escrow_utils module](human_protocol_sdk.escrow.escrow_utils.md)
* [Code Example](human_protocol_sdk.escrow.escrow_utils.md#code-example)
* [Module](human_protocol_sdk.escrow.escrow_utils.md#module)
Expand Down
Loading
Loading