Skip to content

Commit

Permalink
Merge branch 'develop' into feat/rename-leader
Browse files Browse the repository at this point in the history
  • Loading branch information
portuu3 committed Feb 24, 2025
2 parents 9007c81 + 0937065 commit 06afdec
Show file tree
Hide file tree
Showing 14 changed files with 1,373 additions and 1,197 deletions.
8 changes: 4 additions & 4 deletions docs/sdk/python/human_protocol_sdk.constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ Bases: `Enum`

Enum for roles.

#### exchange_oracle *= 'Exchange Oracle'*
#### exchange_oracle *= 'exchange_oracle'*

#### job_launcher *= 'Job Launcher'*
#### job_launcher *= 'job_launcher'*

#### recording_oracle *= 'Recording Oracle'*
#### recording_oracle *= 'recording_oracle'*

#### reputation_oracle *= 'Reputation Oracle'*
#### reputation_oracle *= 'reputation_oracle'*

### *class* human_protocol_sdk.constants.Status(value)

Expand Down
99 changes: 55 additions & 44 deletions docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ as well as some middlewares.
```python
from eth_typing import URI
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.middleware import SignAndSendRawMiddlewareBuilder
from web3.providers.auto import load_provider_from_uri

from human_protocol_sdk.escrow import EscrowClient
Expand All @@ -23,9 +23,10 @@ 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",
w3.middleware_onion.inject(
SignAndSendRawMiddlewareBuilder.build(priv_key),
'SignAndSendRawMiddlewareBuilder',
layer=0,
)
return (w3, gas_payer)

Expand Down Expand Up @@ -91,7 +92,7 @@ Adds an array of addresses to the trusted handlers list.
```python
from eth_typing import URI
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.middleware import SignAndSendRawMiddlewareBuilder
from web3.providers.auto import load_provider_from_uri

from human_protocol_sdk.escrow import EscrowClient
Expand All @@ -100,9 +101,10 @@ Adds an array of addresses to the trusted handlers list.
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",
w3.middleware_onion.inject(
SignAndSendRawMiddlewareBuilder.build(priv_key),
'SignAndSendRawMiddlewareBuilder',
layer=0,
)
return (w3, gas_payer)

Expand Down Expand Up @@ -142,7 +144,7 @@ Pays out the amounts specified to the workers and sets the URL of the final resu
```python
from eth_typing import URI
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.middleware import SignAndSendRawMiddlewareBuilder
from web3.providers.auto import load_provider_from_uri

from human_protocol_sdk.escrow import EscrowClient
Expand All @@ -151,9 +153,10 @@ Pays out the amounts specified to the workers and sets the URL of the final resu
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",
w3.middleware_onion.inject(
SignAndSendRawMiddlewareBuilder.build(priv_key),
'SignAndSendRawMiddlewareBuilder',
layer=0,
)
return (w3, gas_payer)

Expand Down Expand Up @@ -202,7 +205,7 @@ Cancels the specified escrow and sends the balance to the canceler.
```python
from eth_typing import URI
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.middleware import SignAndSendRawMiddlewareBuilder
from web3.providers.auto import load_provider_from_uri

from human_protocol_sdk.escrow import EscrowClient
Expand All @@ -211,9 +214,10 @@ Cancels the specified escrow and sends the balance to the canceler.
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",
w3.middleware_onion.inject(
SignAndSendRawMiddlewareBuilder.build(priv_key),
'SignAndSendRawMiddlewareBuilder',
layer=0,
)
return (w3, gas_payer)

Expand Down Expand Up @@ -242,7 +246,7 @@ Sets the status of an escrow to completed.
```python
from eth_typing import URI
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.middleware import SignAndSendRawMiddlewareBuilder
from web3.providers.auto import load_provider_from_uri

from human_protocol_sdk.escrow import EscrowClient
Expand All @@ -251,9 +255,10 @@ Sets the status of an escrow to completed.
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",
w3.middleware_onion.inject(
SignAndSendRawMiddlewareBuilder.build(priv_key),
'SignAndSendRawMiddlewareBuilder',
layer=0,
)
return (w3, gas_payer)

Expand Down Expand Up @@ -285,7 +290,7 @@ Creates a prepared transaction for bulk payout without signing or sending it.
```python
from eth_typing import URI
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.middleware import SignAndSendRawMiddlewareBuilder
from web3.providers.auto import load_provider_from_uri

from human_protocol_sdk.escrow import EscrowClient
Expand All @@ -294,9 +299,10 @@ Creates a prepared transaction for bulk payout without signing or sending it.
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",
w3.middleware_onion.inject(
SignAndSendRawMiddlewareBuilder.build(priv_key),
'SignAndSendRawMiddlewareBuilder',
layer=0,
)
return (w3, gas_payer)

Expand Down Expand Up @@ -354,7 +360,7 @@ Creates a new escrow contract.
```python
from eth_typing import URI
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.middleware import SignAndSendRawMiddlewareBuilder
from web3.providers.auto import load_provider_from_uri

from human_protocol_sdk.escrow import EscrowClient
Expand All @@ -364,9 +370,10 @@ Creates a new escrow contract.
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",
w3.middleware_onion.inject(
SignAndSendRawMiddlewareBuilder.build(priv_key),
'SignAndSendRawMiddlewareBuilder',
layer=0,
)
return (w3, gas_payer)

Expand Down Expand Up @@ -421,7 +428,7 @@ Adds funds to the escrow.
```python
from eth_typing import URI
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.middleware import SignAndSendRawMiddlewareBuilder
from web3.providers.auto import load_provider_from_uri

