diff --git a/.github/workflows/ci-test-dashboard.yaml b/.github/workflows/ci-test-dashboard.yaml new file mode 100644 index 0000000000..f9f654b227 --- /dev/null +++ b/.github/workflows/ci-test-dashboard.yaml @@ -0,0 +1,23 @@ +name: Dashboard Check + +on: + push: + branches: + - 'main' + pull_request: + paths: + - 'packages/core/**' + - 'packages/sdk/typescript/human-protocol-sdk/**' + - 'packages/apps/dashboard/**' + workflow_dispatch: + +jobs: + dashboard-server-test: + name: Dashboard Server Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: npm install --global yarn && yarn + name: Install dependencies + - run: yarn workspace @human-protocol/dashboard-server test + name: Run dashboard Server test diff --git a/README.md b/README.md index 02b6921675..9f4c2f2fe6 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ | | | | | | --- | --- | --- | --- | | [![Lint Check](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-lint.yaml/badge.svg?branch=main)](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-lint.yaml) | [![Protocol Check](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-core.yaml/badge.svg?branch=main)](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-core.yaml) | [![Python SDK Check](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-python-sdk.yaml/badge.svg?branch=main)](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-python-sdk.yaml) | [![Node.js SDK Check](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-node-sdk.yaml/badge.svg?branch=main)](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-node-sdk.yaml) | -| [![Subgraph Check](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-subgraph.yaml/badge.svg?branch=main)](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-subgraph.yaml) | [![Dashboard UI Check](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-dashboard-ui.yaml/badge.svg?branch=main)](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-dashboard-ui.yaml) | [![Faucet Server Check](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-faucet-server.yaml/badge.svg?branch=main)](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-faucet-server.yaml) | [![Contract Deploy](https://github.com/humanprotocol/human-protocol/actions/workflows/cd-deploy-contracts.yaml/badge.svg?event=workflow_dispatch)](https://github.com/humanprotocol/human-protocol/actions/workflows/cd-deploy-contracts.yaml) | +| [![Subgraph Check](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-subgraph.yaml/badge.svg?branch=main)](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-subgraph.yaml) | [![Dashboard Check](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-dashboard.yaml/badge.svg?branch=main)](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-dashboard.yaml) | [![Faucet Server Check](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-faucet-server.yaml/badge.svg?branch=main)](https://github.com/humanprotocol/human-protocol/actions/workflows/ci-test-faucet-server.yaml) | [![Contract Deploy](https://github.com/humanprotocol/human-protocol/actions/workflows/cd-deploy-contracts.yaml/badge.svg?event=workflow_dispatch)](https://github.com/humanprotocol/human-protocol/actions/workflows/cd-deploy-contracts.yaml) | | [![Core NPM Publish](https://github.com/humanprotocol/human-protocol/actions/workflows/cd-core.yaml/badge.svg?event=release)](https://github.com/humanprotocol/human-protocol/actions/workflows/cd-core.yaml) | [![Python SDK Publish](https://github.com/humanprotocol/human-protocol/actions/workflows/cd-python-sdk.yaml/badge.svg?event=release)](https://github.com/humanprotocol/human-protocol/actions/workflows/cd-python-sdk.yaml) | [![Node.js SDK Publish](https://github.com/humanprotocol/human-protocol/actions/workflows/cd-node-sdk.yaml/badge.svg?event=release)](https://github.com/humanprotocol/human-protocol/actions/workflows/cd-node-sdk.yaml) | [![Subgraph Deploy](https://github.com/humanprotocol/human-protocol/actions/workflows/cd-subgraph.yaml/badge.svg?branch=main)](https://github.com/humanprotocol/human-protocol/actions/workflows/cd-subgraph.yaml) | @@ -92,4 +92,4 @@ git config blame.markUnblamableLines true ## LEGAL NOTICE The Protocol is an open-source, blockchain-based network that organizes, evaluates, and compensates human labor (the “Protocol”). Your use of the Protocol is entirely at your own risk. The Protocol is available on an “as is” basis without warranties of any kind, either express or implied, including, but not limited to, warranties of merchantability, title, fitness for a particular purpose and non-infringement. You assume all risks associated with using the Protocol, and digital assets and decentralized systems generally, including but not -limited to, that: (a) digital assets are highly volatile; (b) using digital assets is inherently risky due to both features of such assets and the potential unauthorized acts of third parties; (c) you may not have ready access to digital assets; and (d) you may lose some or all of your tokens or other digital assets. You agree that you will have no recourse against anyone else for any losses due to the use of the Protocol. For example, these losses may arise from or relate to: (i) incorrect information; (ii) software or network failures; (iii) corrupted digital wallet files; (iv) unauthorized access; (v) errors, mistakes, or inaccuracies; or (vi) third-party activities. The Protocol does not collect any personal data, and your interaction with the Protocol will solely be through your public digital wallet address. Any personal or other data that you may make available in connection with the Protocol may not be private or secure. \ No newline at end of file +limited to, that: (a) digital assets are highly volatile; (b) using digital assets is inherently risky due to both features of such assets and the potential unauthorized acts of third parties; (c) you may not have ready access to digital assets; and (d) you may lose some or all of your tokens or other digital assets. You agree that you will have no recourse against anyone else for any losses due to the use of the Protocol. For example, these losses may arise from or relate to: (i) incorrect information; (ii) software or network failures; (iii) corrupted digital wallet files; (iv) unauthorized access; (v) errors, mistakes, or inaccuracies; or (vi) third-party activities. The Protocol does not collect any personal data, and your interaction with the Protocol will solely be through your public digital wallet address. Any personal or other data that you may make available in connection with the Protocol may not be private or secure. diff --git a/docs/sdk/python/human_protocol_sdk.encryption.encryption.md b/docs/sdk/python/human_protocol_sdk.encryption.encryption.md index 3e62e0dcdc..f1047539e0 100644 --- a/docs/sdk/python/human_protocol_sdk.encryption.encryption.md +++ b/docs/sdk/python/human_protocol_sdk.encryption.encryption.md @@ -1,11 +1,11 @@ # human_protocol_sdk.encryption.encryption module -This class allows to sign, verify, encrypt and -decrypt messages at all levels of escrow processing. +This class allows signing, verifying, encrypting, and +decrypting messages at all levels of escrow processing. The algorithm includes the implementation of the [PGP encryption algorithm]([https://github.com/openpgpjs/openpgpjs](https://github.com/openpgpjs/openpgpjs)) -multi-public key encryption on python. +multi-public key encryption in Python. Using the vanilla [ed25519]([https://en.wikipedia.org/wiki/EdDSA#Ed25519](https://en.wikipedia.org/wiki/EdDSA#Ed25519)) implementation Schnorr signatures for signature and [curve25519]([https://en.wikipedia.org/wiki/Curve25519](https://en.wikipedia.org/wiki/Curve25519)) for encryption. diff --git a/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md b/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md index aa21abc1ef..3ad628a9ea 100644 --- a/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md +++ b/docs/sdk/python/human_protocol_sdk.escrow.escrow_client.md @@ -64,7 +64,7 @@ Represents the result of an escrow cancellation transaction. Bases: `object` -A class used to manage escrow on the HUMAN network. +A client class to interact with the escrow smart contract. #### \_\_init_\_(web3) @@ -127,7 +127,7 @@ Pays out the amounts specified to the workers and sets the URL of the final resu * **escrow_address** (`str`) – Address of the escrow * **recipients** (`List`[`str`]) – Array of recipient addresses * **amounts** (`List`[`Decimal`]) – Array of amounts the recipients will receive - * **final_results_url** (`str`) – Final results file url + * **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 @@ -263,19 +263,22 @@ Sets the status of an escrow to completed. escrow_client.complete("0x62dD51230A30401C455c8398d06F85e4EaB6309f") ``` -#### create_escrow(token_address, trusted_handlers, job_requester_id, tx_options=None) +#### create_bulk_payout_transaction(escrow_address, recipients, amounts, final_results_url, final_results_hash, txId, force_complete=False, tx_options=None) -Creates an escrow contract that uses the token passed to pay oracle fees and reward workers. +Creates a prepared transaction for bulk payout without signing or sending it. * **Parameters:** - * **tokenAddress** – The address of the token to use for payouts - * **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_address** (`str`) – Address of the escrow + * **recipients** (`List`[`str`]) – Array of recipient addresses + * **amounts** (`List`[`Decimal`]) – Array of amounts the recipients will receive + * **final_results_url** (`str`) – Final results file URL + * **final_results_hash** (`str`) – Final results file hash + * **txId** (`Decimal`) – Serial number of the bulks * **tx_options** (`Optional`[`TxParams`]) – (Optional) Additional transaction parameters * **Return type:** - `str` + `TxParams` * **Returns:** - The address of the escrow created + A dictionary containing the prepared transaction * **Raises:** [**EscrowClientError**](#human_protocol_sdk.escrow.escrow_client.EscrowClientError) – If an error occurs while checking the parameters * **Example:** @@ -300,10 +303,80 @@ Creates an escrow contract that uses the token passed to pay oracle fees and rew (w3, gas_payer) = get_w3_with_priv_key('YOUR_PRIVATE_KEY') escrow_client = EscrowClient(w3) - token_address = '0x0376D26246Eb35FF4F9924cF13E6C05fd0bD7Fb4' - trusted_handlers = [ + recipients = [ '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', - '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266' + '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92267' + ] + amounts = [ + Web3.to_wei(5, 'ether'), + Web3.to_wei(10, 'ether') + ] + results_url = 'http://localhost/results.json' + results_hash = 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079' + + transaction = escrow_client.create_bulk_payout_transaction( + "0x62dD51230A30401C455c8398d06F85e4EaB6309f", + recipients, + amounts, + results_url, + results_hash, + 1, + false + ) + + print(f"Transaction: {transaction}") + + signed_transaction = w3.eth.account.sign_transaction( + transaction, private_key + ) + tx_hash = w3.eth.send_raw_transaction( + signed_transaction.raw_transaction + ) + tx_receipt = w3.eth.wait_for_transaction_receipt(tx_hash) + print(f"Transaction sent with hash: {tx_hash.hex()}") + print(f"Transaction receipt: {tx_receipt}") + ``` + +#### create_escrow(token_address, trusted_handlers, job_requester_id, tx_options=None) + +Creates a new escrow contract. + +* **Parameters:** + * **token_address** (`str`) – Address of the token to be used in the escrow + * **trusted_handlers** (`List`[`str`]) – List of trusted handler addresses + * **job_requester_id** (`str`) – ID of the job requester + * **tx_options** (`Optional`[`TxParams`]) – (Optional) Transaction options +* **Return type:** + `str` +* **Returns:** + Address of the created escrow contract +* **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 = '0x1234567890abcdef1234567890abcdef12345678' + trusted_handlers = [ + '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef' ] job_requester_id = 'job-requester' escrow_address = escrow_client.create_escrow( @@ -313,12 +386,29 @@ Creates an escrow contract that uses the token passed to pay oracle fees and rew ) ``` +#### ensure_correct_bulk_payout_input(escrow_address, recipients, amounts, final_results_url, final_results_hash) + +Validates input parameters for bulk payout operations. + +* **Parameters:** + * **escrow_address** (`str`) – Address of the escrow + * **recipients** (`List`[`str`]) – Array of recipient addresses + * **amounts** (`List`[`Decimal`]) – Array of amounts the recipients will receive + * **final_results_url** (`str`) – Final results file URL + * **final_results_hash** (`str`) – Final results file hash +* **Return type:** + `None` +* **Returns:** + None +* **Raises:** + [**EscrowClientError**](#human_protocol_sdk.escrow.escrow_client.EscrowClientError) – If validation fails + #### fund(escrow_address, amount, tx_options=None) Adds funds to the escrow. * **Parameters:** - * **escrow_address** (`str`) – Address of the escrow to setup + * **escrow_address** (`str`) – Address of the escrow to fund * **amount** (`Decimal`) – Amount to be added as funds * **tx_options** (`Optional`[`TxParams`]) – (Optional) Additional transaction parameters * **Return type:** @@ -349,8 +439,10 @@ Adds funds to the escrow. (w3, gas_payer) = get_w3_with_priv_key('YOUR_PRIVATE_KEY') escrow_client = EscrowClient(w3) - amount = Web3.to_wei(5, 'ether') # convert from ETH to WEI - escrow_client.fund("0x62dD51230A30401C455c8398d06F85e4EaB6309f", amount) + amount = Web3.to_wei(5, 'ether') # convert from ETH to WEI + escrow_client.fund( + "0x62dD51230A30401C455c8398d06F85e4EaB6309f", amount + ) ``` #### get_balance(escrow_address) @@ -694,15 +786,9 @@ Gets the address of the token used to fund the escrow. Sets up the parameters of the escrow. * **Parameters:** - * **escrow_address** (`str`) – Address of the escrow to setup - * **escrow_config** ([`EscrowConfig`](#human_protocol_sdk.escrow.escrow_client.EscrowConfig)) – Object containing all the necessary information to setup an escrow - * **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 + * **escrow_address** (`str`) – Address of the escrow contract + * **escrow_config** ([`EscrowConfig`](#human_protocol_sdk.escrow.escrow_client.EscrowConfig)) – Configuration parameters for the escrow + * **tx_options** (`Optional`[`TxParams`]) – (Optional) Transaction options * **Example:** ```python from eth_typing import URI @@ -713,7 +799,8 @@ Sets up the parameters of the escrow. 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"))) + 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( @@ -725,27 +812,35 @@ Sets up the parameters of the escrow. (w3, gas_payer) = get_w3_with_priv_key('YOUR_PRIVATE_KEY') escrow_client = EscrowClient(w3) - escrow_address = "0x62dD51230A30401C455c8398d06F85e4EaB6309f" + escrow_address = "0x1234567890abcdef1234567890abcdef12345678" escrow_config = EscrowConfig( - "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", - 10, - 10, - 10, - "htttp://localhost/manifest.json", - "b5dad76bf6772c0f07fd5e048f6e75a5f86ee079", + recording_oracle_address='0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + reputation_oracle_address='0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + exchange_oracle_address='0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + recording_oracle_fee=100, + reputation_oracle_fee=100, + exchange_oracle_fee=100, + recording_oracle_url='https://example.com/recording', + reputation_oracle_url='https://example.com/reputation', + exchange_oracle_url='https://example.com/exchange', + manifest_url='https://example.com/manifest', + manifest_hash='0xabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdef' + ) + escrow_client.setup( + escrow_address, + escrow_config ) - escrow_client.setup(escrow_address, escrow_config) ``` +* **Return type:** + `None` #### store_results(escrow_address, url, hash, tx_options=None) -Stores the results url. +Stores the results URL. * **Parameters:** * **escrow_address** (`str`) – Address of the escrow - * **url** (`str`) – Results file url + * **url** (`str`) – Results file URL * **hash** (`str`) – Results file hash * **tx_options** (`Optional`[`TxParams`]) – (Optional) Additional transaction parameters * **Return type:** diff --git a/docs/sdk/python/human_protocol_sdk.escrow.escrow_utils.md b/docs/sdk/python/human_protocol_sdk.escrow.escrow_utils.md index 9f6320ace2..9d4645d552 100644 --- a/docs/sdk/python/human_protocol_sdk.escrow.escrow_utils.md +++ b/docs/sdk/python/human_protocol_sdk.escrow.escrow_utils.md @@ -6,7 +6,7 @@ Utility class for escrow-related operations. ```python from human_protocol_sdk.constants import ChainId -from human_protocol_sdk.escrow import EscrowUtils, EscorwFilter, Status +from human_protocol_sdk.escrow import EscrowUtils, EscrowFilter, Status print( EscrowUtils.get_escrows( @@ -133,7 +133,7 @@ Retrieve status events for specified networks and statuses within a date range. print( EscrowUtils.get_status_events( - networks=[ChainId.POLYGON_AMOY, ChainId.ETHEREUM], + chain_id=ChainId.POLYGON_AMOY, statuses=[Status.Pending, Status.Paid], date_from=datetime(2023, 1, 1), date_to=datetime(2023, 12, 31), diff --git a/docs/sdk/python/human_protocol_sdk.escrow.md b/docs/sdk/python/human_protocol_sdk.escrow.md index aa29ac1288..8ee3c93e5b 100644 --- a/docs/sdk/python/human_protocol_sdk.escrow.md +++ b/docs/sdk/python/human_protocol_sdk.escrow.md @@ -16,7 +16,9 @@ obtain information from both the contracts and subgraph. * [`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_bulk_payout_transaction()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.create_bulk_payout_transaction) * [`EscrowClient.create_escrow()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.create_escrow) + * [`EscrowClient.ensure_correct_bulk_payout_input()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.ensure_correct_bulk_payout_input) * [`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) * [`EscrowClient.get_exchange_oracle_address()`](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClient.get_exchange_oracle_address) diff --git a/docs/sdk/python/human_protocol_sdk.filter.md b/docs/sdk/python/human_protocol_sdk.filter.md index a5ba62a19b..9572274f11 100644 --- a/docs/sdk/python/human_protocol_sdk.filter.md +++ b/docs/sdk/python/human_protocol_sdk.filter.md @@ -50,18 +50,29 @@ Initializes a PayoutFilter instance. Bases: `object` -A class used to filter statistics requests. - -#### \_\_init_\_(date_from=None, date_to=None, first=10, skip=0, order_direction=OrderDirection.ASC) - -Initializes a StatisticsFilter instance. +A class used to filter statistical data. * **Parameters:** - * **date_from** (`Optional`[`datetime`]) – Created from date - * **date_to** (`Optional`[`datetime`]) – Created to date - * **first** (`int`) – Number of items per page - * **skip** (`int`) – Page number to retrieve - * **order_direction** ([`OrderDirection`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OrderDirection)) – Order of results, “asc” or “desc” + * **date_from** (`Optional`[`datetime`]) – Start date for the query range. + * **date_to** (`Optional`[`datetime`]) – End date for the query range. + * **first** (`int`) – Number of items per page. + * **skip** (`int`) – Page number to retrieve. + * **order_direction** ([`OrderDirection`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OrderDirection)) – Order of results, “asc” or “desc”. +* **Example:** + ```python + from datetime import datetime + from human_protocol_sdk.filter import StatisticsFilter + + filter = StatisticsFilter( + date_from=datetime(2023, 1, 1), + date_to=datetime(2023, 12, 31), + first=10, + skip=0, + order_direction=OrderDirection.ASC + ) + ``` + +#### \_\_init_\_(date_from=None, date_to=None, first=10, skip=0, order_direction=OrderDirection.ASC) ### *class* human_protocol_sdk.filter.TransactionFilter(chain_id, from_address=None, to_address=None, start_date=None, end_date=None, start_block=None, end_block=None, first=10, skip=0, order_direction=OrderDirection.DESC) diff --git a/docs/sdk/python/human_protocol_sdk.kvstore.kvstore_client.md b/docs/sdk/python/human_protocol_sdk.kvstore.kvstore_client.md index 383585be9e..a59d98e5cd 100644 --- a/docs/sdk/python/human_protocol_sdk.kvstore.kvstore_client.md +++ b/docs/sdk/python/human_protocol_sdk.kvstore.kvstore_client.md @@ -1,10 +1,10 @@ # human_protocol_sdk.kvstore.kvstore_client module -This client enables to perform actions on KVStore contract and -obtain information from both the contracts and subgraph. +This client enables performing actions on the KVStore contract and +obtaining information from both the contracts and subgraph. Internally, the SDK will use one network or another according to the network ID of the web3. -To use this client, you need to create Web3 instance, and configure default account, +To use this client, you need to create a Web3 instance and configure the default account, as well as some middlewares. ## Code Example @@ -59,7 +59,8 @@ A class used to manage kvstore on the HUMAN network. Initializes a KVStore instance. * **Parameters:** - **web3** (`Web3`) – The Web3 object + * **web3** (`Web3`) – The Web3 object + * **gas_limit** (`Optional`[`int`]) – (Optional) Gas limit for transactions #### set(key, value, tx_options=None) @@ -131,8 +132,8 @@ Sets multiple key-value pairs in the contract. (w3, gas_payer) = get_w3_with_priv_key('YOUR_PRIVATE_KEY') kvstore_client = KVStoreClient(w3) - keys = ['Role', 'Webhook_url']; - values = ['RecordingOracle', 'http://localhost']; + keys = ['Role', 'Webhook_url'] + values = ['RecordingOracle', 'http://localhost'] kvstore_client.set_bulk(keys, values) ``` diff --git a/docs/sdk/python/human_protocol_sdk.kvstore.kvstore_utils.md b/docs/sdk/python/human_protocol_sdk.kvstore.kvstore_utils.md index 453d96a100..fa1434be9e 100644 --- a/docs/sdk/python/human_protocol_sdk.kvstore.kvstore_utils.md +++ b/docs/sdk/python/human_protocol_sdk.kvstore.kvstore_utils.md @@ -9,7 +9,7 @@ from human_protocol_sdk.constants import ChainId from human_protocol_sdk.kvstore import KVStoreUtils print( - KVStoreUtils.get_data( + KVStoreUtils.get_kvstore_data( ChainId.POLYGON_AMOY, "0x15d34aaf54267db7d7c367839aaf71a00a2c6a65" ) diff --git a/docs/sdk/python/human_protocol_sdk.operator.operator_utils.md b/docs/sdk/python/human_protocol_sdk.operator.operator_utils.md index a04ced3502..2b0ba2b266 100644 --- a/docs/sdk/python/human_protocol_sdk.operator.operator_utils.md +++ b/docs/sdk/python/human_protocol_sdk.operator.operator_utils.md @@ -10,7 +10,7 @@ from human_protocol_sdk.operator import OperatorUtils, LeaderFilter print( OperatorUtils.get_leaders( - LeaderFilter(networks=[ChainId.POLYGON_AMOY], role="Job Launcher") + LeaderFilter(chain_id=ChainId.POLYGON_AMOY, roles=["Job Launcher"]) ) ) ``` @@ -23,7 +23,7 @@ Bases: `object` #### \_\_init_\_(chain_id, id, address, amount_staked, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reward, amount_jobs_processed, role=None, fee=None, public_key=None, webhook_url=None, website=None, url=None, job_types=None, registration_needed=None, registration_instructions=None, reputation_networks=None) -Initializes an LeaderData instance. +Initializes a LeaderData instance. * **Parameters:** * **chain_id** ([`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)) – Chain Identifier @@ -39,27 +39,32 @@ Initializes an LeaderData instance. * **role** (`Optional`[`str`]) – Role * **fee** (`Optional`[`int`]) – Fee * **public_key** (`Optional`[`str`]) – Public key - * **webhook_url** (`Optional`[`str`]) – Webhook url - * **website** (`Optional`[`str`]) – Website url - * **url** (`Optional`[`str`]) – Url + * **webhook_url** (`Optional`[`str`]) – Webhook URL + * **website** (`Optional`[`str`]) – Website URL + * **url** (`Optional`[`str`]) – URL * **job_types** (`Optional`[`List`[`str`]]) – Job types - * **registration_needed** (`Optional`[`bool`]) – True - * **registration_instructions** (`Optional`[`str`]) – Instructions url + * **registration_needed** (`Optional`[`bool`]) – Whether registration is needed + * **registration_instructions** (`Optional`[`str`]) – Registration instructions * **reputation_networks** (`Optional`[`List`[`str`]]) – List of reputation networks -### *class* human_protocol_sdk.operator.operator_utils.LeaderFilter(chain_id, role=None) +### *class* human_protocol_sdk.operator.operator_utils.LeaderFilter(chain_id, roles=[], min_amount_staked=None, order_by=None, order_direction=OrderDirection.DESC, first=10, skip=0) Bases: `object` A class used to filter leaders. -#### \_\_init_\_(chain_id, role=None) +#### \_\_init_\_(chain_id, roles=[], min_amount_staked=None, order_by=None, order_direction=OrderDirection.DESC, first=10, skip=0) Initializes a LeaderFilter instance. * **Parameters:** - * **chain_id** ([`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)) – Chain Id to request data - * **role** (`Optional`[`str`]) – Leader role + * **chain_id** ([`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)) – Chain ID to request data + * **roles** (`Optional`[`str`]) – Roles to filter by + * **min_amount_staked** (`Optional`[`int`]) – Minimum amount staked to filter by + * **order_by** (`Optional`[`str`]) – Property to order by, e.g., “role” + * **order_direction** ([`OrderDirection`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OrderDirection)) – Order direction of results, “asc” or “desc” + * **first** (`int`) – Number of items per page + * **skip** (`int`) – Number of items to skip (for pagination) ### *class* human_protocol_sdk.operator.operator_utils.Operator(address, role, url='', job_types=[], registration_needed=None, registration_instructions=None) @@ -72,8 +77,10 @@ Initializes an Operator instance. * **Parameters:** * **address** (`str`) – Operator address * **role** (`str`) – Role of the operator - * **registration_needed** (`Optional`[`bool`]) – True, - * **registration_instructions** (`Optional`[`str`]) – Instructions url, + * **url** (`str`) – URL of the operator + * **job_types** (`List`[`str`]) – List of job types + * **registration_needed** (`Optional`[`bool`]) – Whether registration is needed + * **registration_instructions** (`Optional`[`str`]) – Registration instructions ### *class* human_protocol_sdk.operator.operator_utils.OperatorUtils @@ -83,7 +90,7 @@ A utility class that provides additional operator-related functionalities. #### *static* get_leader(chain_id, leader_address) -Get the leader details. +Gets the leader details. * **Parameters:** * **chain_id** ([`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)) – Network in which the leader exists @@ -97,15 +104,16 @@ Get the leader details. from human_protocol_sdk.constants import ChainId from human_protocol_sdk.operator import OperatorUtils - leader = OperatorUtils.get_leader( - ChainId.POLYGON_AMOY, - '0x62dD51230A30401C455c8398d06F85e4EaB6309f' - ) + chain_id = ChainId.POLYGON_AMOY + leader_address = '0x62dD51230A30401C455c8398d06F85e4EaB6309f' + + leader_data = OperatorUtils.get_leader(chain_id, leader_address) + print(leader_data) ``` #### *static* get_leaders(filter) -Get leaders data of the protocol +Get leaders data of the protocol. * **Parameters:** **filter** ([`LeaderFilter`](#human_protocol_sdk.operator.operator_utils.LeaderFilter)) – Leader filter @@ -120,7 +128,7 @@ Get leaders data of the protocol print( OperatorUtils.get_leaders( - LeaderFilter(chain_id=ChainId.POLYGON_AMOY) + LeaderFilter(chain_id=ChainId.POLYGON_AMOY, roles=["Job Launcher"]) ) ) ``` @@ -142,15 +150,16 @@ Get the reputation network operators of the specified address. from human_protocol_sdk.constants import ChainId from human_protocol_sdk.operator import OperatorUtils - leader = OperatorUtils.get_reputation_network_operators( + operators = OperatorUtils.get_reputation_network_operators( ChainId.POLYGON_AMOY, '0x62dD51230A30401C455c8398d06F85e4EaB6309f' ) + print(operators) ``` #### *static* get_rewards_info(chain_id, slasher) -Get rewards of the given slasher +Get rewards of the given slasher. * **Parameters:** * **chain_id** ([`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)) – Network in which the slasher exists @@ -168,13 +177,14 @@ Get rewards of the given slasher ChainId.POLYGON_AMOY, '0x62dD51230A30401C455c8398d06F85e4EaB6309f' ) + print(rewards_info) ``` ### *exception* human_protocol_sdk.operator.operator_utils.OperatorUtilsError Bases: `Exception` -Raises when some error happens when interacting with operator. +Raised when an error occurs while interacting with the operator. ### *class* human_protocol_sdk.operator.operator_utils.RewardData(escrow_address, amount) diff --git a/docs/sdk/python/human_protocol_sdk.staking.md b/docs/sdk/python/human_protocol_sdk.staking.md index 8392395af5..b4e35a7a66 100644 --- a/docs/sdk/python/human_protocol_sdk.staking.md +++ b/docs/sdk/python/human_protocol_sdk.staking.md @@ -11,6 +11,7 @@ obtain staking information from both the contracts and subgraph. * [`StakingClient`](human_protocol_sdk.staking.staking_client.md#human_protocol_sdk.staking.staking_client.StakingClient) * [`StakingClient.__init__()`](human_protocol_sdk.staking.staking_client.md#human_protocol_sdk.staking.staking_client.StakingClient.__init__) * [`StakingClient.approve_stake()`](human_protocol_sdk.staking.staking_client.md#human_protocol_sdk.staking.staking_client.StakingClient.approve_stake) + * [`StakingClient.get_staker_info()`](human_protocol_sdk.staking.staking_client.md#human_protocol_sdk.staking.staking_client.StakingClient.get_staker_info) * [`StakingClient.slash()`](human_protocol_sdk.staking.staking_client.md#human_protocol_sdk.staking.staking_client.StakingClient.slash) * [`StakingClient.stake()`](human_protocol_sdk.staking.staking_client.md#human_protocol_sdk.staking.staking_client.StakingClient.stake) * [`StakingClient.unstake()`](human_protocol_sdk.staking.staking_client.md#human_protocol_sdk.staking.staking_client.StakingClient.unstake) diff --git a/docs/sdk/python/human_protocol_sdk.staking.staking_client.md b/docs/sdk/python/human_protocol_sdk.staking.staking_client.md index 57b9ffcc69..2435cb066d 100644 --- a/docs/sdk/python/human_protocol_sdk.staking.staking_client.md +++ b/docs/sdk/python/human_protocol_sdk.staking.staking_client.md @@ -1,10 +1,10 @@ # human_protocol_sdk.staking.staking_client module -This client enables to perform actions on staking contracts and -obtain staking information from both the contracts and subgraph. +This client enables performing actions on staking contracts and +obtaining staking information from both the contracts and subgraph. Internally, the SDK will use one network or another according to the network ID of the web3. -To use this client, you need to create Web3 instance, and configure default account, +To use this client, you need to create a Web3 instance and configure the default account, as well as some middlewares. ## Code Example @@ -100,6 +100,33 @@ Approves HMT token for Staking. staking_client.approve_stake(amount) ``` +#### get_staker_info(staker_address) + +Retrieves comprehensive staking information for a staker. + +* **Parameters:** + **staker_address** (`str`) – The address of the staker +* **Return type:** + `dict` +* **Returns:** + A dictionary containing staker information +* **Validate:** + - Staker address must be valid +* **Example:** + ```python + from eth_typing import URI + from web3 import Web3 + from web3.providers.auto import load_provider_from_uri + + from human_protocol_sdk.staking import StakingClient + + w3 = Web3(load_provider_from_uri(URI("http://localhost:8545"))) + staking_client = StakingClient(w3) + + staking_info = staking_client.get_staker_info('0xYourStakerAddress') + print(staking_info['stakedAmount']) + ``` + #### slash(slasher, staker, escrow_address, amount, tx_options=None) Slashes HMT token. @@ -186,10 +213,8 @@ Stakes HMT token. (w3, gas_payer) = get_w3_with_priv_key('YOUR_PRIVATE_KEY') staking_client = StakingClient(w3) - amount = Web3.to_wei(5, 'ether') - # convert from ETH to WEI - staking_client.approve_stake(amount) - # if it was already approved before, this is not necessary + amount = Web3.to_wei(5, 'ether') # convert from ETH to WEI + staking_client.approve_stake(amount) # if it was already approved before, this is not necessary staking_client.stake(amount) ``` diff --git a/docs/sdk/python/human_protocol_sdk.statistics.statistics_client.md b/docs/sdk/python/human_protocol_sdk.statistics.statistics_client.md index 763afb78fd..8430d38ff3 100644 --- a/docs/sdk/python/human_protocol_sdk.statistics.statistics_client.md +++ b/docs/sdk/python/human_protocol_sdk.statistics.statistics_client.md @@ -173,7 +173,7 @@ Get escrow statistics data for the given date range. Escrow statistics data * **Example:** ```python - from human_protocol_sdk.contants import ChainId + from human_protocol_sdk.constants import ChainId from human_protocol_sdk.statistics import StatisticsClient from human_protocol_sdk.filter import StatisticsFilter @@ -192,7 +192,7 @@ Get escrow statistics data for the given date range. #### get_hmt_daily_data(filter=) -Get HMT dailt statistics data for the given date range. +Get HMT daily statistics data for the given date range. * **Parameters:** **filter** ([`StatisticsFilter`](human_protocol_sdk.filter.md#human_protocol_sdk.filter.StatisticsFilter)) – Object containing the date range @@ -202,7 +202,7 @@ Get HMT dailt statistics data for the given date range. HMT statistics data * **Example:** ```python - from human_protocol_sdk.contants import ChainId + from human_protocol_sdk.constants import ChainId from human_protocol_sdk.statistics import StatisticsClient, StatisticsFilter statistics_client = StatisticsClient(ChainId.POLYGON_AMOY) @@ -230,7 +230,7 @@ Get HMT holders data with optional filters and ordering. List of HMT holders * **Example:** ```python - from human_protocol_sdk.contants import ChainId + from human_protocol_sdk.constants import ChainId from human_protocol_sdk.statistics import StatisticsClient, HMTHoldersParam statistics_client = StatisticsClient(ChainId.POLYGON_AMOY) @@ -256,7 +256,7 @@ Get HMT statistics data. HMT statistics data * **Example:** ```python - from human_protocol_sdk.contants import ChainId + from human_protocol_sdk.constants import ChainId from human_protocol_sdk.statistics import StatisticsClient statistics_client = StatisticsClient(ChainId.POLYGON_AMOY) @@ -276,7 +276,7 @@ Get payment statistics data for the given date range. Payment statistics data * **Example:** ```python - from human_protocol_sdk.contants import ChainId + from human_protocol_sdk.constants import ChainId from human_protocol_sdk.statistics import StatisticsClient from human_protocol_sdk.filter import StatisticsFilter @@ -305,7 +305,7 @@ Get worker statistics data for the given date range. Worker statistics data * **Example:** ```python - from human_protocol_sdk.contants import ChainId + from human_protocol_sdk.constants import ChainId from human_protocol_sdk.statistics import StatisticsClient from human_protocol_sdk.filter import StatisticsFilter diff --git a/docs/sdk/python/human_protocol_sdk.storage.storage_client.md b/docs/sdk/python/human_protocol_sdk.storage.storage_client.md index 497becc3a2..e93da074af 100644 --- a/docs/sdk/python/human_protocol_sdk.storage.storage_client.md +++ b/docs/sdk/python/human_protocol_sdk.storage.storage_client.md @@ -228,7 +228,7 @@ Uploads a list of files to the specified S3-compatible bucket. ) result = storage_client.upload_files( - files = ["file content"], + files = [{"file": "file content", "key": "file1.txt", "hash": "hash1"}], bucket = "my-bucket" ) ``` diff --git a/docs/sdk/python/human_protocol_sdk.storage.storage_utils.md b/docs/sdk/python/human_protocol_sdk.storage.storage_utils.md index d45551b0ee..8b08a80370 100644 --- a/docs/sdk/python/human_protocol_sdk.storage.storage_utils.md +++ b/docs/sdk/python/human_protocol_sdk.storage.storage_utils.md @@ -22,9 +22,9 @@ Downloads a file from the specified URL. [**StorageClientError**](human_protocol_sdk.storage.storage_client.md#human_protocol_sdk.storage.storage_client.StorageClientError) – If an error occurs while downloading the file. * **Example:** ```python - from human_protocol_sdk.storage import StorageClient + from human_protocol_sdk.storage import StorageUtils - result = StorageClient.download_file_from_url( + result = StorageUtils.download_file_from_url( "https://www.example.com/file.txt" ) ``` diff --git a/docs/sdk/python/human_protocol_sdk.transaction.transaction_utils.md b/docs/sdk/python/human_protocol_sdk.transaction.transaction_utils.md index 2d6bfb9064..7b31e4ea65 100644 --- a/docs/sdk/python/human_protocol_sdk.transaction.transaction_utils.md +++ b/docs/sdk/python/human_protocol_sdk.transaction.transaction_utils.md @@ -11,7 +11,7 @@ from human_protocol_sdk.transaction import TransactionUtils, TransactionFilter print( TransactionUtils.get_transactions( TransactionFilter( - networks=[ChainId.POLYGON_AMOY], + chain_id=ChainId.POLYGON_AMOY, from_address="0x1234567890123456789012345678901234567890", to_address="0x0987654321098765432109876543210987654321", start_date=datetime.datetime(2023, 5, 8), diff --git a/docs/sdk/python/human_protocol_sdk.utils.md b/docs/sdk/python/human_protocol_sdk.utils.md index 2b4f5d7d81..48aa0d3427 100644 --- a/docs/sdk/python/human_protocol_sdk.utils.md +++ b/docs/sdk/python/human_protocol_sdk.utils.md @@ -11,6 +11,17 @@ Retrieve the contract interface of a given contract. ### human_protocol_sdk.utils.get_data_from_subgraph(network, query, params=None) +Fetch data from the subgraph. + +* **Parameters:** + * **network** (`dict`) – Network configuration dictionary + * **query** (`str`) – GraphQL query string + * **params** (`Optional`[`dict`]) – Query parameters +* **Returns:** + JSON response from the subgraph +* **Raises:** + **Exception** – If the subgraph query fails + ### human_protocol_sdk.utils.get_erc20_interface() Retrieve the ERC20 interface. @@ -34,7 +45,7 @@ Retrieve the EscrowFactory interface. ### human_protocol_sdk.utils.get_hmt_balance(wallet_addr, token_addr, w3) -Get hmt balance +Get HMT balance * **Parameters:** * **wallet_addr** – wallet address @@ -73,31 +84,40 @@ Executes the transaction and waits for the receipt. The transaction receipt * **Validate:** - There must be a default account +* **Raises:** + **exception** – If the transaction fails ### human_protocol_sdk.utils.parse_transfer_transaction(hmtoken_contract, tx_receipt) +Parse a transfer transaction receipt. + +* **Parameters:** + * **hmtoken_contract** (`Contract`) – The HMT token contract + * **tx_receipt** (`Optional`[`TxReceipt`]) – The transaction receipt * **Return type:** `Tuple`[`bool`, `Optional`[`int`]] +* **Returns:** + A tuple indicating if HMT was transferred and the transaction balance ### human_protocol_sdk.utils.validate_url(url) -Gets the url string. +Validates the given URL. * **Parameters:** - **url** (`str`) – Public or private url address + **url** (`str`) – Public or private URL address * **Return type:** `bool` * **Returns:** - True if url is valid + True if URL is valid, False otherwise * **Raises:** - **ValidationFailure** – If the url is invalid + **ValidationFailure** – If the URL is invalid ### human_protocol_sdk.utils.with_retry(fn, retries=3, delay=5, backoff=2) Retry a function Mainly used with handle_transaction to retry on case of failure. -Uses expnential backoff. +Uses exponential backoff. * **Parameters:** * **fn** – to run with retry logic. diff --git a/docs/sdk/typescript/base/classes/BaseEthersClient.md b/docs/sdk/typescript/base/classes/BaseEthersClient.md index 5c8aea4f73..aab302b3c0 100644 --- a/docs/sdk/typescript/base/classes/BaseEthersClient.md +++ b/docs/sdk/typescript/base/classes/BaseEthersClient.md @@ -44,7 +44,7 @@ The network information required to connect to the contracts #### Defined in -[base.ts:20](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20) +[base.ts:20](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20) ## Properties @@ -54,7 +54,7 @@ The network information required to connect to the contracts #### Defined in -[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) *** @@ -64,4 +64,4 @@ The network information required to connect to the contracts #### Defined in -[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) diff --git a/docs/sdk/typescript/encryption/classes/Encryption.md b/docs/sdk/typescript/encryption/classes/Encryption.md index 4f001979e7..9eb33287cc 100644 --- a/docs/sdk/typescript/encryption/classes/Encryption.md +++ b/docs/sdk/typescript/encryption/classes/Encryption.md @@ -42,7 +42,7 @@ import { Encryption } from '@human-protocol/sdk'; const privateKey = 'Armored_priv_key'; const passphrase = 'example_passphrase'; -const encription = await Encryption.build(privateKey, passphrase); +const encryption = await Encryption.build(privateKey, passphrase); ``` ## Constructors @@ -67,7 +67,7 @@ The private key. #### Defined in -[encryption.ts:62](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L62) +[encryption.ts:66](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L66) ## Methods @@ -104,7 +104,7 @@ import { Encryption } from '@human-protocol/sdk'; const privateKey = 'Armored_priv_key'; const passphrase = 'example_passphrase'; -const encription = await Encryption.build(privateKey, passphrase); +const encryption = await Encryption.build(privateKey, passphrase); const publicKey = `-----BEGIN PGP PUBLIC KEY BLOCK----- xjMEZKQEMxYJKwYBBAHaRw8BAQdA5oZTq4UPlS0IXn4kEaSqQdAa9+Cq522v @@ -118,12 +118,12 @@ XdYkEU+66G1CjgAA0xgBAK4AIahFFnmWR2Mp6A3q021cZXpGklc0Xw1Hfswc UYLqAQDfdym4kiUvKO1+REKASt0Gwykndl7hra9txqlUL5DXBQ===Vwgv -----END PGP PUBLIC KEY BLOCK-----`; -const resultMessage = await encription.decrypt('message'); +const resultMessage = await encryption.decrypt('message'); ``` #### Defined in -[encryption.ts:190](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L190) +[encryption.ts:194](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L194) *** @@ -154,14 +154,14 @@ import { Encryption } from '@human-protocol/sdk'; const privateKey = 'Armored_priv_key'; const passphrase = 'example_passphrase'; -const encription = await Encryption.build(privateKey, passphrase); +const encryption = await Encryption.build(privateKey, passphrase); -const resultMessage = await encription.sign('message'); +const resultMessage = await encryption.sign('message'); ``` #### Defined in -[encryption.ts:247](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L247) +[encryption.ts:251](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L251) *** @@ -199,7 +199,7 @@ import { EscrowClient } from '@human-protocol/sdk'; const privateKey = 'Armored_priv_key'; const passphrase = 'example_passphrase'; -const encription = await Encryption.build(privateKey, passphrase); +const encryption = await Encryption.build(privateKey, passphrase); const publicKey1 = `-----BEGIN PGP PUBLIC KEY BLOCK----- xjMEZKQEMxYJKwYBBAHaRw8BAQdA5oZTq4UPlS0IXn4kEaSqQdAa9+Cq522v WYxJQn3vo1/NFEh1bWFuIDxodW1hbkBobXQuYWk+wowEEBYKAD4FAmSkBDME @@ -225,12 +225,12 @@ s/88AQCDErzvn+SOX4s3gvZcM3Vr4wh4Q2syHV8Okgx8STYPDg===DsVk -----END PGP PUBLIC KEY BLOCK-----`; const publicKeys = [publicKey1, publicKey2]; -const resultMessage = await encription.signAndEncrypt('message', publicKeys); +const resultMessage = await encryption.signAndEncrypt('message', publicKeys); ``` #### Defined in -[encryption.ts:138](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L138) +[encryption.ts:142](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L142) *** @@ -262,4 +262,4 @@ Optional: The passphrase for the private key. #### Defined in -[encryption.ts:73](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L73) +[encryption.ts:77](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L77) diff --git a/docs/sdk/typescript/encryption/classes/EncryptionUtils.md b/docs/sdk/typescript/encryption/classes/EncryptionUtils.md index 87c09e196a..639f450450 100644 --- a/docs/sdk/typescript/encryption/classes/EncryptionUtils.md +++ b/docs/sdk/typescript/encryption/classes/EncryptionUtils.md @@ -98,12 +98,12 @@ s/88AQCDErzvn+SOX4s3gvZcM3Vr4wh4Q2syHV8Okgx8STYPDg===DsVk -----END PGP PUBLIC KEY BLOCK-----`; const publicKeys = [publicKey1, publicKey2] -const result = await EncriptionUtils.encrypt('message', publicKeys); +const result = await EncryptionUtils.encrypt('message', publicKeys); ``` #### Defined in -[encryption.ts:452](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L452) +[encryption.ts:444](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L444) *** @@ -144,27 +144,15 @@ Key pair generated. ```ts import { EncryptionUtils } from '@human-protocol/sdk'; -const publicKey = `-----BEGIN PGP PUBLIC KEY BLOCK----- -xjMEZKQEMxYJKwYBBAHaRw8BAQdA5oZTq4UPlS0IXn4kEaSqQdAa9+Cq522v -WYxJQn3vo1/NFEh1bWFuIDxodW1hbkBobXQuYWk+wowEEBYKAD4FAmSkBDME -CwkHCAkQJBFPuuhtQo4DFQgKBBYAAgECGQECGwMCHgEWIQTQ5fbVPB9CWIdf -XdYkEU+66G1CjgAAKYYA/jMyDCtJtqu6hj22kq9SW6fuV1FCT2ySJ9vBhumF -X8wWAP433zVFl4VECOkgGk8qFr8BgkYxaz16GOFAqYbfO6oMBc44BGSkBDMS -CisGAQQBl1UBBQEBB0AKR+A48zVVYZWQvgu7Opn2IGvzI9jePB/J8pzqRhg2 -YAMBCAfCeAQYFggAKgUCZKQEMwkQJBFPuuhtQo4CGwwWIQTQ5fbVPB9CWIdf -XdYkEU+66G1CjgAA0xgBAK4AIahFFnmWR2Mp6A3q021cZXpGklc0Xw1Hfswc -UYLqAQDfdym4kiUvKO1+REKASt0Gwykndl7hra9txqlUL5DXBQ===Vwgv ------END PGP PUBLIC KEY BLOCK-----`; - const name = 'YOUR_NAME'; const email = 'YOUR_EMAIL'; const passphrase = 'YOUR_PASSPHRASE'; -const result = await EncriptionUtils.generateKeyPair(name, email, passphrase); +const result = await EncryptionUtils.generateKeyPair(name, email, passphrase); ``` #### Defined in -[encryption.ts:390](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L390) +[encryption.ts:382](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L382) *** @@ -193,12 +181,12 @@ Signed data. ```ts import { EncryptionUtils } from '@human-protocol/sdk'; -const signedData = await EncriptionUtils.getSignedData('message'); +const signedData = await EncryptionUtils.getSignedData('message'); ``` #### Defined in -[encryption.ts:347](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L347) +[encryption.ts:351](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L351) *** @@ -237,7 +225,7 @@ QIJZ7oQ2w7BaPo1a991gvTOSNm5v2x44KfqPI1uj859BjsQTCA== =tsmI -----END PGP MESSAGE-----`; -const isEncrypted = await EncriptionUtils.isEncrypted(message); +const isEncrypted = await EncryptionUtils.isEncrypted(message); if (isEncrypted) { console.log('The message is encrypted with OpenPGP.'); @@ -248,7 +236,7 @@ if (isEncrypted) { #### Defined in -[encryption.ts:502](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L502) +[encryption.ts:494](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L494) *** @@ -270,7 +258,7 @@ Message to verify. `string` -Public key to verify that the message was sign by a specific source. +Public key to verify that the message was signed by a specific source. #### Returns @@ -295,9 +283,9 @@ XdYkEU+66G1CjgAA0xgBAK4AIahFFnmWR2Mp6A3q021cZXpGklc0Xw1Hfswc UYLqAQDfdym4kiUvKO1+REKASt0Gwykndl7hra9txqlUL5DXBQ===Vwgv -----END PGP PUBLIC KEY BLOCK-----`; -const result = await EncriptionUtils.verify('message', publicKey); +const result = await EncryptionUtils.verify('message', publicKey); ``` #### Defined in -[encryption.ts:314](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L314) +[encryption.ts:318](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L318) diff --git a/docs/sdk/typescript/enums/enumerations/ChainId.md b/docs/sdk/typescript/enums/enumerations/ChainId.md index 5581f1e887..1126047e1a 100644 --- a/docs/sdk/typescript/enums/enumerations/ChainId.md +++ b/docs/sdk/typescript/enums/enumerations/ChainId.md @@ -14,7 +14,7 @@ #### Defined in -[enums.ts:2](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L2) +[enums.ts:2](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L2) *** @@ -24,7 +24,7 @@ #### Defined in -[enums.ts:15](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L15) +[enums.ts:15](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L15) *** @@ -34,7 +34,7 @@ #### Defined in -[enums.ts:14](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L14) +[enums.ts:14](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L14) *** @@ -44,7 +44,7 @@ #### Defined in -[enums.ts:7](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L7) +[enums.ts:7](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L7) *** @@ -54,7 +54,7 @@ #### Defined in -[enums.ts:8](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L8) +[enums.ts:8](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L8) *** @@ -64,7 +64,7 @@ #### Defined in -[enums.ts:16](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L16) +[enums.ts:16](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L16) *** @@ -74,7 +74,7 @@ #### Defined in -[enums.ts:17](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L17) +[enums.ts:17](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L17) *** @@ -84,7 +84,7 @@ #### Defined in -[enums.ts:5](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L5) +[enums.ts:5](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L5) *** @@ -94,7 +94,7 @@ #### Defined in -[enums.ts:19](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L19) +[enums.ts:19](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L19) *** @@ -104,7 +104,7 @@ #### Defined in -[enums.ts:3](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L3) +[enums.ts:3](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L3) *** @@ -114,7 +114,7 @@ #### Defined in -[enums.ts:13](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L13) +[enums.ts:13](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L13) *** @@ -124,7 +124,7 @@ #### Defined in -[enums.ts:12](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L12) +[enums.ts:12](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L12) *** @@ -134,7 +134,7 @@ #### Defined in -[enums.ts:9](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L9) +[enums.ts:9](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L9) *** @@ -144,7 +144,7 @@ #### Defined in -[enums.ts:11](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L11) +[enums.ts:11](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L11) *** @@ -154,7 +154,7 @@ #### Defined in -[enums.ts:10](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L10) +[enums.ts:10](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L10) *** @@ -164,7 +164,7 @@ #### Defined in -[enums.ts:4](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L4) +[enums.ts:4](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L4) *** @@ -174,7 +174,7 @@ #### Defined in -[enums.ts:6](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L6) +[enums.ts:6](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L6) *** @@ -184,7 +184,7 @@ #### Defined in -[enums.ts:20](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L20) +[enums.ts:20](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L20) *** @@ -194,4 +194,4 @@ #### Defined in -[enums.ts:18](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L18) +[enums.ts:18](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L18) diff --git a/docs/sdk/typescript/enums/enumerations/OrderDirection.md b/docs/sdk/typescript/enums/enumerations/OrderDirection.md index 871fd34269..bf0533ffbf 100644 --- a/docs/sdk/typescript/enums/enumerations/OrderDirection.md +++ b/docs/sdk/typescript/enums/enumerations/OrderDirection.md @@ -14,7 +14,7 @@ #### Defined in -[enums.ts:24](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L24) +[enums.ts:24](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L24) *** @@ -24,4 +24,4 @@ #### Defined in -[enums.ts:25](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L25) +[enums.ts:25](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/enums.ts#L25) diff --git a/docs/sdk/typescript/escrow/classes/EscrowClient.md b/docs/sdk/typescript/escrow/classes/EscrowClient.md index dbaf2fb297..68e862ef62 100644 --- a/docs/sdk/typescript/escrow/classes/EscrowClient.md +++ b/docs/sdk/typescript/escrow/classes/EscrowClient.md @@ -8,19 +8,19 @@ ## Introduction -This client enables to perform actions on Escrow contracts and obtain information from both the contracts and subgraph. +This client enables performing actions on Escrow contracts and obtaining information from both the contracts and subgraph. Internally, the SDK will use one network or another according to the network ID of the `runner`. To use this client, it is recommended to initialize it using the static `build` method. ```ts -static async build(runner: ContractRunner); +static async build(runner: ContractRunner): Promise; ``` A `Signer` or a `Provider` should be passed depending on the use case of this module: -- **Signer**: when the user wants to use this model in order to send transactions caling the contract functions. -- **Provider**: when the user wants to use this model in order to get information from the contracts or subgraph. +- **Signer**: when the user wants to use this model to send transactions calling the contract functions. +- **Provider**: when the user wants to use this model to get information from the contracts or subgraph. ## Installation @@ -38,21 +38,21 @@ yarn install @human-protocol/sdk ### Signer -**Using private key(backend)** +**Using private key (backend)** ```ts import { EscrowClient } from '@human-protocol/sdk'; import { Wallet, providers } from 'ethers'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); const escrowClient = await EscrowClient.build(signer); ``` -**Using Wagmi(frontend)** +**Using Wagmi (frontend)** ```ts import { useSigner, useChainId } from 'wagmi'; @@ -110,7 +110,7 @@ The network information required to connect to the Escrow contract #### Defined in -[escrow.ts:136](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L136) +[escrow.ts:138](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L138) ## Properties @@ -124,7 +124,7 @@ The network information required to connect to the Escrow contract #### Defined in -[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) *** @@ -138,7 +138,7 @@ The network information required to connect to the Escrow contract #### Defined in -[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) ## Methods @@ -183,25 +183,25 @@ import { Wallet, providers } from 'ethers'; import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); const escrowClient = await EscrowClient.build(signer); -const trustedHandlers = ['0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'] +const trustedHandlers = ['0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266']; await escrowClient.addTrustedHandlers('0x62dD51230A30401C455c8398d06F85e4EaB6309f', trustedHandlers); ``` #### Defined in -[escrow.ts:802](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L802) +[escrow.ts:766](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L766) *** ### bulkPayOut() -> **bulkPayOut**(`escrowAddress`, `recipients`, `amounts`, `finalResultsUrl`, `finalResultsHash`, `forceComplete`, `txOptions`?): `Promise`\<`void`\> +> **bulkPayOut**(`escrowAddress`, `recipients`, `amounts`, `finalResultsUrl`, `finalResultsHash`, `txId`, `forceComplete`, `txOptions`?): `Promise`\<`void`\> This function pays out the amounts specified to the workers and sets the URL of the final results file. @@ -229,7 +229,7 @@ Array of amounts the recipients will receive. `string` -Final results file url. +Final results file URL. ##### finalResultsHash @@ -237,6 +237,12 @@ Final results file url. Final results file hash. +##### txId + +`number` + +Transaction ID. + ##### forceComplete `boolean` = `false` @@ -264,7 +270,7 @@ import { ethers, Wallet, providers } from 'ethers'; import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); @@ -273,14 +279,15 @@ const escrowClient = await EscrowClient.build(signer); const recipients = ['0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266']; const amounts = [ethers.parseUnits(5, 'ether'), ethers.parseUnits(10, 'ether')]; const resultsUrl = 'http://localhost/results.json'; -const resultsHash'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079'; +const resultsHash = 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079'; +const txId = 1; -await escrowClient.bulkPayOut('0x62dD51230A30401C455c8398d06F85e4EaB6309f', recipients, amounts, resultsUrl, resultsHash); +await escrowClient.bulkPayOut('0x62dD51230A30401C455c8398d06F85e4EaB6309f', recipients, amounts, resultsUrl, resultsHash, txId); ``` #### Defined in -[escrow.ts:595](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L595) +[escrow.ts:599](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L599) *** @@ -319,7 +326,7 @@ import { ethers, Wallet, providers } from 'ethers'; import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); @@ -330,7 +337,7 @@ await escrowClient.cancel('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); #### Defined in -[escrow.ts:716](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L716) +[escrow.ts:680](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L680) *** @@ -369,7 +376,7 @@ import { Wallet, providers } from 'ethers'; import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); @@ -380,7 +387,103 @@ await escrowClient.complete('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); #### Defined in -[escrow.ts:536](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L536) +[escrow.ts:538](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L538) + +*** + +### createBulkPayoutTransaction() + +> **createBulkPayoutTransaction**(`escrowAddress`, `recipients`, `amounts`, `finalResultsUrl`, `finalResultsHash`, `txId`, `forceComplete`, `txOptions`?): `Promise`\<[`TransactionLikeWithNonce`](../../types/type-aliases/TransactionLikeWithNonce.md)\> + +Creates a prepared transaction for bulk payout without immediately sending it. + +#### Parameters + +##### escrowAddress + +`string` + +Escrow address to payout. + +##### recipients + +`string`[] + +Array of recipient addresses. + +##### amounts + +`bigint`[] + +Array of amounts the recipients will receive. + +##### finalResultsUrl + +`string` + +Final results file URL. + +##### finalResultsHash + +`string` + +Final results file hash. + +##### txId + +`number` + +Transaction ID. + +##### forceComplete + +`boolean` = `false` + +Indicates if remaining balance should be transferred to the escrow creator (optional, defaults to false). + +##### txOptions? + +`Overrides` = `{}` + +Additional transaction parameters (optional, defaults to an empty object). + +#### Returns + +`Promise`\<[`TransactionLikeWithNonce`](../../types/type-aliases/TransactionLikeWithNonce.md)\> + +Returns object with raw transaction and signed transaction hash + +**Code example** + +> Only Reputation Oracle or a trusted handler can call it. + +```ts +import { ethers, Wallet, providers } from 'ethers'; +import { EscrowClient } from '@human-protocol/sdk'; + +const rpcUrl = 'YOUR_RPC_URL'; +const privateKey = 'YOUR_PRIVATE_KEY' + +const provider = new providers.JsonRpcProvider(rpcUrl); +const signer = new Wallet(privateKey, provider); +const escrowClient = await EscrowClient.build(signer); + +const recipients = ['0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266']; +const amounts = [ethers.parseUnits(5, 'ether'), ethers.parseUnits(10, 'ether')]; +const resultsUrl = 'http://localhost/results.json'; +const resultsHash = 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079'; +const txId = 1; + +const rawTransaction = await escrowClient.createBulkPayoutTransaction('0x62dD51230A30401C455c8398d06F85e4EaB6309f', recipients, amounts, resultsUrl, resultsHash, txId); +console.log('Raw transaction:', rawTransaction); + +const signedTransaction = await signer.signTransaction(rawTransaction); +console.log('Tx hash:', ethers.keccak256(signedTransaction)); +(await signer.sendTransaction(rawTransaction)).wait(); + +#### Defined in + +[escrow.ts:935](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L935) *** @@ -396,7 +499,7 @@ This function creates an escrow contract that uses the token passed to pay oracl `string` -Token address to use for pay outs. +Token address to use for payouts. ##### trustedHandlers @@ -420,7 +523,7 @@ Additional transaction parameters (optional, defaults to an empty object). `Promise`\<`string`\> -Return the address of the escrow created. +Returns the address of the escrow created. **Code example** @@ -431,7 +534,7 @@ import { Wallet, providers } from 'ethers'; import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); @@ -445,7 +548,7 @@ const escrowAddress = await escrowClient.createEscrow(tokenAddress, trustedHandl #### Defined in -[escrow.ts:216](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L216) +[escrow.ts:218](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L218) *** @@ -488,7 +591,7 @@ import { ethers, Wallet, providers } from 'ethers'; import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); @@ -500,7 +603,7 @@ await escrowClient.fund('0x62dD51230A30401C455c8398d06F85e4EaB6309f', amount); #### Defined in -[escrow.ts:407](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L407) +[escrow.ts:409](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L409) *** @@ -533,14 +636,14 @@ import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; const provider = new providers.JsonRpcProvider(rpcUrl); -const escrowClient = await EscrowClient.build(signer); +const escrowClient = await EscrowClient.build(provider); const balance = await escrowClient.getBalance('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` #### Defined in -[escrow.ts:950](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L950) +[escrow.ts:1080](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1080) *** @@ -573,14 +676,14 @@ import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; const provider = new providers.JsonRpcProvider(rpcUrl); -const escrowClient = await EscrowClient.build(signer); +const escrowClient = await EscrowClient.build(provider); const oracleAddress = await escrowClient.getExchangeOracleAddress('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` #### Defined in -[escrow.ts:1336](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1336) +[escrow.ts:1466](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1466) *** @@ -613,14 +716,14 @@ import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; const provider = new providers.JsonRpcProvider(rpcUrl); -const escrowClient = await EscrowClient.build(signer); +const escrowClient = await EscrowClient.build(provider); const factoryAddress = await escrowClient.getFactoryAddress('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` #### Defined in -[escrow.ts:1374](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1374) +[escrow.ts:1504](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1504) *** @@ -653,14 +756,14 @@ import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; const provider = new providers.JsonRpcProvider(rpcUrl); -const escrowClient = await EscrowClient.build(signer); +const escrowClient = await EscrowClient.build(provider); -const intemediateResultsUrl = await escrowClient.getIntermediateResultsUrl('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); +const intermediateResultsUrl = await escrowClient.getIntermediateResultsUrl('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` #### Defined in -[escrow.ts:1108](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1108) +[escrow.ts:1238](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1238) *** @@ -693,14 +796,14 @@ import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; const provider = new providers.JsonRpcProvider(rpcUrl); -const escrowClient = await EscrowClient.build(signer); +const escrowClient = await EscrowClient.build(provider); const jobLauncherAddress = await escrowClient.getJobLauncherAddress('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` #### Defined in -[escrow.ts:1260](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1260) +[escrow.ts:1390](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1390) *** @@ -733,14 +836,14 @@ import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; const provider = new providers.JsonRpcProvider(rpcUrl); -const escrowClient = await EscrowClient.build(signer); +const escrowClient = await EscrowClient.build(provider); const manifestHash = await escrowClient.getManifestHash('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` #### Defined in -[escrow.ts:994](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L994) +[escrow.ts:1124](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1124) *** @@ -773,14 +876,14 @@ import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; const provider = new providers.JsonRpcProvider(rpcUrl); -const escrowClient = await EscrowClient.build(signer); +const escrowClient = await EscrowClient.build(provider); const manifestUrl = await escrowClient.getManifestUrl('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` #### Defined in -[escrow.ts:1032](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1032) +[escrow.ts:1162](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1162) *** @@ -813,14 +916,14 @@ import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; const provider = new providers.JsonRpcProvider(rpcUrl); -const escrowClient = await EscrowClient.build(signer); +const escrowClient = await EscrowClient.build(provider); const oracleAddress = await escrowClient.getRecordingOracleAddress('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` #### Defined in -[escrow.ts:1222](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1222) +[escrow.ts:1352](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1352) *** @@ -853,14 +956,14 @@ import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; const provider = new providers.JsonRpcProvider(rpcUrl); -const escrowClient = await EscrowClient.build(signer); +const escrowClient = await EscrowClient.build(provider); const oracleAddress = await escrowClient.getReputationOracleAddress('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` #### Defined in -[escrow.ts:1298](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1298) +[escrow.ts:1428](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1428) *** @@ -893,14 +996,14 @@ import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; const provider = new providers.JsonRpcProvider(rpcUrl); -const escrowClient = await EscrowClient.build(signer); +const escrowClient = await EscrowClient.build(provider); const resultsUrl = await escrowClient.getResultsUrl('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` #### Defined in -[escrow.ts:1070](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1070) +[escrow.ts:1200](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1200) *** @@ -933,14 +1036,14 @@ import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; const provider = new providers.JsonRpcProvider(rpcUrl); -const escrowClient = await EscrowClient.build(signer); +const escrowClient = await EscrowClient.build(provider); const status = await escrowClient.getStatus('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` #### Defined in -[escrow.ts:1184](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1184) +[escrow.ts:1314](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1314) *** @@ -973,14 +1076,14 @@ import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; const provider = new providers.JsonRpcProvider(rpcUrl); -const escrowClient = await EscrowClient.build(signer); +const escrowClient = await EscrowClient.build(provider); const tokenAddress = await escrowClient.getTokenAddress('0x62dD51230A30401C455c8398d06F85e4EaB6309f'); ``` #### Defined in -[escrow.ts:1146](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1146) +[escrow.ts:1276](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1276) *** @@ -1025,7 +1128,7 @@ import { Wallet, providers } from 'ethers'; import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); @@ -1036,10 +1139,10 @@ const escrowConfig = { recordingOracle: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', reputationOracle: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', exchangeOracle: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', - recordingOracleFee: bigint.from('10'), - reputationOracleFee: bigint.from('10'), - exchangeOracleFee: bigint.from('10'), - manifestUrl: 'htttp://localhost/manifest.json', + recordingOracleFee: BigInt('10'), + reputationOracleFee: BigInt('10'), + exchangeOracleFee: BigInt('10'), + manifestUrl: 'http://localhost/manifest.json', manifestHash: 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079', }; await escrowClient.setup(escrowAddress, escrowConfig); @@ -1047,7 +1150,7 @@ await escrowClient.setup(escrowAddress, escrowConfig); #### Defined in -[escrow.ts:297](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L297) +[escrow.ts:299](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L299) *** @@ -1055,7 +1158,7 @@ await escrowClient.setup(escrowAddress, escrowConfig); > **storeResults**(`escrowAddress`, `url`, `hash`, `txOptions`?): `Promise`\<`void`\> -This function stores the results url and hash. +This function stores the results URL and hash. #### Parameters @@ -1069,7 +1172,7 @@ Address of the escrow. `string` -Results file url. +Results file URL. ##### hash @@ -1098,18 +1201,18 @@ import { ethers, Wallet, providers } from 'ethers'; import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); const escrowClient = await EscrowClient.build(signer); -await storeResults.storeResults('0x62dD51230A30401C455c8398d06F85e4EaB6309f', 'http://localhost/results.json', 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079'); +await escrowClient.storeResults('0x62dD51230A30401C455c8398d06F85e4EaB6309f', 'http://localhost/results.json', 'b5dad76bf6772c0f07fd5e048f6e75a5f86ee079'); ``` #### Defined in -[escrow.ts:472](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L472) +[escrow.ts:474](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L474) *** @@ -1154,7 +1257,7 @@ import { ethers, Wallet, providers } from 'ethers'; import { EscrowClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); @@ -1168,7 +1271,7 @@ await escrowClient.withdraw( #### Defined in -[escrow.ts:868](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L868) +[escrow.ts:832](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L832) *** @@ -1202,4 +1305,4 @@ Thrown if the network's chainId is not supported #### Defined in -[escrow.ts:154](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L154) +[escrow.ts:156](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L156) diff --git a/docs/sdk/typescript/escrow/classes/EscrowUtils.md b/docs/sdk/typescript/escrow/classes/EscrowUtils.md index 88fbaaeafd..c61c8d723a 100644 --- a/docs/sdk/typescript/escrow/classes/EscrowUtils.md +++ b/docs/sdk/typescript/escrow/classes/EscrowUtils.md @@ -32,7 +32,7 @@ yarn install @human-protocol/sdk import { ChainId, EscrowUtils } from '@human-protocol/sdk'; const escrowAddresses = new EscrowUtils.getEscrows({ - network: ChainId.POLYGON_AMOY + chainId: ChainId.POLYGON_AMOY }); ``` @@ -133,7 +133,7 @@ const escrowData = new EscrowUtils.getEscrow(ChainId.POLYGON_AMOY, "0x1234567890 #### Defined in -[escrow.ts:1656](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1656) +[escrow.ts:1784](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1784) *** @@ -179,7 +179,6 @@ enum ChainId { AVALANCHE_TESTNET = 43113, CELO = 42220, CELO_ALFAJORES = 44787, - = 1273227453, LOCALHOST = 1338, } ``` @@ -256,7 +255,7 @@ const escrowDatas = await EscrowUtils.getEscrows(filters); #### Defined in -[escrow.ts:1530](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1530) +[escrow.ts:1658](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1658) *** @@ -385,4 +384,4 @@ import { ChainId, EscrowUtils, EscrowStatus } from '@human-protocol/sdk'; #### Defined in -[escrow.ts:1754](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1754) +[escrow.ts:1882](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/escrow.ts#L1882) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md index 43f9c26d3d..6939c17073 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyEscrowData.md @@ -36,4 +36,4 @@ ## Defined in -[graphql/types.ts:83](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L83) +[graphql/types.ts:83](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L83) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md index a6829736ec..631a1136f5 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyHMTData.md @@ -32,4 +32,4 @@ ## Defined in -[graphql/types.ts:127](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L127) +[graphql/types.ts:127](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L127) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md index 58b2ee2db4..c00cd71a39 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyPaymentData.md @@ -28,4 +28,4 @@ ## Defined in -[graphql/types.ts:106](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L106) +[graphql/types.ts:106](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L106) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md index 251d9d7115..6dad88e163 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyTaskData.md @@ -24,4 +24,4 @@ ## Defined in -[graphql/types.ts:148](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L148) +[graphql/types.ts:148](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L148) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md b/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md index afbcc9f9e8..9db6c7728c 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/DailyWorkerData.md @@ -20,4 +20,4 @@ ## Defined in -[graphql/types.ts:97](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L97) +[graphql/types.ts:97](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L97) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md b/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md index 8ec17d1f52..5016e99053 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EscrowData.md @@ -88,4 +88,4 @@ ## Defined in -[graphql/types.ts:3](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L3) +[graphql/types.ts:3](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L3) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md index 01132636c1..6f053e052a 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatistics.md @@ -20,4 +20,4 @@ ## Defined in -[graphql/types.ts:92](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L92) +[graphql/types.ts:92](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L92) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md index 8ea7e3d692..2217dcc069 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EscrowStatisticsData.md @@ -52,4 +52,4 @@ ## Defined in -[graphql/types.ts:42](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L42) +[graphql/types.ts:42](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L42) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md b/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md index 4a1822bd86..75aebe52f0 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/EventDayData.md @@ -84,4 +84,4 @@ ## Defined in -[graphql/types.ts:55](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L55) +[graphql/types.ts:55](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L55) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md index efc6ec65ea..705bf707dd 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolder.md @@ -20,4 +20,4 @@ ## Defined in -[graphql/types.ts:122](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L122) +[graphql/types.ts:122](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L122) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md index bf6ec36712..e556d5c3ac 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTHolderData.md @@ -20,4 +20,4 @@ ## Defined in -[graphql/types.ts:117](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L117) +[graphql/types.ts:117](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L117) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md index 8b7be95e98..e9bf2db822 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatistics.md @@ -24,4 +24,4 @@ ## Defined in -[graphql/types.ts:135](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L135) +[graphql/types.ts:135](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L135) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md index 0fff5c8c8a..5f6cd95556 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/HMTStatisticsData.md @@ -36,4 +36,4 @@ ## Defined in -[graphql/types.ts:33](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L33) +[graphql/types.ts:33](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L33) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/IMData.md b/docs/sdk/typescript/graphql/types/type-aliases/IMData.md index 9c8eb7c020..55e5b90f48 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/IMData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/IMData.md @@ -10,4 +10,4 @@ ## Defined in -[graphql/types.ts:146](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L146) +[graphql/types.ts:146](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L146) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md b/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md index b4a5fa2959..6a2393c1d7 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/IMDataEntity.md @@ -20,4 +20,4 @@ ## Defined in -[graphql/types.ts:141](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L141) +[graphql/types.ts:141](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L141) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md b/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md index 95e4ff56ac..0766b090c1 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/KVStoreData.md @@ -36,4 +36,4 @@ ## Defined in -[graphql/types.ts:165](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L165) +[graphql/types.ts:165](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L165) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md index 667f5a8eb1..4537a6a134 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/PaymentStatistics.md @@ -16,4 +16,4 @@ ## Defined in -[graphql/types.ts:113](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L113) +[graphql/types.ts:113](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L113) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/PayoutData.md b/docs/sdk/typescript/graphql/types/type-aliases/PayoutData.md index b920f462ed..23eafd31c1 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/PayoutData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/PayoutData.md @@ -32,4 +32,4 @@ ## Defined in -[graphql/types.ts:25](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L25) +[graphql/types.ts:25](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L25) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md b/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md index 8171093bcb..d647adb306 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/RewardAddedEventData.md @@ -28,4 +28,4 @@ ## Defined in -[graphql/types.ts:76](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L76) +[graphql/types.ts:76](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L76) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md b/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md index 821b77a2df..062aa352a2 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/StatusEvent.md @@ -28,4 +28,4 @@ ## Defined in -[graphql/types.ts:158](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L158) +[graphql/types.ts:158](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L158) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md index d6af185f10..519f786bbc 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/TaskStatistics.md @@ -16,4 +16,4 @@ ## Defined in -[graphql/types.ts:154](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L154) +[graphql/types.ts:154](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L154) diff --git a/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md b/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md index e21126a847..17b8ea44cd 100644 --- a/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md +++ b/docs/sdk/typescript/graphql/types/type-aliases/WorkerStatistics.md @@ -16,4 +16,4 @@ ## Defined in -[graphql/types.ts:102](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L102) +[graphql/types.ts:102](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts#L102) diff --git a/docs/sdk/typescript/interfaces/README.md b/docs/sdk/typescript/interfaces/README.md index 02fcc52d30..3774917e75 100644 --- a/docs/sdk/typescript/interfaces/README.md +++ b/docs/sdk/typescript/interfaces/README.md @@ -29,3 +29,4 @@ - [IStatisticsFilter](interfaces/IStatisticsFilter.md) - [ITransaction](interfaces/ITransaction.md) - [ITransactionsFilter](interfaces/ITransactionsFilter.md) +- [StakerInfo](interfaces/StakerInfo.md) diff --git a/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md b/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md index 758b2f1289..bbba2181bd 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md +++ b/docs/sdk/typescript/interfaces/interfaces/IEscrowConfig.md @@ -14,7 +14,7 @@ #### Defined in -[interfaces.ts:82](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L82) +[interfaces.ts:84](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L84) *** @@ -24,7 +24,7 @@ #### Defined in -[interfaces.ts:85](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L85) +[interfaces.ts:87](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L87) *** @@ -34,7 +34,7 @@ #### Defined in -[interfaces.ts:87](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L87) +[interfaces.ts:89](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L89) *** @@ -44,7 +44,7 @@ #### Defined in -[interfaces.ts:86](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L86) +[interfaces.ts:88](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L88) *** @@ -54,7 +54,7 @@ #### Defined in -[interfaces.ts:80](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L80) +[interfaces.ts:82](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L82) *** @@ -64,7 +64,7 @@ #### Defined in -[interfaces.ts:83](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L83) +[interfaces.ts:85](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L85) *** @@ -74,7 +74,7 @@ #### Defined in -[interfaces.ts:81](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L81) +[interfaces.ts:83](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L83) *** @@ -84,4 +84,4 @@ #### Defined in -[interfaces.ts:84](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L84) +[interfaces.ts:86](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L86) diff --git a/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md b/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md index 424a2c0ef3..953c6c0683 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IEscrowsFilter.md @@ -18,7 +18,7 @@ #### Defined in -[interfaces.ts:76](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L76) +[interfaces.ts:78](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L78) *** @@ -28,7 +28,7 @@ #### Defined in -[interfaces.ts:71](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L71) +[interfaces.ts:73](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L73) *** @@ -42,7 +42,7 @@ #### Defined in -[interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) +[interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) *** @@ -52,7 +52,7 @@ #### Defined in -[interfaces.ts:74](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L74) +[interfaces.ts:76](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L76) *** @@ -62,7 +62,7 @@ #### Defined in -[interfaces.ts:72](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L72) +[interfaces.ts:74](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L74) *** @@ -72,7 +72,7 @@ #### Defined in -[interfaces.ts:68](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L68) +[interfaces.ts:70](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L70) *** @@ -86,7 +86,7 @@ #### Defined in -[interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +[interfaces.ts:157](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L157) *** @@ -96,7 +96,7 @@ #### Defined in -[interfaces.ts:70](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L70) +[interfaces.ts:72](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L72) *** @@ -106,7 +106,7 @@ #### Defined in -[interfaces.ts:69](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L69) +[interfaces.ts:71](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L71) *** @@ -120,7 +120,7 @@ #### Defined in -[interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +[interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) *** @@ -130,7 +130,7 @@ #### Defined in -[interfaces.ts:73](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L73) +[interfaces.ts:75](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L75) *** @@ -140,4 +140,4 @@ #### Defined in -[interfaces.ts:75](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L75) +[interfaces.ts:77](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L77) diff --git a/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md b/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md index e3b23ff093..765f1fbcb4 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md +++ b/docs/sdk/typescript/interfaces/interfaces/IHMTHoldersParams.md @@ -18,7 +18,7 @@ #### Defined in -[interfaces.ts:103](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L103) +[interfaces.ts:105](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L105) *** @@ -32,7 +32,7 @@ #### Defined in -[interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) +[interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) *** @@ -46,7 +46,7 @@ #### Defined in -[interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +[interfaces.ts:157](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L157) *** @@ -60,4 +60,4 @@ #### Defined in -[interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +[interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) diff --git a/docs/sdk/typescript/interfaces/interfaces/IKVStore.md b/docs/sdk/typescript/interfaces/interfaces/IKVStore.md index 71a9267bd0..095f7bf67a 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IKVStore.md +++ b/docs/sdk/typescript/interfaces/interfaces/IKVStore.md @@ -14,7 +14,7 @@ #### Defined in -[interfaces.ts:114](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L114) +[interfaces.ts:116](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L116) *** @@ -24,4 +24,4 @@ #### Defined in -[interfaces.ts:115](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L115) +[interfaces.ts:117](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L117) diff --git a/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md b/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md index a3a532a35c..4617446a23 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md +++ b/docs/sdk/typescript/interfaces/interfaces/IKeyPair.md @@ -14,7 +14,7 @@ #### Defined in -[interfaces.ts:93](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L93) +[interfaces.ts:95](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L95) *** @@ -24,7 +24,7 @@ #### Defined in -[interfaces.ts:91](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L91) +[interfaces.ts:93](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L93) *** @@ -34,7 +34,7 @@ #### Defined in -[interfaces.ts:92](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L92) +[interfaces.ts:94](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L94) *** @@ -44,4 +44,4 @@ #### Defined in -[interfaces.ts:94](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L94) +[interfaces.ts:96](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L96) diff --git a/docs/sdk/typescript/interfaces/interfaces/ILeader.md b/docs/sdk/typescript/interfaces/interfaces/ILeader.md index f980341d8f..d6294e29e9 100644 --- a/docs/sdk/typescript/interfaces/interfaces/ILeader.md +++ b/docs/sdk/typescript/interfaces/interfaces/ILeader.md @@ -14,7 +14,7 @@ #### Defined in -[interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) +[interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) *** @@ -24,7 +24,7 @@ #### Defined in -[interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) +[interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) *** @@ -34,7 +34,7 @@ #### Defined in -[interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) +[interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) *** @@ -44,7 +44,7 @@ #### Defined in -[interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) +[interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) *** @@ -54,7 +54,7 @@ #### Defined in -[interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) +[interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) *** @@ -64,7 +64,7 @@ #### Defined in -[interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) +[interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) *** @@ -74,7 +74,7 @@ #### Defined in -[interfaces.ts:11](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L11) +[interfaces.ts:11](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L11) *** @@ -84,7 +84,7 @@ #### Defined in -[interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) +[interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) *** @@ -94,7 +94,7 @@ #### Defined in -[interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) +[interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) *** @@ -104,7 +104,7 @@ #### Defined in -[interfaces.ts:26](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L26) +[interfaces.ts:26](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L26) *** @@ -114,7 +114,7 @@ #### Defined in -[interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) +[interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) *** @@ -124,7 +124,7 @@ #### Defined in -[interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) +[interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) *** @@ -134,7 +134,7 @@ #### Defined in -[interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) +[interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) *** @@ -144,7 +144,7 @@ #### Defined in -[interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) +[interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) *** @@ -154,7 +154,7 @@ #### Defined in -[interfaces.ts:29](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L29) +[interfaces.ts:29](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L29) *** @@ -164,7 +164,7 @@ #### Defined in -[interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) +[interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) *** @@ -174,7 +174,7 @@ #### Defined in -[interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) +[interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) *** @@ -184,7 +184,7 @@ #### Defined in -[interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) +[interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) *** @@ -194,7 +194,7 @@ #### Defined in -[interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) +[interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) *** @@ -204,4 +204,4 @@ #### Defined in -[interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) +[interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) diff --git a/docs/sdk/typescript/interfaces/interfaces/ILeaderSubgraph.md b/docs/sdk/typescript/interfaces/interfaces/ILeaderSubgraph.md index 43146503cd..b63dc1076a 100644 --- a/docs/sdk/typescript/interfaces/interfaces/ILeaderSubgraph.md +++ b/docs/sdk/typescript/interfaces/interfaces/ILeaderSubgraph.md @@ -22,7 +22,7 @@ #### Defined in -[interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) +[interfaces.ts:12](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L12) *** @@ -36,7 +36,7 @@ #### Defined in -[interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) +[interfaces.ts:19](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L19) *** @@ -50,7 +50,7 @@ #### Defined in -[interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) +[interfaces.ts:14](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L14) *** @@ -64,7 +64,7 @@ #### Defined in -[interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) +[interfaces.ts:17](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L17) *** @@ -78,7 +78,7 @@ #### Defined in -[interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) +[interfaces.ts:13](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L13) *** @@ -92,7 +92,7 @@ #### Defined in -[interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) +[interfaces.ts:16](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L16) *** @@ -106,7 +106,7 @@ #### Defined in -[interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) +[interfaces.ts:21](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L21) *** @@ -120,7 +120,7 @@ #### Defined in -[interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) +[interfaces.ts:10](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L10) *** @@ -130,7 +130,7 @@ #### Defined in -[interfaces.ts:34](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L34) +[interfaces.ts:34](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L34) *** @@ -144,7 +144,7 @@ #### Defined in -[interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) +[interfaces.ts:15](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L15) *** @@ -158,7 +158,7 @@ #### Defined in -[interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) +[interfaces.ts:22](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L22) *** @@ -172,7 +172,7 @@ #### Defined in -[interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) +[interfaces.ts:28](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L28) *** @@ -186,7 +186,7 @@ #### Defined in -[interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) +[interfaces.ts:27](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L27) *** @@ -196,7 +196,7 @@ #### Defined in -[interfaces.ts:35](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L35) +[interfaces.ts:35](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L35) *** @@ -210,7 +210,7 @@ #### Defined in -[interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) +[interfaces.ts:18](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L18) *** @@ -224,7 +224,7 @@ #### Defined in -[interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) +[interfaces.ts:20](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L20) *** @@ -238,7 +238,7 @@ #### Defined in -[interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) +[interfaces.ts:25](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L25) *** @@ -252,7 +252,7 @@ #### Defined in -[interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) +[interfaces.ts:23](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L23) *** @@ -266,4 +266,4 @@ #### Defined in -[interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) +[interfaces.ts:24](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L24) diff --git a/docs/sdk/typescript/interfaces/interfaces/ILeadersFilter.md b/docs/sdk/typescript/interfaces/interfaces/ILeadersFilter.md index e81c0fd893..03b77ee114 100644 --- a/docs/sdk/typescript/interfaces/interfaces/ILeadersFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/ILeadersFilter.md @@ -6,6 +6,10 @@ # Interface: ILeadersFilter +## Extends + +- [`IPagination`](IPagination.md) + ## Properties ### chainId @@ -14,14 +18,76 @@ #### Defined in -[interfaces.ts:39](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L39) +[interfaces.ts:39](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L39) + +*** + +### first? + +> `optional` **first**: `number` + +#### Inherited from + +[`IPagination`](IPagination.md).[`first`](IPagination.md#first) + +#### Defined in + +[interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) *** -### role? +### minAmountStaked? + +> `optional` **minAmountStaked**: `number` + +#### Defined in + +[interfaces.ts:41](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L41) + +*** + +### orderBy? + +> `optional` **orderBy**: `string` + +#### Defined in + +[interfaces.ts:42](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L42) + +*** + +### orderDirection? + +> `optional` **orderDirection**: [`OrderDirection`](../../enums/enumerations/OrderDirection.md) + +#### Inherited from + +[`IPagination`](IPagination.md).[`orderDirection`](IPagination.md#orderdirection) + +#### Defined in + +[interfaces.ts:157](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L157) + +*** + +### roles? + +> `optional` **roles**: `string`[] + +#### Defined in + +[interfaces.ts:40](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L40) + +*** + +### skip? + +> `optional` **skip**: `number` + +#### Inherited from -> `optional` **role**: `string` +[`IPagination`](IPagination.md).[`skip`](IPagination.md#skip) #### Defined in -[interfaces.ts:40](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L40) +[interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) diff --git a/docs/sdk/typescript/interfaces/interfaces/IOperator.md b/docs/sdk/typescript/interfaces/interfaces/IOperator.md index cc6a52985e..14d310da5f 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IOperator.md +++ b/docs/sdk/typescript/interfaces/interfaces/IOperator.md @@ -14,7 +14,7 @@ #### Defined in -[interfaces.ts:55](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L55) +[interfaces.ts:57](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L57) *** @@ -24,7 +24,7 @@ #### Defined in -[interfaces.ts:58](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L58) +[interfaces.ts:60](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L60) *** @@ -34,7 +34,7 @@ #### Defined in -[interfaces.ts:60](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L60) +[interfaces.ts:62](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L62) *** @@ -44,7 +44,7 @@ #### Defined in -[interfaces.ts:59](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L59) +[interfaces.ts:61](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L61) *** @@ -54,7 +54,7 @@ #### Defined in -[interfaces.ts:56](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L56) +[interfaces.ts:58](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L58) *** @@ -64,4 +64,4 @@ #### Defined in -[interfaces.ts:57](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L57) +[interfaces.ts:59](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L59) diff --git a/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md b/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md index 664a83421e..f5737a7811 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md +++ b/docs/sdk/typescript/interfaces/interfaces/IOperatorSubgraph.md @@ -22,7 +22,7 @@ #### Defined in -[interfaces.ts:55](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L55) +[interfaces.ts:57](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L57) *** @@ -32,7 +32,7 @@ #### Defined in -[interfaces.ts:64](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L64) +[interfaces.ts:66](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L66) *** @@ -46,7 +46,7 @@ #### Defined in -[interfaces.ts:60](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L60) +[interfaces.ts:62](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L62) *** @@ -60,7 +60,7 @@ #### Defined in -[interfaces.ts:59](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L59) +[interfaces.ts:61](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L61) *** @@ -74,7 +74,7 @@ #### Defined in -[interfaces.ts:56](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L56) +[interfaces.ts:58](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L58) *** @@ -88,4 +88,4 @@ #### Defined in -[interfaces.ts:57](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L57) +[interfaces.ts:59](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L59) diff --git a/docs/sdk/typescript/interfaces/interfaces/IPagination.md b/docs/sdk/typescript/interfaces/interfaces/IPagination.md index 4ac1dc3c53..67a0229bfa 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IPagination.md +++ b/docs/sdk/typescript/interfaces/interfaces/IPagination.md @@ -8,6 +8,7 @@ ## Extended by +- [`ILeadersFilter`](ILeadersFilter.md) - [`IEscrowsFilter`](IEscrowsFilter.md) - [`IStatisticsFilter`](IStatisticsFilter.md) - [`IHMTHoldersParams`](IHMTHoldersParams.md) @@ -21,7 +22,7 @@ #### Defined in -[interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) +[interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) *** @@ -31,7 +32,7 @@ #### Defined in -[interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +[interfaces.ts:157](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L157) *** @@ -41,4 +42,4 @@ #### Defined in -[interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +[interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) diff --git a/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md b/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md index 10aa72eb68..8eaf8bf075 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IPayoutFilter.md @@ -14,7 +14,7 @@ #### Defined in -[interfaces.ts:107](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L107) +[interfaces.ts:109](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L109) *** @@ -24,7 +24,7 @@ #### Defined in -[interfaces.ts:109](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L109) +[interfaces.ts:111](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L111) *** @@ -34,7 +34,7 @@ #### Defined in -[interfaces.ts:108](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L108) +[interfaces.ts:110](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L110) *** @@ -44,4 +44,4 @@ #### Defined in -[interfaces.ts:110](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L110) +[interfaces.ts:112](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L112) diff --git a/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md b/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md index a79cb7d264..3f904e9eb0 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md +++ b/docs/sdk/typescript/interfaces/interfaces/IReputationNetwork.md @@ -14,7 +14,7 @@ #### Defined in -[interfaces.ts:45](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L45) +[interfaces.ts:47](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L47) *** @@ -24,7 +24,7 @@ #### Defined in -[interfaces.ts:44](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L44) +[interfaces.ts:46](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L46) *** @@ -34,4 +34,4 @@ #### Defined in -[interfaces.ts:46](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L46) +[interfaces.ts:48](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L48) diff --git a/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md b/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md index aee9378fb6..623849a7b9 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md +++ b/docs/sdk/typescript/interfaces/interfaces/IReputationNetworkSubgraph.md @@ -22,7 +22,7 @@ #### Defined in -[interfaces.ts:45](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L45) +[interfaces.ts:47](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L47) *** @@ -36,7 +36,7 @@ #### Defined in -[interfaces.ts:44](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L44) +[interfaces.ts:46](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L46) *** @@ -46,4 +46,4 @@ #### Defined in -[interfaces.ts:51](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L51) +[interfaces.ts:53](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L53) diff --git a/docs/sdk/typescript/interfaces/interfaces/IReward.md b/docs/sdk/typescript/interfaces/interfaces/IReward.md index 3744b69802..5e2cc1f0f9 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IReward.md +++ b/docs/sdk/typescript/interfaces/interfaces/IReward.md @@ -14,7 +14,7 @@ #### Defined in -[interfaces.ts:6](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L6) +[interfaces.ts:6](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L6) *** @@ -24,4 +24,4 @@ #### Defined in -[interfaces.ts:5](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L5) +[interfaces.ts:5](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L5) diff --git a/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md b/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md index ff896e3160..df1bd7a969 100644 --- a/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/IStatisticsFilter.md @@ -22,7 +22,7 @@ #### Defined in -[interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) +[interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) *** @@ -32,7 +32,7 @@ #### Defined in -[interfaces.ts:98](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L98) +[interfaces.ts:100](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L100) *** @@ -46,7 +46,7 @@ #### Defined in -[interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +[interfaces.ts:157](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L157) *** @@ -60,7 +60,7 @@ #### Defined in -[interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +[interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) *** @@ -70,4 +70,4 @@ #### Defined in -[interfaces.ts:99](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L99) +[interfaces.ts:101](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L101) diff --git a/docs/sdk/typescript/interfaces/interfaces/ITransaction.md b/docs/sdk/typescript/interfaces/interfaces/ITransaction.md index 8bd621bb12..4f3900f362 100644 --- a/docs/sdk/typescript/interfaces/interfaces/ITransaction.md +++ b/docs/sdk/typescript/interfaces/interfaces/ITransaction.md @@ -14,7 +14,7 @@ #### Defined in -[interfaces.ts:129](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L129) +[interfaces.ts:131](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L131) *** @@ -24,7 +24,7 @@ #### Defined in -[interfaces.ts:137](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L137) +[interfaces.ts:139](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L139) *** @@ -34,7 +34,7 @@ #### Defined in -[interfaces.ts:131](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L131) +[interfaces.ts:133](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L133) *** @@ -44,7 +44,7 @@ #### Defined in -[interfaces.ts:139](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L139) +[interfaces.ts:141](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L141) *** @@ -54,7 +54,7 @@ #### Defined in -[interfaces.ts:135](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L135) +[interfaces.ts:137](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L137) *** @@ -64,7 +64,7 @@ #### Defined in -[interfaces.ts:136](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L136) +[interfaces.ts:138](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L138) *** @@ -74,7 +74,7 @@ #### Defined in -[interfaces.ts:133](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L133) +[interfaces.ts:135](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L135) *** @@ -84,7 +84,7 @@ #### Defined in -[interfaces.ts:132](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L132) +[interfaces.ts:134](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L134) *** @@ -94,7 +94,7 @@ #### Defined in -[interfaces.ts:138](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L138) +[interfaces.ts:140](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L140) *** @@ -104,7 +104,7 @@ #### Defined in -[interfaces.ts:130](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L130) +[interfaces.ts:132](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L132) *** @@ -114,4 +114,4 @@ #### Defined in -[interfaces.ts:134](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L134) +[interfaces.ts:136](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L136) diff --git a/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md b/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md index e7ab0b1be4..c8bc1caaa3 100644 --- a/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md +++ b/docs/sdk/typescript/interfaces/interfaces/ITransactionsFilter.md @@ -18,7 +18,7 @@ #### Defined in -[interfaces.ts:143](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L143) +[interfaces.ts:145](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L145) *** @@ -28,7 +28,7 @@ #### Defined in -[interfaces.ts:145](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L145) +[interfaces.ts:147](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L147) *** @@ -38,7 +38,7 @@ #### Defined in -[interfaces.ts:147](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L147) +[interfaces.ts:149](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L149) *** @@ -52,7 +52,7 @@ #### Defined in -[interfaces.ts:153](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L153) +[interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) *** @@ -62,7 +62,7 @@ #### Defined in -[interfaces.ts:148](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L148) +[interfaces.ts:150](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L150) *** @@ -76,7 +76,7 @@ #### Defined in -[interfaces.ts:155](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L155) +[interfaces.ts:157](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L157) *** @@ -90,7 +90,7 @@ #### Defined in -[interfaces.ts:154](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L154) +[interfaces.ts:156](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L156) *** @@ -100,7 +100,7 @@ #### Defined in -[interfaces.ts:144](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L144) +[interfaces.ts:146](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L146) *** @@ -110,7 +110,7 @@ #### Defined in -[interfaces.ts:146](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L146) +[interfaces.ts:148](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L148) *** @@ -120,4 +120,4 @@ #### Defined in -[interfaces.ts:149](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L149) +[interfaces.ts:151](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L151) diff --git a/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md b/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md index 34647cc879..4232571832 100644 --- a/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md +++ b/docs/sdk/typescript/interfaces/interfaces/InternalTransaction.md @@ -14,7 +14,7 @@ #### Defined in -[interfaces.ts:124](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L124) +[interfaces.ts:126](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L126) *** @@ -24,7 +24,7 @@ #### Defined in -[interfaces.ts:119](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L119) +[interfaces.ts:121](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L121) *** @@ -34,7 +34,7 @@ #### Defined in -[interfaces.ts:122](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L122) +[interfaces.ts:124](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L124) *** @@ -44,7 +44,7 @@ #### Defined in -[interfaces.ts:123](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L123) +[interfaces.ts:125](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L125) *** @@ -54,7 +54,7 @@ #### Defined in -[interfaces.ts:120](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L120) +[interfaces.ts:122](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L122) *** @@ -64,7 +64,7 @@ #### Defined in -[interfaces.ts:125](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L125) +[interfaces.ts:127](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L127) *** @@ -74,4 +74,4 @@ #### Defined in -[interfaces.ts:121](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L121) +[interfaces.ts:123](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L123) diff --git a/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md b/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md new file mode 100644 index 0000000000..ca9eef85bf --- /dev/null +++ b/docs/sdk/typescript/interfaces/interfaces/StakerInfo.md @@ -0,0 +1,47 @@ +[**@human-protocol/sdk**](../../README.md) + +*** + +[@human-protocol/sdk](../../modules.md) / [interfaces](../README.md) / StakerInfo + +# Interface: StakerInfo + +## Properties + +### lockedAmount + +> **lockedAmount**: `bigint` + +#### Defined in + +[interfaces.ts:162](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L162) + +*** + +### lockedUntil + +> **lockedUntil**: `bigint` + +#### Defined in + +[interfaces.ts:163](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L163) + +*** + +### stakedAmount + +> **stakedAmount**: `bigint` + +#### Defined in + +[interfaces.ts:161](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L161) + +*** + +### withdrawableAmount + +> **withdrawableAmount**: `bigint` + +#### Defined in + +[interfaces.ts:164](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts#L164) diff --git a/docs/sdk/typescript/kvstore/classes/KVStoreClient.md b/docs/sdk/typescript/kvstore/classes/KVStoreClient.md index 574073c60c..99bebf359f 100644 --- a/docs/sdk/typescript/kvstore/classes/KVStoreClient.md +++ b/docs/sdk/typescript/kvstore/classes/KVStoreClient.md @@ -8,19 +8,19 @@ ## Introduction -This client enables to perform actions on KVStore contract and obtain information from both the contracts and subgraph. +This client enables performing actions on KVStore contract and obtaining information from both the contracts and subgraph. Internally, the SDK will use one network or another according to the network ID of the `runner`. To use this client, it is recommended to initialize it using the static `build` method. ```ts -static async build(runner: ContractRunner); +static async build(runner: ContractRunner): Promise; ``` A `Signer` or a `Provider` should be passed depending on the use case of this module: -- **Signer**: when the user wants to use this model in order to send transactions caling the contract functions. -- **Provider**: when the user wants to use this model in order to get information from the contracts or subgraph. +- **Signer**: when the user wants to use this model to send transactions calling the contract functions. +- **Provider**: when the user wants to use this model to get information from the contracts or subgraph. ## Installation @@ -38,21 +38,21 @@ yarn install @human-protocol/sdk ### Signer -**Using private key(backend)** +**Using private key (backend)** ```ts import { KVStoreClient } from '@human-protocol/sdk'; import { Wallet, providers } from 'ethers'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); const kvstoreClient = await KVStoreClient.build(signer); ``` -**Using Wagmi(frontend)** +**Using Wagmi (frontend)** ```ts import { useSigner, useChainId } from 'wagmi'; @@ -71,7 +71,7 @@ import { providers } from 'ethers'; const rpcUrl = 'YOUR_RPC_URL'; const provider = new providers.JsonRpcProvider(rpcUrl); -const kvstoreClient = await KVStoreClient.build(signer); +const kvstoreClient = await KVStoreClient.build(provider); ``` ## Extends @@ -110,7 +110,7 @@ The network information required to connect to the KVStore contract #### Defined in -[kvstore.ts:108](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L108) +[kvstore.ts:108](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L108) ## Properties @@ -124,7 +124,7 @@ The network information required to connect to the KVStore contract #### Defined in -[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) *** @@ -138,7 +138,7 @@ The network information required to connect to the KVStore contract #### Defined in -[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) ## Methods @@ -183,7 +183,7 @@ import { Wallet, providers } from 'ethers'; import { KVStoreClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); @@ -194,7 +194,7 @@ await kvstoreClient.set('Role', 'RecordingOracle'); #### Defined in -[kvstore.ts:171](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L171) +[kvstore.ts:171](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L171) *** @@ -239,7 +239,7 @@ import { Wallet, providers } from 'ethers'; import { KVStoreClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); @@ -247,12 +247,12 @@ const kvstoreClient = await KVStoreClient.build(signer); const keys = ['role', 'webhook_url']; const values = ['RecordingOracle', 'http://localhost']; -await kvstoreClient.set(keys, values); +await kvstoreClient.setBulk(keys, values); ``` #### Defined in -[kvstore.ts:214](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L214) +[kvstore.ts:214](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L214) *** @@ -295,19 +295,19 @@ import { Wallet, providers } from 'ethers'; import { KVStoreClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); const kvstoreClient = await KVStoreClient.build(signer); await kvstoreClient.setFileUrlAndHash('example.com'); -await kvstoreClient.setFileUrlAndHash('linkedin.com/example', 'linkedin_url); +await kvstoreClient.setFileUrlAndHash('linkedin.com/example', 'linkedin_url'); ``` #### Defined in -[kvstore.ts:257](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L257) +[kvstore.ts:257](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L257) *** @@ -341,4 +341,4 @@ The Runner object to interact with the Ethereum network #### Defined in -[kvstore.ts:126](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L126) +[kvstore.ts:126](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L126) diff --git a/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md b/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md index 6954f0b98b..282ac129c2 100644 --- a/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md +++ b/docs/sdk/typescript/kvstore/classes/KVStoreUtils.md @@ -31,9 +31,9 @@ yarn install @human-protocol/sdk ```ts import { ChainId, KVStoreUtils } from '@human-protocol/sdk'; -const KVStoreAddresses = new KVStoreUtils.getKVStoreData({ +const KVStoreAddresses = await KVStoreUtils.getKVStoreData( ChainId.POLYGON_AMOY, - "0x1234567890123456789012345678901234567890", + "0x1234567890123456789012345678901234567890" ); ``` @@ -108,7 +108,7 @@ console.log(value); #### Defined in -[kvstore.ts:389](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L389) +[kvstore.ts:389](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L389) *** @@ -158,7 +158,7 @@ console.log(url); #### Defined in -[kvstore.ts:436](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L436) +[kvstore.ts:436](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L436) *** @@ -207,7 +207,7 @@ console.log(kvStoreData); #### Defined in -[kvstore.ts:337](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L337) +[kvstore.ts:337](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L337) *** @@ -251,4 +251,4 @@ console.log(publicKey); #### Defined in -[kvstore.ts:496](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L496) +[kvstore.ts:496](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/kvstore.ts#L496) diff --git a/docs/sdk/typescript/operator/classes/OperatorUtils.md b/docs/sdk/typescript/operator/classes/OperatorUtils.md index c0ac41c2fb..56db12b9ee 100644 --- a/docs/sdk/typescript/operator/classes/OperatorUtils.md +++ b/docs/sdk/typescript/operator/classes/OperatorUtils.md @@ -30,6 +30,8 @@ This function returns the leader data for the given address. [`ChainId`](../../enums/enumerations/ChainId.md) +Network in which the leader is deployed + ##### address `string` @@ -52,7 +54,7 @@ const leader = await OperatorUtils.getLeader(ChainId.POLYGON_AMOY, '0x62dD51230A #### Defined in -[operator.ts:44](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L44) +[operator.ts:44](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L44) *** @@ -79,7 +81,7 @@ Returns an array with all the leader details. **Code example** ```ts -import { OperatorUtils } from '@human-protocol/sdk'; +import { OperatorUtils, ChainId } from '@human-protocol/sdk'; const filter: ILeadersFilter = { chainId: ChainId.POLYGON @@ -89,7 +91,7 @@ const leaders = await OperatorUtils.getLeaders(filter); #### Defined in -[operator.ts:108](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L108) +[operator.ts:107](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L107) *** @@ -105,6 +107,8 @@ Retrieves the reputation network operators of the specified address. [`ChainId`](../../enums/enumerations/ChainId.md) +Network in which the reputation network is deployed + ##### address `string` @@ -123,9 +127,9 @@ Address of the reputation oracle. - Returns an array of operator details. -#### Example +**Code example** -```typescript +```ts import { OperatorUtils, ChainId } from '@human-protocol/sdk'; const operators = await OperatorUtils.getReputationNetworkOperators(ChainId.POLYGON_AMOY, '0x62dD51230A30401C455c8398d06F85e4EaB6309f'); @@ -133,7 +137,7 @@ const operators = await OperatorUtils.getReputationNetworkOperators(ChainId.POLY #### Defined in -[operator.ts:172](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L172) +[operator.ts:186](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L186) *** @@ -149,6 +153,8 @@ This function returns information about the rewards for a given slasher address. [`ChainId`](../../enums/enumerations/ChainId.md) +Network in which the rewards are deployed + ##### slasherAddress `string` @@ -171,4 +177,4 @@ const rewards = await OperatorUtils.getRewards(ChainId.POLYGON_AMOY, '0x62dD5123 #### Defined in -[operator.ts:222](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L222) +[operator.ts:236](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/operator.ts#L236) diff --git a/docs/sdk/typescript/staking/classes/StakingClient.md b/docs/sdk/typescript/staking/classes/StakingClient.md index d0c2a3ac51..d3d4fa0724 100644 --- a/docs/sdk/typescript/staking/classes/StakingClient.md +++ b/docs/sdk/typescript/staking/classes/StakingClient.md @@ -8,19 +8,19 @@ ## Introduction -This client enables to perform actions on staking contracts and obtain staking information from both the contracts and subgraph. +This client enables performing actions on staking contracts and obtaining staking information from both the contracts and subgraph. Internally, the SDK will use one network or another according to the network ID of the `runner`. To use this client, it is recommended to initialize it using the static `build` method. ```ts -static async build(runner: ContractRunner); +static async build(runner: ContractRunner): Promise; ``` A `Signer` or a `Provider` should be passed depending on the use case of this module: -- **Signer**: when the user wants to use this model in order to send transactions caling the contract functions. -- **Provider**: when the user wants to use this model in order to get information from the contracts or subgraph. +- **Signer**: when the user wants to use this model to send transactions calling the contract functions. +- **Provider**: when the user wants to use this model to get information from the contracts or subgraph. ## Installation @@ -38,21 +38,21 @@ yarn install @human-protocol/sdk ### Signer -**Using private key(backend)** +**Using private key (backend)** ```ts import { StakingClient } from '@human-protocol/sdk'; import { Wallet, providers } from 'ethers'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); const stakingClient = await StakingClient.build(signer); ``` -**Using Wagmi(frontend)** +**Using Wagmi (frontend)** ```ts import { useSigner, useChainId } from 'wagmi'; @@ -110,7 +110,7 @@ The network information required to connect to the Staking contract #### Defined in -[staking.ts:107](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L107) +[staking.ts:108](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L108) ## Properties @@ -120,7 +120,7 @@ The network information required to connect to the Staking contract #### Defined in -[staking.ts:99](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L99) +[staking.ts:100](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L100) *** @@ -134,7 +134,7 @@ The network information required to connect to the Staking contract #### Defined in -[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) +[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12) *** @@ -148,7 +148,7 @@ The network information required to connect to the Staking contract #### Defined in -[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) +[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11) *** @@ -158,7 +158,7 @@ The network information required to connect to the Staking contract #### Defined in -[staking.ts:98](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L98) +[staking.ts:99](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L99) *** @@ -168,7 +168,7 @@ The network information required to connect to the Staking contract #### Defined in -[staking.ts:97](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L97) +[staking.ts:98](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L98) ## Methods @@ -205,7 +205,7 @@ import { ethers, Wallet, providers } from 'ethers'; import { StakingClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); @@ -217,7 +217,45 @@ await stakingClient.approveStake(amount); #### Defined in -[staking.ts:193](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L193) +[staking.ts:193](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L193) + +*** + +### getStakerInfo() + +> **getStakerInfo**(`stakerAddress`): `Promise`\<[`StakerInfo`](../../interfaces/interfaces/StakerInfo.md)\> + +Retrieves comprehensive staking information for a staker. + +#### Parameters + +##### stakerAddress + +`string` + +The address of the staker. + +#### Returns + +`Promise`\<[`StakerInfo`](../../interfaces/interfaces/StakerInfo.md)\> + +**Code example** + +```ts +import { StakingClient } from '@human-protocol/sdk'; + +const rpcUrl = 'YOUR_RPC_URL'; + +const provider = new providers.JsonRpcProvider(rpcUrl); +const stakingClient = await StakingClient.build(provider); + +const stakingInfo = await stakingClient.getStakerInfo('0xYourStakerAddress'); +console.log(stakingInfo.tokensStaked); +``` + +#### Defined in + +[staking.ts:435](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L435) *** @@ -225,7 +263,7 @@ await stakingClient.approveStake(amount); > **slash**(`slasher`, `staker`, `escrowAddress`, `amount`, `txOptions`?): `Promise`\<`void`\> -This function reduces the allocated amount by an staker in an escrow and transfers those tokens to the reward pool. This allows the slasher to claim them later. +This function reduces the allocated amount by a staker in an escrow and transfers those tokens to the reward pool. This allows the slasher to claim them later. #### Parameters @@ -251,7 +289,7 @@ Address of the escrow that the slash is made `bigint` -Amount in WEI of tokens to unstake. +Amount in WEI of tokens to slash. ##### txOptions? @@ -272,7 +310,7 @@ import { ethers, Wallet, providers } from 'ethers'; import { StakingClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); @@ -284,7 +322,7 @@ await stakingClient.slash('0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', '0xf39Fd #### Defined in -[staking.ts:377](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L377) +[staking.ts:373](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L373) *** @@ -323,7 +361,7 @@ import { ethers, Wallet, providers } from 'ethers'; import { StakingClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); @@ -331,12 +369,12 @@ const stakingClient = await StakingClient.build(signer); const amount = ethers.parseUnits(5, 'ether'); //convert from ETH to WEI await stakingClient.approveStake(amount); // if it was already approved before, this is not necessary -await stakingClient.approveStake(amount); +await stakingClient.stake(amount); ``` #### Defined in -[staking.ts:248](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L248) +[staking.ts:247](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L247) *** @@ -375,7 +413,7 @@ import { ethers, Wallet, providers } from 'ethers'; import { StakingClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); @@ -387,7 +425,7 @@ await stakingClient.unstake(amount); #### Defined in -[staking.ts:293](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L293) +[staking.ts:291](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L291) *** @@ -395,7 +433,7 @@ await stakingClient.unstake(amount); > **withdraw**(`txOptions`?): `Promise`\<`void`\> -This function withdraws unstaked and non locked tokens form staking contract to the user wallet. +This function withdraws unstaked and non-locked tokens from staking contract to the user wallet. > Must have tokens available to withdraw @@ -420,7 +458,7 @@ import { Wallet, providers } from 'ethers'; import { StakingClient } from '@human-protocol/sdk'; const rpcUrl = 'YOUR_RPC_URL'; -const privateKey = 'YOUR_PRIVATE_KEY' +const privateKey = 'YOUR_PRIVATE_KEY'; const provider = new providers.JsonRpcProvider(rpcUrl); const signer = new Wallet(privateKey, provider); @@ -431,7 +469,7 @@ await stakingClient.withdraw(); #### Defined in -[staking.ts:339](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L339) +[staking.ts:336](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L336) *** @@ -465,4 +503,4 @@ The Runner object to interact with the Ethereum network #### Defined in -[staking.ts:135](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L135) +[staking.ts:136](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/staking.ts#L136) diff --git a/docs/sdk/typescript/statistics/classes/StatisticsClient.md b/docs/sdk/typescript/statistics/classes/StatisticsClient.md index f49c11699c..44461b4bd6 100644 --- a/docs/sdk/typescript/statistics/classes/StatisticsClient.md +++ b/docs/sdk/typescript/statistics/classes/StatisticsClient.md @@ -8,20 +8,15 @@ ## Introduction -This client enables to obtain statistical information from the subgraph. +This client enables obtaining statistical information from the subgraph. -Unlikely from the other SDK clients, `StatisticsClient` does not require `signer` or `provider` to be provided. -We just need to create client object using relevant network data. +Unlike other SDK clients, `StatisticsClient` does not require `signer` or `provider` to be provided. +We just need to create a client object using relevant network data. ```ts constructor(network: NetworkData) ``` -A `Signer` or a `Provider` should be passed depending on the use case of this module: - -- **Signer**: when the user wants to use this model in order to send transactions caling the contract functions. -- **Provider**: when the user wants to use this model in order to get information from the contracts or subgraph. - ## Installation ### npm @@ -64,7 +59,7 @@ The network information required to connect to the Statistics contract #### Defined in -[statistics.ts:72](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L72) +[statistics.ts:67](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L67) ## Properties @@ -74,7 +69,7 @@ The network information required to connect to the Statistics contract #### Defined in -[statistics.ts:64](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L64) +[statistics.ts:59](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L59) *** @@ -84,7 +79,7 @@ The network information required to connect to the Statistics contract #### Defined in -[statistics.ts:65](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L65) +[statistics.ts:60](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L60) ## Methods @@ -152,7 +147,7 @@ const escrowStatisticsApril = await statisticsClient.getEscrowStatistics({ #### Defined in -[statistics.ts:128](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L128) +[statistics.ts:120](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L120) *** @@ -219,7 +214,7 @@ console.log('HMT statistics from 5/8 - 6/8:', hmtStatisticsRange); #### Defined in -[statistics.ts:497](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L497) +[statistics.ts:478](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L478) *** @@ -264,7 +259,7 @@ console.log('HMT holders:', hmtHolders.map((h) => ({ #### Defined in -[statistics.ts:423](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L423) +[statistics.ts:407](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L407) *** @@ -274,6 +269,7 @@ console.log('HMT holders:', hmtHolders.map((h) => ({ This function returns the statistical data of HMToken. +```ts type HMTStatistics = { totalTransferAmount: BigNumber; totalTransferCount: BigNumber; @@ -281,7 +277,11 @@ type HMTStatistics = { }; ``` -@returns {HMTStatistics} HMToken statistics data. +#### Returns + +`Promise`\<[`HMTStatistics`](../../graphql/types/type-aliases/HMTStatistics.md)\> + +HMToken statistics data. **Code example** @@ -298,13 +298,9 @@ console.log('HMT statistics:', { }); ``` -#### Returns - -`Promise`\<[`HMTStatistics`](../../graphql/types/type-aliases/HMTStatistics.md)\> - #### Defined in -[statistics.ts:380](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L380) +[statistics.ts:364](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L364) *** @@ -390,7 +386,7 @@ console.log( #### Defined in -[statistics.ts:314](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L314) +[statistics.ts:300](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L300) *** @@ -453,4 +449,4 @@ const workerStatisticsApril = await statisticsClient.getWorkerStatistics({ #### Defined in -[statistics.ts:215](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L215) +[statistics.ts:204](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/statistics.ts#L204) diff --git a/docs/sdk/typescript/storage/classes/StorageClient.md b/docs/sdk/typescript/storage/classes/StorageClient.md index 19625fed23..86d8855a7d 100644 --- a/docs/sdk/typescript/storage/classes/StorageClient.md +++ b/docs/sdk/typescript/storage/classes/StorageClient.md @@ -12,7 +12,7 @@ StorageClient is deprecated. Use Minio.Client directly. ## Introduction -This client enables to interact with S3 cloud storage services like Amazon S3 Bucket, Google Cloud Storage and others. +This client enables interacting with S3 cloud storage services like Amazon S3 Bucket, Google Cloud Storage, and others. The instance creation of `StorageClient` should be made using its constructor: @@ -20,7 +20,7 @@ The instance creation of `StorageClient` should be made using its constructor: constructor(params: StorageParams, credentials?: StorageCredentials) ``` -> If credentials is not provided, it uses an anonymous access to the bucket for downloading files. +> If credentials are not provided, it uses anonymous access to the bucket for downloading files. ## Installation @@ -73,7 +73,7 @@ Cloud storage params [`StorageCredentials`](../../types/type-aliases/StorageCredentials.md) -Optional. Cloud storage access data. If credentials is not provided - use an anonymous access to the bucket +Optional. Cloud storage access data. If credentials are not provided - use anonymous access to the bucket #### Returns @@ -81,7 +81,7 @@ Optional. Cloud storage access data. If credentials is not provided - use an ano #### Defined in -[storage.ts:73](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L73) +[storage.ts:73](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L73) ## Methods @@ -127,7 +127,7 @@ const exists = await storageClient.bucketExists('bucket-name'); #### Defined in -[storage.ts:266](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L266) +[storage.ts:262](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L262) *** @@ -155,7 +155,7 @@ Bucket name. `Promise`\<`any`[]\> -Returns an array of json files downloaded and parsed into objects. +Returns an array of JSON files downloaded and parsed into objects. **Code example** @@ -177,7 +177,7 @@ const files = await storageClient.downloadFiles(keys, 'bucket-name'); #### Defined in -[storage.ts:113](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L113) +[storage.ts:112](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L112) *** @@ -185,7 +185,7 @@ const files = await storageClient.downloadFiles(keys, 'bucket-name'); > **listObjects**(`bucket`): `Promise`\<`string`[]\> -This function list all file names contained in the bucket. +This function lists all file names contained in the bucket. #### Parameters @@ -223,7 +223,7 @@ const fileNames = await storageClient.listObjects('bucket-name'); #### Defined in -[storage.ts:297](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L297) +[storage.ts:292](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L292) *** @@ -239,7 +239,7 @@ This function uploads files to a bucket. `any`[] -Array of objects to upload serialized into json. +Array of objects to upload serialized into JSON. ##### bucket @@ -251,7 +251,7 @@ Bucket name. `Promise`\<[`UploadFile`](../../types/type-aliases/UploadFile.md)[]\> -Returns an array of json files downloaded and parsed into objects. +Returns an array of uploaded file metadata. **Code example** @@ -278,7 +278,7 @@ const uploadedFiles = await storageClient.uploadFiles(files, 'bucket-name'); #### Defined in -[storage.ts:201](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L201) +[storage.ts:198](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L198) *** @@ -286,7 +286,7 @@ const uploadedFiles = await storageClient.uploadFiles(files, 'bucket-name'); > `static` **downloadFileFromUrl**(`url`): `Promise`\<`any`\> -This function downloads files from a Url. +This function downloads files from a URL. #### Parameters @@ -294,22 +294,22 @@ This function downloads files from a Url. `string` -Url of the file to download. +URL of the file to download. #### Returns `Promise`\<`any`\> -Returns the JSON file downloaded and parsed into object. +Returns the JSON file downloaded and parsed into an object. **Code example** ```ts import { StorageClient } from '@human-protocol/sdk'; -const file = await storageClient.downloadFileFromUrl('http://localhost/file.json'); +const file = await StorageClient.downloadFileFromUrl('http://localhost/file.json'); ``` #### Defined in -[storage.ts:148](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L148) +[storage.ts:146](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/storage.ts#L146) diff --git a/docs/sdk/typescript/transaction/classes/TransactionUtils.md b/docs/sdk/typescript/transaction/classes/TransactionUtils.md index d87190140c..9e9693a3df 100644 --- a/docs/sdk/typescript/transaction/classes/TransactionUtils.md +++ b/docs/sdk/typescript/transaction/classes/TransactionUtils.md @@ -54,7 +54,7 @@ const transaction = await TransactionUtils.getTransaction(ChainId.POLYGON, '0x62 #### Defined in -[transaction.ts:34](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L34) +[transaction.ts:34](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L34) *** @@ -127,4 +127,4 @@ const transactions = await TransactionUtils.getTransactions(filter); #### Defined in -[transaction.ts:109](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L109) +[transaction.ts:109](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/transaction.ts#L109) diff --git a/docs/sdk/typescript/types/README.md b/docs/sdk/typescript/types/README.md index ed6ec3f590..a6eef85112 100644 --- a/docs/sdk/typescript/types/README.md +++ b/docs/sdk/typescript/types/README.md @@ -19,4 +19,5 @@ - [NetworkData](type-aliases/NetworkData.md) - [StorageCredentials](type-aliases/StorageCredentials.md) - [StorageParams](type-aliases/StorageParams.md) +- [TransactionLikeWithNonce](type-aliases/TransactionLikeWithNonce.md) - [UploadFile](type-aliases/UploadFile.md) diff --git a/docs/sdk/typescript/types/enumerations/EscrowStatus.md b/docs/sdk/typescript/types/enumerations/EscrowStatus.md index 846b8d4d48..216b18273a 100644 --- a/docs/sdk/typescript/types/enumerations/EscrowStatus.md +++ b/docs/sdk/typescript/types/enumerations/EscrowStatus.md @@ -18,7 +18,7 @@ Escrow is cancelled. #### Defined in -[types.ts:30](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L30) +[types.ts:32](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L32) *** @@ -26,11 +26,11 @@ Escrow is cancelled. > **Complete**: `4` -Escrow is finished.. +Escrow is finished. #### Defined in -[types.ts:26](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L26) +[types.ts:28](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L28) *** @@ -42,7 +42,7 @@ Escrow is launched. #### Defined in -[types.ts:10](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L10) +[types.ts:12](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L12) *** @@ -54,7 +54,7 @@ Escrow is fully paid. #### Defined in -[types.ts:22](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L22) +[types.ts:24](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L24) *** @@ -66,7 +66,7 @@ Escrow is partially paid out. #### Defined in -[types.ts:18](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L18) +[types.ts:20](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L20) *** @@ -78,4 +78,4 @@ Escrow is funded, and waiting for the results to be submitted. #### Defined in -[types.ts:14](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L14) +[types.ts:16](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L16) diff --git a/docs/sdk/typescript/types/type-aliases/EscrowCancel.md b/docs/sdk/typescript/types/type-aliases/EscrowCancel.md index b3bf362bb3..34a40f9a8b 100644 --- a/docs/sdk/typescript/types/type-aliases/EscrowCancel.md +++ b/docs/sdk/typescript/types/type-aliases/EscrowCancel.md @@ -26,4 +26,4 @@ The hash of the transaction associated with the escrow cancellation. ## Defined in -[types.ts:143](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L143) +[types.ts:145](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L145) diff --git a/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md b/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md index 187d592176..71dc329883 100644 --- a/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md +++ b/docs/sdk/typescript/types/type-aliases/EscrowWithdraw.md @@ -32,4 +32,4 @@ The hash of the transaction associated with the escrow withdrawal. ## Defined in -[types.ts:157](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L157) +[types.ts:159](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L159) diff --git a/docs/sdk/typescript/types/type-aliases/NetworkData.md b/docs/sdk/typescript/types/type-aliases/NetworkData.md index 746f2d4adf..83a5bc2e19 100644 --- a/docs/sdk/typescript/types/type-aliases/NetworkData.md +++ b/docs/sdk/typescript/types/type-aliases/NetworkData.md @@ -70,7 +70,7 @@ Subgraph URL > **subgraphUrlApiKey**: `string` -Subgraph URL +Subgraph URL API key ### title @@ -80,4 +80,4 @@ Network title ## Defined in -[types.ts:93](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L93) +[types.ts:95](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L95) diff --git a/docs/sdk/typescript/types/type-aliases/StorageCredentials.md b/docs/sdk/typescript/types/type-aliases/StorageCredentials.md index d99b41f6f0..0161f59062 100644 --- a/docs/sdk/typescript/types/type-aliases/StorageCredentials.md +++ b/docs/sdk/typescript/types/type-aliases/StorageCredentials.md @@ -30,4 +30,4 @@ StorageClient is deprecated. Use Minio.Client directly. ## Defined in -[types.ts:38](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L38) +[types.ts:40](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L40) diff --git a/docs/sdk/typescript/types/type-aliases/StorageParams.md b/docs/sdk/typescript/types/type-aliases/StorageParams.md index d8ca085e73..c900a7461e 100644 --- a/docs/sdk/typescript/types/type-aliases/StorageParams.md +++ b/docs/sdk/typescript/types/type-aliases/StorageParams.md @@ -40,4 +40,4 @@ StorageClient is deprecated. Use Minio.Client directly. ## Defined in -[types.ts:52](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L52) +[types.ts:54](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L54) diff --git a/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md b/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md new file mode 100644 index 0000000000..0118484b2d --- /dev/null +++ b/docs/sdk/typescript/types/type-aliases/TransactionLikeWithNonce.md @@ -0,0 +1,19 @@ +[**@human-protocol/sdk**](../../README.md) + +*** + +[@human-protocol/sdk](../../modules.md) / [types](../README.md) / TransactionLikeWithNonce + +# Type Alias: TransactionLikeWithNonce + +> **TransactionLikeWithNonce**: `TransactionLike` & `object` + +## Type declaration + +### nonce + +> **nonce**: `number` + +## Defined in + +[types.ts:174](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L174) diff --git a/docs/sdk/typescript/types/type-aliases/UploadFile.md b/docs/sdk/typescript/types/type-aliases/UploadFile.md index ca33318c3e..2e61465a0e 100644 --- a/docs/sdk/typescript/types/type-aliases/UploadFile.md +++ b/docs/sdk/typescript/types/type-aliases/UploadFile.md @@ -32,4 +32,4 @@ Uploaded object URL ## Defined in -[types.ts:75](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L75) +[types.ts:77](https://github.com/humanprotocol/human-protocol/blob/b190dc1831c2c96fe3d44fd63e915e54011e1ec8/packages/sdk/typescript/human-protocol-sdk/src/types.ts#L77) diff --git a/package.json b/package.json index 8871815e01..986078ff8c 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "repository": "https://github.com/humanprotocol/human-protocol", "license": "MIT", "scripts": { - "test": "concurrently \"yarn workspace @human-protocol/core test\" \"yarn workspace @human-protocol/sdk test\" \"yarn workspace @human-protocol/subgraph test\" \"yarn workspace @human-protocol/dashboard-ui test\" \"yarn workspace @human-protocol/faucet-server test\" \"yarn workspace @human-protocol/job-launcher-server test\" \"yarn workspace @human-protocol/job-launcher-client test\" \"yarn workspace @human-protocol/human-app-frontend test\" \"yarn workspace @human-protocol/human-app-server test\" \"yarn workspace @human-protocol/reputation-oracle test\" \"yarn workspace @human-protocol/fortune-exchange-oracle-server test\" \"yarn workspace @human-protocol/fortune-recording-oracle test\"", - "lint": "concurrently \"yarn workspace @human-protocol/core lint\" \"yarn workspace @human-protocol/sdk lint\" \"yarn workspace @human-protocol/subgraph lint\" \"yarn workspace @human-protocol/faucet-client lint\" \"yarn workspace @human-protocol/faucet-server lint\" \"yarn workspace @human-protocol/job-launcher-server lint\" \"yarn workspace @human-protocol/job-launcher-client lint\" \"yarn workspace @human-protocol/human-app-frontend lint\" \"yarn workspace @human-protocol/human-app-server lint\" \"yarn workspace @human-protocol/reputation-oracle lint\" \"yarn workspace @human-protocol/fortune-exchange-oracle-server lint\" \"yarn workspace @human-protocol/fortune-recording-oracle lint\"", + "test": "concurrently \"yarn workspace @human-protocol/core test\" \"yarn workspace @human-protocol/sdk test\" \"yarn workspace @human-protocol/subgraph test\" \"yarn workspace @human-protocol/faucet-server test\" \"yarn workspace @human-protocol/job-launcher-server test\" \"yarn workspace @human-protocol/job-launcher-client test\" \"yarn workspace @human-protocol/human-app-frontend test\" \"yarn workspace @human-protocol/human-app-server test\" \"yarn workspace @human-protocol/reputation-oracle test\" \"yarn workspace @human-protocol/fortune-exchange-oracle-server test\" \"yarn workspace @human-protocol/fortune-recording-oracle test\"", + "lint": "concurrently \"yarn workspace @human-protocol/core lint\" \"yarn workspace @human-protocol/sdk lint\" \"yarn workspace @human-protocol/subgraph lint\" \"yarn workspace @human-protocol/faucet-client lint\" \"yarn workspace @human-protocol/faucet-server lint\" \"yarn workspace @human-protocol/job-launcher-server lint\" \"yarn workspace @human-protocol/job-launcher-client lint\" \"yarn workspace @human-protocol/human-app-frontend lint\" \"yarn workspace @human-protocol/human-app-server lint\" \"yarn workspace @human-protocol/reputation-oracle lint\" \"yarn workspace @human-protocol/fortune-exchange-oracle-server lint\" \"yarn workspace @human-protocol/fortune-recording-oracle lint\" \"yarn workspace @human-protocol/dashboard-ui-2024 lint\"", "prepare": "husky", "postinstall": "yarn workspace @human-protocol/sdk build" }, @@ -24,7 +24,7 @@ "@babel/preset-typescript": "^7.18.6", "@jest/globals": "^29.3.1", "@types/jest": "^29.5.12", - "@types/node": "^22.5.4", + "@types/node": "^22.10.5", "@typescript-eslint/eslint-plugin": "^5.43.0", "@typescript-eslint/parser": "^5.43.0", "@typescript-eslint/utils": "^8.4.0", @@ -38,7 +38,7 @@ "husky": "^9.1.6", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", - "lint-staged": "^15.2.7", + "lint-staged": "^15.3.0", "prettier": "^3.4.2", "ts-jest": "^29.2.5", "ts-node": "^10.9.2", diff --git a/packages/apps/dashboard/server/package.json b/packages/apps/dashboard/server/package.json index 0309e77817..0822378082 100644 --- a/packages/apps/dashboard/server/package.json +++ b/packages/apps/dashboard/server/package.json @@ -41,7 +41,7 @@ "@nestjs/testing": "^10.4.6", "@types/express": "^4.17.13", "@types/jest": "29.5.1", - "@types/node": "22.5.4", + "@types/node": "22.10.5", "@types/supertest": "^2.0.11", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.0.0", diff --git a/packages/apps/dashboard/server/src/common/constants/leader.ts b/packages/apps/dashboard/server/src/common/constants/leader.ts new file mode 100644 index 0000000000..4415b4ef8c --- /dev/null +++ b/packages/apps/dashboard/server/src/common/constants/leader.ts @@ -0,0 +1,2 @@ +export const MIN_AMOUNT_STAKED = 1; +export const MAX_LEADERS_COUNT = 1000; diff --git a/packages/apps/dashboard/server/src/common/enums/leader.ts b/packages/apps/dashboard/server/src/common/enums/leader.ts new file mode 100644 index 0000000000..3885b97282 --- /dev/null +++ b/packages/apps/dashboard/server/src/common/enums/leader.ts @@ -0,0 +1,6 @@ +export enum LeadersOrderBy { + ROLE = 'role', + AMOUNT_STAKED = 'amountStaked', + REPUTATION = 'reputation', + FEE = 'fee', +} diff --git a/packages/apps/dashboard/server/src/common/enums/reputation.ts b/packages/apps/dashboard/server/src/common/enums/reputation.ts new file mode 100644 index 0000000000..18a9e9c94c --- /dev/null +++ b/packages/apps/dashboard/server/src/common/enums/reputation.ts @@ -0,0 +1,5 @@ +export enum ReputationLevel { + LOW = 'low', + MEDIUM = 'medium', + HIGH = 'high', +} diff --git a/packages/apps/dashboard/server/src/common/enums/roles.ts b/packages/apps/dashboard/server/src/common/enums/roles.ts index 5b35824c36..1a68ff2cf0 100644 --- a/packages/apps/dashboard/server/src/common/enums/roles.ts +++ b/packages/apps/dashboard/server/src/common/enums/roles.ts @@ -4,3 +4,10 @@ export enum OracleRole { RECORDING_ORACLE = 'recording_oracle', REPUTATION_ORACLE = 'reputation_oracle', } + +export enum SubgraphOracleRole { + JOB_LAUNCHER = 'Job Launcher', + EXCHANGE_ORACLE = 'Exchange Oracle', + RECORDING_ORACLE = 'Reputation Oracle', + REPUTATION_ORACLE = 'Recording Oracle', +} diff --git a/packages/apps/dashboard/server/src/common/types/index.ts b/packages/apps/dashboard/server/src/common/types/index.ts new file mode 100644 index 0000000000..d025f15457 --- /dev/null +++ b/packages/apps/dashboard/server/src/common/types/index.ts @@ -0,0 +1 @@ +export * from './leader'; diff --git a/packages/apps/dashboard/server/src/common/types/leader.ts b/packages/apps/dashboard/server/src/common/types/leader.ts new file mode 100644 index 0000000000..47dc7530ac --- /dev/null +++ b/packages/apps/dashboard/server/src/common/types/leader.ts @@ -0,0 +1,8 @@ +import { OrderDirection } from '@human-protocol/sdk'; +import { LeadersOrderBy } from '../enums/leader'; + +export type GetLeadersPaginationOptions = { + orderBy?: LeadersOrderBy; + orderDirection?: OrderDirection; + first?: number; +}; diff --git a/packages/apps/dashboard/server/src/modules/details/details.controller.ts b/packages/apps/dashboard/server/src/modules/details/details.controller.ts index a8400a05c6..beff08f6bd 100644 --- a/packages/apps/dashboard/server/src/modules/details/details.controller.ts +++ b/packages/apps/dashboard/server/src/modules/details/details.controller.ts @@ -19,6 +19,7 @@ import { import { DetailsTransactionsPaginationDto, DetailsEscrowsPaginationDto, + LeadersPaginationDto, } from './dto/details-pagination.dto'; import { WalletDto } from './dto/wallet.dto'; import { EscrowDto, EscrowPaginationDto } from './dto/escrow.dto'; @@ -32,7 +33,6 @@ export class DetailsController { constructor(private readonly detailsService: DetailsService) {} @Get('/leaders') - @ApiQuery({ name: 'chainId', enum: ChainId, required: false }) @HttpCode(200) @ApiOperation({ summary: 'Get the best leaders by role', @@ -46,28 +46,13 @@ export class DetailsController { isArray: true, }) public async leaders( - @Query('chainId') chainId?: ChainId, + @Query() query: LeadersPaginationDto, ): Promise { - return this.detailsService.getLeadersByChainId(chainId, 4); - } - - @Get('/leaders/all') - @ApiQuery({ name: 'chainId', enum: ChainId, required: false }) - @HttpCode(200) - @ApiOperation({ - summary: 'Get all leaders', - description: 'Returns all leaders for a given chain or all chains.', - }) - @ApiResponse({ - status: 200, - description: 'All leaders retrieved successfully', - type: LeaderDto, - isArray: true, - }) - public async allLeaders( - @Query('chainId') chainId?: ChainId, - ): Promise { - return this.detailsService.getLeadersByChainId(chainId); + return this.detailsService.getLeaders(query.chainId, { + orderBy: query.orderBy, + orderDirection: query.orderDirection, + first: query.first, + }); } @Get('/:address') diff --git a/packages/apps/dashboard/server/src/modules/details/details.service.ts b/packages/apps/dashboard/server/src/modules/details/details.service.ts index e4f1e6d8ab..4e45ea21a5 100644 --- a/packages/apps/dashboard/server/src/modules/details/details.service.ts +++ b/packages/apps/dashboard/server/src/modules/details/details.service.ts @@ -8,7 +8,8 @@ import { IEscrowsFilter, Role, NETWORKS, - ILeader, + ILeadersFilter, + OrderDirection, } from '@human-protocol/sdk'; import { WalletDto } from './dto/wallet.dto'; @@ -21,8 +22,14 @@ import { firstValueFrom } from 'rxjs'; import { HMToken__factory } from '@human-protocol/core/typechain-types'; import { ethers } from 'ethers'; import { NetworkConfigService } from '../../common/config/network-config.service'; -import { NetworksService } from '../networks/networks.service'; -import { OracleRole } from '../../common/enums/roles'; +import { OracleRole, SubgraphOracleRole } from '../../common/enums/roles'; +import { LeadersOrderBy } from '../../common/enums/leader'; +import { ReputationLevel } from '../../common/enums/reputation'; +import { + MAX_LEADERS_COUNT, + MIN_AMOUNT_STAKED, +} from '../../common/constants/leader'; +import { GetLeadersPaginationOptions } from 'src/common/types'; @Injectable() export class DetailsService { @@ -30,7 +37,6 @@ export class DetailsService { constructor( private readonly configService: EnvironmentConfigService, private readonly httpService: HttpService, - private readonly networksService: NetworksService, private readonly networkConfig: NetworkConfigService, ) {} @@ -149,40 +155,77 @@ export class DetailsService { return result; } - public async getLeadersByChainId( - chainId?: ChainId, - take?: number, + public async getLeaders( + chainId: ChainId, + { orderBy, orderDirection, first }: GetLeadersPaginationOptions = {}, ): Promise { - const chainIds = !chainId - ? await this.networksService.getOperatingNetworks() - : [chainId]; - - let allLeadersData: ILeader[] = []; - for (const id of chainIds) { - const leadersData = await OperatorUtils.getLeaders({ chainId: id }); - allLeadersData = allLeadersData.concat( - leadersData.filter((leader) => leader.amountStaked > 0 && leader.role), + const filter = this.createLeadersFilter( + chainId, + orderBy, + orderDirection, + first, + ); + + const [rawLeaders, reputations] = await Promise.all([ + OperatorUtils.getLeaders(filter), + this.fetchReputations( + chainId, + orderBy, + orderDirection, + orderBy === LeadersOrderBy.REPUTATION ? filter.first : undefined, + ), + ]); + + const leaders = rawLeaders + .filter((leader) => leader.role) + .map((leader) => + plainToInstance(LeaderDto, leader, { excludeExtraneousValues: true }), ); - } - allLeadersData.sort((a, b) => - BigInt(a.amountStaked) >= BigInt(b.amountStaked) ? -1 : 1, + const leadersWithReputation = this.assignReputationsToLeaders( + leaders, + reputations, ); - if (take && take > 0) { - allLeadersData = allLeadersData.slice(0, take); + + if (orderBy === LeadersOrderBy.REPUTATION) { + return this.sortLeadersByReputation( + leadersWithReputation, + orderDirection, + first, + ); } - const leaders = allLeadersData.map((leader) => - plainToInstance(LeaderDto, leader, { - excludeExtraneousValues: true, - }), - ); - for (const id of chainIds) { - const reputations = await this.fetchReputations(id); - this.assignReputationsToLeaders(leaders, reputations, id); + return leadersWithReputation; + } + + private createLeadersFilter( + chainId: ChainId, + orderBy: LeadersOrderBy, + orderDirection: OrderDirection, + first?: number, + ): ILeadersFilter { + const leadersFilter: ILeadersFilter = { + chainId, + minAmountStaked: MIN_AMOUNT_STAKED, + roles: [ + SubgraphOracleRole.JOB_LAUNCHER, + SubgraphOracleRole.EXCHANGE_ORACLE, + SubgraphOracleRole.RECORDING_ORACLE, + SubgraphOracleRole.REPUTATION_ORACLE, + ], + }; + + if (orderBy === LeadersOrderBy.REPUTATION) { + leadersFilter.first = MAX_LEADERS_COUNT; + } else { + Object.assign(leadersFilter, { + orderBy, + orderDirection, + first, + }); } - return leaders; + return leadersFilter; } private async fetchReputation( @@ -192,10 +235,16 @@ export class DetailsService { try { const response = await firstValueFrom( this.httpService.get( - this.configService.reputationSource + `/reputation/${address}`, + `${this.configService.reputationSource}/reputation/${address}`, { params: { chain_id: chainId, + roles: [ + OracleRole.JOB_LAUNCHER, + OracleRole.EXCHANGE_ORACLE, + OracleRole.RECORDING_ORACLE, + OracleRole.REPUTATION_ORACLE, + ], }, }, ), @@ -209,11 +258,14 @@ export class DetailsService { private async fetchReputations( chainId: ChainId, + orderBy?: LeadersOrderBy, + orderDirection?: OrderDirection, + first?: number, ): Promise<{ address: string; reputation: string }[]> { try { const response = await firstValueFrom( this.httpService.get( - this.configService.reputationSource + '/reputation', + `${this.configService.reputationSource}/reputation`, { params: { chain_id: chainId, @@ -223,6 +275,12 @@ export class DetailsService { OracleRole.RECORDING_ORACLE, OracleRole.REPUTATION_ORACLE, ], + ...(orderBy && + orderBy === LeadersOrderBy.REPUTATION && { + order_by: 'reputation_points', + }), + ...(orderDirection && { order_direction: orderDirection }), + ...(first && { first }), }, }, ), @@ -240,19 +298,45 @@ export class DetailsService { private assignReputationsToLeaders( leaders: LeaderDto[], reputations: { address: string; reputation: string }[], - chainId: ChainId, - ) { + ): LeaderDto[] { const reputationMap = new Map( reputations.map((rep) => [rep.address.toLowerCase(), rep.reputation]), ); - leaders - .filter((leader) => leader.chainId === chainId) - .forEach((leader) => { - const reputation = reputationMap.get(leader.address.toLowerCase()); - if (reputation) { - leader.reputation = reputation; - } - }); + leaders.forEach((leader) => { + const reputation = reputationMap.get(leader.address.toLowerCase()); + leader.reputation = reputation || ReputationLevel.LOW; + }); + + return leaders; + } + + private sortLeadersByReputation( + leaders: LeaderDto[], + orderDirection: OrderDirection, + first?: number, + ): LeaderDto[] { + const reputationOrder = { + [ReputationLevel.LOW]: 1, + [ReputationLevel.MEDIUM]: 2, + [ReputationLevel.HIGH]: 3, + }; + + const sortedLeaders = leaders.sort((a, b) => { + const reputationA = reputationOrder[a.reputation || ReputationLevel.LOW]; + const reputationB = reputationOrder[b.reputation || ReputationLevel.LOW]; + + if (orderDirection === OrderDirection.ASC) { + return reputationA - reputationB; + } else { + return reputationB - reputationA; + } + }); + + if (first) { + return sortedLeaders.slice(0, first); + } + + return sortedLeaders; } } diff --git a/packages/apps/dashboard/server/src/modules/details/details.spec.ts b/packages/apps/dashboard/server/src/modules/details/details.spec.ts new file mode 100644 index 0000000000..28895a15a7 --- /dev/null +++ b/packages/apps/dashboard/server/src/modules/details/details.spec.ts @@ -0,0 +1,165 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { DetailsService } from './details.service'; +import { HttpService } from '@nestjs/axios'; +import { EnvironmentConfigService } from '../../common/config/env-config.service'; +import { NetworkConfigService } from '../../common/config/network-config.service'; +import { Logger } from '@nestjs/common'; +import { of, throwError } from 'rxjs'; +import { + ChainId, + ILeader, + OperatorUtils, + OrderDirection, +} from '@human-protocol/sdk'; +import { LeadersOrderBy } from '../../common/enums/leader'; + +jest.mock('@human-protocol/sdk', () => ({ + ...jest.requireActual('@human-protocol/sdk'), + OperatorUtils: { + getLeaders: jest.fn(), + }, +})); + +jest.mock('../../common/constants/leader', () => ({ + ...jest.requireActual('../../common/constants/leader'), + MAX_LEADERS_COUNT: 5, +})); + +describe('DetailsService', () => { + let service: DetailsService; + let httpService: HttpService; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [ + DetailsService, + { + provide: HttpService, + useValue: { + get: jest.fn(), + }, + }, + { + provide: EnvironmentConfigService, + useValue: { + reputationSource: 'http://reputation.api', + }, + }, + { + provide: NetworkConfigService, + useValue: { + getAvailableNetworks: jest + .fn() + .mockResolvedValue([ChainId.MAINNET]), + }, + }, + Logger, + ], + }).compile(); + + service = module.get(DetailsService); + httpService = module.get(HttpService); + }); + + it('should fetch and return leaders with reputations', async () => { + const mockLeaders = [{ address: '0x123', role: 'Reputation Oracle' }]; + const mockReputations = [{ address: '0x123', reputation: 'hign' }]; + + jest + .spyOn(OperatorUtils, 'getLeaders') + .mockResolvedValue(mockLeaders as ILeader[]); + jest + .spyOn(httpService as any, 'get') + .mockReturnValue(of({ data: mockReputations })); + + const result = await service.getLeaders(ChainId.ALL); + + expect(result).toEqual([ + expect.objectContaining({ + address: '0x123', + role: 'Reputation Oracle', + reputation: 'hign', + }), + ]); + }); + + it('should handle missing reputation data gracefully', async () => { + const mockLeaders = [{ address: '0x456', role: 'Job Launcher' }]; + + jest + .spyOn(OperatorUtils, 'getLeaders') + .mockResolvedValue(mockLeaders as ILeader[]); + jest.spyOn(httpService as any, 'get').mockReturnValue(of({ data: [] })); + + const result = await service.getLeaders(ChainId.ALL); + + expect(result).toEqual([ + expect.objectContaining({ + address: '0x456', + role: 'Job Launcher', + reputation: 'low', + }), + ]); + }); + + it('should return sorted leaders by reputation', async () => { + const mockLeaders = [ + { address: '0xA', role: 'Job Launcher' }, + { address: '0xB', role: 'Exchange Oracle' }, + { address: '0xC', role: 'Exchange Oracle' }, + { address: '0xD', role: 'Exchange Oracle' }, + { address: '0xE', role: 'Recording Oracle' }, + ]; + const mockReputations = [ + { address: '0xB', reputation: 'high' }, + { address: '0xC', reputation: 'high' }, + { address: '0xD', reputation: 'medium' }, + ]; + + const getLeadersSpy = jest.spyOn(OperatorUtils, 'getLeaders'); + getLeadersSpy.mockImplementation(async ({ first }) => { + return mockLeaders.slice(0, first) as ILeader[]; + }); + + jest + .spyOn(httpService as any, 'get') + .mockReturnValue(of({ data: mockReputations })); + + const result = await service.getLeaders(ChainId.POLYGON_AMOY, { + orderBy: LeadersOrderBy.REPUTATION, + orderDirection: OrderDirection.DESC, + first: 5, + }); + + expect(result[0].address).toBe('0xB'); + expect(result[1].address).toBe('0xC'); + expect(result[2].address).toBe('0xD'); + expect(result.length).toBe(5); + expect(getLeadersSpy).toBeCalledWith( + expect.objectContaining({ + first: 5, + }), + ); + }); + + it('should handle errors when fetching reputations', async () => { + const mockLeaders = [{ address: '0x789', role: 'Recording Oracle' }]; + + jest + .spyOn(OperatorUtils, 'getLeaders') + .mockResolvedValue(mockLeaders as ILeader[]); + jest + .spyOn(httpService, 'get') + .mockReturnValue(throwError(() => new Error('API error'))); + + const result = await service.getLeaders(ChainId.ALL); + + expect(result).toEqual([ + expect.objectContaining({ + address: '0x789', + role: 'Recording Oracle', + reputation: 'low', + }), + ]); + }); +}); diff --git a/packages/apps/dashboard/server/src/modules/details/dto/details-pagination.dto.ts b/packages/apps/dashboard/server/src/modules/details/dto/details-pagination.dto.ts index a672b6b450..08d4a2e69b 100644 --- a/packages/apps/dashboard/server/src/modules/details/dto/details-pagination.dto.ts +++ b/packages/apps/dashboard/server/src/modules/details/dto/details-pagination.dto.ts @@ -9,9 +9,47 @@ import { IsIn, } from 'class-validator'; import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; -import { ChainId } from '@human-protocol/sdk'; +import { ChainId, OrderDirection } from '@human-protocol/sdk'; import { IsRoleValid } from './validation/role-validation'; +import { LeadersOrderBy } from 'src/common/enums/leader'; + +export class LeadersPaginationDto { + @ApiProperty({ enum: ChainId }) + @IsEnum(ChainId) + @IsIn(Object.values(ChainId).filter((id) => id !== ChainId.ALL)) + @Transform(({ value }) => parseInt(value)) + public chainId: ChainId; + + @ApiPropertyOptional({ + enum: LeadersOrderBy, + default: LeadersOrderBy.AMOUNT_STAKED, + }) + @IsEnum(LeadersOrderBy) + @IsIn(Object.values(LeadersOrderBy)) + @IsOptional() + public orderBy?: LeadersOrderBy = LeadersOrderBy.AMOUNT_STAKED; + + @ApiPropertyOptional({ + enum: OrderDirection, + default: OrderDirection.DESC, + }) + @IsEnum(OrderDirection) + @IsIn(Object.values(OrderDirection)) + @IsOptional() + public orderDirection?: OrderDirection = OrderDirection.DESC; + + @ApiPropertyOptional({ + minimum: 1, + default: 10, + }) + @Type(() => Number) + @IsNumber() + @Min(1) + @Max(1000) + @IsOptional() + public first?: number = 10; +} export class DetailsTransactionsPaginationDto { @ApiProperty({ enum: ChainId }) diff --git a/packages/apps/dashboard/server/src/modules/networks/network.service.spec.ts b/packages/apps/dashboard/server/src/modules/networks/network.service.spec.ts index 5b8e5430f0..95509e912f 100644 --- a/packages/apps/dashboard/server/src/modules/networks/network.service.spec.ts +++ b/packages/apps/dashboard/server/src/modules/networks/network.service.spec.ts @@ -9,6 +9,7 @@ import { ChainId, NETWORKS } from '@human-protocol/sdk'; import { HttpService } from '@nestjs/axios'; import { ConfigService } from '@nestjs/config'; import { NetworksService } from './networks.service'; +import { NetworkConfigService } from '../../common/config/network-config.service'; jest.mock('@human-protocol/sdk', () => ({ ...jest.requireActual('@human-protocol/sdk'), @@ -21,6 +22,7 @@ describe('NetworksService', () => { beforeAll(async () => { process.env.RPC_URL_POLYGON = 'https://testrpc.com'; + process.env.RPC_URL_BSC_MAINNET = 'https://testrpc.com'; process.env.RPC_URL_ETHEREUM = 'https://testrpc.com'; process.env.WEB3_ENV = 'mainnet'; }); @@ -44,6 +46,7 @@ describe('NetworksService', () => { networkOperatingCacheTtl: 1000, }, }, + NetworkConfigService, ConfigService, Logger, ], @@ -56,8 +59,8 @@ describe('NetworksService', () => { it('should regenerate network list when cache TTL expires', async () => { const mockNetworkList = [ ChainId.MAINNET, - ChainId.BSC_MAINNET, ChainId.POLYGON, + ChainId.BSC_MAINNET, ]; // Step 1: Initial request - populate cache diff --git a/packages/apps/dashboard/server/src/modules/networks/networks.service.ts b/packages/apps/dashboard/server/src/modules/networks/networks.service.ts index 6b5b9cb6d5..26e9fbeab2 100644 --- a/packages/apps/dashboard/server/src/modules/networks/networks.service.ts +++ b/packages/apps/dashboard/server/src/modules/networks/networks.service.ts @@ -8,7 +8,7 @@ import { MINIMUM_HMT_TRANSFERS, } from '../../common/config/env-config.service'; import { OPERATING_NETWORKS_CACHE_KEY } from '../../common/config/redis-config.service'; -import { MAINNET_CHAIN_IDS } from '../../common/utils/constants'; +import { NetworkConfigService } from '../../common/config/network-config.service'; @Injectable() export class NetworksService { @@ -16,6 +16,7 @@ export class NetworksService { constructor( @Inject(CACHE_MANAGER) private cacheManager: Cache, private readonly envConfigService: EnvironmentConfigService, + private readonly networkConfigService: NetworkConfigService, ) {} public async getOperatingNetworks(): Promise { @@ -38,8 +39,8 @@ export class NetworksService { const availableNetworks = []; - for (const chainId of Object.values(MAINNET_CHAIN_IDS)) { - const networkConfig = NETWORKS[chainId]; + for (const network of Object.values(this.networkConfigService.networks)) { + const networkConfig = NETWORKS[network.chainId]; if (!networkConfig) continue; const statisticsClient = new StatisticsClient(networkConfig); @@ -64,11 +65,11 @@ export class NetworksService { totalTransactionCount > MINIMUM_HMT_TRANSFERS; if (recentEscrowsCreated && sufficientHMTTransfers) { - availableNetworks.push(chainId); + availableNetworks.push(network.chainId); } } catch (error) { this.logger.error( - `Error processing network ${chainId}: ${error.message}`, + `Error processing network ${network.chainId}: ${error.message}`, ); } } diff --git a/packages/apps/dashboard/server/src/modules/stats/stats.service.ts b/packages/apps/dashboard/server/src/modules/stats/stats.service.ts index d8702151ee..041747a743 100644 --- a/packages/apps/dashboard/server/src/modules/stats/stats.service.ts +++ b/packages/apps/dashboard/server/src/modules/stats/stats.service.ts @@ -22,7 +22,6 @@ import { DailyHMTData } from '@human-protocol/sdk/dist/graphql'; import { CachedHMTData } from './stats.interface'; import { HmtDailyStatsData } from './dto/hmt.dto'; import { StorageService } from '../storage/storage.service'; -import { NetworkConfigService } from '../../common/config/network-config.service'; import { CronJob } from 'cron'; import { SchedulerRegistry } from '@nestjs/schedule'; import { NetworksService } from '../networks/networks.service'; diff --git a/packages/apps/dashboard/ui-2024/package.json b/packages/apps/dashboard/ui-2024/package.json index 1a659c616b..0686f5d3b6 100644 --- a/packages/apps/dashboard/ui-2024/package.json +++ b/packages/apps/dashboard/ui-2024/package.json @@ -19,7 +19,7 @@ "@mui/material": "^5.15.18", "@mui/styled-engine-sc": "6.1.3", "@mui/x-data-grid": "^7.23.2", - "@mui/x-date-pickers": "^7.5.0", + "@mui/x-date-pickers": "^7.23.6", "@tanstack/react-query": "^5.48.0", "@types/react-router-dom": "^5.3.3", "@types/recharts": "^1.8.29", diff --git a/packages/apps/dashboard/ui-2024/src/components/SearchBar/SearchBar.tsx b/packages/apps/dashboard/ui-2024/src/components/SearchBar/SearchBar.tsx index 6abd09b890..60b49386ca 100644 --- a/packages/apps/dashboard/ui-2024/src/components/SearchBar/SearchBar.tsx +++ b/packages/apps/dashboard/ui-2024/src/components/SearchBar/SearchBar.tsx @@ -13,9 +13,10 @@ import { MenuItem, Box, Tooltip, + CircularProgress, } from '@mui/material'; import { colorPalette } from '@assets/styles/color-palette'; -import { getNetwork, networks } from '@utils/config/networks'; +import { useFilteredNetworks } from '@utils/hooks/use-filtered-networks'; import { useBreakPoints } from '@utils/hooks/use-is-mobile'; import { NetworkIcon } from '@components/NetworkIcon'; import { useWalletSearch } from '@utils/hooks/use-wallet-search'; @@ -40,32 +41,36 @@ const SearchBar: FC = ({ initialInputValue = '', }) => { const { mobile } = useBreakPoints(); - const [inputValue, setInputValue] = useState(initialInputValue); - const [selectValue, setSelectValue] = useState(''); - const [focus, setFocus] = useState(false); - const { filterParams } = useWalletSearch(); + const { filteredNetworks, isLoading } = useFilteredNetworks(); + const { filterParams, setChainId, setAddress } = useWalletSearch(); const navigate = useNavigate(); + const [inputValue, setInputValue] = useState(initialInputValue); const [error, setError] = useState(null); + const [focus, setFocus] = useState(false); - const navigateToAddress = useCallback( - (chainIdParam?: number | undefined) => { - const chainId = chainIdParam || selectValue || -1; - const address = inputValue || ''; - navigate(`/search/${chainId}/${address}`); - }, - [inputValue, selectValue, navigate] - ); + useEffect(() => { + setInputValue(filterParams.address); + }, [filterParams.address]); useEffect(() => { - const networkName = getNetwork(filterParams.chainId || -1)?.name || ''; - if (networkName) { - setSelectValue(filterParams.chainId); + if ( + !isLoading && + filteredNetworks.length > 0 && + filterParams.chainId === -1 + ) { + setChainId(filteredNetworks[0].id); } - }, [filterParams.chainId]); + }, [filteredNetworks, isLoading, filterParams.chainId, setChainId]); - useEffect(() => { - setInputValue(filterParams.address); - }, [filterParams.address]); + const navigateToAddress = useCallback(() => { + if (!isValidEVMAddress(inputValue)) { + setError('Invalid EVM address.'); + return; + } + + setAddress(inputValue); + navigate(`/search/${filterParams.chainId}/${inputValue}`); + }, [inputValue, filterParams.chainId, navigate, setAddress]); const handleInputChange = (event: React.ChangeEvent) => { const value = event.target.value; @@ -75,30 +80,27 @@ const SearchBar: FC = ({ setError(null); } else if (value.length > 0) { setError('Invalid EVM address. Must start with 0x and be 42 characters.'); + } else { + setError(null); } }; - const handleSelectChange = (event: SelectChangeEvent) => { - const chainId = Number(event.target.value); - setSelectValue(chainId); + const handleSelectChange = (event: SelectChangeEvent) => { + setChainId(Number(event.target.value)); }; const handleClearClick = () => { setInputValue(''); + setError(null); }; const handleSubmit = (event: React.FormEvent) => { event.preventDefault(); - - if (!isValidEVMAddress(inputValue)) { - return; - } - - if (inputValue && !!inputValue.length) { - navigateToAddress(); - } + navigateToAddress(); }; + if (isLoading) return ; + const renderEmptyValue = ( Network ); @@ -106,12 +108,15 @@ const SearchBar: FC = ({ const renderSelectedValue = ( n.id === selectValue)?.id || -1} + chainId={ + filteredNetworks.find((n) => n.id === filterParams.chainId)?.id || -1 + } />
- {mobile.isMobile || !selectValue + {mobile.isMobile || filterParams.chainId === -1 ? null - : getNetwork(Number(selectValue))?.name || ''} + : filteredNetworks.find((n) => n.id === filterParams.chainId)?.name || + ''}
); @@ -126,6 +131,7 @@ const SearchBar: FC = ({ onFocus={() => setFocus(true)} onBlur={() => setFocus(false)} error={!!error} + helperText={error} fullWidth sx={muiTextFieldSx(mobile)} InputProps={{ @@ -137,20 +143,22 @@ const SearchBar: FC = ({ position="start" sx={startAdornmentInputAdornmentSx} > - - value={selectValue} + + value={filterParams.chainId} displayEmpty sx={muiSelectSx(mobile)} onChange={handleSelectChange} renderValue={() => - selectValue === null ? renderEmptyValue : renderSelectedValue + filterParams.chainId === -1 + ? renderEmptyValue + : renderSelectedValue } > - {networks.map((network) => ( + {filteredNetworks.map((network) => ( diff --git a/packages/apps/dashboard/ui-2024/src/features/Leaderboard/components/RoleCell.tsx b/packages/apps/dashboard/ui-2024/src/features/Leaderboard/components/RoleCell.tsx index 9bc9151c44..fade268f52 100644 --- a/packages/apps/dashboard/ui-2024/src/features/Leaderboard/components/RoleCell.tsx +++ b/packages/apps/dashboard/ui-2024/src/features/Leaderboard/components/RoleCell.tsx @@ -1,26 +1,60 @@ import { Box, Typography } from '@mui/material'; import { useBreakPoints } from '@utils/hooks/use-is-mobile'; - +import { Link } from 'react-router-dom'; import { EntityIcon } from './EntityIcon'; -export const RoleCell = ({ role }: { role: string }) => { +export const RoleCell = ({ + role, + websiteUrl, +}: { + role: string; + websiteUrl?: string; +}) => { const { mobile: { isMobile }, } = useBreakPoints(); return ( - {!isMobile && } - - {role} - + {websiteUrl ? ( + + {!isMobile && } + + {role} + + + ) : ( + <> + {!isMobile && } + + {role} + + + )} ); }; diff --git a/packages/apps/dashboard/ui-2024/src/features/Leaderboard/components/SelectNetwork.tsx b/packages/apps/dashboard/ui-2024/src/features/Leaderboard/components/SelectNetwork.tsx index 02e6739ff2..dfc9488530 100644 --- a/packages/apps/dashboard/ui-2024/src/features/Leaderboard/components/SelectNetwork.tsx +++ b/packages/apps/dashboard/ui-2024/src/features/Leaderboard/components/SelectNetwork.tsx @@ -3,13 +3,12 @@ import FormControl from '@mui/material/FormControl'; import InputLabel from '@mui/material/InputLabel'; import MenuItem from '@mui/material/MenuItem'; import Box from '@mui/material/Box'; -import HumanIcon from '@components/Icons/HumanIcon'; -import { - leaderboardSearchSelectConfig, - useLeaderboardSearch, -} from '@utils/hooks/use-leaderboard-search'; +import { useLeaderboardSearch } from '@utils/hooks/use-leaderboard-search'; +import { useFilteredNetworks } from '@utils/hooks/use-filtered-networks'; import { useBreakPoints } from '@utils/hooks/use-is-mobile'; import { NetworkIcon } from '@components/NetworkIcon'; +import CircularProgress from '@mui/material/CircularProgress'; +import { useEffect } from 'react'; export const SelectNetwork = () => { const { @@ -17,17 +16,36 @@ export const SelectNetwork = () => { filterParams: { chainId }, } = useLeaderboardSearch(); + const { filteredNetworks, isLoading } = useFilteredNetworks(); + + useEffect(() => { + if (chainId === -1 && filteredNetworks.length > 0) { + setChainId(filteredNetworks[0].id); + } + }, [chainId, filteredNetworks, setChainId]); + const { mobile: { isMobile }, } = useBreakPoints(); const handleChange = (event: SelectChangeEvent) => { - const value = event.target.value; - if (typeof value === 'number') { - setChainId(value); - } + const value = Number(event.target.value); + setChainId(value); }; + if (isLoading) { + return ( + + + + ); + } + return ( { labelId="network-select-label" id="network-select" - value={chainId} + value={chainId === -1 ? '' : chainId} label="By Network" onChange={handleChange} > - {leaderboardSearchSelectConfig.map((selectItem) => { - if ('allNetworksId' in selectItem) { - return ( - - - All Networks - - ); - } - - return ( - - - - - - {selectItem.name} - - ); - })} + {filteredNetworks.map((network) => ( + + + + + {network.name} + + ))} ); }; + +export default SelectNetwork; diff --git a/packages/apps/dashboard/ui-2024/src/features/Leaderboard/hooks/useDataGrid.tsx b/packages/apps/dashboard/ui-2024/src/features/Leaderboard/hooks/useDataGrid.tsx index af0af375c5..e73d7e0d61 100644 --- a/packages/apps/dashboard/ui-2024/src/features/Leaderboard/hooks/useDataGrid.tsx +++ b/packages/apps/dashboard/ui-2024/src/features/Leaderboard/hooks/useDataGrid.tsx @@ -58,7 +58,7 @@ export const useDataGrid = (data: LeaderBoardData) => { ), renderCell: (params: GridRenderCellParams) => ( - + ), }, { diff --git a/packages/apps/dashboard/ui-2024/src/pages/Leaderboard/index.tsx b/packages/apps/dashboard/ui-2024/src/pages/Leaderboard/index.tsx index 8530a56c38..997067848b 100644 --- a/packages/apps/dashboard/ui-2024/src/pages/Leaderboard/index.tsx +++ b/packages/apps/dashboard/ui-2024/src/pages/Leaderboard/index.tsx @@ -2,11 +2,11 @@ import Breadcrumbs from '@components/Breadcrumbs'; import PageWrapper from '@components/PageWrapper'; import ShadowIcon from '@components/ShadowIcon'; import { Leaderboard } from '../../features/Leaderboard/index'; -import { useLeaderboardAllDetails } from '@services/api/use-leaderboard-all-details'; +import { useLeaderboardDetails } from '@services/api/use-leaderboard-details'; import { LeaderboardIcon } from '@components/Icons/LeaderboardIcon'; export const LeaderBoard = () => { - const { data, status, error } = useLeaderboardAllDetails(); + const { data, status, error } = useLeaderboardDetails(); const isMoreThatFiveEntries = data?.length && data.length > 5; return ( diff --git a/packages/apps/dashboard/ui-2024/src/services/api-paths.ts b/packages/apps/dashboard/ui-2024/src/services/api-paths.ts index 0e767181bb..79e0f82eb5 100644 --- a/packages/apps/dashboard/ui-2024/src/services/api-paths.ts +++ b/packages/apps/dashboard/ui-2024/src/services/api-paths.ts @@ -17,9 +17,6 @@ export const apiPaths = { leaderboardDetails: { path: '/details/leaders', }, - leaderboardDetailsAll: { - path: '/details/leaders/all', - }, addressDetails: { path: '/details', }, @@ -29,4 +26,7 @@ export const apiPaths = { escrowDetails: { path: '/details/escrows', }, + enabledChains: { + path: '/networks/operating', + }, } as const; diff --git a/packages/apps/dashboard/ui-2024/src/services/api/use-leaderboard-all-details.tsx b/packages/apps/dashboard/ui-2024/src/services/api/use-leaderboard-all-details.tsx deleted file mode 100644 index ef9040d893..0000000000 --- a/packages/apps/dashboard/ui-2024/src/services/api/use-leaderboard-all-details.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { useQuery } from '@tanstack/react-query'; -import { httpService } from '../http-service'; -import { apiPaths } from '../api-paths'; -import { validateResponse } from '@services/validate-response'; -import { useLeaderboardSearch } from '@utils/hooks/use-leaderboard-search'; -import { leaderBoardSuccessResponseSchema } from '@services/api/use-leaderboard-details'; - -export function useLeaderboardAllDetails() { - const { - filterParams: { chainId }, - } = useLeaderboardSearch(); - - return useQuery({ - queryFn: async () => { - const { data } = await httpService.get( - apiPaths.leaderboardDetailsAll.path, - { - params: { chainId: chainId === -1 ? undefined : chainId }, - } - ); - - const validResponse = validateResponse( - data, - leaderBoardSuccessResponseSchema - ); - - return validResponse; - }, - queryKey: ['useLeaderboardAllDetails', chainId], - }); -} diff --git a/packages/apps/dashboard/ui-2024/src/services/api/use-leaderboard-details.tsx b/packages/apps/dashboard/ui-2024/src/services/api/use-leaderboard-details.tsx index 29b0d02cb7..03e0b774bd 100644 --- a/packages/apps/dashboard/ui-2024/src/services/api/use-leaderboard-details.tsx +++ b/packages/apps/dashboard/ui-2024/src/services/api/use-leaderboard-details.tsx @@ -56,8 +56,11 @@ export function useLeaderboardDetails() { return useQuery({ queryFn: async () => { + if (chainId === -1) { + return []; + } const { data } = await httpService.get(apiPaths.leaderboardDetails.path, { - params: { chainId: chainId === -1 ? undefined : chainId }, + params: { chainId }, }); const validResponse = validateResponse( diff --git a/packages/apps/dashboard/ui-2024/src/utils/hooks/use-filtered-networks.ts b/packages/apps/dashboard/ui-2024/src/utils/hooks/use-filtered-networks.ts new file mode 100644 index 0000000000..752b65b58b --- /dev/null +++ b/packages/apps/dashboard/ui-2024/src/utils/hooks/use-filtered-networks.ts @@ -0,0 +1,30 @@ +import { useQuery } from '@tanstack/react-query'; +import { z } from 'zod'; +import { networks as allNetworks } from '@utils/config/networks'; +import { httpService } from '@services/http-service'; +import { apiPaths } from '@services/api-paths'; +import { useMemo } from 'react'; + +const enabledChainsSchema = z.array(z.number()); + +export const useFilteredNetworks = () => { + const { + data: enabledChains, + isLoading, + error, + } = useQuery({ + queryKey: ['enabledChains'], + queryFn: async () => { + const response = await httpService.get(apiPaths.enabledChains.path); + return enabledChainsSchema.parse(response.data); + }, + }); + + const filteredNetworks = useMemo(() => { + return enabledChains + ? allNetworks.filter((network) => enabledChains.includes(network.id)) + : []; + }, [enabledChains]); + + return { filteredNetworks, isLoading, error }; +}; diff --git a/packages/apps/dashboard/ui-2024/src/utils/hooks/use-leaderboard-search.ts b/packages/apps/dashboard/ui-2024/src/utils/hooks/use-leaderboard-search.ts index 792c2a1c77..f470ac22b9 100644 --- a/packages/apps/dashboard/ui-2024/src/utils/hooks/use-leaderboard-search.ts +++ b/packages/apps/dashboard/ui-2024/src/utils/hooks/use-leaderboard-search.ts @@ -1,11 +1,4 @@ -import { networks } from '@utils/config/networks'; import { create } from 'zustand'; -import type { Chain } from 'viem/chains'; - -export const leaderboardSearchSelectConfig: ( - | Chain - | { name: 'All Networks'; allNetworksId: -1 } -)[] = [{ name: 'All Networks', allNetworksId: -1 }, ...networks]; export interface LeaderboardSearchStore { filterParams: { diff --git a/packages/apps/dashboard/ui-2024/src/utils/hooks/use-wallet-search.ts b/packages/apps/dashboard/ui-2024/src/utils/hooks/use-wallet-search.ts index fcefb87180..6ff0ec5092 100644 --- a/packages/apps/dashboard/ui-2024/src/utils/hooks/use-wallet-search.ts +++ b/packages/apps/dashboard/ui-2024/src/utils/hooks/use-wallet-search.ts @@ -1,4 +1,3 @@ -import { networks } from '../config/networks'; import { create } from 'zustand'; export interface WalletSearchStore { @@ -13,7 +12,7 @@ export interface WalletSearchStore { export const useWalletSearch = create((set) => ({ filterParams: { address: '', - chainId: networks[0].id, + chainId: -1, }, setAddress: (address) => { set((state) => ({ diff --git a/packages/apps/fortune/exchange-oracle/client/package.json b/packages/apps/fortune/exchange-oracle/client/package.json index 969ea82292..094b9322bc 100644 --- a/packages/apps/fortune/exchange-oracle/client/package.json +++ b/packages/apps/fortune/exchange-oracle/client/package.json @@ -38,7 +38,7 @@ "react-router-dom": "^6.24.1", "serve": "^14.2.4", "vite-plugin-node-polyfills": "^0.22.0", - "wagmi": "^2.12.8" + "wagmi": "^2.14.6" }, "devDependencies": { "@types/react": "^18.3.12", diff --git a/packages/apps/fortune/exchange-oracle/server/package.json b/packages/apps/fortune/exchange-oracle/server/package.json index 15f17a0dc5..09b216cac0 100644 --- a/packages/apps/fortune/exchange-oracle/server/package.json +++ b/packages/apps/fortune/exchange-oracle/server/package.json @@ -44,7 +44,7 @@ "@types/express": "^4.17.13", "@types/jest": "29.5.12", "@types/pg": "8.11.10", - "@types/node": "22.5.4", + "@types/node": "22.10.5", "@types/supertest": "^6.0.2", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.0.0", diff --git a/packages/apps/fortune/exchange-oracle/server/src/modules/assignment/assignment.controller.spec.ts b/packages/apps/fortune/exchange-oracle/server/src/modules/assignment/assignment.controller.spec.ts index 9f0caafdad..7594876b8e 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/modules/assignment/assignment.controller.spec.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/modules/assignment/assignment.controller.spec.ts @@ -76,9 +76,11 @@ describe('assignmentController', () => { chainId: 80001, escrowAddress: escrowAddress, }; - jest - .spyOn(assignmentService, 'createAssignment') - .mockResolvedValue({ id: 1, workerAddress: MOCK_ADDRESS, job: { rewardToken: 'HMT' } } as any); + jest.spyOn(assignmentService, 'createAssignment').mockResolvedValue({ + id: 1, + workerAddress: MOCK_ADDRESS, + job: { rewardToken: 'HMT' }, + } as any); await assignmentController.createAssignment(body, { user: { address: userAddress }, } as RequestWithUser); diff --git a/packages/apps/fortune/exchange-oracle/server/src/modules/assignment/assignment.controller.ts b/packages/apps/fortune/exchange-oracle/server/src/modules/assignment/assignment.controller.ts index 4e67bec4e9..6f2d76ed65 100644 --- a/packages/apps/fortune/exchange-oracle/server/src/modules/assignment/assignment.controller.ts +++ b/packages/apps/fortune/exchange-oracle/server/src/modules/assignment/assignment.controller.ts @@ -68,7 +68,7 @@ export class AssignmentController { escrowAddress: body.escrowAddress, chainId: body.chainId, workerAddress: assignment.workerAddress, - rewardToken: assignment.job.rewardToken + rewardToken: assignment.job.rewardToken, }; return response; } diff --git a/packages/apps/human-app/frontend/.eslintrc.cjs b/packages/apps/human-app/frontend/.eslintrc.cjs index ede32c8d48..fcf2b386c2 100644 --- a/packages/apps/human-app/frontend/.eslintrc.cjs +++ b/packages/apps/human-app/frontend/.eslintrc.cjs @@ -43,6 +43,13 @@ module.exports = { allowNullish: true, }, ], + '@typescript-eslint/naming-convention': [ + 'error', + { + selector: 'enumMember', + format: ['UPPER_CASE'], + }, + ], }, settings: { 'import/resolver': { diff --git a/packages/apps/human-app/frontend/package.json b/packages/apps/human-app/frontend/package.json index 5705e79a12..d7ad7ecabe 100644 --- a/packages/apps/human-app/frontend/package.json +++ b/packages/apps/human-app/frontend/package.json @@ -34,6 +34,7 @@ "lodash": "^4.17.21", "material-react-table": "^3.0.1", "mui-image": "^1.0.7", + "notistack": "^3.0.1", "query-string": "^9.0.0", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -44,7 +45,7 @@ "react-router-dom": "^6.22.0", "viem": "^2.21.44", "vite-plugin-svgr": "^4.2.0", - "wagmi": "2.12.29", + "wagmi": "2.14.6", "zod": "^3.22.4", "zustand": "^4.5.0" }, @@ -55,7 +56,7 @@ "@testing-library/react": "^15.0.7", "@types/lodash": "^4.17.12", "@types/mui-image": "^1.0.5", - "@types/node": "^22.5.4", + "@types/node": "^22.10.5", "@types/react": "^18.3.12", "@types/react-dom": "^18.2.17", "@typescript-eslint/eslint-plugin": "^6.20.0", @@ -68,7 +69,7 @@ "eslint-plugin-react-refresh": "^0.4.11", "husky": "^9.1.6", "jsdom": "^25.0.1", - "lint-staged": "^15.2.1", + "lint-staged": "^15.3.0", "prettier": "^3.4.2", "typescript": "^5.6.3", "vite": "^5.4.7", diff --git a/packages/apps/human-app/frontend/src/api/fetch-refresh-token.ts b/packages/apps/human-app/frontend/src/api/fetch-refresh-token.ts index b0a4c33c58..77226af471 100644 --- a/packages/apps/human-app/frontend/src/api/fetch-refresh-token.ts +++ b/packages/apps/human-app/frontend/src/api/fetch-refresh-token.ts @@ -1,6 +1,6 @@ import { apiPaths } from '@/api/api-paths'; -import { browserAuthProvider } from '@/shared/helpers/browser-auth-provider'; -import { signInSuccessResponseSchema } from '@/api/services/worker/sign-in/schema'; +import { browserAuthProvider } from '@/shared/contexts/browser-auth-provider'; +import { signInSuccessResponseSchema } from '@/modules/worker/services/sign-in/schema'; export const fetchTokenRefresh = async (baseUrl: string) => { const response = await fetch( diff --git a/packages/apps/human-app/frontend/src/api/fetcher.ts b/packages/apps/human-app/frontend/src/api/fetcher.ts index 73bb6d41bb..d91945c258 100644 --- a/packages/apps/human-app/frontend/src/api/fetcher.ts +++ b/packages/apps/human-app/frontend/src/api/fetcher.ts @@ -1,10 +1,10 @@ import merge from 'lodash/merge'; import { ZodError, type ZodType, type ZodTypeDef } from 'zod'; import type { ResponseError } from '@/shared/types/global.type'; -import { browserAuthProvider } from '@/shared/helpers/browser-auth-provider'; +import { browserAuthProvider } from '@/shared/contexts/browser-auth-provider'; import { env } from '@/shared/env'; -import { type SignInSuccessResponse } from '@/api/services/worker/sign-in/types'; -import { normalizeBaseUrl } from '@/shared/helpers/normalize-base-url'; +import { type SignInSuccessResponse } from '@/modules/worker/services/sign-in/types'; +import { normalizeBaseUrl } from '@/shared/helpers/url'; import { fetchTokenRefresh } from './fetch-refresh-token'; const appendHeader = ( diff --git a/packages/apps/human-app/frontend/src/api/services/common/use-access-token-refresh.ts b/packages/apps/human-app/frontend/src/api/hooks/use-access-token-refresh.ts similarity index 90% rename from packages/apps/human-app/frontend/src/api/services/common/use-access-token-refresh.ts rename to packages/apps/human-app/frontend/src/api/hooks/use-access-token-refresh.ts index 054e59a0d9..3532d0070e 100644 --- a/packages/apps/human-app/frontend/src/api/services/common/use-access-token-refresh.ts +++ b/packages/apps/human-app/frontend/src/api/hooks/use-access-token-refresh.ts @@ -1,9 +1,9 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'; import { useNavigate } from 'react-router-dom'; -import { useAuth } from '@/auth/use-auth'; -import { browserAuthProvider } from '@/shared/helpers/browser-auth-provider'; +import { useAuth } from '@/modules/auth/hooks/use-auth'; +import { browserAuthProvider } from '@/shared/contexts/browser-auth-provider'; import type { AuthType } from '@/shared/types/browser-auth-provider'; -import { useWeb3Auth } from '@/auth-web3/use-web3-auth'; +import { useWeb3Auth } from '@/modules/auth-web3/hooks/use-web3-auth'; import { routerPaths } from '@/router/router-paths'; import { refreshToken } from '@/api/fetcher'; diff --git a/packages/apps/human-app/frontend/src/api/services/common/prepare-signature.ts b/packages/apps/human-app/frontend/src/api/hooks/use-prepare-signature.ts similarity index 88% rename from packages/apps/human-app/frontend/src/api/services/common/prepare-signature.ts rename to packages/apps/human-app/frontend/src/api/hooks/use-prepare-signature.ts index 0aaf8102f3..4034114681 100644 --- a/packages/apps/human-app/frontend/src/api/services/common/prepare-signature.ts +++ b/packages/apps/human-app/frontend/src/api/hooks/use-prepare-signature.ts @@ -4,10 +4,10 @@ import { apiClient } from '@/api/api-client'; import { apiPaths } from '@/api/api-paths'; export enum PrepareSignatureType { - SignUp = 'signup', - SignIn = 'signin', - DisableOperator = 'disable_operator', - RegisterAddress = 'register_address', + SIGN_UP = 'signup', + SIGN_IN = 'signin', + DISABLE_OPERATOR = 'disable_operator', + REGISTER_ADDRESS = 'register_address', } export const prepareSignatureSuccessSchema = z.object({ diff --git a/packages/apps/human-app/frontend/src/api/services/enums.ts b/packages/apps/human-app/frontend/src/api/services/enums.ts deleted file mode 100644 index deb82a5fd4..0000000000 --- a/packages/apps/human-app/frontend/src/api/services/enums.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { z } from 'zod'; - -export const testType = z.enum(['TYPE']); diff --git a/packages/apps/human-app/frontend/src/api/services/test.schema.ts b/packages/apps/human-app/frontend/src/api/utils/test.schema.ts similarity index 100% rename from packages/apps/human-app/frontend/src/api/services/test.schema.ts rename to packages/apps/human-app/frontend/src/api/utils/test.schema.ts diff --git a/packages/apps/human-app/frontend/src/api/services/test.service.ts b/packages/apps/human-app/frontend/src/api/utils/test.service.ts similarity index 100% rename from packages/apps/human-app/frontend/src/api/services/test.service.ts rename to packages/apps/human-app/frontend/src/api/utils/test.service.ts diff --git a/packages/apps/human-app/frontend/src/components/data-entry/input-masks/input-masks.ts b/packages/apps/human-app/frontend/src/components/data-entry/input-masks/input-masks.ts deleted file mode 100644 index 8a2af068a2..0000000000 --- a/packages/apps/human-app/frontend/src/components/data-entry/input-masks/input-masks.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { HumanCurrencyInputMask } from '@/components/data-entry/input-masks/human-currency-input-mask'; -import { PercentsInputMask } from '@/components/data-entry/input-masks/percents-input-mask'; - -export const InputMasks = { - HumanCurrencyInputMask, - PercentsInputMask, -}; - -export type InputMask = keyof typeof InputMasks; diff --git a/packages/apps/human-app/frontend/src/components/layout/protected/layout-notification-context.tsx b/packages/apps/human-app/frontend/src/components/layout/protected/layout-notification-context.tsx deleted file mode 100644 index 57c765b9d8..0000000000 --- a/packages/apps/human-app/frontend/src/components/layout/protected/layout-notification-context.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { createContext } from 'react'; -import type { TopNotificationType } from '@/components/ui/top-notification'; - -export interface TopNotificationPayload { - content: string; - type: TopNotificationType; -} - -export type SetTopNotificationFn = (data: TopNotificationPayload) => void; - -export const ProtectedLayoutContext = createContext<{ - setTopNotification: SetTopNotificationFn; - closeNotification: () => void; -} | null>(null); diff --git a/packages/apps/human-app/frontend/src/components/layout/protected/layout.tsx b/packages/apps/human-app/frontend/src/components/layout/protected/layout.tsx deleted file mode 100644 index ee77f76201..0000000000 --- a/packages/apps/human-app/frontend/src/components/layout/protected/layout.tsx +++ /dev/null @@ -1,224 +0,0 @@ -import { Grid, styled } from '@mui/material'; -import type { Dispatch, SetStateAction } from 'react'; -import { useEffect, useRef, useState } from 'react'; -import { Outlet } from 'react-router-dom'; -import { useIsMobile } from '@/hooks/use-is-mobile'; -import { useBackgroundColorStore } from '@/hooks/use-background-store'; -import type { PageHeaderProps } from '@/components/layout/protected/page-header'; -import { PageHeader } from '@/components/layout/protected/page-header'; -import { breakpoints } from '@/styles/breakpoints'; -import { TopNotification } from '@/components/ui/top-notification'; -import type { TopNotificationPayload } from '@/components/layout/protected/layout-notification-context'; -import { ProtectedLayoutContext } from '@/components/layout/protected/layout-notification-context'; -import { useIsHCaptchaLabelingPage } from '@/hooks/use-is-hcaptcha-labeling-page'; -import { Footer } from '../footer'; -import { Navbar } from './navbar'; - -const Main = styled('main', { - shouldForwardProp: (prop) => prop !== 'open' && prop !== 'isMobile', -})<{ - open?: boolean; - isMobile?: boolean; -}>(({ theme, open, isMobile }) => ({ - width: '100%', - display: 'flex', - flex: '1', - transition: theme.transitions.create('margin', { - easing: theme.transitions.easing.sharp, - duration: theme.transitions.duration.leavingScreen, - }), - ...(open && { - transition: theme.transitions.create('margin', { - easing: theme.transitions.easing.easeOut, - duration: theme.transitions.duration.enteringScreen, - }), - paddingLeft: isMobile ? 0 : `140px`, - }), -})); - -export function Layout({ - pageHeaderProps, - renderDrawer, - renderHCaptchaStatisticsDrawer, -}: { - pageHeaderProps: PageHeaderProps; - renderDrawer: ( - open: boolean, - setDrawerOpen: Dispatch> - ) => JSX.Element; - renderHCaptchaStatisticsDrawer?: (isOpen: boolean) => JSX.Element; -}) { - const [notificationWith, setNotificationWith] = useState< - number | undefined - >(); - const layoutElementRef = useRef(); - const isHCaptchaLabelingPage = useIsHCaptchaLabelingPage(); - const [notification, setNotification] = - useState(null); - const isMobile = useIsMobile(); - const [drawerOpen, setDrawerOpen] = useState(!isMobile); - const [hcaptchaDrawerOpen, setHcaptchaDrawerOpen] = useState(false); - const { backgroundColor, setGrayBackground } = useBackgroundColorStore(); - const toggleUserStatsDrawer = isHCaptchaLabelingPage - ? () => { - setHcaptchaDrawerOpen((state) => !state); - } - : undefined; - - useEffect(() => { - if (isMobile) { - setHcaptchaDrawerOpen(false); - setDrawerOpen(false); - } else { - setHcaptchaDrawerOpen(false); - setDrawerOpen(true); - } - }, [isMobile]); - - const setNotificationWidth = () => { - if (layoutElementRef.current) { - setNotificationWith(layoutElementRef.current.clientWidth); - } - }; - useEffect(() => { - setNotificationWidth(); - window.addEventListener('resize', () => { - setNotificationWidth(); - }); - return () => { - window.removeEventListener('resize', setNotificationWidth); - }; - }, []); - - useEffect(() => { - setNotificationWidth(); - }, [notification]); - - useEffect(() => { - setGrayBackground(); - }, [setGrayBackground]); - - return ( - { - setNotification(data); - }, - closeNotification: () => { - setNotification(null); - }, - }} - > - - - {renderDrawer(drawerOpen, setDrawerOpen)} - {isHCaptchaLabelingPage && renderHCaptchaStatisticsDrawer - ? renderHCaptchaStatisticsDrawer(hcaptchaDrawerOpen) - : null} -
- - - - {notification ? ( - - { - setNotification(null); - }} - type={notification.type} - > - {notification.content} - - - ) : null} - - - - - - - - - - -
-