from human_protocol_sdk.escrow import EscrowClient
Expand All @@ -430,9 +437,10 @@ Adds funds to the escrow.
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",
w3.middleware_onion.inject(
SignAndSendRawMiddlewareBuilder.build(priv_key),
'SignAndSendRawMiddlewareBuilder',
layer=0,
)
return (w3, gas_payer)

Expand Down Expand Up @@ -793,7 +801,7 @@ Sets up the parameters of the escrow.
```python
from eth_typing import URI
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.middleware import SignAndSendRawMiddlewareBuilder
from web3.providers.auto import load_provider_from_uri

from human_protocol_sdk.escrow import EscrowClient
Expand All @@ -803,9 +811,10 @@ Sets up the parameters of the escrow.
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",
w3.middleware_onion.inject(
SignAndSendRawMiddlewareBuilder.build(priv_key),
'SignAndSendRawMiddlewareBuilder',
layer=0,
)
return (w3, gas_payer)

Expand Down Expand Up @@ -853,7 +862,7 @@ Stores the results URL.
```python
from eth_typing import URI
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.middleware import SignAndSendRawMiddlewareBuilder
from web3.providers.auto import load_provider_from_uri

from human_protocol_sdk.escrow import EscrowClient
Expand All @@ -862,9 +871,10 @@ Stores the results URL.
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",
w3.middleware_onion.inject(
SignAndSendRawMiddlewareBuilder.build(priv_key),
'SignAndSendRawMiddlewareBuilder',
layer=0,
)
return (w3, gas_payer)

Expand Down Expand Up @@ -900,7 +910,7 @@ Withdraws additional tokens in the escrow to the canceler.
```python
from eth_typing import URI
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.middleware import SignAndSendRawMiddlewareBuilder
from web3.providers.auto import load_provider_from_uri

from human_protocol_sdk.escrow import EscrowClient
Expand All @@ -909,9 +919,10 @@ Withdraws additional tokens in the escrow to the canceler.
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",
w3.middleware_onion.inject(
SignAndSendRawMiddlewareBuilder.build(priv_key),
'SignAndSendRawMiddlewareBuilder',
layer=0,
)
return (w3, gas_payer)

Expand Down
36 changes: 20 additions & 16 deletions docs/sdk/python/human_protocol_sdk.kvstore.kvstore_client.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ as well as some middlewares.
```python
from eth_typing import URI
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.middleware import SignAndSendRawMiddlewareBuilder
from web3.providers.auto import load_provider_from_uri

from human_protocol_sdk.kvstore import KVStoreClient
Expand All @@ -23,9 +23,10 @@ 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",
w3.middleware_onion.inject(
SignAndSendRawMiddlewareBuilder.build(priv_key),
'SignAndSendRawMiddlewareBuilder',
layer=0,
)
return (w3, gas_payer)

Expand Down Expand Up @@ -78,7 +79,7 @@ Sets the value of a key-value pair in the contract.
```python
from eth_typing import URI
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.middleware import SignAndSendRawMiddlewareBuilder
from web3.providers.auto import load_provider_from_uri

from human_protocol_sdk.kvstore import KVStoreClient
Expand All @@ -87,9 +88,10 @@ Sets the value of a key-value pair in the contract.
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",
w3.middleware_onion.inject(
SignAndSendRawMiddlewareBuilder.build(priv_key),
'SignAndSendRawMiddlewareBuilder',
layer=0,
)
return (w3, gas_payer)

Expand All @@ -114,7 +116,7 @@ Sets multiple key-value pairs in the contract.
```python
from eth_typing import URI
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.middleware import SignAndSendRawMiddlewareBuilder
from web3.providers.auto import load_provider_from_uri

from human_protocol_sdk.kvstore import KVStoreClient
Expand All @@ -123,9 +125,10 @@ Sets multiple key-value pairs in the contract.
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",
w3.middleware_onion.inject(
SignAndSendRawMiddlewareBuilder.build(priv_key),
'SignAndSendRawMiddlewareBuilder',
layer=0,
)
return (w3, gas_payer)

Expand Down Expand Up @@ -155,7 +158,7 @@ Sets a URL value for the address that submits the transaction, and its hash.
```python
from eth_typing import URI
from web3 import Web3
from web3.middleware import construct_sign_and_send_raw_middleware
from web3.middleware import SignAndSendRawMiddlewareBuilder
from web3.providers.auto import load_provider_from_uri

from human_protocol_sdk.kvstore import KVStoreClient
Expand All @@ -164,9 +167,10 @@ Sets a URL value for the address that submits the transaction, and its hash.
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",
w3.middleware_onion.inject(
SignAndSendRawMiddlewareBuilder.build(priv_key),
'SignAndSendRawMiddlewareBuilder',
layer=0,
)
return (w3, gas_payer)

Expand Down
Loading

0 comments on commit 06afdec

Please sign in to comment.